Skip to content

feat(roadmap): re-anchor a stale citation that matches one line - #5040

Merged
dan-petty merged 3 commits into
mainfrom
feat/4479-re-anchor-a-stale-citation-that
Nov 12, 2026
Merged

dan-petty merged 3 commits into
mainfrom
feat/4479-re-anchor-a-stale-citation-that

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The citation gate of the stage plan check accepts a path:N:text citation whose text is not on line N when exactly one other line of the staged file holds the text, as a citation of that line. Most such citations are stale and not false: the planner copies a line number from another commit, and the text moved. The gate still refuses a citation whose text is on no line or on more than one other line, applies the minimum of 3 characters first, and does not re-anchor a citation whose line N holds the text.

Each check with a reader of the staged files writes one log line, The citation gate re-anchored <n> of <m> line citations., so the job log shows the rate. The stage prompt and the gate table of the plan recheck guide state the rule.

Closes #4479

Change: openspec/changes/archive/2026-11-12-4479-re-anchor-a-stale-citation-that/

@dan-petty dan-petty added type/feature Type feature: a new function scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main, base 87ae9ee): 8 failed on base, and all 8 pass on the head (213 tests in the 3 changed files: 8 failed and 205 passed on base). The tests that fail on the base:

  • tests/roadmap/stage/test_roadmap_stage_content.py::test_a_stale_citation_whose_text_is_on_one_other_line_is_re_anchored
  • tests/roadmap/stage/test_roadmap_stage_content.py::test_a_stale_citation_that_quotes_part_of_one_other_line_is_re_anchored
  • tests/roadmap/stage/test_roadmap_stage_content.py::test_a_stale_citation_whose_text_is_on_no_line_or_on_two_lines_is_refused[on-no-line]
  • tests/roadmap/stage/test_roadmap_stage_content.py::test_a_stale_citation_whose_text_is_on_no_line_or_on_two_lines_is_refused[on-two-lines]
  • tests/roadmap/stage/test_roadmap_stage_content.py::test_a_citation_of_a_line_that_holds_the_text_is_not_re_anchored
  • tests/roadmap/stage/test_roadmap_stage_content.py::test_a_short_text_on_one_other_line_is_refused_and_not_re_anchored
  • tests/roadmap/stage/test_roadmap_stage_content.py::test_the_gate_writes_one_line_with_the_count_of_the_plan
  • tests/roadmap/stage/test_roadmap_stage_prompt_rules.py::test_the_prompt_states_the_citation_forms_and_prefers_a_symbol

The refusal cases on no line and on two lines fail on the base only for the new log line. Their refusal is the same on both trees.

Golden-set replay (uv run devops roadmap eval stage --replay): the same result on the base and on the change. 58 cases, 5 good. paths 53/53, kind 25/25, criteria 0/0, content 3/3, prompt_keys 1/1. Good plans that every gate accepts: 5 of 5. "Every gate refuses what it must refuse." The replay passes no reader of the staged files, so it judges no citation and cannot show this change.

Replay of the refused records of 2026-11-11 (#3387, #3389, #4028, #4043; 11 replies; each cited file read with git show at the origin/main commit of the refusal time; scratch script, not in the repository):

Base Change
Stale-citation problems 17 1
Stale line citations with the text on exactly one line 29 refused 29 re-anchored
Stale line citations with the text on two lines 1 refused 1 refused

Each re-anchor names the moved line of the same code, for example src/devops_cli/config/constants.py 3276 to 3296 (CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS) and src/devops_cli/roadmap/refine/refine.py 744 to 748. The one problem that stays is src/devops_cli/roadmap/implement/implement_run.py:1502, whose text budget = load_settings().roadmap.implement.repair_rounds is on lines 1321 and 1646. The log lines of the change read, for example, The citation gate re-anchored 7 of 22 line citations.

Scoped local checks (no full devops ci, as the host is loaded):

  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree: all 7 rows pass.
  • uv run mypy on the 4 changed Python files: no issues.
  • uv run devops ci test on test_roadmap_stage_content.py, test_roadmap_stage_citation_quote.py, test_roadmap_stage_gates.py, test_roadmap_stage_prompt_rules.py and test_roadmap_stage_eval_gates.py: 333 passed.

The prompt text changes, so the prompt version changes and the stage job plans each kept plan again once.

This is Service code: it waits for the "safe and vetted" call of the owner before the merge.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 11:34
@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #5040 has merge conflicts with main at commit 0536700050ab. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 12:41
The citation gate of the stage plan check accepts a `path:N:text` citation whose text is not on line N when exactly one other line of the staged file holds the text. It refuses the citation when no line or more than one other line holds the text. The minimum of 3 characters applies first, and a citation whose line N holds the text is not re-anchored. Each check with a reader writes one log line with the count of re-anchored line citations.

Refs #4479
@dan-petty
dan-petty force-pushed the feat/4479-re-anchor-a-stale-citation-that branch from 0536700 to e6795f8 Compare November 12, 2026 12:54
@dan-petty
dan-petty merged commit 16356d8 into main Nov 12, 2026
24 checks passed
@dan-petty

Copy link
Copy Markdown
Owner Author

Rebase onto main at a172563f7 (with #4982). New head: e6795f87c.

What the rebase changed:

  • refactor(openspec): split big capabilities into nested ones #4981 split openspec/specs/roadmap-stage/spec.md into nested capabilities and deleted the flat file. The old archive commit appended to the flat file, so it conflicted. The rebase keeps the deletion of the flat file and drops the old archive commit.
  • The delta of 4479-re-anchor-a-stale-citation-that moved from specs/roadmap-stage/spec.md to specs/roadmap-stage/trace-gate/spec.md. The three MODIFIED requirements ("Refuse a stale line citation", "Refuse a citation of an absent line", "A line citation may hold its text in the code span that follows it") are in trace-gate on main, and their base text did not change. The two ADDED requirements are about line citations, so they also go to trace-gate. proposal.md now names roadmap-stage/trace-gate.
  • A new uv run devops openspec archive 4479-re-anchor-a-stale-citation-that wrote the same added and changed lines as the old archive, now in openspec/specs/roadmap-stage/trace-gate/spec.md (21 requirements). The archive commit is the last commit.
  • The code commit did not change.
  • fix(roadmap): a refused kept plan uses no stage gate return #4983 adds requirements to roadmap-stage/plan-cache and fix(roadmap): count a command as removed only when MUST NOT governs it #4985 to roadmap-stage/spec-delta. Neither pull request changes these trace-gate requirements.

Results:

  • uv run devops ci test tests/roadmap/stage/test_roadmap_stage_citation_quote.py tests/roadmap/stage/test_roadmap_stage_content.py tests/roadmap/stage/test_roadmap_stage_prompt_rules.py: 213 passed.
  • uv run devops openspec check: passed.

CI on e6795f8: 19 passed, 5 skipped, 0 failed.

@dan-petty
dan-petty deleted the feat/4479-re-anchor-a-stale-citation-that branch November 12, 2026 13:12
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.119.0](v0.118.0...v0.119.0)
(2026-11-12)


### Features

* **repos:** the claim sets In Progress
([#5111](#5111))
([06ef1c6](06ef1c6))
* **roadmap:** a fix-plan step repairs a plan PR with open findings
([#5104](#5104))
([ca5b16d](ca5b16d))
* **roadmap:** extend stage review rounds while open findings drop
([#5090](#5090))
([bacf713](bacf713))
* **roadmap:** re-anchor a stale citation that matches one line
([#5040](#5040))
([16356d8](16356d8))


### Bug Fixes

* **ci:** keep failed test IDs in the service image shard summary
([#5106](#5106))
([88589ef](88589ef))
* **github:** count each page of a paginated GitHub read
([#5070](#5070))
([908e24a](908e24a))
* **github:** keep the metrics permissions out of the runner Job token
([#5064](#5064))
([fb549ff](fb549ff))
* **github:** pace mutations through the clock seam
([#5063](#5063))
([2bd87bc](2bd87bc))
* **k8s:** delete the CoreDNS files that k3s never applies
([#5055](#5055))
([463f601](463f601))
* **monitoring:** tidy LLM stack windows, units and lines
([#5052](#5052))
([375d724](375d724))
* **roadmap:** a refused kept plan uses no stage gate return
([#4983](#4983))
([b8adbca](b8adbca))
* **roadmap:** count a command as removed only when MUST NOT governs it
([#4985](#4985))
([2e6f407](2e6f407))
* **roadmap:** cut prose after a cited stage command
([#4982](#4982))
([a172563](a172563))
* **roadmap:** name every module of a group with no named test
([#5089](#5089))
([27a0e79](27a0e79))
* **roadmap:** stage returns every open review finding to the planner
([#5067](#5067))
([21b116e](21b116e))
* **roadmap:** the alternatives check reads the tools in use
([#5062](#5062))
([8903233](8903233))
* **roadmap:** the constants gate reads 6_500 and no new value
([#5080](#5080))
([8a7b113](8a7b113))
* **roadmap:** the constants gate reads only a stated value
([#5042](#5042))
([cf4733e](cf4733e))
* **telemetry:** read repository traffic as the GitHub App
([#4932](#4932))
([7c42823](7c42823))
* **tests:** close the UDP, DNS and git gaps of the network floor
([#5101](#5101))
([047ee48](047ee48))
* **tests:** repair the bwrap contract suite and gate it
([#5110](#5110))
([9a0659d](9a0659d)),
closes [#4715](#4715)


### Performance Improvements

* **ci:** build the Service image once for its test shards
([#5079](#5079))
([dcf5bd5](dcf5bd5))
* **ci:** run only the required checks on the release PR
([#5057](#5057))
([8174071](8174071))
* **ci:** stop the cache export of pull request image builds
([#5113](#5113))
([ba30820](ba30820))
* **roadmap:** consolidate keeps its vectors in the shared tiers
([#5099](#5099))
([2a8bf1a](2a8bf1a))


### Code Refactoring

* **roadmap:** one Status writer for every job
([#5109](#5109))
([24cfedc](24cfedc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(roadmap): re-anchor a stale citation that matches one line

1 participant