feat(coach): expose structured snapshot sections + tool-trace provenance

The Coach snapshot builder returns the structured, post-degrade record it
serialises to JSON alongside the JSON string, so a single domain block can be
read out without re-parsing. Add an optional tool-call trace to the provenance
envelope (which retrieval tools ran + whether each found data) and mirror it in
the OpenAPI provenance schema.

Groundwork for on-demand retrieval: the retrieval tools slice one section out
of this record, reusing the builder's gates and I/O verbatim.
This commit is contained in:
Marc-André Bombeck committed 2026-06-22 07:37:15 +02:00
1 parent b07fbcb6fa
commit ec77862286
3 files changed
+37

No files matched your search

+11
View File
@@ -277,6 +277,17 @@ const coachProvenanceSchema = z
.describe(
"Load-bearing numbers the assistant surfaced, rendered in the collapsible evidence block. Hard-capped at 8 entries.",
),
toolCalls: z
.array(
z.object({
name: z.string(),
present: z.boolean(),
}),
)
.optional()
.describe(
"v1.20.0 — the retrieval-tool trace for this turn: which tools the Coach called and whether each found data. Metadata only (no values). Absent on the legacy snapshot path and on turns that called no tools.",
),
})
.meta({
id: "CoachProvenance",