Repository navigation
Description
Split from #5465.
Problem: The code change can be tested offline. The issue also asks for a one-off measurement on the 54 sample item bodies and a live proof on real Service stage runs for 7 days. Those checks are not offline tests of the changed code. Why deferred: The live proof waits on a release and 7 days of real stage runs. The sample measurement needs the 54 item bodies of the sample. Acceptance criteria: - Rebuild collect_context for the 54 item bodies of the sample, before and after the change. Report the kept cited files with the baseline of 131 of 323. - On real Service stage runs for 7 days after release, no context holds a superseded ADR. - On those runs, the docs/adr reads for each item stay near the baseline of 5 of 54 items.
Proposed design
Problem statement
Add two offline tests for a cited ADR in the plan context. The context lists the ADRs in force as an index and holds no ADR text unless the item cites the path. The module tests/roadmap/refine/test_roadmap_refine_context.py already tests the index and the trace gate for a body with no ADR citation. It has no test for a cited ADR: a superseded ADR must stay out, and an ADR in force must bring its text. The 54-body measurement and the 7-day live proof need data and a release outside the repository, so they go to separate issues.
Acceptance criteria
Requirement: A cited superseded ADR stays out
The plan context builder SHALL hold no text of a cited ADR whose front matter states status: superseded.
Scenario: Item body cites a superseded ADR
- WHEN The test calls
collect_contextfor an item body that citesdocs/adr/0092-old.md, whose front matter statesstatus: superseded, in thestage_repofixture. - THEN The context holds no text of
docs/adr/0092-old.md, and the new test passes underuv run pytest tests/roadmap/refine/test_roadmap_refine_context.py.
Requirement: A cited ADR in force brings its text
The plan context builder SHALL hold the text of a cited ADR whose front matter states status: accepted.
Scenario: Item body cites an accepted ADR
- WHEN The test calls
collect_contextfor an item body that citesdocs/adr/0094-replacement.md, whose front matter statesstatus: accepted, in thestage_repofixture. - THEN The context holds the heading
### Code: docs/adr/0094-replacement.mdand the text of that file, and the new test passes underuv run pytest tests/roadmap/refine/test_roadmap_refine_context.py.
Existing Tool Considered
No alternatives check has run. pytest (MIT, actively maintained) covers the need: the two new cases run in the existing module tests/roadmap/refine/test_roadmap_refine_context.py through uv run pytest and uv run devops ci test. pytest lacks any way to read the 54 item bodies of the sample, which are not in the repository, and any way to observe live Service stage runs. Those two checks are deferred. The change builds no product code and no helper library, so it has no build cost.
Key questions
- Which offline cases does the test module add for the ADR index?: Two cases in the existing module: an item body that cites a superseded ADR gives no text of it, and an item body that cites an ADR in force gives its text. The module already covers the index for a body with no citation and the trace gate, so those cases stay out. (best practice) [sources: tests/roadmap/refine/test_roadmap_refine_context.py, src/devops_cli/roadmap/refine/refine.py:1088]
- Chosen: Extend the existing module with the two cited-ADR cases. The module holds the ADR index tests of fix(roadmap): the plan context lists the ADRs in force, not ADR 0001-0005 #5465, and the two cited-ADR cases are the only ones missing.
- Rejected: Add the three criteria of the earlier draft. Two of them repeat
test_collect_context_lists_only_in_force_adr_indexandtest_stage_trace_gate_refuses_adr_only_in_index, which are already in the module. - Rejected: Check the behavior on live Service stage runs. It needs a release and 7 days of runs, so it is deferred.
- Which ADR file does the test cite?: A synthetic ADR in the
stage_repofixture,docs/adr/0092-old.mdwithstatus: superseded, as the existing index test does. The fixture repository holds no real ADR file, and a real ADR can change its status. (best practice) [sources: tests/support/roadmap_stage.py:167, tests/roadmap/refine/test_roadmap_refine_context.py, docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md]- Chosen: A synthetic ADR in the
stage_repofixture. The fixture repository starts with nodocs/adrfile, so the test writes the status that it needs. - Rejected: The real ADR 0002. The fixture repository does not hold it, and its status can change under the test.
- Chosen: A synthetic ADR in the
- Is the offline test of the ADR index already in the repository?: Yes. The module holds
test_collect_context_lists_only_in_force_adr_index,test_collect_context_omits_adr_index_when_none_in_forceandtest_stage_trace_gate_refuses_adr_only_in_index, each marked(#5465). No test cites an ADR path, so the two cited-ADR cases are open. [sources: tests/roadmap/refine/test_roadmap_refine_context.py] - Does this issue depend on fix(roadmap): the plan context lists the ADRs in force, not ADR 0001-0005 #5465?: No. The tests of fix(roadmap): the plan context lists the ADRs in force, not ADR 0001-0005 #5465 are in the default branch at the refined commit. A dependency would also deadlock, because fix(roadmap): the plan context lists the ADRs in force, not ADR 0001-0005 #5465 stays open until its split issues finish. [sources: tests/roadmap/refine/test_roadmap_refine_context.py]
- Does this issue change product code?: It adds tests only. The docstring of the existing test says that the builder leaves out superseded text, so the cited case proves that behavior. If the new test fails, the implement job returns the item with the failure as evidence and writes no compensating code. (best practice) [sources: tests/roadmap/refine/test_roadmap_refine_context.py, AGENTS.md]
- Chosen: Add tests only. The builder behavior comes from fix(roadmap): the plan context lists the ADRs in force, not ADR 0001-0005 #5465 and is on the default branch.
- Rejected: Change
collect_contextin this issue. It repeats the change of fix(roadmap): the plan context lists the ADRs in force, not ADR 0001-0005 #5465 and makes atestitem ship a product change.
- Can the 54-body measurement and the 7-day live proof be built in this repository?: No. The tests build their repositories from local fixtures. A sample of 54 item bodies is not in the repository, and a test has no network and no token. The live proof needs a release and 7 days of Service stage runs. Both go to separate issues. [sources: tests/support/roadmap_stage.py:167, tests/roadmap/refine/test_roadmap_refine_context.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 24, 2026
Both work on the ADR context in plan stages; #5465 delivers the fix, the candidate delivers the offline and live verification of that fix.devops-cli-service commentedon Nov 24, 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 25, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.