[codex] Require structured hosted reviews and repair loop#31
Conversation
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
romgenie
left a comment
There was a problem hiding this comment.
Reviewed the structured review contract and hosted adapter changes. I found several actionable issues around contract enforcement, webhook security, policy gating, and review evidence completeness.
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
romgenie
left a comment
There was a problem hiding this comment.
Reviewed the current PR head after the previous fixes. The build/test suite passes locally, but I found additional contract and routing issues that should be addressed before merging.
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
|
@BunsDev Ready for your review. |
There was a problem hiding this comment.
Pull request overview
This PR upgrades the coven-code ↔ coven-github headless interface to contract v2, adding a structured hosted-review result envelope (evidence, reviewed files, findings, limitations, and no-findings rationale) and introducing a hosted dogfood Python adapter that can publish those results back to GitHub and optionally run a bounded “review fix loop”.
Changes:
- Bump the headless contract to v2 across docs + JSON schemas, adding structured
reviewoutput and optional hostedreview_context/audit_instruction. - Add a deployment-specific Python hosted adapter (plus unit tests) to capture PR evidence, validate v2 results, publish review output, and optionally perform bounded repair cycles.
- Enforce v2 result-contract validation in the Rust worker and extend CI to compile + test the hosted adapter.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/headless-contract.md | Updates contract documentation to v2 and defines structured review requirements. |
| docs/contracts/session-brief.schema.json | Updates session brief JSON schema to require v2 contract_version and allow hosted review context fields. |
| docs/contracts/session-brief.example.json | Updates session brief example to v2. |
| docs/contracts/result.schema.json | Updates result JSON schema to v2 and adds structured review envelope rules. |
| docs/contracts/result.example.json | Updates result example to v2, including review envelope. |
| deploy/coven-github/test_coven_github_adapter.py | Adds unit tests for mention parsing and PR evidence staleness detection. |
| deploy/coven-github/README.md | Documents hosted dogfood adapter behavior, inputs, and fix-loop toggle. |
| deploy/coven-github/coven_github_adapter.py | Implements hosted adapter: routing, evidence capture, v2 validation, publication, and bounded repair loop. |
| crates/worker/tests/contract.rs | Expands contract tests to v2, including hosted review fields and stricter parsing rules. |
| crates/worker/src/lib.rs | Adds v2 result-contract validation and updates worker plumbing for the new result shape. |
| crates/worker/src/brief.rs | Tightens session-brief deserialization (deny unknown fields, enforce v2 contract_version) and adds optional hosted review context. |
| crates/github/src/tasks.rs | Updates test fixtures to include v2 review field. |
| crates/github/src/lib.rs | Bumps HEADLESS_CONTRACT_VERSION to 2 and adds ReviewResult / related types to the API model. |
| .gitignore | Ignores hosted adapter deployment-local secrets/policy/state paths. |
| .github/workflows/ci.yml | Extends CI to py_compile + run hosted adapter unit tests before Rust checks/tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- docs/headless-contract.md: clarify that `line` and `recommendation` on findings are required (present in every finding) but may be null, matching the v2 JSON schema which lists them in `required` with nullable types. - deploy/coven-github/coven_github_adapter.py: catch RuntimeError from verify_webhook_signature() in route_signed_delivery() and return a structured 500 response instead of propagating an unhandled exception when the webhook secret is not configured.
Accepts degraded partial review results from coven-code while preserving complete clean-review validation. Aligns the v2 schemas and contract prose with coven-code PR #132. Refs OpenCoven#11 Refs PR OpenCoven#31 Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Return a structured 500 for missing webhook secret configuration and clarify nullable finding fields in the v2 contract docs. Refs PR OpenCoven#31 Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
BunsDev
left a comment
There was a problem hiding this comment.
Approved after independent local verification of head d03b5a2:
- Python adapter: py_compile OK + 3 unittest tests pass
- cargo check --all-targets: clean (all 4 crates)
- cargo clippy --all-targets -D warnings: clean
- cargo test --all: 29 unit + 9 contract tests, 0 failures
Contract-v2 tests validate wire-naming, contract-version enforcement, unknown-field rejection, and golden deserialization. No unresolved review threads; author signed off "Ready to merge". CI workflow + .gitignore diffs reviewed and clean.
Note: this PR renames the CI job to "python + cargo check + clippy + test"; updating branch-protection required-check context accordingly at merge.
Upstreams the hosted review hardening stack: hosted-review runtime and memory isolation, tenant/installation/repo/domain scoping, trust classification, provenance metadata, secret scanning before memory write or sync, team-memory sync conflict handling, retention/deletion/redaction controls, structured headless review output with supporting-evidence tracing, and substantive-review enforcement. Adds Rust CI and interactive terminal suite workflows. Verified at 8b62b4a: all requested review changes addressed; fmt, check, clippy -D warnings, and full workspace tests pass; v2 headless contract schemas validated against runtime output with ajv; matching v2 adapter support already merged as OpenCoven/coven-github#31. Closes #97 Closes #100 Closes #101 Closes #102 Closes #105 Closes #108 Refs #98, #99, #103, #104, #106, #107, #109, #110, #111, #112, #119 — partially advanced by this PR; remaining gaps tracked on each issue. Co-authored-by: Timothy Wayne Gregg <5861166+romgenie@users.noreply.github.com>
Summary
coven-githubdogfood adapter support for publishing structured review evidence back to GitHub.COVEN_REVIEW_FIX_LOOPSfor bounded hosted review repair cycles using prior structured findings as explicit repair instructions.Issue tags
Refs OpenCoven/coven-code#119
Related to OpenCoven/coven-code#132, #2, #4, #7, #10, #11
Commit issue-linking note
Some commits in this stacked PR use the shorthand
#119because they were created while working across the pairedcoven-codeandcoven-githubbranches. For cross-repository review, treat those commit references asOpenCoven/coven-code#119; this PR body records the explicit cross-repository links.Upstreaming note
This upstream PR is created from the research fork branch
codex/review-fix-loop. It intentionally contains the full stacked research work for:Validation
python -B -m py_compile deploy\coven-github\coven_github_adapter.pycargo fmt --allcargo check --workspacecargo clippy --workspace --all-targets -- -D warningscargo test --workspacegit diff --check(only Windows line-ending warnings)Behavior
COVEN_REVIEW_FIX_LOOPSis set above0.