Skip to content

fix(#601,#602): row nouns without mode names; trajectory shapes and shows what turns did - #642

Closed
justrach wants to merge 2 commits into
mainfrom
fix/601-row-nouns-and-trajectory
Closed

fix(#601,#602): row nouns without mode names; trajectory shapes and shows what turns did#642
justrach wants to merge 2 commits into
mainfrom
fix/601-row-nouns-and-trajectory

Conversation

@justrach

Copy link
Copy Markdown
Owner

What changed

  • Line REPL tool rows: remaining rendering after ADR 0019 #601interpretJson no longer surfaces the CodeDB mode name verbatim. A content-bearing read now interprets as 161 lines instead of lines · 161 lines (tautology) or full · 72 lines; modes that are themselves the fact (outline, symbol) stay.
  • Harness observability: /trajectory cannot show what the model did #602 (2 of 5 slices)
    • finalResponseShape broke its backward walk on a trailing bare function_call_output, so every tool-using turn whose history ends on tool results (turn cut after execution, crash, attempt_completion's final call) archived resp_blocks=0 — indistinguishable from an empty turn. Those items are now skipped; the shape describes the last model-authored run.
    • /trajectory printed only turn N ✓ 95s · prompt <sha> · <task>. The row now appends what the node already carried: model calls, tool count, tool errors, cache-hit percent, and response shape (text+reasoning), when present.
    • commands_session.zig crossed the 600-line ceiling with the above; the /trajectory handler moved verbatim into commands_trajectory.zig.

Why

The recorder bug made the DGM archive lie about tool-using turns: #270 added resp_* precisely to separate 'text-only refusal' from 'empty turn', but the Responses+tools path defeated it, so a history ending on tool results was never covered by a test. And /trajectory is the human inspect path — it ignored fields already on the turn node, leaving a run unreadable compared with a grok-build session folder.

Out of scope (kept open on #602)

Live turn stubs in the DGM file, periodic session-transcript flush, and first_token/call_id on operational traces. Behavior lifecycle (turn_committed/run_finished) already landed earlier. Click-to-expand for line-REPL rows (#601's progressive disclosure) stays out per ADR 0019 — /debug remains the raw path.

Verification

  • New tests: mode-noun cases in agent_tool_label.zig; cut-after-execution shaping case in mainloop_trace.zig. Updated the one render test that asserted the old section · N lines string.
  • zig build test green; scripts/eval-tier1.sh green locally (twice) and via the pre-push hook.

justrach and others added 2 commits August 26, 2026 15:03
interpretJson surfaced the mode verbatim, so a codedb read rendered
'lines · 161 lines' — a tautology — and 'full · 72 lines', where the
mode name is not a decision. A read that carried content now says
'{n} lines'; modes that ARE the fact ('outline', 'symbol') stay.
The file is already the row's detail column.

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
…turns did

Two slices of the inspect-path issue; behavior lifecycle
(turn_committed/run_finished) already landed separately.

- finalResponseShape walked backward and broke on trailing
  function_call_output, so every tool-using turn whose tail is tool
  results archived resp_blocks=0 — an empty turn and a cut-after-
  execution turn were indistinguishable. Skip those bare items; the
  shape still describes the last model-authored run.
- /trajectory printed 'turn N ✓ 95s · prompt <sha> · <task>' while the
  node already carries model_calls, the tools bag, tool_errors, token
  counters, and resp_types. The row now appends calls/tools/errors,
  cache-hit percent, and response shape when present.
- commands_session.zig was over the 600-line ceiling after the above;
  the /trajectory handler moved to commands_trajectory.zig.

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
@justrach

Copy link
Copy Markdown
Owner Author

Closing as landed on tip. Row nouns without mode names (161 lines not lines · 161 lines) and finalResponseShape skipping a trailing bare function_call_output are already in agent_tool_label.zig / mainloop_trace.zig. Dirty vs main; no unique leftover.

@justrach justrach closed this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant