Skip to content

feat(issue-review): add an optional pre-implementation readiness stage - #114

Merged
datacas merged 4 commits into
mainfrom
issue-110-issue-review
Sep 29, 2026
Merged

datacas merged 4 commits into
mainfrom
issue-110-issue-review

Conversation

@datacas

@datacas datacas commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #110 — #110

Summary

Adds cc-issue-review, a read-only readiness pass over a work item, and runs it in run_cycle.py immediately before implement.

  • Skill (skills/cc-issue-review/SKILL.md): compares the work item and its linked work with the current repository, evaluates only the relevant dimensions (applicability, existing_work, overlap_dependency, scope_architecture, acceptance_verification, compatibility, security, data, operations), and returns READY, NEEDS_REFINEMENT, or BLOCKED with a categorical confidence, evidence-backed IR-NNN findings, IU-NNN uncertainties, and suggested issue edits. It never edits, comments on, labels, or closes the work item, and it does not repeat the implementer's diagnosis or review code.
  • Result contract (scripts/issue_review.py): closed shape and vocabularies. REV-xxx identities, finding status, resolver disposition, and a diagnosis object are refused. The validator checks the skill's tables and example against this same check.
  • Gate: only a confirmed READY (confidence high/medium, no unresolved material uncertainty) dispatches implement. A READY with low confidence or an open material uncertainty escalates once to senior_reviewer (escalation_selector), then stops as readiness_unconfirmed; high-risk work that already ran on senior_reviewer stops directly. NEEDS_REFINEMENT stops as needs_refinement and prints findings, evidence, and proposed edits. BLOCKED, missing, or malformed results stop before implement.
  • Mode: auto by default (code_cycle.issue_review.mode, --issue-review). auto skips only work declared trivial and not security-sensitive (--difficulty 1 without --security-sensitive); the default difficulty 2 is reviewed. off restores implement → review → resolve → rereview. Resumes from review/resolve/rereview are unchanged.
  • Routing: issue_review candidates are reviewer/senior_reviewer; difficulty 3 or security-sensitive → senior_reviewer. No new executor-specific, temperature, or context-budget knobs.
  • Workspace/publication: the role reuses READ_ONLY with no publication permissions, so it gets the existing after-dispatch checkout fingerprint and the "publishes nothing" prompt policy.
  • Telemetry (schema 11, additive, payload-only): verdict readiness_result_valid, readiness_confidence, readiness_findings_total, readiness_findings_blocking, readiness_uncertainties_material; dispatch signal escalated; cycle issue_review (off/skipped/dispatched); stop reasons needs_refinement, readiness_unconfirmed. No issue text, finding prose, or prompts are stored.
  • Docs: review cycle, routing, role workspace policy, telemetry, instrumentation, configuration, workflows, skills reference, README, CONTRIBUTING shared-section table, CHANGELOG.

Compatibility note

auto is the new default for run_cycle.py and run_cycle(...), as the issue specifies, so a default new cycle now dispatches one extra read-only stage before implement. Existing driver tests pin issue_review="off" to keep describing the original flow; the installed-cycle tests run the default and assert the new stage.

Verification (agent-reported)

Level Command Exit Executed
test python3 -m unittest tests.test_issue_review 0 43
test python3 -m unittest discover -s tests 0 897
static python3 scripts/validate-package.py 0 —
boundary bash scripts/install.sh --agent all --scope global and --scope project into a temporary HOME; cc-issue-review/SKILL.md present in all six host layouts and the installed runtime imports run_cycle and issue_review 0 —
boundary npx --yes skills@1.5.23 add . --list lists cc-issue-review with no skipped or unparsable skill 0 —

Conceptual fixtures (tests/fixtures/issue-review/): #92 is skipped as trivial; #90 is READY on reviewer and a result carrying diagnosis is refused; #91 routes to senior_reviewer, returns NEEDS_REFINEMENT with a blocking finding that the detector must cover what git status hides (ignored files, the index, refs), and a low-confidence READY for it cannot reach implement. Tests need no optional workspace tools. PowerShell/Windows installation was not run locally; CI ran it.

The first CI run failed on two defects fixed in 5f64359: the skill's description contained : , which strict YAML rejects, so the skills CLI skipped it (the first local discovery check matched that skip warning and was wrong); and a test left a SQLite connection open, which Windows could not clean up. All four checks pass on 5f64359.

Residual risk / not in scope

  • cc-orchestrator and cc-orca-orchestrator do not dispatch the new stage; only the runtime driver does.
  • Confidence is the agent's categorical assessment; the runtime can only enforce the shape and the gate, not the quality of the judgement.

Add the read-only cc-issue-review skill and run it before implement in
run_cycle.py. It returns READY, NEEDS_REFINEMENT, or BLOCKED with a
categorical confidence, IR-NNN findings with evidence, and IU-NNN
uncertainties, without editing or commenting on the work item and
without repeating the implementer's diagnosis.

Only a confirmed READY dispatches implement. A READY with low confidence
or an unresolved material uncertainty is reviewed once more on
senior_reviewer, then stops as readiness_unconfirmed. NEEDS_REFINEMENT
stops as needs_refinement and prints the findings; BLOCKED, missing, or
malformed results stop before implement.

The default is auto, which skips only work declared trivial and not
security-sensitive; issue_review.mode: off or --issue-review off keeps
the original flow, and resumed cycles are unchanged. The role reuses the
read_only policy with no publication permission. Telemetry schema 11 adds
counts and tokens only. The validator checks the skill's tables and
example against the runtime's result check.

Closes #110
@datacas

datacas commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260929-001] · reviewer · openai/gpt-6-sol→? · high · schema:1

Summary and scope

Reviewed the full accumulated diff for PR #114, from merge base 8e4d52e8fde985bfaf08e8b75609420125c3d986 through head 5bed9454fafff25751a64df9384a76e18d0d9984 (34 files, three commits). Scope covers the new cc-issue-review skill and result contract, the pre-implementation gate and escalation in run_cycle.py, routing/workspace permissions, telemetry, package validation, tests, CI, and documentation. PR #110 is the linked work item. There is no prior review finding history on this PR.

Verdict: APPROVED. One medium, non-blocking finding remains open. No finding blocks approval.

Findings

[REV-001] · medium · open · - · blocks:no — READY results are not bound to the requested work item

Path: scripts/run_cycle.py:1000

The runtime calls assess_readiness(reported.payload) without the requested task ID. In scripts/issue_review.py, identity fields such as issue_id are optional and are not compared with the task being run. A valid READY result naming a different issue therefore passes the gate and lets implementation start for the requested task. A targeted runtime probe confirmed that a high-confidence READY payload with issue_id: "123" is accepted with gate='continue'. Require a work-item identity in the result and compare it with the requested identifier (or its provider-resolved canonical ID) before continuing.

Security triage and audit

.code-cycle.yml defines no security_review.always_when rule, so the default deterministic rule did not activate. My sensitivity triage did activate the audit because the change adds a role to the read-only workspace and profile-routing permission contracts. The cc-security-review pass examined the changed workspace/access boundaries, provider and command handling, telemetry privacy, dependencies, and CI/install surfaces. No actionable security finding was identified.

Execution-backed verification

  • python3 -m unittest discover -s tests -p 'test_issue_review.py' -v — passed, 43 tests.
  • python3 scripts/validate-package.py — passed; 15 skills validated and shared sections/manifests aligned.
  • python3 -m unittest discover -s tests -v — passed, 899 tests.
  • git diff --check origin/main...origin/pr/114 — passed.
  • Targeted issue_review.assess probe with a mismatched issue_id — returned gate='continue'; this reproduces REV-001.

The verification preflight found no required application configuration, external service, database server, or migration for this Python runtime/package change. Windows was not exercised locally; the PowerShell CI job completed successfully.

CI and expected gates

All four check runs on head 5bed9454fafff25751a64df9384a76e18d0d9984 passed: Skills, manifests, and Bash installer (two runs) and PowerShell installer (two runs). No PR check is pending, failed, cancelled, or skipped, and no expected PR gate is missing. The release workflow runs after successful pushes to main or by manual dispatch, so it is not a PR gate.

Residual risks

The readiness assessment is model-authored; the runtime enforces its result shape and gate but cannot independently prove the assessment's reasoning. The new stage is integrated into run_cycle.py; the two orchestration skills do not dispatch it, as also stated in the PR description.

Project verdict: APPROVED. REV-001 is non-blocking; blocking findings: none.

Resolves REV-001: a result must name the reviewed work item in issue_id, and the runtime stops before implement when it names another one.
@datacas

datacas commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260929-001] · reviewer · openai/gpt-6-sol→? · high · schema:1

[CCT-20260929-001] · manual · anthropic/claude-opus-5-5→? · unknown · triaged:5bed9454fafff25751a64df9384a76e18d0d9984 · schema:1

Triage

Every finding was classified against 5bed9454fafff25751a64df9384a76e18d0d9984 before any edit.

[REV-001] · medium · open · valid · blocks:no — READY results are not bound to the requested work item

Path: scripts/run_cycle.py:1000, scripts/issue_review.py

Valid. issue_review.assess accepts a result without issue_id and never compares it with the task the runtime dispatched, so a confirmed READY for another work item opens the gate. The fix will require issue_id in the result contract and have the runtime stop before implement when it does not name the requested work item.

@datacas

datacas commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260929-001] · reviewer · openai/gpt-6-sol→? · high · schema:1

[CCT-20260929-001] · manual · anthropic/claude-opus-5-5→? · unknown · triaged:5bed9454fafff25751a64df9384a76e18d0d9984 · schema:1

Resolution summary — RESOLVED

Triaged against 5bed9454fafff25751a64df9384a76e18d0d9984; fixed in 9bbe8d20cbeabfe5f8832a77e33543556190a7df.

[REV-001] · medium · resolved · valid · blocks:no — READY results are not bound to the requested work item

Paths: scripts/issue_review.py, scripts/run_cycle.py, skills/cc-issue-review/SKILL.md

  • issue_id is now a required key of the issue-review result.
  • issue_review.assess(payload, work_item) refuses a result whose issue_id does not name the requested work item. The comparison ignores case, surrounding space, and a leading #, and it matches a work item given as a provider URL by its last path segment. The runtime passes its task_id, so such a result stops before implement (stage_not_completed) and is recorded with readiness_result_valid: false. The reported value is not echoed to the terminal.
  • The skill states that issue_id is the identifier the invocation named. The docs and CHANGELOG are updated.

Reproduction: the reviewer's probe, a high-confidence READY with issue_id: "123" for task API-7, now returns gate='stop' (test_a_ready_for_another_work_item_does_not_continue). Through the runtime, no implementation is dispatched (test_a_ready_for_another_work_item_stops_before_implementation).

Verification (agent-reported)

Level Command Exit Executed
test python3 -m unittest discover -s tests 0 903
static python3 scripts/validate-package.py 0 —

Post-change review of the accumulated diff found no new issue. Security triage: no default security_review path matched, and the change only narrows the gate, so no audit was added.

CI

All four checks passed on 9bbe8d20cbeabfe5f8832a77e33543556190a7df: Skills, manifests, and Bash installer (×2) and PowerShell installer (×2).

Residual risk

The identity check proves that the result names the requested item. It cannot prove that the agent actually read that item.

@datacas

datacas commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260929-002] · reviewer · openai/gpt-6-sol→? · high · schema:1

[CCR-20260929-001] · reviewer · openai/gpt-6-sol→? · high · schema:1

[CCT-20260929-001] · manual · anthropic/claude-opus-5-5→? · unknown · triaged:5bed9454fafff25751a64df9384a76e18d0d9984 · schema:1

Summary and scope

Rereviewed the full accumulated diff for PR #114 against base 8e4d52e8fde985bfaf08e8b75609420125c3d986, through current head 9bbe8d20cbeabfe5f8832a77e33543556190a7df (34 files, four commits). Since the prior review, one commit changed nine files to bind readiness results to the requested work item. I preserved the original finding ID, severity, and triage disposition.

Verdict: APPROVED. The prior non-blocking finding is resolved; there are no open or blocking findings.

Findings

[REV-001] · medium · resolved · valid · blocks:no — READY results are not bound to the requested work item

Paths: scripts/issue_review.py, scripts/run_cycle.py, skills/cc-issue-review/SKILL.md

The result contract now requires issue_id. assess(payload, work_item) compares it with the requested work item, normalizing case, surrounding whitespace, a leading #, and provider URLs by their last path segment. The runtime passes its task_id; a mismatch stops the gate before implementation, and the supplied mismatching value is not echoed.

Execution-backed regression evidence: an in-memory probe against the old and current remote source changed the mismatched READY result from gate=continue, valid=True to gate=stop, valid=False. The current-head CI suite ran both test_a_ready_for_another_work_item_does_not_continue and test_a_ready_for_another_work_item_stops_before_implementation.

No new findings were identified in the accumulated diff.

Security triage and audit

No deterministic .code-cycle.yml security_review.always_when rule matched. Reviewer sensitivity triage triggered a focused audit because the change validates an untrusted, model-authored result before opening the implementation gate. The audit examined identity normalization, validation bounds and types, mismatch handling, and whether supplied identity values are exposed. No actionable security finding was identified.

Verification

  • Remote-source before/after probe for REV-001 — passed; mismatch now stops.
  • Current-head CI ran the full Python suite: 903 tests passed.
  • Current-head package validator: 15 skills validated.
  • Current-head regression tests for the gate and runtime dispatch — passed.
  • Local full-suite rerun was not possible: this checkout is behind the PR head, and fetching failed because .git/FETCH_HEAD is read-only. The PR's current-head CI provides full-suite verification.

CI and expected gates

All four PR check runs passed on 9bbe8d20cbeabfe5f8832a77e33543556190a7df: Skills, manifests, and Bash installer (two runs) and PowerShell installer (two runs). No PR check is pending, failed, cancelled, or skipped, and no expected PR gate is missing. The release workflow is not a PR gate.

Residual risk

The identity check confirms that the result names the requested work item. It cannot independently prove that the model actually read that item; readiness reasoning remains model-authored.

Project verdict: APPROVED. REV-001 is resolved; blocking findings: none.

@datacas
datacas merged commit a6201c7 into main Sep 29, 2026
4 checks passed
@datacas
datacas deleted the issue-110-issue-review branch October 6, 2026 07:53
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.

feat(issue-review): add an optional pre-implementation readiness stage

1 participant