Repository navigation
feat(roadmap): stage plan rules read the project profile #4643
Description
Problem or Motivation
src/devops_cli/roadmap/stage/stage_form.py:44accepts only verify commands that start withuv run devops.:47and:142make tests mirrorsrc/devops_cli.src/devops_cli/roadmap/stage/stage_change.py:557makes a behavior group change a path undersrc/. vibes, dotfiles, homelab and danielpetty.com do not havesrc/.src/devops_cli/lang/en/messages.pyhas 16uv run devopslines.:4249adds "Verification:$ uv run devops ci docspasses" to every documents task (docs(openspec): plan #4 fix build config linker and asset root dreamscaper#17 tasks 1.3, 2.3, 3.3 and 4.3, and docs(openspec): plan #4 Remove xterm-256color from tmux config dotfiles#8 line 9).- The no-spec prefix list exists twice and the copies differ:
stage_change.py:160-166has 5 entries,src/devops_cli/config/constants.py:5279-5284has 4. SECURITY_TRIGGER_PATHS(stage_change.py:228-234) names onlypyproject.toml.- The tuicr bullet (
stage_change.py:2654-2660) goes to every plan that changessrc/. roadmap_stage_change.md:26and:39restate these constants as prose.
Proposed Solution & Architectural Design
- The stage resolves the profile (feat(roadmap): a toolchain preset sets the implement checks #4635).
stage_formtakesverify_prefixesfrom the preset.- The source rule uses path roles: a path is source when
load_path_classes(base)gives it no test, fixture, docs or spec role. - The test-mirror rule applies only with
test_selection = python-imports. stage_task_documentsadds the docs verification only when the preset hasdocs_verification. The repair messages (messages.py:3351,:4096,:4106and:4114) take the same prefixes.- Merge the 2 no-spec lists into one constant.
- Add
package.json,Cargo.toml,go.modand their lockfiles to the security manifests. - The tuicr bullet and the self-hosting paragraphs render only when
review_bulletandself_hosting_promptare true. - The stage prompt renders all these values through feat(ai): the prompt loader renders Jinja with project values #4633.
- The devops-cli self rules (
STAGE_EVAL_*,PROMPT_RULE_TEST,GATE_DEFECT_PATHS,_MESSAGES_FILEand_PLAN_CHECK_FILE) stay in code. - Add
*_test.go,*.test.ts,*.spec.tsand__tests__/**to the default test globs.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/roadmap/stage/).
Existing Tool Considered
The path roles come from .devops/review.toml [paths] (load_path_classes), which exists. The prompt values render through Jinja2 (#4633). No other tool is necessary. Cost: about 150 lines and 10 tests, about 500,000 tokens and 5 hours to build.
Acceptance Criteria
-
uv run devops roadmap eval stage --replaygives a score that is not lower than the score before the change (both numbers in the pull request). - A test: for a neutral repository with no
src/, a behavior group that changesinstall.shpasses the source rule, and a documents task has nouv run devopstext. - A test: for devops-cli, the rendered stage prompt and the
check_proposalresults do not change on the golden set. -
git grep -c 'uv run devops' src/devops_cli/lang/en/messages.pygives less than 16, and no line that remains is in a stage text for a neutral repository. - One no-spec prefix constant remains.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Source: #4627
Alternatives check of 2026-11-28: none.
Tool: none found.
Reason: Searches found no external tool that reads a project profile to drive stage plan rules; the need is in-repo changes to devops-cli's stage and plan-rewrite code, which already names load_path_classes and Jinja2.
Lacks:
- Verify prefixes taken from a per-project profile preset
- Source, test, docs and spec roles read from the review config
- Docs verification command supplied by the repository preset
- Configurable review bullet and self-hosting prompt flags
- One shared no-spec prefix constant and wider security manifests
Proposed design
Problem statement
Do not start this item before #6521, #4633 and #4635 close. The stage plan rules assume a Python repository with src/ and uv, so they refuse correct plans in vibes, dotfiles, homelab and danielpetty.com. They accept only verify commands that start with uv run devops, and they write uv run devops texts into every plan. The change makes these rules read the project profile.
Acceptance criteria
Requirement: Verify prefixes from the profile
The stage form SHALL take the allowed verify prefixes from the project profile preset.
Scenario: A preset names another verify prefix
- WHEN A test renders the stage form with a preset whose
verify_prefixesholdsbun run check. - THEN The form accepts
bun run check --fastand refusesuv run devops ci.
Requirement: Source rule reads the path roles
The plan check SHALL count a changed path as source when load_path_classes gives the path no test, fixture, docs or spec role.
Scenario: A behavior group changes a script with no src folder
- WHEN A test runs the plan check on a behavior group that changes
install.sh, and the path roles giveinstall.shno test, fixture, docs or spec role. - THEN The plan check reports no problem that asks for a path under
src/.
Requirement: Test mirror follows the test selection
The stage SHALL apply the test-mirror rule only when the profile sets test_selection to python-imports.
Scenario: A profile selects no Python import tests
- WHEN A test renders the stage rules with a preset whose
test_selectionis notpython-imports. - THEN The rendered rules hold no sentence that asks a test to mirror the path of its source module.
Requirement: A documents task names the profile docs command
The stage SHALL name the preset docs_verification command in a documents task when the preset holds one.
Scenario: A preset names a docs command
- WHEN A test renders a documents task with a preset whose
docs_verificationisbun run docs. - THEN The task holds
Verification: $ bun run docs passesand nouv run devops.
Requirement: The plan rewrite names the profile docs command
The plan rewrite MUST write the preset docs_verification command into a documents task.
Scenario: A preset names a docs command for the plan rewrite
- WHEN A test runs the plan rewrite of
src/devops_cli/roadmap/plan_rewrite.pyon a documents task with a preset whosedocs_verificationisbun run docs. - THEN The rewritten task holds
Verification: $ bun run docs passesand nouv run devops ci docsline.
Requirement: The plan rewrite writes no docs command for a neutral preset
The plan rewrite MUST write no uv run devops command when the preset holds no docs_verification.
Scenario: A neutral preset rewrites a documents task
- WHEN A test runs the plan rewrite of
src/devops_cli/roadmap/plan_rewrite.pyon a documents task with a preset whosedocs_verificationis empty. - THEN The rewritten task holds no
uv run devops ci docsline and noVerification:line.
Requirement: One no-spec prefix constant
The stage plan check MUST read its no-spec prefixes from the one constant NO_SPEC_PREFIXES in src/devops_cli/config/constants.py.
Scenario: The stage module holds no second list
- WHEN A test imports
NO_SPEC_PREFIXESfromsrc/devops_cli/config/constants.pyand reads the source ofsrc/devops_cli/roadmap/stage/stage_change.py. - THEN
NO_SPEC_PREFIXESholds five prefixes once each, and the stage module defines no list of no-spec prefixes of its own.
Requirement: Security manifests cover each ecosystem
SECURITY_TRIGGER_PATHS MUST name pyproject.toml, package.json, package-lock.json, pnpm-lock.yaml, yarn.lock, Cargo.toml, Cargo.lock, go.mod and go.sum.
Scenario: A plan changes a Node or Go manifest
- WHEN A test runs the security trigger match on each of
package.json,package-lock.json,pnpm-lock.yaml,yarn.lock,Cargo.toml,Cargo.lock,go.modandgo.sum. - THEN Each path makes the plan need a
## Securitysection.
Requirement: Review bullet and self-hosting text follow the preset
The stage MUST render the tuicr review bullet and the self-hosting paragraphs only when the preset sets review_bullet and self_hosting_prompt.
Scenario: A preset sets both flags false
- WHEN A test renders the stage prompt with a preset whose
review_bulletandself_hosting_promptare false. - THEN The prompt holds no
tuicrtext and no self-hosting paragraph.
Requirement: Default test globs cover Go and TypeScript tests
The default test globs MUST name *_test.go, *.test.ts, *.spec.ts and __tests__/**.
Scenario: A Go test file and a TypeScript test file get the test role
- WHEN A test asks the default test globs about
pkg/server_test.go,web/app.test.ts,web/app.spec.tsandweb/__tests__/app.js. - THEN Each path matches a test glob.
Requirement: Repair messages take the profile prefixes
The repair messages that name a project command SHALL take the verify prefixes of the preset.
Scenario: A preset with another prefix renders a repair message
- WHEN A test renders the repair message of a refused command with a preset whose verify prefixes hold
cargo test. - THEN The message names
cargo testand holds nouv run devops.
Requirement: A neutral profile stage text holds no project command
A stage text for a neutral profile MUST hold no uv run devops text.
Scenario: A neutral profile renders its stage texts
- WHEN A test renders the stage texts of a neutral profile.
- THEN No rendered text holds
uv run devops.
Requirement: A neutral profile documents task holds no verification line
A documents task for a preset with no docs_verification MUST hold no verification line.
Scenario: A neutral preset renders a documents task
- WHEN A test renders a documents task with a preset whose
docs_verificationis empty. - THEN The task holds no
Verification:line.
Requirement: The devops-cli plan rules do not change
The rendered stage prompt and the plan check results MUST NOT change for devops-cli.
Scenario: The golden set of devops-cli
- WHEN A test renders the stage prompt and runs the plan check on each golden set case with the devops-cli preset.
- THEN Each rendered prompt and each result equals the recorded one.
Requirement: The stage eval score does not fall
The stage eval replay MUST print a score that is not lower than the score before the change, and the pull request MUST give both numbers.
Scenario: The replay runs on the changed tree
- WHEN A run executes
uv run devops roadmap eval stage --replay. - THEN The printed score is not lower than the score recorded before the change.
Requirement: The devops-cli self rules stay in code
The devops-cli self rules STAGE_EVAL_*, PROMPT_RULE_TEST, GATE_DEFECT_PATHS, _MESSAGES_FILE and _PLAN_CHECK_FILE MUST stay in src/devops_cli/roadmap/stage/stage_change.py.
Scenario: A test reads the stage module
- WHEN A test reads
src/devops_cli/roadmap/stage/stage_change.py. - THEN The module defines
PROMPT_RULE_TEST,GATE_DEFECT_PATHS,_MESSAGES_FILEand_PLAN_CHECK_FILE, and theSTAGE_EVAL_*names are in the module.
Requirement: The message catalog names the project command fewer times
The English message catalog MUST hold fewer than 16 lines that name uv run devops.
Scenario: The catalog is counted
- WHEN A test counts the lines of
src/devops_cli/lang/en/messages.pythat holduv run devops. - THEN The count is less than 16.
Existing Tool Considered
The alternatives check of 2026-11-28 in the issue body records the verdict none and names no tool. Its Lacks: list gives the parts that no tool covers. The change builds those parts in src/devops_cli/roadmap/stage/ and src/devops_cli/roadmap/plan_rewrite.py. It takes the path roles from .devops/review.toml through load_path_classes, and it renders the prompt values through the Jinja2 template of #4633. Cost: about 150 lines and 10 tests, about 500,000 tokens and 5 hours to build, keep and fix.
Key questions
- Where does the stage get the allowed verify prefixes?: The stage reads
verify_prefixesfrom the project profile preset that feat(roadmap): a toolchain preset sets the implement checks #4635 resolves. The stage form keeps no hard-codeduv run devopsprefix. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/stage/stage_form.py]- Chosen: The project profile preset. The profile holds the facts of one repository, and feat(roadmap): a toolchain preset sets the implement checks #4635 resolves it before the stage reads its rules.
- Rejected: A hard-coded
uv run devopsprefix. A repository that does not use uv has no such command, so the stage refuses correct plans. - Rejected: A config setting. CONTEXT.md says the config of devops-cli holds operational keys only, never a fact of a project.
- Which rule decides that a changed path is source?: The path roles of the
[paths]table in.devops/review.tomldecide throughload_path_classes. A path is source when the roles give it no test, fixture, docs or spec role. (best practice) [sources: .devops/review.toml, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: The path roles of
load_path_classes. The roles classify the paths of each repository, and.devops/review.tomldeclares them. - Rejected: A path under
src/. vibes, dotfiles, homelab and danielpetty.com have nosrc/, so a behavior group there always fails. - Rejected: A new source glob list in the profile. It repeats the roles that the
[paths]table already declares.
- Chosen: The path roles of
- When does the test-mirror rule apply?: The stage applies the test-mirror rule only when the profile sets
test_selectiontopython-imports. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: Only with
test_selection = python-imports. The mirror path is a fact of a Python project that selects its tests by import. - Rejected: Always. A Go or TypeScript repository has no
tests/<package>/test_<module>.pymirror path. - Rejected: Never. devops-cli selects tests by import, and its plans must keep the mirror rule.
- Chosen: Only with
- What form does
docs_verificationtake in the profile preset?: It is an optional command string. A non-empty value addsVerification: $ <command> passesto a documents task. An empty value adds no line. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: An optional command string. The command is a fact of the repository, and the stage keeps no
uv run devops ci docsin code. - Rejected: A boolean flag. A boolean keeps the
uv run devops ci docscommand in code, so a neutral repository still gets the wrong text. - Rejected: Always
uv run devops ci docs. A repository that does not use uv has no such command, as homelab and danielpetty.com show.
- Chosen: An optional command string. The command is a fact of the repository, and the stage keeps no
- Where does the plan rewrite get the docs command?: The plan rewrite reads the same preset
docs_verificationvalue. The_DOCS_COMMANDatsrc/devops_cli/roadmap/plan_rewrite.py:39is replaced. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py:39, src/devops_cli/lang/en/messages.py]- Chosen: The preset
docs_verificationvalue. One value feeds both the stage text and the plan rewrite, so the two copies cannot drift. - Rejected: Keep
_DOCS_COMMANDasuv run devops ci docs. The text stays wrong in a repository with no docs folder and no documents generator. - Rejected: A second preset key. Two keys for one command drift apart, and the plan rewrite then names another command than the stage.
- Chosen: The preset
- Which no-spec prefixes does the single constant hold?: The constant holds the five prefixes of
stage_change.py:160-166. The four-entry copy inconstants.py:5279-5284misses one prefix. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/config/constants.py]- Chosen: The five prefixes of
stage_change.py. The stage rule in force holds five prefixes, and the four-entry copy is incomplete. - Rejected: The four prefixes of
constants.py. The shorter list accepts a path that needs a spec delta. - Rejected: Keep both lists. The copies differ, so the stage and the constant give different answers.
- Chosen: The five prefixes of
- Where does the single no-spec prefix constant live?: It lives in
src/devops_cli/config/constants.pyasNO_SPEC_PREFIXES.stage_changeimports it and defines no second list. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/roadmap/stage/stage_change.py]- Chosen:
src/devops_cli/config/constants.py. The module holds one copy now, andstage_changealready reads constants from it. - Rejected:
src/devops_cli/roadmap/stage/stage_constants.py.configwould import the stage package, which readsconfig, so the import makes a cycle. - Rejected: Keep both lists. The copies differ, and the shorter one accepts a path that needs a spec delta.
- Chosen:
- Which files make a plan need a security section?:
pyproject.toml,package.json,package-lock.json,pnpm-lock.yaml,yarn.lock,Cargo.toml,Cargo.lock,go.modandgo.sum. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]- Chosen: The four manifests and their lockfiles. The tuple then covers each ecosystem that a managed project uses.
- Rejected:
pyproject.tomlalone. A change ofpackage.jsonorgo.modchanges the dependencies of the project too. - Rejected: The manifests that detection finds. A review trigger must not change when a file that detection reads changes.
- How do the review bullet and the self-hosting text reach the prompt?: The preset sets
review_bulletandself_hosting_prompt. The template renders each text only when its flag is true. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/lang/en/messages.py]- Chosen: Render each only when its preset flag is true. The flags are facts of the repository, and the profile preset holds them.
- Rejected: Always render both. A neutral repository has no tuicr review and no self-hosting rules, so the text is false there.
- Rejected: Never render both. devops-cli uses the tuicr review and the self-hosting rules, so its prompt must keep them.
- Which default test globs cover the other languages?: The default test globs add
*_test.go,*.test.ts,*.spec.tsand__tests__/**to the Python globs. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: Add the four patterns. Each pattern is the name that the test runner of its language uses.
- Rejected: The Python globs alone. The test role then misses a Go or TypeScript test, so the source rule counts that test as source.
- Rejected: Ask detection for the test globs. The test role must not change when a file that detection reads changes.
- Do the repair messages take the profile prefixes?: Yes. Each repair message that names a project command takes the verify prefixes of the preset. The messages at
messages.py:3351,:4096,:4106and:4114change. (best practice) [sources: src/devops_cli/lang/en/messages.py]- Chosen: Take the prefixes of the preset. The repair message and the verify rule then name the same commands.
- Rejected: Keep
uv run devopsin the repair messages. The message names a command that the repository does not have, so the agent runs a command that fails.
- Do the devops-cli self rules stay in code?: Yes.
STAGE_EVAL_*,PROMPT_RULE_TEST,GATE_DEFECT_PATHS,_MESSAGES_FILEand_PLAN_CHECK_FILEstay insrc/devops_cli/roadmap/stage/stage_change.py. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, tests/roadmap/stage/test_roadmap_stage_content.py]- Chosen: Keep them in code. The stage module already defines them, and the devops-cli preset does not need them.
- Rejected: Move them to the profile. They are rules of devops-cli itself, not facts of a managed repository.
- Does the change keep the stage rules of devops-cli?: Yes. The devops-cli preset sets the flags that the current rules assume. A golden set test compares the rendered prompt and the plan check results. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_content.py, src/devops_cli/roadmap/stage/stage_change.py]
- Chosen: Keep the current rules through the preset. Each current rule becomes a preset flag that the devops-cli preset sets.
- Rejected: Change the rules for devops-cli too. The golden set holds the results of the current rules, and a change there lowers the eval score.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.The change broadens the tool to non-Python and non-src projects, but it is not a security fix or a broken-flow blocker.It removes hard-coded assumptions so the stage works for dotfiles, homelab, and danielpetty.com projects.The body estimates about 150 lines, 10 tests, and 5 hours of work.Both items work on the verify command and test-mirror rules in stage_form, but #3015 added the hardcoded enforcement and the candidate makes those rules configurable via a project profile.devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at 0410772 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 17, 2026
Alternatives check: none
Reason: Searches for a project-profile-driven preset tool, for a monorepo per-project target configuration tool, and for a file-classification (source/test/docs globs) library returned only unrelated MDN documentation pages, no open tool or library. The need is devops-cli's own stage prompt and plan-check code (verify prefixes, source rule, test mirror, docs verification, one no-spec constant, security manifests, review bullet and self-hosting flags), which no general tool writes; the issue itself reaches the same conclusion.
Tool: none found
Lacks:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 1812dd2 (see proposed design in issue body).
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
dan-petty commentedon Nov 28, 2026
New evidence for the
stage_task_documentsdefect: the stage job gave task 5.2 of dan-petty/danielpetty.com#115 the verifyuv run devops ci docs. That repository has nodocs/folder and no documents generator, so the command cannot pass there. The implement job stopped group 5 seven times with the classplan_defectand used 20,538,410 input tokens (dan-petty/danielpetty.com#115, comment 7229925581). The plan of that branch now usesgrep -n -Fand! git greponARCHITECTURE.md. The cause insrc/devops_cli/lang/en/messages.py(stage_task_documents) andsrc/devops_cli/roadmap/plan_rewrite.py(_DOCS_COMMAND) stays.dan-petty commentedon Nov 28, 2026
More evidence, 2026-11-28: the stage wrote devops-cli
cirows as verifies into homelab plans, and none of them can pass in homelab (details of the two failures on #7369):uv run devops ci docs: homelab#611 task 2.2, Checkouts and Worktrees Below Another Repository Resolve to Their Own Repository #617 tasks 5.1 and 5.2, feat(sandbox): bubblewrap host confinement for criteria execution (#592) #632 tasks 7.1 and 7.2, and danielpetty.com#126 task 5.2 (the implement Job stopped 7 times on it).uv run devops ci --check --only k8s: homelab#617 spec scenarios 2 to 5, feat(sandbox): bubblewrap host confinement for criteria execution (#592) #632 task 1.1.The plans are being fixed by hand to use
pre-commit run --files ...and themaketargets or scripts of the repository.devops-cli-service commentedon Nov 28, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.