Repository navigation
Description
Problem
A change that adds a constant, a setting, a metric or a job write must also add entries to registries and ratchet tests. A plan cannot know this without running the suite, so the entries are missed. Evidence from 2026-11-02:
- docs(openspec): plan #2947 Raise the alternatives first-pass limit to 20 #3174:
tests/roadmap/test_roadmap_limit_classes.pyrequires an entry for every newDEFAULT_ROADMAP_*number. - docs(openspec): plan #2777 Label the stage and implement pull requests #3169: a new job write needs entries in the dry-run plans (
stage_requests,implement_requests), the fault-testWRITEStable, the contract test and the request-plan entry. - docs(openspec): plan #2950 Add alternatives coverage metrics and alert #3173: the instrument must be in
INSTRUMENTS, anddocs/TELEMETRY.mdis generated from it. A stale test path (tests/test_telemetry_instruments.pyinstead oftests/telemetry/...) stays in a docstring. - The mirror-folder rule (fix(roadmap): the stage job refuses a pytest verify command #3189) covers new test modules only: a test added to an existing module in the wrong folder passes.
Proposed change
Build a table of "if the plan adds X, these places need an entry" from the code, not by hand: each ratchet and registry test declares what it counts (a constant prefix, an enum, a table name). The context lists, for each kind of addition that the plan's Changes implies, the tests and tables that count it, with path:line. check_proposal refuses a plan that adds such a thing and has no task for the listed place. A check also fails when a path in a docstring or a spec names a test file that does not exist.
Acceptance criteria
- A test shows that a plan that adds a
DEFAULT_ROADMAP_*constant gets the limit-class ratchet in its context and is refused without a task for it. - A test shows that a plan that adds a job write gets the dry-run, fault-test and contract entries.
- A test fails when a test path named in a docstring or a spec does not exist.
- The table is derived from the tests (a marker or a named constant), not copied by hand.
Proposed design
Problem statement
A plan can add a constant, a setting, a metric or a job write. The plan can miss the registry entry and the ratchet test that the suite requires. The stage job must list these places from declarations in the tests. It must refuse a plan that has no task for a listed place. It must also fail when a docstring or a spec names a test file that does not exist.
Acceptance criteria
Requirement: Registry table comes from test declarations
The stage job SHALL build the registry and ratchet table from module-level declarations in the test files, and it MUST NOT use a hand-copied table.
Scenario: A new declaration appears in the table
- WHEN A test module adds a REGISTRY_COUNTS entry for a counted prefix, enum or table name.
- THEN The table builder returns that entry with the test path and line, and no hand table changes.
Requirement: Limit-class ratchet is listed and enforced
A plan that adds a DEFAULT_ROADMAP_* constant SHALL get tests/roadmap/test_roadmap_limit_classes.py in its context, and check_proposal MUST refuse the plan when no task names that path.
Scenario: New roadmap limit without a ratchet task
- WHEN A plan adds DEFAULT_ROADMAP_EXAMPLE_LIMIT and has no task for tests/roadmap/test_roadmap_limit_classes.py.
- THEN The context names the limit-class test and check_proposal returns a missing-path problem for it.
Requirement: Job-write registries are listed and enforced
A plan that adds a job write SHALL get the dry-run, fault-test, contract-test and request-plan entries in its context, and check_proposal MUST refuse the plan when a task for one entry is missing.
Scenario: New job write without one registry task
- WHEN A plan adds a write method and has no task for tests/roadmap_faults.py.
- THEN The context names tests/roadmap/test_roadmap_dry_runs.py, the WRITES table in tests/roadmap_faults.py, tests/roadmap/test_roadmap_store_contract.py and src/devops_cli/roadmap/request_plan.py, and check_proposal returns a problem for the fault-test path.
Requirement: Docstring and spec test paths exist
A check SHALL fail when a test file path in a Python docstring or a spec does not exist in the repository.
Scenario: A spec names a missing test file
- WHEN A spec contains tests/test_missing_example.py and that file is absent.
- THEN The check reports tests/test_missing_example.py as a missing path.
Requirement: check_proposal reports missing test paths
check_proposal MUST add each missing test path from a docstring or a spec to its refusal list.
Scenario: A plan changes a docstring with a stale test path
- WHEN A plan changes a Python file whose docstring names a missing test file.
- THEN check_proposal returns a problem that names the missing test path.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers a repository-specific table of test declarations. Build in-house: about 20,000 tokens to build, 8,000 tokens each year to keep, 4,000 tokens for each fix, and 2 engineer-days.
Key questions
- Which open, maintained tool or library covers the registry and ratchet discovery need?: No alternatives check has run. The need is specific to this repository's test declarations, and no open maintained tool covers it. Use an in-repo AST reader. (best practice) [sources: tests/roadmap/test_roadmap_limit_classes.py, tests/roadmap_faults.py:20, tests/telemetry/test_telemetry_instruments.py]
- Chosen: In-repo AST reader. It reads test declarations without importing pytest and keeps one source of truth.
- Rejected: Runtime import of test modules. It pulls test dependencies into the stage job and can run test code.
- Rejected: Hand-kept table. The issue forbids a hand-copied table, and the table goes stale.
- Where do the declarations that the table reads live?: A module-level constant named REGISTRY_COUNTS in each test module holds a tuple of rules. A rule names the test path, the counted kind, and the prefix, enum or table name. (best practice) [sources: tests/roadmap/test_roadmap_limit_classes.py, tests/roadmap_faults.py:20, tests/telemetry/test_telemetry_instruments.py]
- Chosen: Module-level REGISTRY_COUNTS constant. The declaration lives beside the test that enforces it and stays in review.
- Rejected: Marker comments. A comment is easy to break and hard to validate.
- Rejected: Central YAML file. A central file is a second hand-kept copy.
- How does the stage job find the declarations without running the tests?: Parse the test modules with ast and read REGISTRY_COUNTS literals. Do not import the test modules. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_limit_classes.py]
- Chosen: Parse with ast. It reads literals without test imports and without running test code.
- Rejected: Import test modules. It adds pytest and test-only dependencies to the runtime path.
- Rejected: Regular-expression scan. It breaks on multiline literals and on comments.
- How does the stage job know that a plan adds a counted item?: Each rule gives a match token, such as DEFAULT_ROADMAP_, an enum name or a table name. The job scans the plan task text and changed paths for the token. (best practice) [sources: tests/roadmap/test_roadmap_limit_classes.py, tests/roadmap_faults.py:20, docs/TELEMETRY.md:45]
- Chosen: Token scan of task text and changed paths. It is deterministic and uses the plan text that check_proposal already holds.
- Rejected: Run the test suite in the stage job. It is slow and needs the full test environment.
- Rejected: Ask the model to infer additions. It is not deterministic and cannot be a gate.
- What makes a plan satisfy a listed registry entry?: A task must name the declared path in its text. check_proposal refuses the plan when no task names the path. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:232, src/devops_cli/roadmap/stage_change.py]
- Chosen: Task text names the declared path. It is simple to check and shows the task that covers the entry.
- Rejected: Any task in the same group. It lets an unrelated task hide a missing registry entry.
- Where should the path-existence check run?: A pure function checks Python docstrings and openspec spec files. check_proposal calls it, and a unit test calls it directly. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:232, CONTRIBUTING.md:132, docs/TELEMETRY.md:45]
- Chosen: Pure function called by check_proposal and by a unit test. It refuses a bad plan at stage time and has an offline test.
- Rejected: CI-only test. It does not refuse a bad plan at stage time.
- Rejected: Model review. It is not deterministic.
- Should the path check scan all documentation for stale test paths?: No. The body limits the check to docstrings and specs. A stale path in docs/TELEMETRY.md stays for a separate documentation fix. (best practice) [sources: docs/TELEMETRY.md:45, CONTRIBUTING.md:132]
- Chosen: Docstrings and specs only. It matches the acceptance criteria and avoids unrelated documentation edits.
- Rejected: All Markdown under docs/. It expands the scope and changes generated documentation.
- Does this change extend the mirror-folder rule to tests added to an existing module?: No. This change does not extend fix(roadmap): the stage job refuses a pytest verify command #3189. The acceptance criteria cover registry entries and test paths only. Keep fix(roadmap): the stage job refuses a pytest verify command #3189 as a related item. (best practice) [sources: tests/invariants/test_change_folders.py]
- Chosen: Keep fix(roadmap): the stage job refuses a pytest verify command #3189 unchanged. The issue gives the mirror-folder rule as evidence, not as a required result.
- Rejected: Extend the mirror-folder rule. It adds a second rule that the acceptance criteria do not test.
- Where should the new table builder and path scanner live?: Put them in a new module src/devops_cli/roadmap/stage_registry.py. check_proposal calls it from src/devops_cli/roadmap/stage_change.py. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_eval_gates.py]
- Chosen: New stage_registry.py module. It keeps the table builder and path scanner separate from the stage gate code.
- Rejected: Add to stage_change.py. It mixes a large new concern into the gate module.
- Rejected: Add to tests/support. Runtime code cannot import test support.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 2, 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.It prevents a recurring class of missed entries in plans but does not block a release or fix a live defect.It removes a known source of plan defects across constants, job writes, and instruments.It requires deriving a table from test markers, wiring it into check_proposal, and adding three acceptance tests.Both items concern ratchet tests in the suite, but #1336 restructures existing ratchets into bans while the candidate adds a plan-time check that references those ratchets.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at d428c7f (see proposed design in issue body).
devops-cli-service commentedon Nov 2, 2026
Staged: branch
feat/3254-list-the-registry-and-ratchet-entries, draft pull request #3303. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
The plan run made 3 model request(s), and used 232306 input tokens and 16531 output tokens. The model made no tool call.
A model review of the plan found these points. They stop no draft, and a person judges them:
criterion_droppedat group 2 and criterion 2: Criterion 2 needs the contract entry in the context, but no group adds aREGISTRY_COUNTSdeclaration for the contract test. The table cannot list it, so the spec scenario fails. Evidence: "tests/roadmap/test_roadmap_store_contract.py"criterion_droppedat criteria, criterion 1 (group 3): Criterion 1 asks for a refusal of aDEFAULT_ROADMAP_*plan without a ratchet task. Group 3 tests only the context, and the group 4 test covers only a write method. Evidence: "gets the limit-class ratchet in its context and is refused without a task for it."otherat group 6: The plan editsdocs/TELEMETRY.mdby hand but says that the file is generated fromINSTRUMENTS. Regeneration overwrites the edit. The refined design also leaves this stale path for a separate fix. Evidence: "docs/TELEMETRY.mdis generated fromINSTRUMENTSinsrc/devops_cli/telemetry/instruments.py"docs(openspec): plan #3254 list registry and ratchet entries a plan n…
docs(openspec): plan #3254 list registry and ratchet entries a plan n…
[-]feat(roadmap): list the registry and ratchet entries that a new constant or job write needs[/-][+]feat(roadmap): list registry and ratchet entries a plan needs[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 76 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): list the registry and ratchet entries that a new constant or job write needsfeat(roadmap): list registry and ratchet entries a plan needsfeat(roadmap): list registry and ratchet entries a plan needs
devops-cli-service commentedon Nov 7, 2026
Released in v0.82.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.82.0
devops-cli-service commentedon Nov 7, 2026
Live since 2026-11-07 15:48 UTC