Skip to content

feat: add secure Covencat autoreview and repair loop#12

Merged
romgenie merged 19 commits into
mainfrom
agent/covencat-autorepair
Jul 15, 2026
Merged

feat: add secure Covencat autoreview and repair loop#12
romgenie merged 19 commits into
mainfrom
agent/covencat-autorepair

Conversation

@romgenie

@romgenie romgenie commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

  • route opted-in pull-request revisions by repository, PR, and exact head SHA
  • run configured validation commands outside the model and publish only host-generated hashed receipts
  • add a separate same-repository repair opt-in with fork, branch, path, diff-size, stale-head, policy-change, and kill-switch gates
  • commit validated repairs as Covencat with task/attempt trailers, push without force, and enqueue a deterministic review for the new SHA
  • stop on repeated findings, attempt limits, no progress, failed validation, contract mismatch, stale revisions, or infrastructure failure
  • recover safely across publication and ambiguous push boundaries

Security model

The model receives the Codex credential and a sandboxed workspace only. It never receives GitHub tokens. Repair sessions have file tools only; trusted validation runs credential-free with network disabled. The host performs diff inspection, commit, exact-head verification, and non-force push using a fresh repository-scoped token.

Verification

  • npm run build
  • npm test (113 tests)
  • git diff --check
  • immutable live deployment verified with signed/unsigned webhook probes and zero-capability confinement
  • disposable live PR verified REQUEST_CHANGES -> repair commit -> new-SHA APPROVE
  • all retained artifacts scanned with zero secrets, tokens, keys, or emails
  • disposable repository repair opt-in returned to enabled: false after probe cleanup

Runtime dependency

Depends on OpenCoven/coven-code#163 for --hosted-repair and contract-v2-compatible file-only execution. Merge #163 before this PR.

Review status

The deployment and live-loop gates are complete. This PR is ready for review and should be merged after OpenCoven/coven-code#163.

@romgenie
romgenie marked this pull request as ready for review July 15, 2026 00:25

@covencat covencat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coven review

Status: success

The runtime review output was downgraded because its publication evidence was incomplete or contradictory.

Evidence

  • PR: #12
  • Base: main @ 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Head: agent/covencat-autorepair @ e205f255c06e7bd153354beac4f3b75249f727a1
  • Checked-out workspace HEAD: e205f255c06e7bd153354beac4f3b75249f727a1
  • Changed files supplied to agent: 17
  • Review context SHA-256: d83f06bbc2cb9e9ea564a6f6ee3a24fec244fd886fc80270e1def04010b5d4ee
  • Files: .gitignore, README.md, config/example-policy.json, deploy/Containerfile, deploy/covencat-ingress-tunnel.service.example, deploy/covencat-state-volume.service.example, deploy/covencat-worker.service.example, deploy/ingress-relay.mjs, deploy/probe-runtime.mjs, deploy/resolve-egress.mjs, deploy/verify-github-app.mjs, deploy/worker-entrypoint.sh, docs/coven-github-connection.md, src/adapter.ts, src/server.ts, src/task-worker.ts, tests/webhook-adapter.test.ts

Structured review

Files changed: 0
Commits: 1

Task autoreview-ed9912e9b84262d440a44e1e559f90f12c407109c36cd97b.

Publication validation

  • captured diff evidence is incomplete or truncated

Evidence was incomplete or contradictory, so this is a COMMENT review rather than an approval or change request.

@covencat covencat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coven review

Status: success

The runtime review output was downgraded because its publication evidence was incomplete or contradictory.

Evidence

  • PR: #12
  • Base: main @ 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Head: agent/covencat-autorepair @ 3a5f83f1c4141009a6d79b240c9b6f623a9e4d2f
  • Checked-out workspace HEAD: 3a5f83f1c4141009a6d79b240c9b6f623a9e4d2f
  • Changed files supplied to agent: 17
  • Review context SHA-256: 0dbab44b097639c2e10eab049c60b7661b389e5de702512c5ce4b9b44a627181
  • Files: .gitignore, README.md, config/example-policy.json, deploy/Containerfile, deploy/covencat-ingress-tunnel.service.example, deploy/covencat-state-volume.service.example, deploy/covencat-worker.service.example, deploy/ingress-relay.mjs, deploy/probe-runtime.mjs, deploy/resolve-egress.mjs, deploy/verify-github-app.mjs, deploy/worker-entrypoint.sh, docs/coven-github-connection.md, src/adapter.ts, src/server.ts, src/task-worker.ts, tests/webhook-adapter.test.ts

Structured review

Files changed: 0
Commits: 1

Task autoreview-37573322d75b5d5fd102dafcfe4fac1d738e2890e6ddd876.

This review follows the prior covencat publication. A decisive submission replaces its state; a COMMENT does not.

Publication validation

  • captured diff evidence is incomplete or truncated

Evidence was incomplete or contradictory, so this is a COMMENT review rather than an approval or change request.

@covencat covencat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coven review

Status: success

The runtime review output was downgraded because its publication evidence was incomplete or contradictory.

Evidence

  • PR: #12
  • Base: main @ 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Head: agent/covencat-autorepair @ bb3091e63e58ca554e640275f709535f7e484dad
  • Checked-out workspace HEAD: bb3091e63e58ca554e640275f709535f7e484dad
  • Changed files supplied to agent: 17
  • Review context SHA-256: 92cf934f6aa7f17d6df627e7e56201fd3a85a14da24af11d9a4136ac67f27a46
  • Files: .gitignore, README.md, config/example-policy.json, deploy/Containerfile, deploy/covencat-ingress-tunnel.service.example, deploy/covencat-state-volume.service.example, deploy/covencat-worker.service.example, deploy/ingress-relay.mjs, deploy/probe-runtime.mjs, deploy/resolve-egress.mjs, deploy/verify-github-app.mjs, deploy/worker-entrypoint.sh, docs/coven-github-connection.md, src/adapter.ts, src/server.ts, src/task-worker.ts, tests/webhook-adapter.test.ts

Structured review

Files changed: 0
Commits: 1

Task autoreview-0f41a3a7226e8b52229b9cbf5762dcc65f740e0ed650637e.

This review follows the prior covencat publication. A decisive submission replaces its state; a COMMENT does not.

Publication validation

  • captured diff evidence is incomplete or truncated

Evidence was incomplete or contradictory, so this is a COMMENT review rather than an approval or change request.

@covencat covencat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coven review

Status: success

The runtime review output was downgraded because its publication evidence was incomplete or contradictory.

Evidence

  • PR: #12
  • Base: main @ 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Merge base: undefined
  • Head: agent/covencat-autorepair @ ad4247b34036cec0492eb64734bb4438591cb2c3
  • Checked-out workspace HEAD: ad4247b34036cec0492eb64734bb4438591cb2c3
  • Changed files supplied to agent: 17
  • Review context SHA-256: 65e3ff6a59b9ff81acf77c8fef4307dec40ee6fa1b3046d7fa8c9bc22a98867b
  • Files: .gitignore, README.md, config/example-policy.json, deploy/Containerfile, deploy/covencat-ingress-tunnel.service.example, deploy/covencat-state-volume.service.example, deploy/covencat-worker.service.example, deploy/ingress-relay.mjs, deploy/probe-runtime.mjs, deploy/resolve-egress.mjs, deploy/verify-github-app.mjs, deploy/worker-entrypoint.sh, docs/coven-github-connection.md, src/adapter.ts, src/server.ts, src/task-worker.ts, tests/webhook-adapter.test.ts

Structured review

Files changed: 0
Commits: 1

Task autoreview-fc75ba73f9e43b1ef28e6627be4fc70536d9add61ad6478c.

This review follows the prior covencat publication. A decisive submission replaces its state; a COMMENT does not.

Publication validation

  • PR merge-base revision is missing
  • PR head changed after review evidence was captured
  • captured diff evidence is incomplete or truncated

Evidence was incomplete or contradictory, so this is a COMMENT review rather than an approval or change request.

The PR head or base changed before this review was submitted, so stale evidence was published as COMMENT.

The PR head or base changed during submission; this COMMENT must not supersede prior decisive review state.

@covencat covencat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coven review

Status: success

The runtime review output was downgraded because its publication evidence was incomplete or contradictory.

Evidence

  • PR: #12
  • Base: main @ 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Merge base: 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Head: agent/covencat-autorepair @ aa73327d62358afe8b9f699111a94a2168be7aaf
  • Checked-out workspace HEAD: aa73327d62358afe8b9f699111a94a2168be7aaf
  • Changed files supplied to agent: 17
  • Review context SHA-256: 4f2e07ad5d634e79103e1596bf26a703d3c5799ac37fd98691cca3ba9a7a93fb
  • Files: .gitignore, README.md, config/example-policy.json, deploy/Containerfile, deploy/covencat-ingress-tunnel.service.example, deploy/covencat-state-volume.service.example, deploy/covencat-worker.service.example, deploy/ingress-relay.mjs, deploy/probe-runtime.mjs, deploy/resolve-egress.mjs, deploy/verify-github-app.mjs, deploy/worker-entrypoint.sh, docs/coven-github-connection.md, src/adapter.ts, src/server.ts, src/task-worker.ts, tests/webhook-adapter.test.ts

