Wave 7 interlude: prober tool-call chrome + live rename cluster labels
Graph tool-call visibility — the prober's list_sessions /
list_propositions rendered like nothing happened in the transcript
(the registry default is silence for unregistered tools). They now join
the EXACT read/ls/find/grep discipline: artifactRenderers maps both to
the ToolCallCard — collapsed one-liner, expandable Input/Output card.
The results ride the card's string path verbatim (the tools' own
compact name/level/date line format), exactly how read results render.
- list_propositions gets a headline arg: the session id is the call's
subject — the collapsed line reads "list_propositions chat_…".
Shown as given, never resolved (the same no-resolution rule as
read's path). list_sessions carries no arg (empty input — the
ls-with-no-path discipline).
- No bespoke row-layout card: the outputs are pre-formatted strings
(the model-facing format IS the learner-facing format here), and
the dispatch's "SAME look" directive settles the shape question.
Live rename labels — renaming a session anywhere (sidebar inline row,
chat header) already announces lh:chat-renamed {id, title}; the graph
view now listens. The birth-session partition means the title IS the
cluster label, so the patch is targeted and in-place, no refetch: the
snapshot's sessions map (the detail card's provenance line) and the
one matching cluster. The new snapshot object flows the existing
setData → geoVersion → rebuild chain, so the wrapped label (wave 7's
wrapRegionLabel) re-wraps for the new text. Unlabeled clusters keep
their hull-only silence — a null label is a GONE record, the guard
holds the line.
Tests: registry pins for both tools + the prober-card render (collapsed
headline, verbatim rows, no-arg discipline). 855/855; live-verified on
:3001 with fillText instrumentation: both cards render collapsed and
expandable in the transcript, and a sidebar rename flipped the canvas
cluster label old→new with the old label's draws stopping cold.
This commit is contained in:
@@ -855,6 +855,42 @@ describe("tool + renderer registry wiring", () => {
|
||||
for (const t of ["read", "ls", "find", "grep"]) {
|
||||
assert.equal(artifactRenderers[t], ToolCallCard, `${t} renders the tool-call card`);
|
||||
}
|
||||
// wave 7 — the prober's graph tools join the SAME discipline (they
|
||||
// rendered like nothing happened before this interlude)
|
||||
for (const t of ["list_sessions", "list_propositions"]) {
|
||||
assert.equal(artifactRenderers[t], ToolCallCard, `${t} renders the tool-call card`);
|
||||
}
|
||||
});
|
||||
|
||||
it("the tool-call card: the prober's graph tools — collapsed headline + their compact row output", () => {
|
||||
// list_propositions: the session id is the call's subject
|
||||
const propPart = {
|
||||
type: "tool-list_propositions",
|
||||
state: "output-available",
|
||||
toolCallId: "g1",
|
||||
input: { session: "chat_mtiudjao_776beada" },
|
||||
output: "2 proposition(s) born in this session:\n- Kepler's laws — solid (as of 2026-09-20)\n- Tidal locking — shaky (as of 2026-09-21)",
|
||||
};
|
||||
const html = renderToStaticMarkup(<ToolCallCard part={propPart as never} />);
|
||||
assert.match(html, /list_propositions/);
|
||||
assert.match(html, /chat_mtiudjao_776beada/); // the collapsed headline
|
||||
assert.match(html, /Kepler's laws/); // the row output, verbatim (apostrophe HTML-escaped)
|
||||
assert.ok(html.includes("<details"), "collapsed by default");
|
||||
|
||||
// list_sessions: no headline arg (empty input) — the tool name alone,
|
||||
// exactly the ls-with-no-path discipline
|
||||
const sessPart = {
|
||||
type: "tool-list_sessions",
|
||||
state: "output-available",
|
||||
toolCallId: "g2",
|
||||
input: {},
|
||||
output: "3 session(s) in the knowledge graph, most recent first:\n1. Orbital mechanics (chat, 8 propositions, born 2026-09-18)",
|
||||
};
|
||||
const html2 = renderToStaticMarkup(<ToolCallCard part={sessPart as never} />);
|
||||
assert.match(html2, /list_sessions/);
|
||||
assert.match(html2, /Orbital mechanics/);
|
||||
const headline = html2.split("<summary")[1]?.split("</summary>")[0] ?? "";
|
||||
assert.doesNotMatch(headline, /Orbital/, "the collapsed line shows the tool name only — no noise");
|
||||
});
|
||||
|
||||
it("the tool-call card: collapsed one-liner with the tool name + headline arg; expand shows input and output", () => {
|
||||
|
||||
Reference in New Issue
Block a user