Skip to content

fix(roadmap): explain --trace shows the argument digest #4444

Closed

Description

@dan-petty

Problem Description

devops roadmap explain <issue> --trace does not show the digest of the argument of a tool call. The tool event in implement.trace holds the digest (argument_digest, 12 hexadecimal characters of the SHA-256 of the masked argument), but _event_line in src/devops_cli/roadmap/explain.py does not print it. So a reader cannot see that the model made the same call two or more times.

Issue #4393 asked for this. Its acceptance criterion "Render tool and check details" says: "The roadmap explain command SHALL render retained tool events with name, outcome and digest". Pull request #4436 closed #4393 and added the exit status of a shell call to the line, but not the digest.

Reproduction Steps

  1. Make a trace with two calls of the same argument: ImplementTrace(step="group 1"), then trace.tool_call("shell", "git", "abc123abc123", "ok", status=0) two times.
  2. Record it as implement.trace of an item and run render_trace(read_trace(store, number), number=number), the code of devops roadmap explain <issue> --trace.
  3. Each line is group 1: tool shell (program git), ok (exit status 0). No line holds abc123abc123.

Expected vs Actual Behavior

Expected: the line of a tool event shows the digest when the event holds one, for example group 1: tool shell (program git) [argument abc123abc123], ok (exit status 0). A tool event with no digest shows no argument part.

Actual: the line shows the tool, the program, the outcome, the exit status and the reason, and no digest.

Proposed fix

Add explain_trace_tool_digest: str = " [argument {digest}]" to RoadmapMessages, put {digest} after {program} in explain_trace_tool, and fill it in _event_line. Add an ADDED requirement to openspec/specs/roadmap-explain/spec.md ("The trace option prints the argument and the exit status of a tool call", with the scenarios "The same call twice" and "A tool call with no digest"). The current requirement "The trace option prints the trace of the last run" is near the 500-character limit of openspec validate --strict, so a new requirement is necessary. Update the sentence about the trace in docs/roadmap/implement.md. A tested version of this change (about 20 lines of code and tests) was written during the work on #4393 and passed tests/roadmap/test_roadmap_explain.py.

Existing tool considered

No tool applies: the change is one field in a line of text that the project owns.

Environment Diagnostics

Found on 2026-11-11 while the work on #4393 checked the merged fix against its acceptance criteria.

Logs, Traces, or Terminal Output

Red run of the two changed tests on the base: test_the_trace_of_an_item_gives_one_line_for_each_event_in_order and test_a_shell_call_with_an_exit_status_shows_it_in_the_line fail with 'group 1: tool shell (program git), ok (exit status 128)' != 'group 1: tool shell (program git) [argument abc123abc123], ok (exit status 128)'.

Proposed design

Problem statement

The devops roadmap explain <issue> --trace command omits the argument digest from the line of a tool event. A reader cannot see that the model made the same tool call two or more times. The change prints the digest when the event holds one and leaves the argument part out when it does not.

Acceptance criteria

Requirement: Tool line shows argument digest

The devops roadmap explain <issue> --trace command SHALL show the argument digest in the line of a tool event when the event holds one.

Scenario: The same call twice

  • WHEN a trace holds two tool events for the same shell call with argument digest abc123abc123
  • THEN each rendered line contains [argument abc123abc123].

Requirement: Tool line omits an absent digest

The command SHALL omit the argument part from the line of a tool event that holds no argument digest.

Scenario: A tool call with no digest

  • WHEN a trace holds a tool event with no argument_digest field
  • THEN the rendered line has no [argument text.

Requirement: Roadmap-explain spec records the digest

The roadmap-explain specification SHALL state that the trace option prints the argument digest of a tool call.

Scenario: Spec delta adds the requirement

  • WHEN the change adds its spec delta to openspec/specs/roadmap-explain/spec.md
  • THEN the file holds an ADDED requirement with a scenario for a repeated call and a scenario for a call with no digest.

Requirement: Implement documentation names the digest

The implement documentation SHALL say that --trace shows the argument digest of a tool call.

Scenario: Trace sentence in the implement page

  • WHEN the change updates docs/roadmap/implement.md
  • THEN the trace sentence names the argument digest.

Existing Tool Considered

No check has run. No open, maintained tool or library covers this need: the change is one field in a line of text that the project owns. The written cost is about 20 lines of code and tests, about 2,000 tokens to build, keep and fix, and less than one hour of elapsed time.

Key questions

  • Which trace field holds the argument digest?: A tool event holds the digest in the argument_digest field. [sources: src/devops_cli/roadmap/implement/implement_trace.py, src/devops_cli/roadmap/implement/implement_tool_log.py:444]
  • Where should the digest template live?: Put the digest template in RoadmapMessages and format it in _event_line. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/explain.py:364]
    • Chosen: RoadmapMessages template. The project keeps user-facing text in the message catalog.
    • Rejected: Inline text in explain.py. It breaks the message catalog convention.
  • How should the line treat a tool event with no digest?: Omit the argument part, so the line keeps the current format. (best practice) [sources: src/devops_cli/roadmap/explain.py:364]
    • Chosen: Omit the part. The event holds no digest, so the line has no argument text.
    • Rejected: Print empty brackets. It adds noise and suggests a missing value.
  • Should the change modify the current trace requirement or add a new one?: Add an ADDED requirement to openspec/specs/roadmap-explain/spec.md. (best practice) [sources: openspec/specs/roadmap-explain/spec.md]
    • Chosen: Add a new requirement. The current trace requirement is near the 500-character limit of openspec validate --strict.
    • Rejected: Modify the current trace requirement. The added text can exceed the limit.

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/low
    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 known gap in a previously agreed acceptance criterion, but no data loss or security impact.
    • Value: Medium. Users cannot detect repeated tool calls without the digest, which hampers debugging of agent runs.
    • Effort: Low. The candidate states a tested version of about 20 lines of code and tests already exists.
    • Related: fix(roadmap): keep tool events in the trace of a long run #4393, which asks for a different change. Both concern rendering tool events in roadmap explain --trace; #4393 delivered event retention and exit status, the candidate adds the missing argument digest to the line.
  3. added
    priority/p2-medium
    on Nov 11, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

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

  6. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    The review of the merged pull request #4436 found this gap again and rated it blocking, because #4436 closed #4393 with this criterion not delivered. I checked it on main at commit 6cf78e73:

    • ImplementTrace.tool_call in src/devops_cli/roadmap/implement/implement_trace.py keeps the digest in the field digest, not argument_digest. Use fields.get("digest") in _event_line.
    • _event_line in src/devops_cli/roadmap/explain.py (the TraceEventKind.TOOL case) reads tool, program, outcome, status and reason, and does not read digest.
    • explain_trace_tool in src/devops_cli/lang/en/messages.py is "{step}: tool {tool}{program}, {outcome}{status}{reason}", with no digest part.

    The tested change from the work on #4393 reads fields.get("digest") and adds explain_trace_tool_digest: str = " [argument {digest}]". It needs a rebase onto main and its own pull request that closes this issue.

    The same review found a second problem in #4436: the explain totals of a long run are 0 tokens and 0 seconds. It is filed as #4457.

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 11, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 11, 2026
  9. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor
  10. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-11 14:13 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/lowpriority/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