Repository navigation
Description
Problem Description
Refine records the "files" of a person wait in refine.wait_refs. It takes them from the wait text with text_paths (src/devops_cli/roadmap/refine/refine.py:2260-2268). text_paths keeps each match of _CITED_PATH_RE (refine.py:781-783):
r"(?:[\s\(\[`]|^)([a-zA-Z0-9_\-\./]+\.[a-zA-Z0-9_]+)(?::(\d+)(?:-(\d+))?)?(?:[\s\)\]`:]|$)"The pattern matches every token with a dot in it. A decimal (0.202), a version (v1.37.2), a dotted setting (ai.portkey_url), a Python name (DevOpsCLIError.__init__) or a domain (deps.dev) is a "path". text_paths does not check that the path exists. It then keeps only the first CONST_ROADMAP_REFINE_MAX_WAIT_CHECKS = 5 paths (src/devops_cli/config/constants.py:3440). So false paths take the slots of the cap, and a real file that the text names after them is not watched. A change of that file does not end the wait.
The pattern also misses a real path that a period or a comma follows, because the character after the path must be a space, a bracket, a backtick, a colon or the end of the text. In the text "Read src/devops_cli/commands/ai.py." the path is not found.
Each false path also costs one GitHub commits read in each round that checks the wait: _named_cause_ended (refine.py:2339-2348) calls changed_since, and path_changed_at (src/devops_cli/roadmap/stores/github_store.py:1094-1102) reads the commits of the path.
The cause: _CITED_PATH_RE came on 2026-10-04 (e70df90) to put cited files in the model context. There, _read_git_file (refine.py:787-792) drops a path that the commit does not hold. #3555 (ce689f4, 2026-11-04) used the same pattern for the wait watch, with no such check. stage_rejected.py:172 uses text_paths for the reason of a rejected plan, so the stage hold has the same defect.
Real records (job records in the issue bodies, read 2026-11-19 from 1,175 issues updated since 2026-11-01):
- feat(ai): give every agent brain tools through MCP, CLI and skill #4671:
refine.wait_refs=#4880,#3904,#4921,#4884,#4479,AGENTS.md,src/devops_cli/commands/ai.py,CONTEXT.md,0.202,0.453. The values0.202and0.453are nDCG@10 scores from a scope comment on feat(ai): give every agent brain tools through MCP, CLI and skill #4671 (2026-11-12T08:19Z). They fill 2 of the 5 path slots. - 104 records hold at least one path. 117 of their 217 distinct path entries are not files of the tree at
origin/main. - 21 records hold 56 number entries (decimals and versions). 26 records hold 43 dotted names.
- 19 records are at the cap of 5 paths and hold false paths in it.
- In 19 records, no path entry is a real file. Examples: fix(security): bump promtool and drop the ignore #6365 (
v3.16.0,1.27.3,1.26.11,1.27.4,v0.62.0), fix(security): bump kubectl and drop the MCP server Trivy ignores #6084, feat(k8s): run a three-node SeaweedFS object store #4750 (4.53,4.52,4.48,4.51,1.0.44), fix(security): bump opentofu and drop the ignore #5866, feat(k8s): let Argo Workflows run roadmap pods in devops #4566, feat(k8s): run a pinned Playwright browser server in namespace devops #5356.
The spec says that the record holds "the issues, then the paths, that the wait text names" (openspec/specs/roadmap-refine/waits/spec.md:91). docs/roadmap/refine.md:31 says "A round reads at most 5 issues and 5 files of one wait."
Reproduction Steps
-
On
origin/main(0d90de5), run:uv run python -c " from devops_cli.roadmap.refine.refine import text_paths t = ('Edit AGENTS.md and src/devops_cli/commands/ai.py first. The current path has nDCG@10 0.202 today. ' 'Hybrid has 0.453 (+0.252). Bump v1.37.2 first, then read docs/roadmap/refine.md ' 'and src/devops_cli/roadmap/refine/refine.py today.') print(text_paths(t))"
-
See
['AGENTS.md', 'src/devops_cli/commands/ai.py', '0.202', '0.453', 'v1.37.2']. The two real files at the end are not in the list. -
Read the job record of feat(ai): give every agent brain tools through MCP, CLI and skill #4671:
refine.wait_refsends in0.202,0.453.
Expected vs Actual Behavior
Expected: refine.wait_refs holds only paths of files (or directories) of the repository tree. A number, a version, a setting key, a Python name or a domain takes no slot of the cap. The 5 slots go to the first 5 real paths that the wait text names.
Actual: every dotted token is a path. False paths fill the cap, real cited files drop out, and each false path costs one GitHub read in each round that checks the wait.
Environment Diagnostics
- DevOps CLI Version: 0.180.0 (
origin/main0d90de5) - Python Version: 3.14.10
- Execution Environment: the refine job of the roadmap Service in the cluster; the replay ran in the devcontainer.
Logs, Traces, or Terminal Output
# Job record of #4671
"refine.wait_refs": "#4880,#3904,#4921,#4884,#4479,AGENTS.md,src/devops_cli/commands/ai.py,CONTEXT.md,0.202,0.453"
# Job record of #6365
"refine.wait_refs": "...,v3.16.0,1.27.3,1.26.11,1.27.4,v0.62.0"
# Job record of #4750
"refine.wait_refs": "...,4.53,4.52,4.48,4.51,1.0.44"Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate. Searches: "wait_refs", "text_paths", "refine wait refs path", "cited path regex", "watched files refine", "decimal path", "refine path" (title), "refine wait" (title), "cited" (title). fix(roadmap): refine looks again when the cause of a wait ends #3483 and fix(roadmap): refine looks again when a wait ends #3555 (closed) built the watch. fix(roadmap): finish the refine wait and frame fixes of #6353 #6378 (open) finishes the wait and frame fixes of fix(roadmap): refine posts a short event only when its result changes #6353, but it does not name the path pattern. No open issue covers this case.
Acceptance Criteria
- A test: a wait text that names
0.202,v1.37.2,ai.portkey_urlanddeps.devbefore 2 real files gives arefine.wait_refswith the 2 real files and none of the 4 tokens. - A test: a wait text that names 6 real files keeps the first 5, as today.
- A test: a real path that a period or a comma follows ("Read src/devops_cli/commands/ai.py.") is in
refine.wait_refs. - A test: the stage hold of a rejected plan (
stage_rejected.py:172) keeps no number or setting key as a path. - A test: a false path makes no commits read (
path_changed_at). - Live proof: after the merge and the release, the next round that reads the comments of feat(ai): give every agent brain tools through MCP, CLI and skill #4671 records no
0.202or0.453. A comment gives the new record value.
Dependencies
- None. fix(roadmap): finish the refine wait and frame fixes of #6353 #6378 (open) also changes the refine wait code. Rebase before the second of the two merges.
Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches found no library that pulls repository paths out of prose or filters dotted tokens; only path validators and Git clients exist, and the fix is a small regex boundary plus a git tree check the project already runs.
Lacks:
- No token extraction from wait text
- No sentence punctuation boundary handling
- No repository tree membership filter
- No five-path cap or duplicate removal
Proposed design
Problem statement
Refine must keep only real repository paths in refine.wait_refs. False dotted tokens fill the 5-path cap and cost GitHub commits reads. Real files then drop out. The stage hold of a rejected plan has the same defect. The fix filters candidates by the default branch tree and finds a path before a period or a comma.
Acceptance criteria
Requirement: False dotted tokens take no path slot
The wait path extractor SHALL keep only candidates that the repository tree check accepts as a file or a directory.
Scenario: Dotted values before two real files
- WHEN A unit test gives a wait text with
0.202,v1.37.2,ai.portkey_urlanddeps.devbefore two real files. The tree lookup accepts only the two real files. - THEN The extractor returns
['AGENTS.md', 'src/devops_cli/commands/ai.py']and none of the four dotted values.
Requirement: Cap keeps the first five real paths
The wait path extractor SHALL apply the 5-path cap after it drops the candidates that the tree check rejects.
Scenario: Six real files
- WHEN A unit test gives a wait text with 6 real repository files in order. The tree lookup accepts all 6 files.
- THEN The extractor returns the first 5 files and drops the sixth.
Requirement: Path before a period or a comma
The cited-path pattern SHALL accept a period or a comma after a repository path.
Scenario: Sentence punctuation after a path
- WHEN A unit test gives
Read src/devops_cli/commands/ai.py.andSee AGENTS.md,. The tree lookup accepts both paths. - THEN The extractor returns
src/devops_cli/commands/ai.pyandAGENTS.md.
Requirement: Stage hold drops dotted values
The stage hold of a rejected plan MUST use the same repository-tree filter as the refine wait.
Scenario: Rejected plan with a decimal and a version
- WHEN A unit test gives a rejected-plan reason with
0.202andv1.37.2beforeAGENTS.md. The tree lookup accepts onlyAGENTS.md. - THEN The stage hold records
AGENTS.mdonly and holds no decimal or version.
Requirement: No commits read for a false path
The wait check MUST read no commits for a token that the repository-tree filter rejects.
Scenario: False token in a wait text
- WHEN A unit test runs the wait check with
0.202andsrc/devops_cli/commands/ai.py. The tree lookup accepts only the real file. The fake store records path reads. - THEN The fake store records one
path_changed_atcall forsrc/devops_cli/commands/ai.pyand no call for0.202.
Requirement: Directory path is watched
The wait path extractor SHALL accept a repository directory as a watched path.
Scenario: Directory in the tree
- WHEN A unit test gives
foo.barand the tree lookup reports that repository directory. - THEN The extractor returns
foo.bar.
Existing Tool Considered
The alternatives check in the issue body records verdict none and no tool. No open maintained library covers the need. The plan adds a small filter around Git. The written cost is about 15 lines, under 2,000 tokens, and about 1 hour to build, keep and fix.
Key questions
- How does the fix tell a real repository path from a dotted token?: It checks each candidate against the repository tree before the candidate takes a slot. A regex allowlist cannot tell a decimal, a version, a setting, a Python name or a domain from a file. The project already drops a cited path that the commit does not hold. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:781, src/devops_cli/roadmap/refine/refine.py:787, src/devops_cli/roadmap/refine/refine.py:2260]
- Rejected: Regex allowlist of known file types. The false tokens use the same characters as real paths, so a fixed set does not cover them.
- Chosen: Repository tree check. Only tree membership tells a real path, and the project already checks cited paths against a commit.
- Rejected: New path-parser library. No library knows this repository's tree, and Git already covers the membership check.
- Which tree does the check read?: It reads the default branch tree that the wait watch reads, not the working tree. It accepts a file or a directory that the pattern finds. (best practice) [sources: src/devops_cli/roadmap/stores/github_store.py:1094, src/devops_cli/roadmap/refine/refine.py:787, docs/roadmap/refine.md:31]
- Rejected: Working tree with
Path.exists(). A local file can pass and a default branch file can fail. - Chosen: Default branch tree with a Git tree check. It matches the commits that the wait watch reads and accepts a directory.
- Rejected: GitHub contents API. It adds a request for each token.
- Rejected: Working tree with
- Where does the 5-path cap apply?: It applies after the tree check drops false candidates. The first 5 real paths take the slots. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2260, src/devops_cli/config/constants.py:3443, docs/roadmap/refine.md:31, openspec/specs/roadmap-refine/waits/spec.md:91]
- Rejected: Apply the cap before the tree check. False tokens fill the cap and real files drop out.
- Chosen: Apply the cap after the tree check. It matches the expected behavior and the documented 5-file limit.
- Rejected: Remove the cap. The docs and the spec set 5, and each path costs a GitHub read.
- How does the pattern handle a period or a comma after a real path?: Add
.and,to the trailing boundary of_CITED_PATH_REatsrc/devops_cli/roadmap/refine/refine.py:781. The path group stays unchanged, soai.py.andAGENTS.md,match. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:781]- Chosen: Add
.and,to the trailing boundary. The regex accepts the sentence punctuation and keeps the path group unchanged. - Rejected: Strip punctuation after a match. The regex still rejects the text before the strip.
- Rejected: Match all dotted tokens and split. It adds ambiguity for real file names.
- Chosen: Add
- Does the stage hold use the same filter?: Yes.
stage_rejected.py:172calls the same wait path extractor with the same tree check. A rejected plan keeps no decimal or setting key as a path. (best practice) [sources: src/devops_cli/roadmap/stage/stage_rejected.py:172, src/devops_cli/roadmap/refine/refine.py:2260]- Chosen: Shared wait path filter. It removes the same defect and one test covers both callers.
- Rejected: Stage-only filter. It duplicates the code and the two filters can drift.
- How does the fix stop a false path from causing a commits read?: The tree check drops the false token before the caller writes
refine.wait_refs._named_cause_endedthen never passes it topath_changed_at. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2339, src/devops_cli/roadmap/stores/github_store.py:1094]- Rejected: Filter inside
path_changed_at. The token already took a cap slot and the record is wrong. - Chosen: Filter before the record. The false token never reaches the store.
- Rejected: Cache negative reads. The first GitHub read still costs and the cap stays full.
- Rejected: Filter inside
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
Each false path costs a GitHub API read per round and real file changes fail to end waits, causing increased spend and incorrect behavior.The regression commit ce689f4 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.Both deal with path existence validation in the roadmap, but #3010 fixes the stage job plan rejection while this candidate fixes the refine wait watch path extraction.devops-cli-service commentedon Nov 19, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (7)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 20, 2026
Plan state: branch
fix/6444-refine-watches-numbers-and-names-as, draft pull request #6546. The pull request plans the item and closes no issue. The stage job and the step fix-plan edit this comment, and a comment of each run tells what the run did.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
A model review of the plan found these points. They stop no draft, and a person judges them:
otherat tasks (2): The new tree filter drops the reason's only path from the stage hold, because the stage test clone does not tracksrc/devops_cli/roadmap/runner_tools.py, yet the existing case asserts that path. The plan names no update of that case, so the group's own verify fails. Evidence: "paths=("src/devops_cli/roadmap/runner_tools.py",),"otherat tasks (1): Group 1 gives the tree only fromplan_refine, but the publicselect_candidatescalls_select_roundwith no checkout, andrefine_left_outbuilds_Selection(store)fordevops roadmap explain. The plan says nothing about the filter there, so that path either raises for the missing tree or keeps false paths and ends a wait the round keeps, which the module forbids (fix(roadmap): refine looks again when the cause of a wait ends #3483). Evidence: "selected, waiting, _ = _select_round(store, item_number=item_number, limit=limit, actor=actor)"false_premiseat tasks (1): Group 1 tells the implementer to give the tree to_Select, a class the module does not hold; the selection class is_Selection. Evidence: "class _Selection:"otherat tasks (3): The group's documentation line says to updatetests/roadmap/test_roadmap_limit_classes.py, but the group changes only a hand-written document and lists no test inchanges; that registry holds limit constants and no edit ofdocs/roadmap/refine.mdtouches it. Evidence: "Updatetests/roadmap/test_roadmap_limit_classes.py"otherat tasks (2): The plan moves the reason's cited path toCONTEXT.md, but it leavestest_a_commit_that_changed_a_file_the_reason_names_ends_the_holdseeding a commit onsrc/devops_cli/roadmap/runner_tools.py. The record then holds onlyCONTEXT.md, so the hold never ends and the freed selection in that case is empty, which fails the group's own verify. Evidence: "make the constantEVIDENCEciteCONTEXT.md, and update the expectedpathsoftest_a_rejected_plan_returns_the_item_to_new_and_records_the_rejectionto("CONTEXT.md",)"otherat tasks (1): The plan tells theselect_candidatescases to take the tree of their clone, but the bound case intest_roadmap_refine_person_wait.pynames twelvesrc/gone_*.pypaths that thegit_repoclone does not track. The filter drops all twelve, so the expected fivepath_changed_atreads become none and the group's verify fails. Evidence: "Give theselect_candidatescases oftests/roadmap/refine/test_roadmap_refine_person_wait.pyand oftests/roadmap/refine/test_roadmap_refine_selection.pythe tree of their clone"spec_delta_wrongat spec roadmap-refine/waits (A wait keeps only the paths that the tree holds): The delta adds a requirement about whatrefine.wait_refsholds but does not modify the existing requirementA read of the comments of a waiting item is recorded, which still says the record holds the paths that the wait text names. The spec then states two different contents for the same record. Evidence: "openspec/specs/roadmap-refine/waits/spec.md:91:(the issues, then the paths, that the wait text names)"otherat tasks (3): Group 3's documentation tells the builder to updatetests/roadmap/test_roadmap_limit_classes.py, but the group's changes list onlydocs/roadmap/refine.mdand the plan adds no limit constant, so the registry of limits needs no update and the group would touch an undeclared test file. Evidence: "Updatetests/roadmap/test_roadmap_limit_classes.py"missing_pathat tasks (1): Group 1 makesexplain_itemread the tree, but the plan does not changesrc/devops_cli/roadmap/request_plan.py, whoseexplain_requestslists every read thatdevops roadmap explain --dry-runprints, so the dry-run list misses the new git read. Evidence: "read the tracked paths once withtree_filesof the clone'sHEADinexplain_itemand give the set to_refine_verdictand torefine_left_out"spec_delta_wrongat spec roadmap-refine/waits (A wait records only the paths that the tree holds): The delta adds a second rule forrefine.wait_refsand leaves the base requirement that the record holds the paths the wait text names unmodified, so the capability keeps a requirement that the new tree filter breaks. Evidence: "andrefine.wait_refs(the issues, then the paths, that the wait text names)"19 remaining items
fix(roadmap): Keep only the paths that the tree holds in a wait and i…
wip: 2 of 2 tasks of group 2, Filter the paths of a rejected plan's h…
docs(openspec): revise the plan of #6444 for the review findings
test(roadmap): fail on old wait records, runs of paths and the explai…
fix(roadmap): read old wait records again and keep each path of a run
fix(roadmap): explain reads the tree of the default branch
docs(roadmap): state the tree filter of wait paths and rejected plans
fix(roadmap): an empty wait record stays current (#6444)
devops-cli-service commentedon Nov 20, 2026
Released in v0.185.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.185.1
devops-cli-service commentedon Nov 20, 2026
Live since 2026-11-20 22:40 UTC