Structured review

Files changed: 0
Commits: 1

Task autoreview-ffb1b34f0c8d85b16bbe54cac1a1960138ffccae7769b6b4.

This review follows the prior covencat publication. A decisive submission replaces its state; a COMMENT does not.

Publication validation

  • captured diff evidence is incomplete or truncated

Evidence was incomplete or contradictory, so this is a COMMENT review rather than an approval or change request.

@covencat covencat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coven review

Status: success

Files inspected

Files inspected

  • src/server.ts
  • src/adapter.ts
  • src/task-worker.ts
  • tests/webhook-adapter.test.ts
  • README.md
  • docs/coven-github-connection.md

Supporting context used

  • AGENTS.md — repository-wide review/contribution constraints and bounded-review expectations.
  • src/adapter.ts — needed to verify the new task recovery/publication state transitions and scheduler behavior.
  • src/server.ts — needed to inspect how queued tasks are scheduled and retried after webhook handling.
  • src/task-worker.ts — needed to confirm the worker reports the fields the scheduler now relies on.
  • tests/webhook-adapter.test.ts — needed to check the intended behavior asserted by the new tests.
  • README.md — needed to confirm the documented webhook/publication safety requirements match the implementation.
  • docs/coven-github-connection.md — needed to verify the operational guidance for comment publication and trigger configuration.

Findings

None

No-findings justification

The inspected changes are internally consistent across the task lifecycle and review publication flow. In src/server.ts:41-149, the worker scheduler now routes tasks into maintenance vs. compute lanes and correctly reenqueues follow-up and retryable tasks using the worker-reported followup_task_id, publication_state, and retry_not_before fields. In src/adapter.ts:2377-2577, revision-reconciliation failures are explicitly persisted as revision_reconciliation_retry_pending, publication recovery is gated on verified runtime isolation and comment mode, and failed publication retries persist and honor retry_not_before. The worker-side message contract in src/task-worker.ts:20-25 exposes the exact fields the scheduler consumes. The documentation updates in README.md:159-213 and docs/coven-github-connection.md:35-114 align the required GitHub App/webhook triggers with comment publication safety constraints. The trusted validation receipt also confirms git diff --check passed with no whitespace or patch-formatting issues.

Tests/commands considered

  • git diff --check - passed: no whitespace or patch formatting errors.
  • Review-time source inspection only; no additional commands were run beyond the trusted receipt.

Confidence/limitations

None

Evidence

  • PR: #12
  • Base: main @ 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Merge base: 658e542ad469bc5c3acf7ce603440e70bc3f7b92
  • Head: agent/covencat-autorepair @ 8d909105c6efc5384af7aa4f9a7c3ce3bfbbf453
  • Checked-out workspace HEAD: 8d909105c6efc5384af7aa4f9a7c3ce3bfbbf453
  • Changed files supplied to agent: 17
  • Review context SHA-256: 589c1e835a79e9222cceb8a54e2247c003f77add044308e72fdc62f369b74cba
  • Files: .gitignore, README.md, config/example-policy.json, deploy/Containerfile, deploy/covencat-ingress-tunnel.service.example, deploy/covencat-state-volume.service.example, deploy/covencat-worker.service.example, deploy/ingress-relay.mjs, deploy/probe-runtime.mjs, deploy/resolve-egress.mjs, deploy/verify-github-app.mjs, deploy/worker-entrypoint.sh, docs/coven-github-connection.md, src/adapter.ts, src/server.ts, src/task-worker.ts, tests/webhook-adapter.test.ts

Structured review

Files changed: 0
Commits: 1

Task autoreview-1afe1abdbef32243bce3d4145e9b1c5b361d6e6afcee51c9.

This review follows the prior covencat publication. A decisive submission replaces its state; a COMMENT does not.

@romgenie
romgenie merged commit ed9fcb2 into main Jul 15, 2026
1 check passed
@romgenie
romgenie deleted the agent/covencat-autorepair branch July 15, 2026 01:22
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