Skip to content

Reduce live discovery context and bind activation identity - #42

Merged
samtay32 merged 27 commits into
mainfrom
codex/issue-39-live-efficiency
Aug 3, 2026
Merged

Reduce live discovery context and bind activation identity#42
samtay32 merged 27 commits into
mainfrom
codex/issue-39-live-efficiency

Conversation

@samtay32

@samtay32 samtay32 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

What changed

  • Added durable, exact-run skill activation receipts with exact harness/model identity.
  • Added bounded exact-head local reviewer-result artifacts and unavailable-review receipts.
  • Made every local reviewer-result artifact diagnostic only: it can never establish a passed audit, independent review, PR readiness, or top-level success.
  • Separated artifact integrity from reported outcome: local_review_artifact_valid describes structural exact-head validity, while local_review_artifact_outcome reports passed, changes-requested, unavailable, conflict, missing, or invalid.
  • Kept local_review_audit_passed as a fail-closed compatibility field that is always false.
  • Added fail-closed handling when Git state is missing: status returns structured blocked/invalid evidence with public git: null instead of crashing.
  • Updated the protected-review receipt parser for Qodo's current exact-head terminal result: it accepts only one zero count each for bugs, rule violations, and skill insights, while preserving identity, exact-head, processing, pagination, and unresolved-thread gates.
  • Updated all 28 deterministic scenarios, fixtures, evaluator categories, installed instructions, and trust documentation.
  • Preserved the portable npm-first design, zero runtime dependencies, and simple initialization flow.

Why

Issue #39 identified an unsupported-review risk: a coordinator could write a reviewer artifact after a failed or missing delegation and present it as successful local review evidence.

Retained live Codex evidence confirmed that native reviewer dispatch is model/harness behavior, not something a portable npm package can authenticate. The CLI therefore fails closed: local artifacts remain inspectable, but only protected GitHub review can provide the mechanical review gate.

User impact

  • Normal npm installation, onboarding, flexible intake, planning, implementation, verification, and evidence flows remain portable.
  • No-code users are not asked to configure provider SDKs or harness adapters.
  • Missing or fabricated local reviewer evidence cannot make stack-generated status claim review success or PR readiness.
  • Valid negative outcomes such as changes-requested or unavailable remain honestly inspectable without being mislabeled as corrupted evidence.
  • Missing Git state produces a clear blocked result instead of a null dereference.
  • Draft evidence can still be prepared under user authority; merge readiness relies on protected GitHub review when policy requires it.

Exact validation

  • Reviewed head: 90a7aa6564421e07da66747d428b9710c0f389d5
  • Node: 22.23.2
  • npm run release:check: passed
  • Tests: 299 total; 298 passed, 0 failed, 1 platform-specific skip
  • Coverage: 80.60% lines, 75.54% branches, 90.20% functions
  • Deterministic contracts: 28 scenarios across 13 skills
  • Fixture baseline: d16224d9a060d7120090f9593435e058e761dcb17e27068ec79eca938e474d8c (two proposals byte-identical and equal to the tracked catalog)
  • Behavior surface: sha256:64af47dfde66c5a75fc8ef861e06025b1e3056b15286482c7d8c6a2856e633d0
  • Packed npm smoke: passed, 121 installed files
  • Runtime dependencies: 0
  • Worktree: clean

Retained live evidence and honest boundary

Fresh Codex cases confirmed explanation-only, vague discovery, and complete supplied-PRD behavior. The direct-delivery case twice skipped native reviewer dispatch and invented a local reviewer identity. The final implementation prevents those artifacts from becoming a passed-audit, independent-review, or PR-ready claim.

No universal native-dispatch reliability claim is made. Additional paid cross-harness reruns were intentionally stopped because portable instructions cannot authenticate harness-native delegation. Protected GitHub review remains the trusted mechanical gate.

Relates to #39.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change separates local agent-recorded review artifacts from authenticated protected GitHub review. It updates CLI readiness, delivery routing, project templates, evaluation scenarios, documentation, and regression tests to enforce this distinction.

Changes

Review policy and delivery workflow

Layer / File(s) Summary
Route-aware execution contracts
STARTER_PROMPT.md, assets/project-template/*
Routing now selects route-relevant skills and context. DISCOVER remains serial and delays readiness checks until after the initial question.
Review policy and readiness state
bin/ultimate-agent-stack.mjs, skills/*, docs/*, README.md, CHANGELOG.md
Local receipts now report artifact validity only. Protected GitHub review remains the authenticated readiness gate when required.
Evidence outcome evaluation
scripts/skill-eval.mjs, evals/*, docs/BEHAVIORAL_EVALS.md
Evaluation now validates exact identities, explicit review outcomes, receipt bindings, and final Git and tree changes.
Policy and receipt regression coverage
test/*
Tests cover provider-policy mismatches, stale or invalid receipts, exact-head binding, local-only evidence, routing outcomes, and delivery contracts.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LocalCLI
  participant LocalReviewArtifact
  participant ReviewStatus
  participant ProtectedGitHubReview
  LocalCLI->>LocalReviewArtifact: record exact-head local result
  LocalReviewArtifact->>ReviewStatus: report structural validity
  ReviewStatus-->>LocalCLI: keep readiness blocked
  LocalCLI->>ProtectedGitHubReview: request authenticated review when required
  ProtectedGitHubReview-->>ReviewStatus: return protected review receipt
Loading

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes two primary changes: reducing discovery context and binding activation identity.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-39-live-efficiency

Comment @coderabbitai help to get the list of available commands.

Comment thread test/maintenance.test.mjs Fixed
@samtay32
samtay32 marked this pull request as ready for review August 3, 2026 21:38
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fail-closed local review artifacts; bind activation receipts to harness/model identity

🐞 Bug fix 🧪 Tests ✨ Enhancement 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Make local reviewer-result artifacts diagnostic-only; never unlock independent review or PR
 readiness.
• Bind skill-activation receipts to exact harness/model identity; reject generic live identities.
• Compact DISCOVER guidance and update scenarios, fixtures, docs, and tests.
Diagram

graph TD
DOCS["Docs/Templates"] --> U["Operator/Agent"] --> CLI["agent-stack CLI"] --> STAT["Status gating"] --> READY["PR readiness"]
CLI --> REC[("Local receipts")] --> EVAL["skill-eval evaluator"]
SCEN["Deterministic scenarios"] --> EVAL --> OUT["Evidence outcomes"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Harness/provider-specific authenticated delegation adapters
  • ➕ Could provide stronger proof of native reviewer dispatch and identity
  • ➕ Might allow a true local independent-review gate in some harnesses
  • ➖ Breaks npm-first portability and “no runtime deps” constraint
  • ➖ Requires per-harness integration and ongoing maintenance
  • ➖ Still brittle across harness behavior changes and auth models
2. Cryptographic signing of local artifacts (user key)
  • ➕ Prevents simple post-hoc tampering/fabrication of artifacts after signing
  • ➕ Improves chain-of-custody for local evidence integrity
  • ➖ Does not prove reviewer delegation/independence (only signer identity)
  • ➖ Introduces key management UX/ops burden
  • ➖ Adds complexity without solving the core ‘native dispatch is unauthenticated’ boundary
3. Remove local review receipts entirely; require protected GitHub review only
  • ➕ Eliminates ambiguity around local review evidence
  • ➕ Simplifies readiness semantics and documentation
  • ➖ Loses useful bounded diagnostic artifacts for audits/debugging
  • ➖ Reduces offline/no-code utility where protected review can’t be performed yet

Recommendation: Keep the PR’s approach: fail-closed readiness semantics with explicit ‘diagnostic-only’ local artifacts, and place mechanical independence on protected GitHub review. This preserves portability while closing the unsupported-review risk and still retaining bounded, tamper-evident local artifacts for inspection.

Files changed (30) +1925 / -912

Bug fix (2) +224 / -32
ultimate-agent-stack.mjsFail-close local review readiness; validate review provider policy +70/-14

Fail-close local review readiness; validate review provider policy

• Adds review provider policy validation so required_for_release must match provider semantics. Changes review status to report local artifact integrity only (local_review_artifact_valid) while forcing independent_reviewed/review_gate_ready false and retaining local_review_audit_passed=false for compatibility. Updates top-level status readiness to incorporate policy validity and external review requirements, and tightens the delivery start prompt to reduce context loading and keep optional workflows conditional.

bin/ultimate-agent-stack.mjs

skill-eval.mjsBind activation receipts to harness/model; validate exact live identity and evidence outcomes +154/-18

Bind activation receipts to harness/model; validate exact live identity and evidence outcomes

• Adds strict validation for run record harness/model/version identity (rejecting sentinel/template values) and requires activation receipts to match the enclosing harness/model. Introduces normalized review evidence outcomes and updates review evidence derivation so local result artifacts never count as passed independent review; scenarios can now assert expected review_evidence outcomes.

scripts/skill-eval.mjs

Tests (6) +1104 / -149
fixture-baselines.jsonRefresh deterministic fixture baselines after contract changes +46/-46

Refresh deterministic fixture baselines after contract changes

• Updates baseline git heads and project tree hashes to reflect revised scenario behaviors and evidence contracts.

evals/fixture-baselines.json

scenarios.jsonEncode expected review evidence outcomes (local artifact vs unavailable) +23/-16

Encode expected review evidence outcomes (local artifact vs unavailable)

• Updates scenarios to forbid claiming passed audits/independence locally, adds required actions/outcomes for attempting local review audit, and introduces expected.review_evidence fields (e.g., local-result-artifact, unavailable). Changes previously ‘passed’ local review expectations to ‘blocked’ with explicit evidence outcome expectations.

evals/scenarios.json

agent-stack.test.mjsAdd config validation tests for provider-required_for_release invariants +44/-0

Add config validation tests for provider-required_for_release invariants

• Adds tests ensuring capabilities.review.required_for_release must align with the selected provider (builtin vs external providers) and that invalid combinations are rejected.

test/agent-stack.test.mjs

maintenance.test.mjsEnforce compact policies, exact live identity prompts, and review boundary wording +290/-7

Enforce compact policies, exact live identity prompts, and review boundary wording

• Adds tests to keep always-loaded policy text compact, ensure live evaluation identity guidance stays under a strict byte budget, and assert documentation consistently prevents local artifacts from implying PR readiness or independence. Verifies discovery fast-path self-containment and correct routing of optional skills.

test/maintenance.test.mjs

mechanical-receipts.test.mjsStrengthen receipt tests: local artifacts never pass audit; staleness and final-head binding +239/-20

Strengthen receipt tests: local artifacts never pass audit; staleness and final-head binding

• Updates mechanical receipt tests so invented reviewer IDs remain non-authoritative, independent_reviewed is always false, and local_review_audit_passed remains false. Adds scenarios for checkpoint-after-review staleness and ensures verification + review artifact bind the same final clean head while readiness remains blocked.

test/mechanical-receipts.test.mjs

skill-eval.test.mjsEvaluator tests for exact identity binding and review evidence outcomes +462/-60

Evaluator tests for exact identity binding and review evidence outcomes

• Adds tests for harness/model binding in activation receipts, rejects generic/sentinel live identities, and validates review evidence outcome expectations (local-result-artifact vs unavailable vs missing/invalid/conflict). Updates record generation for required-write scenarios to ensure final heads differ from materialized heads when appropriate.

test/skill-eval.test.mjs

Documentation (21) +587 / -723
CHANGELOG.mdDocument fail-closed local review audit boundary +14/-8

Document fail-closed local review audit boundary

• Adds unreleased notes clarifying that local agent-recorded review receipts are inspectable but cannot establish mechanical independence. Updates wording around review-audit vs protected review requirements and upgrade guidance.

CHANGELOG.md

README.mdReframe review flow around protected GitHub review gate +12/-12

Reframe review flow around protected GitHub review gate

• Updates README to state local review receipts never set independent_reviewed/review_gate_ready true and cannot unlock PR readiness. Revises the workflow diagram and capability table to distinguish local artifacts from protected review.

README.md

STARTER_PROMPT.mdCompact starter prompt with progressive disclosure and safe command hygiene +48/-123

Compact starter prompt with progressive disclosure and safe command hygiene

• Shortens and restructures the starter prompt to emphasize routing before loading context, avoiding repository dumps, and running local start/doctor. Ensures free-form request text is not embedded inside executable commands and keeps DISCOVER work compact.

STARTER_PROMPT.md

HANDOFF.mdMake optional skills conditional and keep DISCOVER serial +15/-9

Make optional skills conditional and keep DISCOVER serial

• Updates handoff guidance to only invoke optional skills (knowledge/work/parallel) when the immediate next step requires them. Adds explicit constraints to avoid checkpoint/status/diff dumping during the initial DISCOVER draft phase.

assets/project-template/.agent-stack/HANDOFF.md

deliver.mdRoute-aware artifact loading and optional knowledge usage +3/-2

Route-aware artifact loading and optional knowledge usage

• Tweaks Cursor deliver command guidance to load only route-relevant artifacts and to use knowledge providers only when needed beyond the checkout.

assets/project-template/.cursor/commands/deliver.md

AGENTS.mdCompacted agent contract with exact-run receipts and DISCOVER fast path +149/-295

Compacted agent contract with exact-run receipts and DISCOVER fast path

• Compacts the template agent contract to reduce always-loaded context, introduce a self-contained DISCOVER activation recipe, and enforce run-id correlation semantics. Clarifies that local reviewer-result artifacts are metadata-only and protected GitHub review is the authenticated gate.

assets/project-template/AGENTS.md

CLAUDE.mdBind activation receipt identity to exact harness/model labels +19/-11

Bind activation receipt identity to exact harness/model labels

• Updates the Claude adapter to require exact runtime model identifiers, correct native vs file-read recording, and clarifies local audit vs readiness outputs. Adds a constraint to avoid running readiness commands during the initial DISCOVER draft.

assets/project-template/CLAUDE.md

GEMINI.mdGemini adapter: route-relevant loading and exact identity recording +25/-15

Gemini adapter: route-relevant loading and exact identity recording

• Tightens Gemini adapter guidance to load only route-relevant skills, record exact harness/model identity, and correctly distinguish native activation from file-read mode. Clarifies protected review is not evaluated by the local CLI.

assets/project-template/GEMINI.md

ADAPTERS.mdClarify builtin review artifacts cannot unlock PR readiness +1/-1

Clarify builtin review artifacts cannot unlock PR readiness

• Updates adapter guidance so builtin review remains portable but local reviewer artifacts are structural metadata only and cannot unlock PR readiness.

docs/ADAPTERS.md

ARCHITECTURE.mdUpdate review plane to separate local audit from protected review gate +7/-6

Update review plane to separate local audit from protected review gate

• Adjusts architecture diagrams and narrative to reflect a bounded local reviewer-result artifact step followed by protected GitHub review when required. Clarifies local audit proves integrity only and never unlocks readiness.

docs/ARCHITECTURE.md

BEHAVIORAL_EVALS.mdDefine live identity block and review evidence outcomes +51/-6

Define live identity block and review evidence outcomes

• Adds an operator-supplied live identity + candidate doctor runner block with strict ‘no placeholder’ rules and a 2 KiB context budget. Documents review evidence outcomes (local-result-artifact/unavailable/invalid/etc.) and states local artifacts never prove delegation/independence.

docs/BEHAVIORAL_EVALS.md

OPERATING_MANUAL.mdReframe local review receipts as audit integrity evidence only +11/-12

Reframe local review receipts as audit integrity evidence only

• Updates operating manual language so local receipts never set independent_reviewed/review_gate_ready true and cannot make readiness.pr_ready true. Reinforces that protected GitHub review receipts are the separate authenticated gate.

docs/OPERATING_MANUAL.md

SKILL_STACK.mdSkill stack diagrams: local artifact then protected review gate +10/-3

Skill stack diagrams: local artifact then protected review gate

• Updates the skill stack flow to show a bounded local reviewer-result artifact leading to a draft PR and then protected GitHub review when policy requires it. Adds explicit text about integrity-only semantics for local audits.

docs/SKILL_STACK.md

TRUST.mdTrust boundary: local audit status only; protected review authenticates independence +13/-15

Trust boundary: local audit status only; protected review authenticates independence

• Updates trust guidance to state local receipts can be validated for integrity but never establish mechanical independence. Clarifies that only protected GitHub review receipts satisfy the independence gate and local artifacts cannot unlock PR readiness.

docs/TRUST.md

SKILL.mdClarify skill scope excludes local pre-PR review audit +1/-1

Clarify skill scope excludes local pre-PR review audit

• Updates the skill description to avoid implying it is used for local pre-PR review and to keep it scoped to existing PR/provider threads.

skills/close-review-loop/SKILL.md

SKILL.mdParallel delivery: local reviewer artifacts never satisfy independence gate +6/-3

Parallel delivery: local reviewer artifacts never satisfy independence gate

• Rewords guidance so missing/unverifiable delegation leads to review unavailable and local artifacts remain audit-only; protected GitHub review is required when policy demands external review.

skills/coordinate-parallel-delivery/SKILL.md

delegation-contract.mdDelegation contract: local reviewer artifacts can’t unlock PR readiness +3/-2

Delegation contract: local reviewer artifacts can’t unlock PR readiness

• Adds explicit language that a local reviewer-result artifact cannot establish passed audit/independence/PR readiness and that protected GitHub review is authoritative and not evaluated by the local CLI.

skills/coordinate-parallel-delivery/references/delegation-contract.md

SKILL.mdCompact controller text and DISCOVER fast-path constraints +126/-180

Compact controller text and DISCOVER fast-path constraints

• Compacts always-loaded controller guidance while routing detail into referenced contracts. Adds explicit DISCOVER fast-path constraints to avoid verbose follow-up work, minimize context, and keep optional skills conditional.

skills/run-autonomous-delivery/SKILL.md

delivery-policy.mdDefine final local audit sequence and explicit review-unavailable conditions +58/-0

Define final local audit sequence and explicit review-unavailable conditions

• Adds a detailed sequence: finalize tracked work, verify exact clean head, attempt bounded reviewer dispatch, and record results against the unchanged head. Explicitly forbids fabricating reviewer identity/results and reiterates that local artifacts cannot unlock PR readiness; protected review is the authenticated gate.

skills/run-autonomous-delivery/references/delivery-policy.md

setup-contract.mdSetup contract: builtin review artifacts are metadata-only and fail closed +7/-4

Setup contract: builtin review artifacts are metadata-only and fail closed

• Clarifies portable builtin review configuration produces only structural local artifacts, and missing/unavailable results block readiness. Reinforces protected GitHub review as the authenticated gate and keeps knowledge non-release-critical.

skills/setup-autonomous-project/references/setup-contract.md

SKILL.mdVerification guidance: local reviewer artifacts do not satisfy independence +8/-15

Verification guidance: local reviewer artifacts do not satisfy independence

• Updates verification instructions to treat local reviewer results as audit evidence only; they can’t satisfy independent review. States only protected GitHub review receipts establish mechanical independence.

skills/verify-change/SKILL.md

Other (1) +10 / -8
agent-stack.mdcCursor rules: exact identity + local audit vs readiness semantics +10/-8

Cursor rules: exact identity + local audit vs readiness semantics

• Updates Cursor rules to prefer route-relevant artifacts, avoid unnecessary provider usage, and clarify that review status is structural local-audit evidence while readiness depends on configured policy; protected review is not locally evaluated.

assets/project-template/.cursor/rules/agent-stack.mdc

@qodo-code-review

qodo-code-review Bot commented Aug 3, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 113 rules
✅ Skills: 4 invoked
  verify-change
  maintain-agent-stack
  build-vertical-slice
  secure-launch

Grey Divider


Action required

1. Artifact validity mixes outcomes ✓ Resolved 🐞 Bug ≡ Correctness
Description
commandReviewStatus sets local_review_artifact_valid to false when the local reviewer result is
changes-requested or unavailable (or simply not passed), even if the receipt/file is
structurally valid at an exact clean HEAD. This contradicts the documented contract that
local_review_artifact_valid “reports only exact-head artifact integrity” and will cause valid (but
negative) artifacts to be treated as invalid/missing evidence.
Code

bin/ultimate-agent-stack.mjs[R4993-4994]

+  const localReviewArtifactValid =
+    git.clean === true && localArtifactReasons.length === 0;
Relevance

●●● Strong

Team consistently tightens “exact-head integrity” semantics; similar contract-mismatch fixes
accepted in PRs #31 and #40.

PR-#31
PR-#40

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The CLI code uses semantic outcome conditions to populate localArtifactReasons (including
changes-requested and unavailable), then uses localArtifactReasons.length === 0 to decide
local_review_artifact_valid. Documentation and delivery policy both specify this field must
indicate only integrity at exact HEAD, not review outcome/success, so current logic violates the
documented contract.

bin/ultimate-agent-stack.mjs[4975-5021]
docs/BEHAVIORAL_EVALS.md[86-96]
skills/run-autonomous-delivery/references/delivery-policy.md[120-129]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`local_review_artifact_valid` is currently computed from `localArtifactReasons`, but that array includes semantic review outcomes (e.g. changes-requested / unavailable / no passed result). This makes `local_review_artifact_valid` false even when the artifact is intact, current, and bound to a clean exact HEAD.

### Issue Context
Docs explicitly state `local_review_artifact_valid` is integrity-only, and delivery policy instructs reporting the artifact only when this flag is true (including for non-passed outcomes).

### Fix Focus Areas
- bin/ultimate-agent-stack.mjs[4975-5021]

### What to change
- Split reasons into (a) **integrity** reasons (stale/dirty/altered/missing/invalid receipt or result file) and (b) **outcome** reasons (passed vs changes-requested vs unavailable vs missing).
- Compute `local_review_artifact_valid` from integrity reasons only (and clean git / no receipt/result validation errors), so a valid exact-head `changes-requested` or `unavailable` artifact can still set `local_review_artifact_valid: true`.
- Keep outcome classification in `reasons` (and/or add an explicit `evidence_outcome` field) without reusing it as the integrity predicate.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread bin/ultimate-agent-stack.mjs Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/skill-eval.mjs (1)

1274-1286: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reject review expectation combinations that can never be observed.

reviewStatus is now only blocked or not-required. Two declarable expectations are therefore unsatisfiable:

  • expected.review: "passed" always produces review outcome was blocked, so the expected === "passed" branch at Line 1033 is dead and the value is a permanent failure.
  • expected.review_evidence is validated only against REVIEW_EVIDENCE_OUTCOMES. A scenario can declare review: "not-required" with review_evidence: "unavailable", or review: "blocked" with review_evidence: "not-required", and both fail on every run.

Add a catalog-level consistency check so an unsatisfiable contract fails eval:contracts at authoring time instead of failing every recorded run.

♻️ Proposed catalog check
     if (
       expected.review_evidence !== undefined &&
       !REVIEW_EVIDENCE_OUTCOMES.has(expected.review_evidence)
     ) {
       errors.push(
         `${location}.expected.review_evidence must be a supported review evidence outcome`,
       );
     }
+    if (expected.review === "passed") {
+      errors.push(
+        `${location}.expected.review cannot be passed because local review evidence never derives a passed status`,
+      );
+    }
+    if (
+      REVIEW_EVIDENCE_OUTCOMES.has(expected.review_evidence) &&
+      (expected.review === "not-required") !==
+        (expected.review_evidence === "not-required")
+    ) {
+      errors.push(
+        `${location}.expected.review_evidence must agree with ${location}.expected.review`,
+      );
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/skill-eval.mjs` around lines 1274 - 1286, Update the catalog
validation around REVIEW_EXPECTATIONS and REVIEW_EVIDENCE_OUTCOMES to reject
unsatisfiable review contracts: disallow expected.review values that
reviewStatus cannot produce, and require review_evidence to match the
corresponding review value, including rejecting “unavailable” with
“not-required” and “not-required” with “blocked.” Ensure these consistency
errors are reported by eval:contracts during authoring validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/project-template/.cursor/commands/deliver.md`:
- Around line 1-3: Update the delivery entrypoint instructions to require
reading `.agent-stack/core-policy.json`, a valid checkpoint, and the current
diff in addition to the existing project contract, configuration, and
route-relevant artifacts. Before accepting the request for delivery, require
`start` to acquire the Project Steward lease and run `doctor`, including local
CLI startup evidence; preserve the conditional knowledge-provider usage for
decisions requiring information beyond the checkout.

In `@assets/project-template/AGENTS.md`:
- Around line 56-66: Update the activation recipes in the hash-bound controller
read instructions so --skill-path uses the actual canonical project-relative
installed skill path discovered by the adapter, rather than hardcoding
.agents/skills. Preserve the required skill-specific paths for
run-autonomous-delivery and develop-project-brief, and ensure receipts record
that exact path with the appropriate activation mode.

In `@bin/ultimate-agent-stack.mjs`:
- Around line 4993-4994: Update the commandReviewRecord flow around
localReviewArtifactValid to handle a null gitSnapshot before any Git-dependent
access. Normalize a missing snapshot into the existing blocked-status/reason
path for the entire function, and reuse that normalized result for later
Git-dependent output rather than only optional-chaining git.clean.

In `@CHANGELOG.md`:
- Around line 27-31: Update the changelog release note to describe local audit
output as diagnostic artifact-integrity evidence, not as a passed exact-head
audit that establishes readiness. State that built-in readiness still requires
current successful verification, while authenticated protected review remains
the separate configured gate; do not imply local receipts establish PR
readiness.

In `@README.md`:
- Around line 237-240: Update the README delivery-flow diagram around the
DRAFT-to-PROTECTED transition so protected GitHub review is explicitly
conditional when policy requires it or external review is configured. Preserve
local reviewer-result artifacts as diagnostic receipts and keep protected review
represented as the separate authenticated gate.

In `@skills/setup-autonomous-project/references/setup-contract.md`:
- Line 48: Update the prose sentence in setup-contract.md to use “built-in” when
describing the reviewer-result artifact, while retaining “builtin” only for the
provider enum or configuration value.

In `@test/maintenance.test.mjs`:
- Around line 899-905: Replace the broad alternation assertion in the local
review receipt test with source-specific checks that require each document to
state that receipts are agent-recorded and do not prove reviewer independence.
Remove the generic “always keeps” match and assert the precise local-receipt
claim for every source under test, while preserving the existing agent-recorded
and protected GitHub review assertions.

In `@test/skill-eval.test.mjs`:
- Around line 1201-1240: Extend the review evidence test to cover a
direct-delivery scenario with its valid passed receipt plus a valid
changes-requested receipt and artifact. Evaluate the record and assert it fails
with “review evidence contains conflicting outcomes” and reports
review.evidence_outcome as “conflict”, while preserving the existing blocked and
tampered cases.

---

Outside diff comments:
In `@scripts/skill-eval.mjs`:
- Around line 1274-1286: Update the catalog validation around
REVIEW_EXPECTATIONS and REVIEW_EVIDENCE_OUTCOMES to reject unsatisfiable review
contracts: disallow expected.review values that reviewStatus cannot produce, and
require review_evidence to match the corresponding review value, including
rejecting “unavailable” with “not-required” and “not-required” with “blocked.”
Ensure these consistency errors are reported by eval:contracts during authoring
validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4af78dd6-3fa9-40d6-b1a6-721f7701982a

📥 Commits

Reviewing files that changed from the base of the PR and between dd18be3 and 23ba86b.

📒 Files selected for processing (30)
  • CHANGELOG.md
  • README.md
  • STARTER_PROMPT.md
  • assets/project-template/.agent-stack/HANDOFF.md
  • assets/project-template/.cursor/commands/deliver.md
  • assets/project-template/.cursor/rules/agent-stack.mdc
  • assets/project-template/AGENTS.md
  • assets/project-template/CLAUDE.md
  • assets/project-template/GEMINI.md
  • bin/ultimate-agent-stack.mjs
  • docs/ADAPTERS.md
  • docs/ARCHITECTURE.md
  • docs/BEHAVIORAL_EVALS.md
  • docs/OPERATING_MANUAL.md
  • docs/SKILL_STACK.md
  • docs/TRUST.md
  • evals/fixture-baselines.json
  • evals/scenarios.json
  • scripts/skill-eval.mjs
  • skills/close-review-loop/SKILL.md
  • skills/coordinate-parallel-delivery/SKILL.md
  • skills/coordinate-parallel-delivery/references/delegation-contract.md
  • skills/run-autonomous-delivery/SKILL.md
  • skills/run-autonomous-delivery/references/delivery-policy.md
  • skills/setup-autonomous-project/references/setup-contract.md
  • skills/verify-change/SKILL.md
  • test/agent-stack.test.mjs
  • test/maintenance.test.mjs
  • test/mechanical-receipts.test.mjs
  • test/skill-eval.test.mjs

Comment thread assets/project-template/.cursor/commands/deliver.md Outdated
Comment thread assets/project-template/AGENTS.md
Comment thread bin/ultimate-agent-stack.mjs Outdated
Comment thread CHANGELOG.md Outdated
Comment thread README.md
Comment thread skills/setup-autonomous-project/references/setup-contract.md Outdated
Comment thread test/maintenance.test.mjs Outdated
Comment thread test/skill-eval.test.mjs
@samtay32
samtay32 merged commit d1dae80 into main Aug 3, 2026
8 of 9 checks passed
@samtay32
samtay32 deleted the codex/issue-39-live-efficiency branch August 3, 2026 23:17
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.

2 participants