agentfootprint-lens 0.66.2 → 0.67.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,7 +78,7 @@ changes.
78
78
  |---|---|
79
79
  | `agentfootprint-lens/why` | Replay a recording as the agent's own milestones. `<WhyLens recording={...} />` takes the recording straight (`recordRun()`'s `{ snapshot, events, structure }`, or the `persistRecording` envelope), validates it at mount, and mounts the shipped `<Lens>` shell on the milestone axis — plus the axis helpers (`scrubAxisFor`, `stepForCommitIdx`, `stepForRuntimeStageId`, `resolveNavigation`) for hosts holding one cursor across views. |
80
80
  | `agentfootprint-lens/skillgraph` | Debug how a run routed through its skills. `<SkillGraphDebugger recorder={...} />` plus its headless selectors (`selectSkillRoute`, `selectSkillBeats`, `selectSkillTopology`, `selectSkillFrameContext`, `stepForRuntimeStageId`, `resolveNavigation`). |
81
- | `agentfootprint-lens/context` | What the model HAD at a stop — the served document of that epoch on top (the Served tab itself: pieces, messages, tools, verdicts, delta since the previous call) — and what it was BUILT from beneath: the record key by key, who wrote each, what moved; a long value opens in place (0.54.0). `<ContextView runner={...} />` walks the milestone axis on its own; hand it `cursor` and it follows the ONE cursor (0.53.1). Under the record, the **Findings** band (0.61.0): on an armed run (`.findings()`, agentfootprint 9.101) the model's own ledger at the stop, folded for reading — facts, conflicts as first seen (each witness with its current standing, no verdict), open, ruled out, noise, undeclared — every string off the record, absent on an unarmed run. Beside it, the **Reasoning** lens (0.62.0): `<ReasoningLens runner={...} shared={shared} />` — the same ledger read BY CALL, one card per tool call at the cursor (basis before, result, current standing after, the model's words quoted) and an answer card; absent on an unarmed run. Its `exchange` view (0.63.0) lays the same beats out as the transcript between model and tools — the call with its `_findings` JSON, the result, the ticket served instead, the findings piece, the answer — only what crossed the wire. Beside both, the **Ontology** view (0.64.0): `<OntologyView runner={...} shared={shared} />` — the map an agent declared (`.ontology(...)`, agentfootprint 9.106.0) drawn from the run constant on the record: sources, the terms they hold and via which tool, the terms no source holds under `known, not held here`, relations in the author's words — a chart and the same data as a list; absent on an agent that declared no map. Under the Reasoning lens's cards, the **Coverage** band (0.65.0): what the tools DECLARED they checked, did not check and can never cover (`coverage(...)` / `absent(...)`, agentfootprint 9.109) — the merged boundary the library used to append to the answer, each item with the tool that declared it, and every declaration by call; drawn alone when the record has declarations and no ledger; `<CoverageBand runner={...} shared={shared} />` standalone; absent when no tool declared. Beside them all, the **Proof map** (0.66.0): `<ProofMap runner={...} shared={shared} />` — what the answer rests on as ONE graph off the record (agentfootprint 9.110.0): the answer, the calls with their declared standings (undeclared dashed), the tools, the sources the declared map joins them to; `stands on`, `calls` and `reads` edges, and the `contingent` overlay (a value the model used from a result it had itself set aside) and the `conflict` overlay — a chart and the same data as a list; absent on an unarmed run. |
81
+ | `agentfootprint-lens/context` | What the model HAD at a stop — the served document of that epoch on top (the Served tab itself: pieces, messages, tools, verdicts, delta since the previous call) — and what it was BUILT from beneath: the record key by key, who wrote each, what moved; a long value opens in place (0.54.0). `<ContextView runner={...} />` walks the milestone axis on its own; hand it `cursor` and it follows the ONE cursor (0.53.1). Under the record, the **Findings** band (0.61.0): on an armed run (`.findings()`, agentfootprint 9.101) the model's own ledger at the stop, folded for reading — facts, conflicts as first seen (each witness with its current standing, no verdict), open, ruled out, noise, undeclared — every string off the record, absent on an unarmed run. Beside it, the **Reasoning** lens (0.62.0): `<ReasoningLens runner={...} shared={shared} />` — the same ledger read BY CALL, one card per tool call at the cursor (basis before, result, current standing after, the model's words quoted) and an answer card; absent on an unarmed run. Its `exchange` view (0.63.0) lays the same beats out as the transcript between model and tools — the call with its `_findings` JSON, the result, the ticket served instead, the findings piece, the answer — only what crossed the wire. Beside both, the **Ontology** view (0.64.0): `<OntologyView runner={...} shared={shared} />` — the map an agent declared (`.ontology(...)`, agentfootprint 9.106.0) drawn from the run constant on the record: sources, the terms they hold and via which tool, the terms no source holds under `known, not held here`, relations in the author's words — a chart and the same data as a list; absent on an agent that declared no map. Under the Reasoning lens's cards, the **Coverage** band (0.65.0): what the tools DECLARED they checked, did not check and can never cover (`coverage(...)` / `absent(...)`, agentfootprint 9.109) — the merged boundary the library used to append to the answer, each item with the tool that declared it, and every declaration by call; drawn alone when the record has declarations and no ledger; `<CoverageBand runner={...} shared={shared} />` standalone; absent when no tool declared. Beside them all, the **Proof map** (0.66.0): `<ProofMap runner={...} shared={shared} />` — what the answer rests on as ONE graph off the record (agentfootprint 9.110.0): the answer, the calls with their declared standings (undeclared dashed), the tools, the sources the declared map joins them to; `stands on`, `calls` and `reads` edges, and the `contingent` overlay (a value the model used from a result it had itself set aside) and the `conflict` overlay — a chart and the same data as a list; absent on an unarmed run. And for the Story Lens, `storyMarks(trace, record)` (0.67.0): a pure fold that joins the AgentThinkingUI player's beats (by the `toolCallId` agentfootprint 9.111.0 stamps on ask and return) to the ledger at a stop and returns the chips for the player's `marks` prop — the basis and the model's proposition before a call, the current standing after it (`undeclared` when none), the answer's counts — nothing on an unarmed run; the player stays generic. |
82
82
 
