Skip to content

fix(roadmap): the trace gate reads the subject of a read - #4544

Merged
dan-petty merged 3 commits into
mainfrom
fix/4495-trace-gate-run-subject
Nov 11, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/4495-trace-gate-run-subject

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

The Feasibility trace gate took each read as a claim that the run read the first path of the sentence. It refused sentences with no such claim, such as "This plan reads x.py in group 2" or "a read-only root".

  • A read is a claim of the run only when it is read_file (or read_file path), a passive or participle, a noun read, a read with no subject, or a read whose subject, or that of its verb list, names the run or its author.
  • The gate judges the path that the read takes. A path after a result verb (shows) or a pronoun object is not its object.
  • Trace facts and the kept plan hold the path:line of each search match line. A read whose object cites that line counts as seen; read_file, a pronoun read and a whole-file claim do not. A probe line gives no read. This replaces the issue criteria on search hit and probe paths, which accept invented reads.

Closes #4495

Change: openspec/changes/archive/2026-11-11-4495-trace-gate-refuses-probe-and-search/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 11, 2026
@dan-petty

dan-petty commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner Author

Measurements

Stored refusals (the premise)

The roadmap-service pod held 21 <n>.refused.json records on 2026-11-11 (read with kubectl exec ... cat, no change to the pod). Their last replies hold 14 trace-path refusals of 9 items. The replay script gives the trace every tool and every other path of the reply, so only the refused path is not read.

Gate Refused of 14
origin/main 9087b39 (with #4463) 8
This change 1

The 8 that origin/main still refuses:

3 of the 4 subject cases also cite a search_code match line (runner.py:470, test_roadmap_implement_amend.py:5:..., test_roadmap_stage_plan.py:553:...). The 5 probe refusals (#3423, #4442) already pass on origin/main because of #4463.

Search match and probe decision

Corpus

15,763 Feasibility sentences (13,818 from archived change proposals, 1,255 from refused records, 370 from eval cases, 320 from kept plans), judged with a trace that holds every tool and no path:

Gate Sentences refused
origin/main 781
This change 489

No sentence is newly refused. 17 refusals name another path: the object of the read in place of the first path of the sentence.

The 9 kept plan files with facts in the pod pass the gate of the change with their own facts (0 trace problems).

Eval replay (uv run devops roadmap eval stage --replay)

Base and change give the same report:

paths    #3010     52      52       0
kind     #3005     25      25       0
content  #3200      3       3       0
prompt_keys #3328      1       1       0
Defects that a gate judges: 81 of 318 (25%).
Good plans that every gate accepts: 5 of 5.
Result: every gate refuses what it must refuse.

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main)

24 failed on base and 1 errored (test_roadmap_stage_trace_spans.py does not collect on the base, because TraceFacts has no lines), 68 passed, in tests/ai/client/test_roadmap_agent_run.py, tests/roadmap/stage/test_roadmap_stage_plan_record_facts.py, tests/roadmap/stage/test_roadmap_stage_trace_spans.py and tests/roadmap/stage/test_roadmap_stage_trace_subject.py. On the change: 2423 passed, 1 skipped in tests/roadmap/stage and the related trace tests.

Known limit

A read whose object is a pronoun ("read_file of the same file") reads the last path before it in the sentence. When the file is only in an earlier sentence, the gate finds no object and makes no path claim.

Live steps

None. The kept plan file gets the field facts.lines. A file without it loads with no lines, so an old file needs no change. A rollback to an older image cannot read a plan file that holds lines (the model forbids extra fields): the job stops that item and names the file, and a person removes the file so that the next run plans the item again.

@dan-petty
dan-petty force-pushed the fix/4495-trace-gate-run-subject branch from 7f607dc to f391fd9 Compare November 11, 2026 08:14
@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 09:22
@dan-petty
dan-petty force-pushed the fix/4495-trace-gate-run-subject branch from f391fd9 to 82c3a44 Compare November 11, 2026 10:13
@dan-petty

Copy link
Copy Markdown
Owner Author

Review finding: the read object and the quoted result

Finding Severity Verdict Action
_object_span takes a path in the quoted result of a read with a pronoun object ("read_file on it showed ... instruments.py") as the object. The gate judges the wrong path in both directions, and "No sentence is newly refused" was measured only with a trace that holds no path. major Confirmed Fixed in db12d07. The measurement line is corrected below and in the proposal.

Verification

I ran _sentence_trace_problem with every toolbox tool on origin/main 5f75d25 and on 0ce7f11 (the change before this fix):

Sentence Trace path origin/main 0ce7f11 Fix
#3252 plan sentence docs/TELEMETRY.md pass refuses instruments.py pass
#3252 plan sentence src/devops_cli/telemetry/instruments.py refuses docs/TELEMETRY.md pass refuses docs/TELEMETRY.md
"src/x.py, read with read_file, shows the rule that src/y.py calls." src/x.py pass refuses src/y.py pass
same src/y.py refuses src/x.py pass refuses src/x.py

Fix

The object of a read word now ends at a verb of its result (shows, showed, gave, returned, found, lists, says and their forms). The gate judges the subject of a passive, else the first path of the object, else the last path before the read, else the first path of the result. So "read_file on it showed the text x.py" judges the path before the read, and "the same read shows x.py:3" still judges x.py. I did not use a list of pronoun objects: the participle sentence has no pronoun, and the result verb ends the object in both forms.

tests/roadmap/stage/test_roadmap_stage_trace_subject.py::test_a_path_in_the_result_of_a_read_is_not_its_object holds the #3252 sentence and the participle sentence, each with a trace of only one of its paths. The spec requirement, a new scenario, the design, the proposal and docs/roadmap/stage.md state the rule.

Fail-to-pass

uv run devops ci fail-to-pass --base 0ce7f113: 4 failed on the base (the 4 new cases), 39 passed, 0 errored. On origin/main the 4 new cases pass, because that gate judges the first path of the sentence, which is the correct path in both sentences. uv run devops ci fail-to-pass --base origin/main still gives 24 failed on the base, 72 passed, 1 errored, as before.

uv run devops ci test tests/roadmap/stage tests/ai/client/test_roadmap_agent_run.py: 2331 passed, 1 skipped.

Corpus replay (corrects "No sentence is newly refused")

The same 15,763 Feasibility sentences.

With a trace that holds every tool and no path, origin/main refuses 781, 0ce7f11 489 and the fix 489. No sentence is newly refused with that trace, but that trace cannot show a new refusal from a change of the judged path. With that trace, 17 refusals of 0ce7f11 name another path than origin/main. The fix returns 2 of them to the path of origin/main (#3252 and the SearXNG document of #3927), and 15 stay.

Replay of the 15 with a trace that holds the path that origin/main judged. The fix refuses all 15 again, so the old line was wrong. By hand:

Leave-one-out replay. For each sentence and each path that it cites, the trace holds every tool and every other path of the sentence, so only that path is unread. origin/main judges 780 paths in 780 sentences, 0ce7f11 494 in 489, the fix 494 in 489. Fix against 0ce7f11: 3 sentences change, all to the object of the read (#3252, #3927, #3573). 20 sentences have a path that the fix judges and origin/main does not:

So the change newly refuses some sentences that claim no read by the run when the run read the first path of the sentence. These forms come from archived proposals. None comes from a stored refusal or a kept plan of the stage job. I filed #4590 for the forms (a relative clause read, a code subject before a parenthesis, a subject of code spans only).

Other replays

paths    #3010     52      52       0
kind     #3005     25      25       0
content  #3200      3       3       0
prompt_keys #3328      1       1       0
Defects that a gate judges: 81 of 318 (25%).
Good plans that every gate accepts: 5 of 5.
Result: every gate refuses what it must refuse.

Known limits

Live steps

None.

@dan-petty

Copy link
Copy Markdown
Owner Author

Review fixes (review review:trace-gate-2-3). Head: bebf0d57, rebased on origin/main 5f75d25.

1. Major: _object_span takes a path in the result of a read as its object. CONFIRMED earlier, still FIXED.
Commit 1ef0ab7c (was db12d074) ends the object of a read at a verb of its result (_RESULT_VERB: shows, showed, gave and more), and a read with no path in its object takes the last path before it. The table in tests/roadmap/stage/test_roadmap_stage_trace_subject.py holds the #3252 sentence: with only docs/TELEMETRY.md in the trace it passes, and with only src/devops_cli/telemetry/instruments.py it refuses docs/TELEMETRY.md. The 4 trace test files pass (153 tests).

2. Minor: nested backticks in the trace gate paragraph of docs/roadmap/stage.md. CONFIRMED.
markdown-it-py rendered the no-subject example as three code spans: Read, then a plain x, then a span that holds the rest of the rule up to the passive example. The same defect was in the proposal and in 4 scenario lines of the spec delta (This plan reads ..., I read ..., The run read ... two times), and so in openspec/specs/roadmap-stage/spec.md.
Change: each span is now a double-backtick span with a space inside (`` Read `x` ``). The docs fix is in the code commit; the proposal and spec fixes are in the archive commit. A render of all changed Markdown lines shows no split span. openspec validate --specs --strict: 235 passed.
Other spans of this form were on main before this pull request (docs/roadmap/stage.md:110, openspec/specs/roadmap-stage/spec.md:3975, 3979, 4214). No check finds them. I filed #4605 for a check (markdownlint rule MD038).

3. Minor: the pull request closes #4495 but narrows two acceptance criteria. CONFIRMED.
TraceFacts.of in agent_run.py adds call.matches to lines only. The issue asks that it holds the path of a search hit and each path of a probe line.
I did not deliver the two criteria, because they let invented reads pass. Check on the branch with _sentence_trace_problem: the trace holds the match line src/devops_cli/commands/roadmap.py:813 and the #3423 probe path src/devops_cli/roadmap/stage_change.py, and the run read neither file. The change refuses the #3205 claim "read_file on src/devops_cli/commands/roadmap.py showed the command bodies" and "I read src/devops_cli/roadmap/stage_change.py". With the two criteria, the gate accepts both.
Change: a new Feasibility bullet in the proposal records this evidence, a comment on #4495 records it, and the pull request body now says that the two rules replace the two criteria. The false refusals that the criteria were to stop do not occur without them, so I filed no follow-up issue.

Replay (uv run devops roadmap eval stage --replay), base 5f75d25 and change: the same report. 81 of 318 defects caught by a gate, 0 missed, 5 of 5 good plans accepted, exit 0.

No code changed in this round, so no new fail-to-pass run is necessary.

CI: Service Image Tests (shard 4 of 6) stopped printing at 11:04:44Z and ran to its 30-minute timeout. That shard holds tests/roadmap/test_roadmap_decision_step.py, and the hang matches #4513, so I added the evidence there and ran the job again. The previous head passed this shard in about 6 minutes.

@dan-petty
dan-petty marked this pull request as draft November 11, 2026 12:54
@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 12:56
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 12:56
@dan-petty
dan-petty force-pushed the fix/4495-trace-gate-run-subject branch 2 times, most recently from c6d57f4 to fb985a8 Compare November 11, 2026 13:37
The trace gate takes a read word as a claim of the run only when it is
read_file, a passive, a read with no subject, or a read whose subject
names the run or its author. A read whose subject is the plan, a group,
the probe or code is no claim, and read-only is no read word. The gate
judges the path that the read takes, not the first path of the
sentence. A citation of a line that a search_code or callers match
showed counts as seen; a claim of the whole file does not.
The object of a read word ends at a verb of its result, such as `shows`.
A read with no path in its object takes the last path before it, so
"`read_file` on it showed the text `x.py`" judges the earlier path and
not the quoted path. Refs #4495.
@dan-petty
dan-petty force-pushed the fix/4495-trace-gate-run-subject branch from fb985a8 to 9c6d038 Compare November 11, 2026 13:59
@dan-petty
dan-petty merged commit 4330ee4 into main Nov 11, 2026
34 of 35 checks passed
@dan-petty
dan-petty deleted the fix/4495-trace-gate-run-subject branch November 11, 2026 14:09
@dan-petty

Copy link
Copy Markdown
Owner Author

Fix round 2: findings of the verifier

Head before this round: bebf0d57. Head after this round: 9c6d0380, rebased on origin/main f67c8820. The code, test and doc changes are in the commit fix(roadmap): a path in the result of a read is not its object. The spec, design and proposal changes are in the archive commit.

Finding 1 (major), _subject drops read claims of the run: CONFIRMED

I ran _sentence_trace_problem with every toolbox tool and no path on the 8 sentences of the finding. origin/main 5f75d256 refuses each. bebf0d57 returns None for each.

Change in src/devops_cli/roadmap/stage/stage_change.py:

  • A comma, and or or with no word between it and the read word makes the read a verb of a list. The subject is in the words back to the start of the list (_LIST_START: ;, :, a parenthesis, or a word such as because, that or which). A comma and a preposition such as after do not start a list. So "I listed the folder, opened the test and read x" is a claim, and "The replay lists a, checks b and reads c" is still no claim (new table case).
  • read or reads before of or a verb of the result is a noun read with no subject ("A quick read of", "Both reads of", "the same read of" after and).
  • read after a comma or a code span and before a preposition is a participle, a passive of the path before it ("x, read at the base, shows", "x read from GitHub"). A verb of a list after a passive is a passive ("x was copied and read").
  • The tool name of a span read_file path is a read word, and the read takes the path of that span. Before, the gate blanked the span, so it judged such a sentence only when another read word was in it.

The 8 sentences, plus one form for each extra rule, are refused table cases in tests/roadmap/stage/test_roadmap_stage_trace_subject.py. Each is refused with the path that origin/main refuses.

Replay of the 13,381 Feasibility sentences of the archived proposals (every tool, no path, scripts in .data/agent/scratch/):

Gate Refused
origin/main 5f75d256 469
round 1 bebf0d57 221
this round 272
  • 17 refusals are new against origin/main. Each is a span read_file path whose path the empty trace does not hold. Each is a true read claim of the run.
  • 17 refusals name another path of the same sentence (the object of the read, not the first path).
  • 214 refusals of origin/main are dropped. I read each of them:
    • 19 have only read-only (or read-configuration) as a read word.
    • 188 have a subject that is not the run ("All commands ran on origin/main", "the probe line reads", "the helper reads"), a read of code, or a read claim of the run with no path in its object.
    • 7 are read claims of the run. 3 have no repository path as the object (a key, a source archive, "the repository"). 4 have a label or a heading as the subject: "Code read: x.py" (3) and "Renovate. Read the config" (1), where the sentence split does not end the heading. All 7 come from archived proposals that agents wrote, not from the stage job. I did not add rules for them, because a label rule would also take "The probe line reads: ..." as a claim.

Finding 2 (major), a match line supports a claim of the whole file through a pronoun: CONFIRMED

With the match line src/devops_cli/commands/roadmap.py:813 and no path, bebf0d57 accepted the 3 pronoun forms of the finding. Change: _object_span now also returns whether the read names the span itself. _was_seen(..., by_line=...) lets a match line support only a read that names that line. read_file, a read that takes the line through a pronoun or from the last path before it, and a read that takes the first path of its result judge the path against trace.paths only. New test test_a_match_line_supports_no_read_of_the_whole_file: the 3 forms of the finding, the direct form, and read_file of a match line citation are refused. The direct citation cases of test_a_search_match_supports_a_citation_of_its_line_only still pass.

Finding 3 (minor), a pronoun object with a result verb that is not in _RESULT_VERB: CONFIRMED

bebf0d57 refused src/b.py for "docs/a.md is a file, and read_file on it revealed the text "see src/b.py"" with docs/a.md in the trace. Change: _PRONOUN_OBJECT (it, them, or that, this, these, those, the same before a noun, after one preposition). When the object starts with a pronoun and a path is before the read, the read takes that path. Table cases pronoun-read and pronoun-not-read use revealed.

Earlier findings

Checks

I set the pull request to draft before the push, because it was ready for review, and I changed the body to state the new rules in 976 characters up to the Change: line (the limit is 1,000).

A person merged the pull request at 14:09 UTC with the head 9c6d0380. The squash commit 4330ee43 holds all changes of this round, so no finding needs a new issue.

No live cluster, ConfigMap or Secret step is necessary.

dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.112.1](v0.112.0...v0.112.1)
(2026-11-11)


### Bug Fixes

* **roadmap:** the trace gate reads the subject of a read
([#4544](#4544))
([4330ee4](4330ee4))

---
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/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): trace gate refuses probe and search-hit reads

1 participant