Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ codegenie provider use glm-5.3:max # -> openrouter/z-ai/glm-5.3
codegenie review
```

Codegenie's built-in model overrides pin all OpenRouter models with IDs starting with `deepseek/` to the `deepseek` upstream with `only`/`order` and `allow_fallbacks: false`. For this pinned model family, submit calls expose only the submit tool and use `tool_choice: "auto"`, to accommodate the named forced-tool rejection observed on DeepSeek V4.1 Flash. Returned submissions still undergo strict validation, and missing submissions have bounded retries. These [OpenRouter routing preferences](https://openrouter.ai/docs/guides/routing/provider-selection) apply to every stage, including repairs; Codegenie's stage-specific reasoning levels still apply. Requests cannot fall back to another upstream if DeepSeek is unavailable. Routing is included in debug request traces and local model-call cache keys. The overrides live in `src/provider/models-override.ts`.
Codegenie's built-in model overrides pin all OpenRouter models with IDs starting with `deepseek/` to the `deepseek`, `fireworks`, and `together` upstreams (in that order) with `only`/`order` and `allow_fallbacks: false`. For this pinned model family, submit calls expose only the submit tool and use `tool_choice: "auto"`, to accommodate the named forced-tool rejection observed on DeepSeek V4.1 Flash. Returned submissions still undergo strict validation, and missing submissions have bounded retries. These [OpenRouter routing preferences](https://openrouter.ai/docs/guides/routing/provider-selection) apply to every stage, including repairs; Codegenie's stage-specific reasoning levels still apply. Requests cannot fall back to upstreams outside that list. Routing is included in debug request traces and local model-call cache keys. The overrides live in `src/provider/models-override.ts`.

OpenRouter models with IDs starting with `z-ai/` use `only: ["together", "fireworks", "cloudflare"]`, `order: ["together", "fireworks", "cloudflare"]`, and `allow_fallbacks: false`. This routing override applies across stages, including repairs, and preserves the model's reasoning and tool-choice behavior. It does not add `require_parameters`.

Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.base.sha }} # trusted base; PR head is fetched as review data
fetch-depth: 0
- uses: 0xPolygon/codegenie@v0.6.0
- uses: 0xPolygon/codegenie@v0.6.1
with:
# Works with any model!
model: "openrouter/deepseek/deepseek-v4.1-flash:max"
Expand All @@ -127,6 +127,7 @@ codegenie provider login <provider> # OAuth by default; --api-key to store
codegenie provider models [query] # list available models (e.g. `models gpt`)
codegenie provider use <model> # set the default by fuzzy model id
codegenie provider use <model>:<level> # ...and its reasoning level (e.g. opus:max)
codegenie use <model>[:<level>] # shorthand for `provider use`
```

The full list of supported models — every provider, model id, context window, and reasoning levels — lives in [models.md](./models.md) (generated from the [models.dev](https://models.dev) registry; regenerate with `make models-list`).
Expand All @@ -145,7 +146,7 @@ baseBranch = "main"
depth = "normal"
maxTime = 60 # positive number of minutes; --max-time overrides this per run
budgetBoost = 1.0 # scales per-packet review budgets; does not change finding caps
compositionReasoningStepDown = false # opt in to one lower supported reasoning level for composition
compositionReasoningStepDown = true # default; set false to keep configured reasoning for composition

[telemetry]
enabled = true # opt into local run artifacts under .codegenie/runs
Expand Down Expand Up @@ -267,7 +268,9 @@ expect:

The planning check rejects degraded plans even when every hunk was reviewed. The composition check rejects degraded report synthesis separately from coverage completeness. The recovery check requires complete telemetry, no unresolved structured-output obligations, and demonstrated preservation; regenerated or revised content is reported as `unknown`, not assumed preserved. Repairs retain draft progress across retries and validate the whole merged submission. For unreadable JSON, repair prompts include a bounded, redacted syntax excerpt and parser diagnostic when available. Fragments remain untrusted diagnostics, never accepted data or proof that a replacement preserved the original.

Composition uses the configured review reasoning level by default, including retries. Set `[review] compositionReasoningStepDown = true` in `codegenie.toml` to use the next lower level supported by the model: for a model supporting `low`, `high`, and `max`, `max` becomes `high`. The lowest supported level stays unchanged; models without advertised reasoning levels retain the configured behavior. Override this per run with `codegenie review --composition-reasoning-step-down` or `--no-composition-reasoning-step-down`. Omitting both flags preserves the configuration, which defaults to `false`. Investigation and verification keep their configured reasoning; traces record configured and selected levels. Structured-output repairs continue to use the model’s lowest supported reasoning level. Each composition attempt has a 300-second deadline, with at most one retry. The outer composition deadline is 780 seconds (two attempts plus the shared 180-second repair allowance); overall review cancellation still takes precedence. Repair attempts share that 180-second allowance, rather than receiving 180 seconds each.
SVG files are skipped by default. Set `[review] skipSvgReview = false` in `codegenie.toml`, or run `codegenie review --no-skip-svg-review`, to include them subject to other exclusion rules. `--skip-svg-review` enables the skip explicitly. This controls changed-file review; repository evidence searches can still find SVG content and disclose oversized matches they omit.

Composition uses the next lower supported reasoning level by default, including retries: for a model supporting `low`, `high`, and `max`, `max` becomes `high`. Set `[review] compositionReasoningStepDown = false` in `codegenie.toml` to keep the configured review reasoning level for composition. The lowest supported level stays unchanged; models without advertised reasoning levels retain the configured behavior. Override this per run with `codegenie review --composition-reasoning-step-down` or `--no-composition-reasoning-step-down`. Omitting both flags preserves the configuration, which defaults to `true`. Investigation and verification keep their configured reasoning; traces record configured and selected levels. Structured-output repairs continue to use the model’s lowest supported reasoning level. Each composition attempt has a 300-second deadline, with at most one retry. The outer composition deadline is 780 seconds (two attempts plus the shared 180-second repair allowance); overall review cancellation still takes precedence. Repair attempts share that 180-second allowance, rather than receiving 180 seconds each.

Composition validates source references before acceptance. It locally removes repeated known references and misplaced references already correctly accounted for in the same finding, records those removals, and validates the whole result. Remaining attribution errors receive bounded repairs in a fresh context with exact field paths and source inventories. Attribution patches replace only permitted reference lists; finding order and prose stay intact, and the assembled report must pass full validation. If a recommendation lacks support, a bounded composition repair may instead omit or rewrite that advice section while preserving the diagnosis and retaining its original sources. Reports consolidate identical evidence and keep additional verbatim evidence and caveats in expandable sections. If synthesis fails, the report identifies its source-based presentation and retains distinct contributions. `stages/10-composition/composition-sources.json` records all inputs and dispositions; references establish attribution, not proof of semantic equivalence. Verification distinguishes essential missing proof from secondary uncertainty: unresolved hypotheses remain visible under human attention, while established defects may still have uncertainty about severity.

Expand Down
12 changes: 9 additions & 3 deletions bundled-skills/core/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Review whether the changed behavior is protected by useful tests and whether exi

# Checks

- Missing coverage for changed behavior: new branches, edge cases, failure paths, permission checks, parser cases, and backwards-compatibility contracts.
- Consequential missing coverage: establish a material behavioral requirement, identify a concrete regression that would violate it, and show why inspected relevant tests would accept that regression. A new branch or edge case alone does not justify a finding. Caller behavior and boundary tests can establish a contract without a written specification.
- Deleted or weakened tests: removed assertions, broadened matchers, skipped cases, looser fixtures, or coverage that no longer exercises the changed code.
- Deleted versus replacement coverage: when tests are deleted or rewritten, compare what production behavior the old tests protected against what the new tests still exercise. Helper-level tests do not replace deleted integration, adapter, protocol, RPC, HTTP, database, IO, serialization, or provider tests unless they drive the same boundary wiring.
- Assertion quality: tests that only check calls happened, snapshots that hide the important behavior, or assertions unrelated to the risk introduced by the change.
- Negative paths: absent tests for invalid input, missing resources, auth failures, timeout/cancellation, empty results, and malformed data.
- Regression focus: missing tests for the exact failure mode the change claims to fix.
- Negative paths: report absent rejection tests when they leave an established important boundary unprotected, such as tenant isolation or a payment limit. A currently correct guard can still lack a necessary test; an existing production bug or executed mutation is not required. Check relevant sister tests and transport validation before claiming missing protection.
- Regression focus: proposed tests must exercise a reachable boundary, reject a weakened requirement, and accept valid remedies. A commit title or neighboring test style alone does not establish material impact.
- Flaky patterns: timing sleeps, order dependence, shared mutable fixtures, network dependence, and tests that depend on local machine state.
- Test-only leakage: production behavior that changes only to satisfy a test, test hooks exposed without guardrails, or fixtures used as runtime defaults.

Expand All @@ -29,6 +29,9 @@ Review whether the changed behavior is protected by useful tests and whether exi
- Do not insist on a unit test when an integration test is the right level and already exercises the contract.
- Do not report deleted test coverage solely because the new tests are cleaner; require concrete evidence that a production boundary or behavior is no longer exercised.

- Scope absence claims to tests actually inspected; bounded or unsuccessful searches cannot prove repository-wide absence.
- Omit optional extra coverage instead of creating human-attention noise. Routine uncovered validation without established consequence is not a demonstrated defect.

# Safe Patterns

- Focused fixture tests around parsing, serialization, and configuration boundaries are high value.
Expand All @@ -41,3 +44,6 @@ Review whether the changed behavior is protected by useful tests and whether exi
- If a path guard changes, tests should include absolute paths, `..`, hidden directories, and normal valid paths.
- If a client adds retry-on-failure behavior, tests should prove exactly one retry happens and that repeated failure surfaces an error instead of silence.
- If specialized adapter tests are replaced by a shared helper's tests, verify the replacement still exercises the adapter boundary, not only the pure helper callback.

- A tenant-isolation assertion that passes for another tenant, or a payment-limit assertion that accepts an over-limit charge, is a concrete test defect.
- A Python handler lacking a duplicate malformed-input test is not a gap if the inspected transport test already enforces that same boundary.
12 changes: 12 additions & 0 deletions codegenie.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[review]
compositionReasoningStepDown = true

[[classification.pathRules]]
pattern = "**/specs/**"
processingMode = "skip"
reason = "spec documents are not reviewed"

[[classification.pathRules]]
pattern = "{evals,tests/fixtures}/**"
processingMode = "skip"
reason = "eval and test fixture data, often intentionally defective"
2 changes: 1 addition & 1 deletion examples/workflows/codegenie-review-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
fetch-depth: 0

- uses: 0xPolygon/codegenie@v0.6.0
- uses: 0xPolygon/codegenie@v0.6.1
with:
model: "openrouter/deepseek/deepseek-v4.1-flash:max"
# model: "openrouter/z-ai/glm-5.3:max"
Expand Down
2 changes: 1 addition & 1 deletion examples/workflows/codegenie-review-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 0

- uses: 0xPolygon/codegenie@v0.6.0
- uses: 0xPolygon/codegenie@v0.6.1
with:
model: "openrouter/deepseek/deepseek-v4.1-flash:max"
# model: "openrouter/z-ai/glm-5.3:max"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/codegenie",
"version": "0.6.0",
"version": "0.6.1",
"description": "High-signal AI code review agent",
"type": "module",
"bin": {
Expand Down
Loading
Loading