83
83
  The axis model in three sentences: one run leaves one causal trace, and each
84
84
  lens replays one AXIS of it — the Why reading scrubs the milestones, the Flow
@@ -2754,6 +2754,131 @@ var chip4 = {
2754
2754
  whiteSpace: "nowrap"
2755
2755
  };
2756
2756
 
2757
+ // src/react/components/storyMarks.ts
2758
+ var LABELS7 = Object.freeze({
2759
+ /** The basis word `direct`, printed as the record spells it. */
2760
+ direct: "direct",
2761
+ /** The basis word `exploratory`, printed under the story's word for it. */
2762
+ hypothesis: "hypothesis",
2763
+ expect: "expect",
2764
+ /** The prefix of the `predicts` chip; the model's words follow. */
2765
+ predicts: "predicts:",
2766
+ fact: "fact",
2767
+ open: "open",
2768
+ noise: "noise",
2769
+ ruledOut: "ruled-out",
2770
+ undeclared: "undeclared",
2771
+ sought: "sought",
2772
+ judged: "judged",
2773
+ /** The answer chip's first bucket: results standing as `fact`. */
2774
+ stoodOn: "stood on",
2775
+ contingent: "contingent",
2776
+ unsupported: "unsupported"
2777
+ });
2778
+ var isRecord6 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
2779
+ function keysOf(record) {
2780
+ if (!isRecord6(record) && !Array.isArray(record)) return { rows: [], unsupportedValues: void 0 };
2781
+ if (Array.isArray(record)) {
2782
+ let ledger;
2783
+ let unsupported;
2784
+ for (const k of record) {
2785
+ if (!isRecord6(k) || typeof k.path !== "string") continue;
2786
+ if (k.path === "findingsLedger") ledger = k.value;
2787
+ else if (k.path === "unsupportedValues") unsupported = k.value;
2788
+ }
2789
+ return { rows: Array.isArray(ledger) ? ledger : [], unsupportedValues: unsupported };
2790
+ }
2791
+ const r = record;
2792
+ return { rows: Array.isArray(r.findingsLedger) ? r.findingsLedger : [], unsupportedValues: r.unsupportedValues };
2793
+ }
2794
+ var CLIP3 = 40;
2795
+ function clip3(text) {
2796
+ return text.length <= CLIP3 ? text : `${text.slice(0, CLIP3 - 1)}\u2026`;
2797
+ }
2798
+ var mark = (label, tone, title6) => Object.freeze(title6 !== void 0 ? { label, tone, title: title6 } : { label, tone });
2799
+ function basisMark(basis) {
2800
+ if (basis === "exploratory") return mark(LABELS7.hypothesis, "muted", basis);
2801
+ return mark(basis, "neutral");
2802
+ }
2803
+ function expectTone(expect) {
2804
+ if (expect === "high") return "good";
2805
+ if (expect === "low") return "muted";
2806
+ return "neutral";
2807
+ }
2808
+ function askMarks(before) {
2809
+ const out = [basisMark(before.basis)];
2810
+ if (before.expect !== void 0) out.push(mark(`${LABELS7.expect} ${before.expect}`, expectTone(before.expect)));
2811
+ if (before.proposition !== void 0) out.push(mark(clip3(before.proposition), "neutral", before.proposition));
2812
+ if (before.predicts !== void 0) out.push(mark(`${LABELS7.predicts} ${clip3(before.predicts)}`, "neutral", before.predicts));
2813
+ return Object.freeze(out);
2814
+ }
2815
+ function standingTone(standing) {
2816
+ if (standing === "fact") return "good";
2817
+ if (standing === "open") return "neutral";
2818
+ if (standing === "noise") return "warn";
2819
+ if (standing === "ruled-out") return "bad";
2820
+ return "neutral";
2821
+ }
2822
+ function returnMarks(standing, judged) {
2823
+ const out = [];
2824
+ if (standing === void 0) out.push(mark(LABELS7.undeclared, "muted"));
2825
+ else {
2826
+ out.push(mark(standing.standing, standingTone(standing.standing)));
2827
+ if (standing.sought === true) out.push(mark(LABELS7.sought, "muted"));
2828
+ }
2829
+ if (judged !== void 0) out.push(mark(`${LABELS7.judged} ${judged}`, "muted"));
2830
+ return Object.freeze(out);
2831
+ }
2832
+ function countOf(standings, word) {
2833
+ let n = 0;
2834
+ for (const s of standings.values()) if (s.standing === word) n += 1;
2835
+ return n;
2836
+ }
2837
+ function answerMarks(proof) {
2838
+ const answer = proof.answer;
2839
+ if (answer === void 0) return void 0;
2840
+ const standings = proof.findings.standings;
2841
+ const buckets = [];
2842
+ const stoodOn = countOf(standings, "fact");
2843
+ const open = countOf(standings, "open");
2844
+ const noise = countOf(standings, "noise");
2845
+ const ruledOut = countOf(standings, "ruled-out");
2846
+ if (stoodOn > 0) buckets.push(`${LABELS7.stoodOn} ${stoodOn}`);
2847
+ if (open > 0) buckets.push(`${LABELS7.open} ${open}`);
2848
+ if (noise > 0) buckets.push(`${LABELS7.noise} ${noise}`);
2849
+ if (ruledOut > 0) buckets.push(`${LABELS7.ruledOut} ${ruledOut}`);
2850
+ const out = [];
2851
+ if (buckets.length > 0) out.push(mark(buckets.join(" \xB7 "), stoodOn > 0 ? "good" : "neutral"));
2852
+ if (answer.contingent.length > 0) out.push(mark(`${LABELS7.contingent} ${answer.contingent.length}`, "warn"));
2853
+ if (answer.unsupported.length > 0) out.push(mark(`${LABELS7.unsupported} ${answer.unsupported.length}`, "bad"));
2854
+ return out.length > 0 ? Object.freeze(out) : void 0;
2855
+ }
2856
+ function storyMarks(trace, record) {
2857
+ const keys = keysOf(record);
2858
+ const steps = trace.steps;
2859
+ if (keys.rows.length === 0) return Object.freeze(steps.map(() => void 0));
2860
+ const reasoning = foldReasoning({ rows: keys.rows });
2861
+ const proof = foldProofMap({ rows: keys.rows, unsupportedValues: keys.unsupportedValues });
2862
+ const basisById = /* @__PURE__ */ new Map();
2863
+ for (const card of reasoning.cards) basisById.set(card.toolCallId, card.before);
2864
+ const judgedById = /* @__PURE__ */ new Map();
2865
+ for (const call of proof.calls) if (call.judged !== void 0) judgedById.set(call.toolCallId, call.judged);
2866
+ const standings = proof.findings.standings;
2867
+ const answer = answerMarks(proof);
2868
+ return Object.freeze(
2869
+ steps.map((step) => {
2870
+ if (step.kind === "answer") return answer;
2871
+ if (typeof step.toolCallId !== "string") return void 0;
2872
+ if (step.kind === "ask") {
2873
+ const before = basisById.get(step.toolCallId);
2874
+ return before === void 0 ? void 0 : askMarks(before);
2875
+ }
2876
+ if (step.kind === "return") return returnMarks(standings.get(step.toolCallId), judgedById.get(step.toolCallId));
2877
+ return void 0;
2878
+ })
2879
+ );
2880
+ }
2881
+
2757
2882
  export {
2758
2883
  LABELS2 as LABELS,
2759
2884
  MILESTONE_AXIS,
@@ -2776,6 +2901,9 @@ export {
2776
2901
  foldProofMap,
2777
2902
  GEOMETRY2,
2778
2903
  layoutProofMap,
2779
- ProofMap
2904
+ ProofMap,
2905
+ LABELS7 as LABELS6,
2906
+ CLIP3 as CLIP,
2907
+ storyMarks
2780
2908
  };
2781
- //# sourceMappingURL=chunk-JPJKTMN6.js.map
2909
+ //# sourceMappingURL=chunk-3HSMB6JF.js.map