Skip to content

feat(ci): close GT-146 — secure, provider-neutral, token-bounded agentic review#56

Merged
beyondnetPeru merged 5 commits into
mainfrom
fix/gt-146-agentic-review
Jun 21, 2026
Merged

feat(ci): close GT-146 — secure, provider-neutral, token-bounded agentic review#56
beyondnetPeru merged 5 commits into
mainfrom
fix/gt-146-agentic-review

Conversation

@beyondnetPeru

Copy link
Copy Markdown
Contributor

Cierra GT-146 (P0). Reescribe el agentic CI review en módulos puros y testeados:

  • review-input.mjs: redacción de secretos + selección de archivos relevantes + budget bytes/tokens + chunking.
  • review-result.mjs: schema versionado v1.0 + validación fail-closed (adiós marcador de texto libre).
  • review-provider.mjs: port neutral de proveedor + adapter Gemini (API key en header), fail-closed.
  • Job agentic-review con permissions: contents: read.
  • 27 node:test verde. Board 149/153 done.

🤖 Generated with Claude Code

beyondnetPeru and others added 5 commits June 20, 2026 18:28
…view (GT-146)

First increment toward GT-146. Add a pure, provider-neutral review-input
module and wire it into the agentic CI review so the provider never sees
raw secrets or an unbounded payload:

- review-input.mjs: redactSecrets (PEM/JWT/AWS/GCP/GitHub/Slack/Bearer +
  generic *_KEY=… assignments), selectRelevantFiles (drop lockfiles,
  vendored, generated, binary), estimateTokens, budgetAndChunk (byte/token
  cap with per-file truncation), prepareReviewInput pipeline + telemetry
- 13-agentic-code-review.mjs: sanitize/scope/budget the diff before
  submission, fail closed above the token ceiling, skip when no
  policy-relevant files changed, report aggregate non-sensitive telemetry
- review-input.test.mjs: 9 node:test cases (redaction, selection, budget,
  chunking, end-to-end)

Addresses done-when criterion 2 (redaction + relevant files + bounded/
chunked). Remaining: provider port, versioned response schema/validation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…146)

Second increment toward GT-146. Replace the fragile free-text
'VIOLATION_DETECTED' marker with a structured, versioned contract:

- review-result.mjs: parseProviderResponse (tolerates fences/prose),
  validateReviewResult (schema v1.0: verdict + findings with severity,
  title, evidence file/line, confidence 0..1), evaluateProviderResponse
  (parse+validate+gate, fail-closed). Malformed/unsupported/indeterminate
  output resolves to verdict "error" and can never silently pass.
- 13-agentic-code-review.mjs: prompt now requests the JSON schema; the gate
  uses evaluateProviderResponse and reports findings with evidence.
- review-result.test.mjs: 11 node:test cases (parse, validate, fail-closed).

Addresses done-when criterion 3. Remaining: provider-neutral port/adapters (1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Third increment toward GT-146. Decouple the CI gate from any vendor:

- review-provider.mjs: a review port selected by config
  (EVOLITH_REVIEW_PROVIDER/MODEL); Gemini adapter isolates the only
  vendor networking and sends the API key as a header (not the URL query).
  Unknown providers / missing credentials / invalid adapters fail closed.
- 13-agentic-code-review.mjs: use createReviewProvider() + buildReviewPrompt()
  instead of a hard-coded Gemini call; all error paths fail closed.
- review-provider.test.mjs: 7 node:test cases (registry, fail-closed,
  mock adapter contract, adapter-failure propagation).

Addresses done-when criterion 1. All four criteria now have implementation:
provider port (1), redaction/budget (2), schema validation (3), tests (4).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…146)

Scope the Wilson Agentic Review job to `contents: read` — it only needs to
read the repo to diff changes. Completes done-when criterion 4 (minimum
permissions) alongside the redaction/budget telemetry already in place.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mark GT-146 DONE with closure evidence (commit 3efbb59): provider-neutral
review port, secret-redacting/token-bounded input, versioned fail-closed
result schema, 27 node:test cases, and least-privilege CI permissions.

Board progress 149/153 done, 4 pending.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@beyondnetPeru beyondnetPeru merged commit c5b8c6a into main Jun 21, 2026
6 of 13 checks passed
@github-actions

Copy link
Copy Markdown

📊 Bilingual Coverage Impact

PR Changes

  • Paired EN/ES files modified: 2
  • New EN files needing ES translation: 0

Repository Coverage

Metric Value
Total EN files 415
Total ES files 415
Paired files 0
Coverage 0%

Good: All EN changes have ES counterparts.


Generated by GitHub Actions

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