Skip to content

feat(review): add CI-opt-in gateway review backend - #19

Merged
schickling-assistant merged 6 commits into
mainfrom
schickling-assistant/2026-10-09-gateway-vrs-review
Oct 10, 2026
Merged

schickling-assistant merged 6 commits into
mainfrom
schickling-assistant/2026-10-09-gateway-vrs-review

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Why

Provide bounded advisory semantic review through the AI gateway while keeping CAIC coding-agent backends manual-only.

What and how

  • Build the same review packet as CAIC: target Markdown files, deterministic check diagnostics, corpus review prompt and corpus result schema.
  • One native decision request contains one Noul question per each of the 17 corpus-catalog smell rows. Default decision model: openrouter/~typesafe/jev-latest. Configurable probability threshold defaults to 0.6; below-threshold smells abstain.
  • When flagged smells exist, make one structured grounding call using --model or INTENT_REVIEW_MODEL. Grounding receives only flagged rubric rows. The request schema requires each finding to name a flagged smell id; reject other ids, remove this internal field and validate the original corpus schema. Findings must cite supplied target files. No flagged smells means an empty valid result without grounding.
  • --corpus selects review assets independently of the target root for gateway and CAIC review, defaulting to the target root. The explicit path is workspace-relative; --file remains workspace-relative and constrained to the target root. This supports reviewing sibling trees using one centralized asset corpus.
  • Usage sidecars retain all known decision and grounding usage—including billed usage attached to validation errors—models, and per-smell probabilities on every exit after the first call, including grounding/auth/schema errors and timeouts. Outcome is ok or error; errors include an error_class without provider error payloads. No call means no sidecar.
  • CI permits only gateway with --allow-ci or INTENT_REVIEW_ALLOW_CI=gateway. CAIC remains refused regardless of these opt-ins. Findings are advisory (exit 0); --strict changes findings to exit 1. Operational failures exit 2.
  • Credentials: AI_GATEWAY_URL and AI_GATEWAY_TOKEN. Reports are bare corpus-schema results, not CAIC envelopes; sidecars default to .usage.json. Fixture grading remains CAIC-only.

Rationale

Probability-only triage cannot supply evidence. One separate schema-constrained grounding call provides evidence, with a mechanically checked association to flagged smells. Keep target scope separate from rubric ownership and retain known usage even if later work fails.

Dependency

ai-gateway is pinned to the effect-utils PR #1748 merge commit 61cdf616db95c56fd016b1b78d6dc3010fd83f3c. Cargo.lock and the matching Nix source hash are updated together; the hash is measured by a real Nix build.

Verification

cargo test --locked passes: 10 unit tests, 11 gateway replay regressions, 15 existing check regressions. cargo clippy --locked --all-targets -- -D warnings passes; scoped cargo fmt applied. Token-free in-process replay covers valid triage/grounding, abstention, strict mode, unflagged/missing smell ids, schema errors, unauthorized grounding, timeout after decide with retained usage, sibling target trees using --corpus, and target-boundary rejection. Earlier Nix packaging and private-name checks pass; latest GitHub checks are authoritative for this head.

Posted on behalf of @schickling
field value
agent_identity agent/effect-utils/rust-ai-gateway
session 01a15163
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.6.0
agent_runtime OMP 18.6.0
agent_model anthropic/claude-opus-5-5
worktree effect-utils/2026-10-09-rust-ai-gateway

agent-identity: agent/effect-utils/rust-ai-gateway
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.6.0
agent-runtime: OMP 18.6.0
agent-model: anthropic/claude-opus-5-5
…v name

agent-identity: agent/effect-utils/rust-ai-gateway
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.6.0
agent-runtime: OMP 18.6.0
agent-model: anthropic/claude-opus-5-5
agent-identity: agent/effect-utils/rust-ai-gateway
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.6.0
agent-runtime: OMP 18.6.0
agent-model: anthropic/claude-opus-5-5
agent-identity: agent/effect-utils/rust-ai-gateway
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.6.0
agent-runtime: OMP 18.6.0
agent-model: anthropic/claude-opus-5-5
agent-identity: agent/effect-utils/rust-ai-gateway
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.6.0
agent-runtime: OMP 18.6.0
agent-model: anthropic/claude-opus-5-5
agent-identity: agent/effect-utils/rust-ai-gateway
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.6.0
agent-runtime: OMP 18.6.0
agent-model: anthropic/claude-opus-5-5
@schickling-assistant
schickling-assistant marked this pull request as ready for review October 10, 2026 13:22
@schickling-assistant
schickling-assistant merged commit bd6f61a into main Oct 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant