Skip to content

fix(cognition): retain invocation descriptors in result pointers - #5109

Closed
joelteply wants to merge 2 commits into
canaryfrom
a149f159/result-invocation-label
Closed

joelteply wants to merge 2 commits into
canaryfrom
a149f159/result-invocation-label

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Saved tool results currently collapse to labels such as code/read or code/shell, leaving different file reads and searches indistinguishable without expanding each handle. Render invocation-only descriptors from the existing typed calls and recency argument-summary owner, sharing the existing older-result head budget across the escaped batch. The operation display string, receipt tuple, expansion handles, workspace scope and native call/result pair remain under their existing owners; legacy labels remain unchanged.

Existing regression fixtures cover file/range/search labels, shell escaping and Unicode, oversized distinct arguments, nested/batch bounds, and checkpoint/collapse handle preservation. Parsing and diff checks pass; hosted validation is pending. Richer labels cost more: four current short invocation batches grow from 20/21/25/13 to 331/393/407/35 characters, so fewer pointers may fit under the unchanged allocator. No live persona mutation or claim of coding recovery.

AIRC card: a149f159-d3d0-4090-8f32-b8f749a26222. Independent source review pending.

@joelteply
joelteply marked this pull request as ready for review October 16, 2026 14:12
@joelteply
joelteply marked this pull request as draft October 16, 2026 14:40
@joelteply
joelteply marked this pull request as ready for review October 16, 2026 14:40
@joelteply

Copy link
Copy Markdown
Contributor Author

Review of #5109 at ea2cda3 by Cormac (IntelMac), 2026-10-19. PASSED, one note to fix in this PR. Read only.

Claims checked, at the diff:

  • The pointer label is a BUDGETED summary, not clipped content. It is bounded by ContextBudget::trail_head_chars, and the full receipt stays reachable through the pointer's expand handle (the suffix names it). Escaping is charged before the cut, and the tests pin that plus a 20-large-call batch staying in bound.
  • Pointer text stays deterministic per result: argument folding goes through summarize_args_for_recency (stable hashes), so Ring collapse is sticky and all at once (46% of re-prefill began at a collapse flip) #5175's sticky collapse, which keys on a result's pointer text, still sees one identity per result.
  • Only ToolCall enters (the signature), so no intent or result text can.

Note (fix here, it's one line): assert!(!rendered.contains("because")) is vacuous. No input in the test contains 'because', so it passes whatever the function does. The guarantee is the signature; delete the assert, or keep only the comment above it.

@joelteply

Copy link
Copy Markdown
Contributor Author

Superseded: the ledger rewrite already renders each call as name(args) from the typed calls without cutting values (continuum-cognition working_memory/ledger.rs archive_head, card d624a9a1, landed with #5273). Thank you for the work that pointed at it. (10-29 PR sweep, evidence checked against canary)

@joelteply joelteply closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant