Skip to content

docs(openspec): plan #3049 Plan the review gate before the ready mark - #3183

Closed
devops-cli-service[bot] wants to merge 1 commit into
mainfrom
feat/3049-the-implement-job-reviews-its-own
Closed

devops-cli-service[bot] wants to merge 1 commit into
mainfrom
feat/3049-the-implement-job-reviews-its-own

Conversation

@devops-cli-service

Copy link
Copy Markdown
Contributor

Plans #3049

The implement job marks a pull request ready when the checks pass, with no review of the diff against the issue, the plan and the project rules. This change runs devops review and a plan-conformance check after the last task group and before gh pr ready. A high-severity finding gets one repair round; a finding that survives blocks the ready mark and the item is Blocked. The pull request comment lists every finding with its disposition. The review call budget per item is stated in the settings and enforced, and the ready mark waits for both the checks and the review. The review output is the seam that the draft evaluator reads.

Change: openspec/changes/3049-the-implement-job-reviews-its-own/

Copy link
Copy Markdown
Owner

Review of the plan for #3049.

CI: all 18 check runs on c321f26 are green or skipped, and Semantic PR title passes (summary is 53 characters). The PR base (6f648d5) is behind origin/main; #3177, #3178 and #3182 touch the stage job only, so I found no overlap with them. The cited lines are real: _checks is at implement_run.py:642, _ready at :681, repair_rounds at :508.

  1. The new capability contradicts two existing requirements. It needs MODIFIED deltas. openspec/specs/roadmap-implement-job/spec.md already holds "A pull request that passes its checks is marked ready" (line 156). It says: "When every check passed and no review thread is open, the job SHALL run gh pr ready". The plan's new "The ready mark waits for the checks and the review" says the opposite. The scenarios at lines 138 and 142 of the same spec ("A check fails once/twice ... marks the pull request ready") also lose their meaning. openspec/config.yaml says to reuse a capability and to change an existing requirement only with MODIFIED. Fix: put the gate in roadmap-implement-job as MODIFIED of those requirements (the full text is needed), and keep ADDED only for the genuinely new ones. The plan is also silent on the order of two gates: after a repair round the job pushes a new head, so the checks must be watched again (as _repair_after_push does at implement_run.py:664) before the job re-runs the review and marks ready. As written, gh pr ready could mark a head that no check judged. Add this to the spec and the design.

  2. The feat(roadmap): Add a draft PR evaluator for issue and rules #2867 seam is wrong, and feat(roadmap): one function decides when any draft pull request is ready #2916 is not stated as a dependency. design.md says the review result is "the input of ready_to_mark in stage_ready.py". ready_to_mark(draft: StageDraft) (stage_ready.py:64) is the decision of the stage row for plan pull requests. That row skips any item that has implement.job (stage_ready.py:_recorded_pull). The implement job calls mark_ready directly (implement_run.py:683), and no task touches stage_ready.py (it appears only under "Reads"). Open issue feat(roadmap): one function decides when any draft pull request is ready #2916 ("one function decides when any draft pull request is ready") plans one function that the stage row, the implement Job and devops pr ready all call. Hence either this item depends on feat(roadmap): one function decides when any draft pull request is ready #2916 or it adds a second gate that feat(roadmap): one function decides when any draft pull request is ready #2916 must remove. The proposal says neither. Fix: state the relation to feat(roadmap): one function decides when any draft pull request is ready #2916 and feat(roadmap): Add a draft PR evaluator for issue and rules #2867, and replace the ready_to_mark claim with the real seam, _ready or the feat(roadmap): one function decides when any draft pull request is ready #2916 function.

  3. Feasibility has no evidence for the central step (running devops review). The first four bullets prove only where _checks and _ready sit. The last bullet lists commands to run later ("uv run devops review --help shows ..."), not results. docs/commands/review.md on main has review branch --base, review path and review pr, and no option for machine-readable findings. Not verified: how review_diff reads findings and severity (stdout, review.md, or ReviewSessionStore in review/session.py; --no-reporting keeps no session), whether the exit code reflects findings (the only exits I found in commands/review.py are 0 and 1 for errors), whether the runner pod holds the tools and offline databases (feat(review): one devops command fetches the osv-scanner and trivy databases that a sandboxed review binds read-only #2131 is open), and what "high" means (HIGH only, or HIGH and CRITICAL). Per AGENTS rule 2, run devops review branch on a real diff, record the output and its version in Feasibility, and name the parse path in design.md.

  4. "Plan conformance" is not deterministic as written. _finish_change (implement_run.py:451) archives the change before _checks, so _active_change() returns None and the folder is under archive/. "Every task ticked" is already enforced: openspec/gate.py fails an archived change with unticked tasks. "Every criterion delivered" has no stated mechanism: no input, no rule, no test. Fix: say what the check reads (archived path, spec scenarios, or the diff) and how it decides "delivered", or drop the "criteria" part and record that decision.

  5. Wrong files and missing targets in the tasks.

    • Step names and messages live in src/devops_cli/lang/en/messages.py (implement_step_names at :2464, implement_pull_comment_line at :2540). Group 1 and Impact name config/constants.py.
    • CONTRIBUTING section 5 puts a tunable settings default in config/defaults.py as DEFAULT_<NAME>, read only in config/. The plan names neither defaults.py nor review_runs's Variable() marker.
    • A new setting changes tests/security/test_config_declarations.py and docs/ENV_VARS.md. Both are missing from Impact, and docs are regenerated only in group 4, so group 1 would leave the declaration test red.
    • Existing tests that assert "checks pass, then ready" will change: tests/core/test_roadmap_implement_checks.py, tests/core/test_roadmap_implement_planned_run.py, tests/roadmap/test_roadmap_implement_job.py. They are not listed.
    • Tasks 1.1 and 2.2 are one task each for large work. Task 1.1 verifies with uv run devops config show, which does not fail on base, although it adds behavior.
  6. Task 4.2 is truncated. It reads "docs/ROADMAP_WORKFLOW.md and CONTEXT.md, run uv run devops docs generate --sync-readme, and verify ...". The verb and object are missing, so the task is not an instruction. Rewrite it.

  7. Existing Tool Considered gives no cost for what the change builds. The only cost (weeks, permanent maintenance load) is for the rejected review engine. The change adds implement_review.py and says the conformance check is "a few dozen lines". AGENTS rule 3 asks for the tokens to build, keep and fix, and the elapsed time, for what is built. Add them.

  8. Minor. The "Budget is spent" and "survives the repair round" requirements describe the same stop (2 runs) with two reasons; say which reason the job records. The test file tests/roadmap/test_implement_review.py is in the right mirror folder, but the folder's convention is test_roadmap_implement_*.py.

Checked and fine: no duplicate requirement names against roadmap-implement-job; no requirement text near 500 characters; all uv run devops ... verify forms use real commands (devops roadmap implement --plan exists at commands/roadmap.py:711); Plans #3049 present; the tuicr bullet is allowed; no private data seen. Not verified: openspec validate --strict (not run), and no ASD-STE100 lint beyond reading.

Related issues:

Verdict: hold until findings 1 to 4 are fixed (MODIFIED deltas and the two-gate order, the #2916 relation and real seam, Feasibility evidence from a real devops review run, a defined conformance check). Findings 5 to 7 are also needed before approval.


Generated by Claude Code

dan-petty commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Plan-fix check for #3049: the item cannot be built as written. I did not change the plan. A person should run devops roadmap return 3049 --comment "<this comment>" --confirm (it fails with 401 in an agent session).

The premise is "the implement job runs devops review on the diff". The job runs in the runner pod. In that pod devops review can run no tool, so it can never give a finding. All evidence below is on origin/main 46ab396.

  1. The runner image holds no sandbox and no review tool. The runner stage of Dockerfile (lines 53-58) installs git, ca-certificates, curl, jq only. NOT_IN_RUNNER in src/devops_cli/roadmap/runner_tools.py names bwrap, semgrep, gitleaks, osv-scanner, kube-linter and trivy (I imported it: all six are True). The reason for the scanners is _SCANNER: "A scanner on PATH also fails tests that pass in the gate (test(floor): every test sees the same tokenizer cache, mounts, process table, PATH and programs on every host, and no skip depends on the host #2165). The runner does the same as the gate."
  2. The review fails closed without the sandbox. SECURITY.md rule 6: "A host that fails the check fails closed: no tool runs, in the sandbox or outside it." I ran devops review branch --base <base> --no-group-analysis on a one-file diff on a host with no bwrap (same state as the runner). Output: "The review tools did not run: bubblewrap (/usr/bin/bwrap) is not installed ..." then "The review tool semgrep is not installed on this host", exit code 1. So the job would get an error, not a finding. A gate that treats this as "no finding" never fires. A gate that treats it as a failure blocks every item. Both are code that works around the premise.
  3. A pod cannot start the sandbox. k8s/devops/cronjob-runner.yaml sets runAsNonRoot, capabilities.drop: [ALL], seccompProfile: RuntimeDefault. Issue feat(roadmap): run the implement agent shell in a real sandbox #2695 records that under this profile unshare --user fails with "Operation not permitted" for user 1000. I read this; I did not run it in a pod.
  4. A model cannot supply the finding. ADR 0005: model output "has no field that can create, move, re-rate or change the state of a finding". run_group_analysis (review/analysis.py:1480) only explains findings that tools admitted. With no tool there is no group, so no model call.
  5. Plan conformance is already enforced. "Every task ticked" is checked by _unticked_failure (implement_step.py:788, stop text implement_stop_unticked) and by openspec validate --archived. I unticked one task of an archived change in a scratch copy: "✗ 1 incomplete task (0/1 completed)". The check runs in devops openspec check. "Every criterion delivered" has no stated mechanism (my review, finding 4).

Security question (SECURITY.md rule 13). A review with the model stage sends the code region of each finding to the model of the analysis task. If that is a hosted group, the code leaves the cluster and is billed. The runner pod may reach the gateway (port 4000) and public HTTPS (networkpolicy.yaml). Any new plan must say which model group the review uses and that it sends diff text to it. --no-group-analysis sends none.

Other plans on main that change the same code (the three findings of my review that stay true).

What a new plan needs first: a runner (or another place) where the review tools can run, from #3041 and #2695. After that, #3049 can be planned again against draft_readiness.extra_checks and the failure taxonomy.

I leave the pull request as it is. Not verified: the sandbox in a real runner pod, and a review with the model stage (no gateway here).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW

@dan-petty

Copy link
Copy Markdown
Owner

rejected

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