Skip to content

fix(roadmap): trace gate judges reads that are no run read #4590

Closed

Description

@dan-petty

Problem Description

The Feasibility trace gate of the stage job (_uncalled_path in src/devops_cli/roadmap/stage/stage_change.py) takes some read words as a claim that the run read a file, but the sentence says what code does or names no file. Since #4495 the gate judges the object of each read claim, not the first path of the sentence. In these forms the object is a path that a run usually did not read, so the gate refuses a sentence that origin/main accepts when the run read the first path:

  1. A read at the end of a relative clause, with the object before the relative pronoun: "... so the branch can start past the commit that the planner read." The gate judges the last path before the read (origin/main).
  2. A code subject before a parenthesis: "collect_context (src/x.py) reads CONTEXT.md". The clause starts after ), so the subject is empty and the read counts as a read of the run.
  3. A subject of code spans only: "src/a.py:107 and src/b.py:436 read _core_v1". The claim blanks the code spans, so the subject is empty.

These forms make no claim of a read by the run in origin/main either, but there the gate judged the first path of the sentence, which the run usually read. The gate of origin/main and of #4495 also refuse "/proc/self/exe cannot be read" (_NEGATION has no cannot).

Reproduction Steps

  1. Make a TraceFacts with every toolbox tool and the path src/devops_cli/sample.py.
  2. Call _sentence_trace_problem with each sentence:
    • "read_file of src/devops_cli/sample.py showed that _create fetches origin/main, so the branch can start past the commit that the planner read."
    • "collect_context (src/devops_cli/sample.py) reads CONTEXT.md and a tree."
    • "src/devops_cli/sample.py:107 and src/b.py:436 read _core_v1."
  3. The gate refuses origin/main, CONTEXT.md and src/b.py.

Expected vs Actual Behavior

Expected: no trace problem. The sentences make no claim that the run read origin/main, CONTEXT.md or src/b.py.

Actual: "The Feasibility section states that origin/main was read, but the run did not read it." The same for CONTEXT.md and src/b.py.

Evidence: a leave-one-out replay of the 15,763 Feasibility sentences of the corpus of #4495 (for each cited path, the trace holds every tool and every other path of the sentence). 20 sentences have a judged path that origin/main does not judge. In 10 of them it is the true object of a read claim of the run, or another path of the same claim. The other 10 come from sentences that claim no read of a file by the run, such as the archived proposals of #2920, #3012, #3188, #3309 and #1315.

Environment Diagnostics

Logs, Traces, or Terminal Output

uv run python loo.py corpus.json loo-fix.json
489 sentences, 494 judged paths

Related: #4314, #4495, #4547.

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.

Alternatives check of 2026-11-13: none.
Tool: none found.

Proposed design

Problem statement

The Feasibility trace gate of the stage job refuses sentences that make no claim that the run read a file. The gate judges the last path before a relative-clause read. It judges the object after a code subject in parentheses. It judges the object after a subject of code spans only. It also treats cannot as no negation. The gate must accept these sentences and still refuse a true run read of a path that the trace lacks.

Acceptance criteria

Requirement: Relative clause read

The trace gate SHALL not judge the last path before a relative-clause read whose object holds no path.

Scenario: Relative clause with a planner read

  • WHEN The sentence is read_file of src/devops_cli/sample.py showed that _create fetches origin/main, so the branch starts past the commit that the planner read. The trace holds src/devops_cli/sample.py.
  • THEN _sentence_trace_problem returns None.

Requirement: Code subject in parentheses

The trace gate SHALL treat a code span before a parenthesis as the subject of the read, so the object is no run read.

Scenario: Code subject with a location

  • WHEN The sentence is collect_context (src/devops_cli/sample.py) reads CONTEXT.md and a tree. The trace holds src/devops_cli/sample.py.
  • THEN _sentence_trace_problem returns None.

Requirement: Code-span subject

The trace gate SHALL treat a subject of code spans only as a code subject, so a read of _core_v1 is no run read.

Scenario: Two code spans read a symbol

  • WHEN The sentence is src/devops_cli/sample.py:107 and src/b.py:436 read _core_v1. The trace holds src/devops_cli/sample.py.
  • THEN _sentence_trace_problem returns None.

Requirement: Cannot negation

The trace gate SHALL treat cannot as a negation word, so a read it negates is no claim.

Scenario: Cannot be read

  • WHEN The sentence is /proc/self/exe cannot be read. The trace holds no /proc/self/exe.
  • THEN _sentence_trace_problem returns None.

Requirement: Space line range

The trace gate SHALL strip a trailing space-separated line range from a path span, so the gate judges the path.

Scenario: Citation with a space line range

  • WHEN The sentence is read_file of src/devops_cli/sample.py 590-610 showed _create. The trace holds src/devops_cli/sample.py.
  • THEN _sentence_trace_problem returns None.

Requirement: True run read refused

The trace gate SHALL refuse a read of a path that the trace does not hold when the subject is the run.

Scenario: Run reads an unread path

  • WHEN The sentence is I read src/b.py. The trace holds no src/b.py.
  • THEN _sentence_trace_problem returns the trace path problem for src/b.py.

Existing Tool Considered

No tool covers this: the alternatives check of 2026-11-13 found no open, maintained tool or library that judges the object of a read claim in these sentence forms. The fix stays in the repository's own _uncalled_path, _subject, _object_span, _is_code_reading and _NEGATION logic. Cost: about 30k tokens and 2 hours to write, keep and fix that logic.

Key questions

  • Why does the gate judge origin/main in the sentence with the relative clause?: _object_span finds no path in the commit. It uses the last path before the read, origin/main. _is_run_read treats the planner as a run reader, so the gate judges origin/main. [sources: src/devops_cli/roadmap/stage/stage_change.py]
  • Why does the gate judge CONTEXT.md when a code span and a parenthesis precede the read?: _claim_words blanks the code span collect_context. _subject starts the clause after the closing ), so the subject is empty. _is_run_read treats an empty subject as the run's read, so the gate judges CONTEXT.md. [sources: src/devops_cli/roadmap/stage/stage_change.py]
  • Why does the gate judge _core_v1 when the subject is code spans only?: _claim_words blanks the code spans, so the subject is empty. _is_code_reading recognizes reads or reading with a code span before it. It does not recognize read after a plural list of code spans. The empty subject makes the read the run's. [sources: src/devops_cli/roadmap/stage/stage_change.py]
  • Should cannot count as a negation word?: Yes. Add cannot to _NEGATION, because it negates the read. The sentence makes no claim that the run read the path. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:1903]
    • Chosen: Add cannot to _NEGATION. It is a negation word and the issue's reproduction shows the gate refuses cannot be read.
    • Rejected: Keep _NEGATION unchanged. It leaves the false refusal in place.
  • Should this change make the job write the Feasibility read list instead of fixing the gate?: No. Fix the gate's parser now. The job-write change changes the stage prompt and the Feasibility generation. It is a separate design. The issue asks for the gate to accept the three sentences. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: Fix the gate's parser. It is the smallest change that meets the issue's expected behavior and keeps the current stage prompt.
    • Rejected: Job writes the read list. It is a larger design change that belongs to a separate item; the issue asks for the gate fix.
  • Should the gate strip a trailing line range from a path span, as in path 590-610?: Yes. _citation strips line numbers only after a tool name. A space-separated line range stays in the claimed path. Strip a trailing <start>-<end> from a span that is a path, so the gate judges the path. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]
    • Chosen: Strip the line range in _citation. It fixes the false refusal of a citation form that the reply's evidence names.
    • Rejected: Change the read_file answer to path:start-end. It changes the tool output and the stage prompt, and the gate can accept the form directly.
  • Should this change alter the trace finding text to name the accepted read forms?: No. The gate fix removes the false refusals. The finding text is a separate usability change. It does not change the gate's judgment. (best practice) [sources: src/devops_cli/lang/en/messages.py]
    • Chosen: Keep the finding text. The issue's expected behavior is no trace problem, and the message text does not cause the refusal.
    • Rejected: Name the accepted forms in the message. It is a separate change to messages.py and the stage prompt, and the gate fix already accepts the forms.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. A regression that blocks valid plans in three specific sentence forms, affecting 20 of 15,763 corpus sentences.
    • Value: Medium. Unblocks valid plans that are incorrectly refused in three specific sentence patterns.
    • Effort: Medium. Requires fixing object detection in three distinct sentence forms within the gate logic.
    • Related: fix(roadmap): trace gate refuses probe and search-hit reads #4495, which asks for a different change. Both fix the trace gate read-claim judgment, but #4495 fixed probe and search-hit reads while this candidate fixes false positives that #4495 introduced in three sentence forms.
  3. added
    priority/p2-medium
    on Nov 11, 2026
  4. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The issue asks for a bug fix inside the project's own trace gate (_uncalled_path / _NEGATION in src/devops_cli/roadmap/stage/stage_change.py), not for a tool or library. Searches for sentence-parsing, subject/object and claim-extraction tooling returned only generic glossary pages, so nothing found covers the need of making the gate judge the true object of a read claim in these three sentence forms.

    Tool: none found

    Lacks:

    • No tool found that judges the object of a read claim in the gate's own trace sentences
    • No tool found that fixes the empty-subject cases (code subject before a parenthesis, code-span-only subject)
    • No tool found that adds cannot to the gate's negation words
    • The fix belongs in the repository's own _uncalled_path logic, not in an external dependency

    Searches run:

    • detect negation and read claims in prose text Python tool, results: 5
    • Python library parse sentence to find subject and object of clause dependency parser, results: 5
    • spaCy dependency parsing extract subject verb object nsubj dobj, results: 5
    • open source tool extract claims from text subject predicate object triples, results: 5

    Checked on 2026-11-13. A person decides what this means for the item. The check changes no label and closes no issue.

  5. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    New evidence of 2026-11-13 (review of failing jobs).

    • Loki, 3 days to 2026-11-13: 30 stage_problem_trace_path findings in 9 stage gate returns lines (releases 0.123.1 to 0.129.x).
    • 6 of 13 visible claimed spans are citation forms of a read that probably happened: path 590-610, path:250-330, read_file("p", 60, 80). _citation removes the line numbers only after a tool name (src/devops_cli/roadmap/stage/stage_change.py, near lines 2033-2039).
    • The finding text names no accepted form (messages.py, near lines 4848-4850).
    • Cost of one such failure: item feat(ci): Add ast-grep rules for RLIMIT_NPROC, O_NONBLOCK, os.killpg #1976 used about 3.8 M model input and output in one run, and item refactor(ai): rank the benchmark with numpy and pytrec-eval #1928 used about 17.4 M and failed as plan_defect. The planner sends 25 to 41 tool calls in each reply.

    Two scope points:

    1. The job writes the read list. The job writes the read list of the Feasibility section from the run trace, so the model makes no read claim. This follows the owner rule of 2026-10-03: tools originate evidence, and the model correlates.
    2. Until then, one citation form. Each read_file answer starts with path:start-end, which the model can copy. The finding text names the forms that the gate accepts.

    #5433 logs each refused claim. Its data confirms the share of citation-form refusals before a build.

    Measure: stage_problem_trace_path findings per 100 stage runs go down, plan_defect results go down, and model input and output per staged item go down.

  6. added
    status/ready
    and removed
    status/new
    on Nov 14, 2026
  7. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at b15faab (see proposed design in issue body).

  8. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 18, 2026
  9. removed
    status/in-review
    on Nov 18, 2026
  10. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-18 17:44 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions