agentfootprint 6.26.0 → 6.27.0
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 +251 -48
- package/dist/esm/lib/context-bisect/index.js +1 -0
- package/dist/esm/lib/context-bisect/index.js.map +1 -1
- package/dist/esm/lib/context-bisect/toBacktrackTrace.js +137 -0
- package/dist/esm/lib/context-bisect/toBacktrackTrace.js.map +1 -0
- package/dist/esm/lib/tool-lint/cli.js +6 -1
- package/dist/esm/lib/tool-lint/cli.js.map +1 -1
- package/dist/esm/observe.js +4 -0
- package/dist/esm/observe.js.map +1 -1
- package/dist/lib/context-bisect/index.js +3 -1
- package/dist/lib/context-bisect/index.js.map +1 -1
- package/dist/lib/context-bisect/toBacktrackTrace.js +141 -0
- package/dist/lib/context-bisect/toBacktrackTrace.js.map +1 -0
- package/dist/lib/tool-lint/cli.js +30 -2
- package/dist/lib/tool-lint/cli.js.map +1 -1
- package/dist/observe.js +24 -19
- package/dist/observe.js.map +1 -1
- package/dist/types/lib/context-bisect/index.d.ts +1 -0
- package/dist/types/lib/context-bisect/index.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/toBacktrackTrace.d.ts +139 -0
- package/dist/types/lib/context-bisect/toBacktrackTrace.d.ts.map +1 -0
- package/dist/types/lib/tool-lint/cli.d.ts.map +1 -1
- package/dist/types/observe.d.ts +1 -0
- package/dist/types/observe.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
<h1 align="center">Agentfootprint</h1>
|
|
4
|
+
|
|
2
5
|
<p align="center">
|
|
3
|
-
<
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/hero-dark.svg">
|
|
5
|
-
<source media="(prefers-color-scheme: light)" srcset="docs/assets/hero-light.svg">
|
|
6
|
-
<img alt="agentfootprint mascot composing context flavors (Skills, Steering, Guardrails, RAG, Tool APIs, Memory) into three structured LLM slots (system, messages, tools) — the central abstraction, visualized." src="docs/assets/hero-light.svg" width="100%"/>
|
|
7
|
-
</picture>
|
|
6
|
+
<strong>Your agent picked the wrong tool, gave a wrong answer — and the logs can't tell you why.<br/>Agentfootprint can.</strong>
|
|
8
7
|
</p>
|
|
9
8
|
|
|
10
|
-
<
|
|
9
|
+
<p align="center">
|
|
10
|
+
The explainable agent framework: every read, write, decision, and tool call becomes
|
|
11
|
+
<strong>connected evidence</strong> as your agent runs. When something goes wrong, you don't grep logs — you ask.
|
|
12
|
+
</p>
|
|
11
13
|
|
|
12
14
|
<p align="center">
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
+
<a href="https://footprintjs.github.io/agentThinkingUI/">
|
|
16
|
+
<img src="docs/assets/hero-atui.png" alt="An agent run replayed in AgentThinkingUI — the LLM 'brain' calls the Flight-search tool, the step inspector shows the tool's raw output and the brain's reasoning about it, and the timeline scrubs every step of the run." width="100%">
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
<p align="center">
|
|
20
|
+
<sub>A real run, replayed — rendered with <a href="https://github.com/footprintjs/agentThinkingUI"><b>AgentThinkingUI</b></a> (<code>npm i agentthinkingui</code>). Every frame is generated from the run's own trace; <a href="https://footprintjs.github.io/agentThinkingUI/">▶ watch it live</a>.</sub>
|
|
15
21
|
</p>
|
|
16
22
|
|
|
17
23
|
<p align="center">
|
|
@@ -26,7 +32,233 @@
|
|
|
26
32
|
|
|
27
33
|
---
|
|
28
34
|
|
|
29
|
-
##
|
|
35
|
+
## The new error class
|
|
36
|
+
|
|
37
|
+
For decades, software had two kinds of errors — and developers never needed deep
|
|
38
|
+
domain knowledge to fix either:
|
|
39
|
+
|
|
40
|
+
| Error class | Where the bug lives | How you find it |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| **Infrastructure** — crash, timeout, 500 | the system | infra logs, monitoring |
|
|
43
|
+
| **Business logic** — wrong branch, wrong math | the code | stack trace, debugger, `console.log` |
|
|
44
|
+
| **Contextual** — wrong tool chosen, wrong fact believed, stale memory trusted | **what the model was given** | **nothing. Until now.** |
|
|
45
|
+
|
|
46
|
+
Agents introduced the third class. The code is correct, the infra is healthy — and
|
|
47
|
+
the run is still wrong, because two tool descriptions read alike, or an injected
|
|
48
|
+
fact was misleading, or memory carried last week's truth. Classical logs can't
|
|
49
|
+
explain it: **they record what the code did, never what the context did.**
|
|
50
|
+
|
|
51
|
+
## The idea
|
|
52
|
+
|
|
53
|
+
If contextual errors live in what the model was given, then the run itself must be
|
|
54
|
+
structured so context is **evidence** — every injection, read, write, decision, and
|
|
55
|
+
tool call recorded *connected*, the moment it happens. Not logs you grep. Evidence
|
|
56
|
+
you ask.
|
|
57
|
+
|
|
58
|
+
## How — we abstract context engineering
|
|
59
|
+
|
|
60
|
+
Every piece of context enters the LLM through one of **3 slots** (`system` ·
|
|
61
|
+
`messages` · `tools`), under one of **4 triggers** — skills, steering, RAG, facts,
|
|
62
|
+
memory, guardrails are all the same move: `Injection = slot × trigger × cache`.
|
|
63
|
+
|
|
64
|
+
**Because the framework owns that injection point, every piece of context is born
|
|
65
|
+
tracked.** Tracking isn't an add-on you wire up — it's a consequence of the
|
|
66
|
+
abstraction. [The full model ↓](#the-model--what-we-abstract)
|
|
67
|
+
|
|
68
|
+
<p align="center">
|
|
69
|
+
<picture>
|
|
70
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/hero-dark.svg">
|
|
71
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/assets/hero-light.svg">
|
|
72
|
+
<img alt="agentfootprint mascot composing context flavors (Skills, Steering, Guardrails, RAG, Tool APIs, Memory) into three structured LLM slots (system, messages, tools) — the central abstraction, visualized." src="docs/assets/hero-light.svg" width="100%"/>
|
|
73
|
+
</picture>
|
|
74
|
+
</p>
|
|
75
|
+
|
|
76
|
+
## What tracking buys you
|
|
77
|
+
|
|
78
|
+
**See it in 30 seconds** — four questions logs can't answer, each answered by code in this repo from a real run:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
Q: Why did the model pick refund_full instead of refund_partial?
|
|
82
|
+
A: margin 0.02 — ⚠ NARROW: the two tool descriptions read nearly identical
|
|
83
|
+
(toolChoiceRecorder — and the catalog lint flags the pair before you ever run)
|
|
84
|
+
|
|
85
|
+
Q: Why was this loan declined?
|
|
86
|
+
A: decision ← [control: "DTI above the 0.43 affordability ceiling"] ← dti 0.52 ← monthlyDebt / income
|
|
87
|
+
(decide() evidence + the causal slice — every hop is a real recorded edge)
|
|
88
|
+
|
|
89
|
+
Q: Which piece of context made the answer wrong?
|
|
90
|
+
A: CAUSAL: ablating fact 'vip-override' flipped the outcome in 3/3 seeded reruns
|
|
91
|
+
(localizeContextBug — ranked proxies, counterfactual proof)
|
|
92
|
+
|
|
93
|
+
Q: Prove nobody edited this run's record.
|
|
94
|
+
A: verifyAuditBundle → valid: false, brokenAt: #16 — the tampered record, named
|
|
95
|
+
(hash-chained audit export, offline verification)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
And you don't have to read the trace yourself — **we provide the tools for an LLM to track it for you**: the trace toolpack let a debugger model find a planted bug while reading **9.5% of the trace** ([guide](docs/guides/trace-debugging.md)).
|
|
99
|
+
|
|
100
|
+
## One contextual error, walked end to end
|
|
101
|
+
|
|
102
|
+
The third question above, in full — every value below is the captured output of
|
|
103
|
+
[`examples/observability/05-context-bisect.ts`](examples/observability/05-context-bisect.ts)
|
|
104
|
+
and [`06-backtrack-trace.ts`](examples/observability/06-backtrack-trace.ts), runnable offline.
|
|
105
|
+
|
|
106
|
+
**The bug.** A refunds agent carries a poisoned customer-profile fact. It answers:
|
|
107
|
+
|
|
108
|
+
> *"Refund APPROVED: Dana Reyes holds VIP tier override status, so the 47-day-old
|
|
109
|
+
> order qualifies for a refund beyond the 30-day window."*
|
|
110
|
+
|
|
111
|
+
The policy says 30 days. The logs look fine — the model was *given* bad context,
|
|
112
|
+
and classical logging has no row for that.
|
|
113
|
+
|
|
114
|
+
**The walk.** Because context here is state, the decision backtracks like a
|
|
115
|
+
variable: who read it, who wrote it, who let it in, where it was born —
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
ANSWER "Refund APPROVED…" ← the bug
|
|
119
|
+
READ call-llm#40 assembled the system prompt ← exactly what the model saw
|
|
120
|
+
LANDED context#6 wrote systemPromptInjections ← who mutated state
|
|
121
|
+
ALLOWED trigger { kind: 'always' } — active every iteration ← why it was let in
|
|
122
|
+
BORN defineFact('vip-override-fact') ← who wrote it
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
That chain gives the **complete, provable candidate set** — every piece of
|
|
126
|
+
context that demonstrably reached the call, and nothing else. Influence scoring
|
|
127
|
+
then *ranks* inside it (the two facts sit 0.01 apart — proxies can't separate
|
|
128
|
+
them), and counterfactual **ablation proves**: removing `vip-override-fact`
|
|
129
|
+
flips APPROVED → DECLINED in **3/3 seeded reruns**; the benign style fact and
|
|
130
|
+
the lookup tool come back not-confirmed, 0/3. Scores are proxies; only the
|
|
131
|
+
ablation verdict makes a causal claim — the report says so itself.
|
|
132
|
+
|
|
133
|
+
**The same walk, visual.** One call serializes the report for
|
|
134
|
+
[AgentThinkingUI](https://github.com/footprintjs/agentThinkingUI)'s
|
|
135
|
+
`<BacktrackView>` — the "why?" board, triggerable from **any** decision point
|
|
136
|
+
(final answer, a mid-loop tool choice, a deterministic `decide()` rule):
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { localizeContextBug, toBacktrackTrace } from 'agentfootprint/observe';
|
|
140
|
+
|
|
141
|
+
const report = await localizeContextBug({ artifacts, embedder, atStep, rerun });
|
|
142
|
+
const trace = toBacktrackTrace(report, {
|
|
143
|
+
claim: 'The agent approved a refund 47 days past the 30-day window — why?',
|
|
144
|
+
answer: { text: buggyAnswer, label: 'the wrong answer' },
|
|
145
|
+
});
|
|
146
|
+
// <BacktrackView trace={trace}/> — or <BacktrackOverlay/> from any decision point
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
<img alt="The BacktrackView board: the wrong answer, the suspects with influence meters, the CAUSAL 3/3 ablation stamp on the planted fact, and the chain-of-custody rewind showing the exact system prompt the model saw with the culprit sentence highlighted." src="docs/assets/backtrack-board.png" width="100%"/>
|
|
150
|
+
|
|
151
|
+
The rewind pane at the bottom is the killer view: **the exact system prompt the
|
|
152
|
+
model saw**, with the culprit sentence highlighted — recorded state, not a
|
|
153
|
+
reconstruction. And the same chain feeds the machine door: every id on the
|
|
154
|
+
board is a `runtimeStageId` a debugger LLM can drill with the
|
|
155
|
+
[trace toolpack](docs/guides/trace-debugging.md), token-cheaply.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Pick your door
|
|
160
|
+
|
|
161
|
+
| 🔧 Building an agent? | 🐛 Agent misbehaving? | 🏛️ Need audit / compliance? |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| Typed agents with skills, steering, RAG, memory, guardrails — and the trace for free. | Lint your tool catalog in 5 minutes — works on **any** framework's tool list (plain JSON / MCP / OpenAI / Anthropic shapes). Then causal slices, context bisection, and the debugger-LLM toolpack. | Hash-chained, tamper-evident run records with an offline verifier — record-keeping in the EU-AI-Act shape. |
|
|
164
|
+
| [→ Quick start](#quick-start--runs-offline-no-api-key) | [→ Tool-catalog lint](docs/guides/tool-catalog-lint.md) · [→ Trace debugging](docs/guides/trace-debugging.md) | [→ Tamper-evident audit](docs/guides/security.md) |
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Quick start — runs offline, no API key
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npm install agentfootprint footprintjs
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
import { Agent, defineTool, mock } from 'agentfootprint';
|
|
176
|
+
|
|
177
|
+
const weather = defineTool({
|
|
178
|
+
name: 'weather',
|
|
179
|
+
description: 'Get current weather for a city.',
|
|
180
|
+
inputSchema: {
|
|
181
|
+
type: 'object',
|
|
182
|
+
properties: { city: { type: 'string' } },
|
|
183
|
+
required: ['city'],
|
|
184
|
+
},
|
|
185
|
+
execute: async ({ city }: { city: string }) => `${city}: 72°F, sunny`,
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
const agent = Agent.create({
|
|
189
|
+
provider: mock({ reply: 'I checked: it is 72°F and sunny.' }),
|
|
190
|
+
model: 'mock',
|
|
191
|
+
})
|
|
192
|
+
.system('You answer weather questions using the weather tool.')
|
|
193
|
+
.tool(weather)
|
|
194
|
+
.build();
|
|
195
|
+
|
|
196
|
+
const result = await agent.run({ message: 'Weather in Paris?' });
|
|
197
|
+
console.log(result); // → "I checked: it is 72°F and sunny."
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
For production, import a real provider from `agentfootprint/llm-providers` and swap it in — `anthropic(...)` / `openai(...)` / `bedrock(...)` / `ollama(...)`. Only the import line changes; the agent code stays the same. (The vendor-SDK providers live on the `agentfootprint/llm-providers` subpath so the main `agentfootprint` barrel stays free of optional peer-dep requires; `mock`, `browserAnthropic`, and `browserOpenai` are on the main barrel.)
|
|
201
|
+
|
|
202
|
+
### Then add context
|
|
203
|
+
|
|
204
|
+
A real agent carries more than one prompt and one tool: facts about the user, always-on rules, skills that unlock on demand. Declare each piece — the framework decides **when** it fires and **which slot** it lands in, and every piece is born tracked:
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
import { defineFact, defineSteering, defineSkill } from 'agentfootprint';
|
|
208
|
+
|
|
209
|
+
const agent = Agent.create({ provider, model })
|
|
210
|
+
.system('You are a support agent.')
|
|
211
|
+
.fact(defineFact({ // data the model should know — always on
|
|
212
|
+
id: 'user-profile',
|
|
213
|
+
data: 'Name: Maya · Plan: Pro · Customer since 2022',
|
|
214
|
+
}))
|
|
215
|
+
.steering(defineSteering({ // rules the model must follow — always on
|
|
216
|
+
id: 'refund-policy',
|
|
217
|
+
prompt: 'Never promise a refund before checking the policy tool.',
|
|
218
|
+
}))
|
|
219
|
+
.skill(defineSkill({ // guidance + tools — unlocks when the LLM asks
|
|
220
|
+
id: 'billing',
|
|
221
|
+
description: 'Use for refunds, charges, billing questions.',
|
|
222
|
+
body: 'When handling billing: confirm identity first, then…',
|
|
223
|
+
tools: [refundTool],
|
|
224
|
+
}))
|
|
225
|
+
.build();
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Same shape for `.instruction()` / `.memory()` / `.rag()` / raw `.injection()` — they're all the one primitive, `Injection = slot × trigger × cache`. [The full model ↓](#the-model--what-we-abstract)
|
|
229
|
+
|
|
230
|
+
### Then compose control flow
|
|
231
|
+
|
|
232
|
+
One agent is a `Runner`. So is every composition of agents — four control-flow primitives, and anything that runs composes into anything else:
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
import { Sequence, Parallel, Conditional } from 'agentfootprint';
|
|
236
|
+
|
|
237
|
+
const pipeline = Sequence.create()
|
|
238
|
+
.step('classify', classifyAgent) // sequence: step → step
|
|
239
|
+
.step('review',
|
|
240
|
+
Parallel.create() // parallel: fan out, then merge
|
|
241
|
+
.branch('legal', legalAgent)
|
|
242
|
+
.branch('ethics', ethicsAgent)
|
|
243
|
+
.mergeWithLLM({ provider, model, prompt: 'Synthesize:' })
|
|
244
|
+
.build())
|
|
245
|
+
.step('respond',
|
|
246
|
+
Conditional.create() // conditional: one branch runs
|
|
247
|
+
.when('urgent', (i) => i.message.startsWith('URGENT'), urgentAgent)
|
|
248
|
+
.otherwise('normal', normalAgent)
|
|
249
|
+
.build())
|
|
250
|
+
.build();
|
|
251
|
+
|
|
252
|
+
await pipeline.run({ message: 'URGENT: refund dispute on order #4411' });
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
The fourth primitive is `Loop` — `Loop.repeat(agent).until(guard).times(5)`, with a mandatory budget guard. And the named patterns from the research literature ship pre-composed from the same four: `selfConsistency` · `reflection` · `debate` · `mapReduce` · `tot` · `swarm`. Because every composition is a flowchart, the structure you wrote is the structure you see in the UI — and the trace spans the whole pipeline, not one agent at a time. [Designing systems of agents ↓](#how-do-i-design-my-agent-or-system-of-agents)
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## The model — what we abstract
|
|
260
|
+
|
|
261
|
+
|
|
30
262
|
|
|
31
263
|
When you build an Agentic Application, you collect domain-specific data and instructions, then wire them up based on what your system receives.
|
|
32
264
|
|
|
@@ -70,7 +302,7 @@ That's the whole model: `Injection = slot × trigger × cache`.
|
|
|
70
302
|
|
|
71
303
|
---
|
|
72
304
|
|
|
73
|
-
##
|
|
305
|
+
## Why we chose this abstraction
|
|
74
306
|
|
|
75
307
|
The agent space has many credible primary abstractions:
|
|
76
308
|
|
|
@@ -143,7 +375,7 @@ And a fourth, novel: **the agent can read its own trace.** Six months after the
|
|
|
143
375
|
|
|
144
376
|
---
|
|
145
377
|
|
|
146
|
-
##
|
|
378
|
+
## How do I design my agent or system of agents?
|
|
147
379
|
|
|
148
380
|
Two scales — same alphabet. Four control flows are the entire vocabulary.
|
|
149
381
|
|
|
@@ -305,7 +537,14 @@ Same trick as Beat 1: instead of N libraries for N patterns, we found the M buil
|
|
|
305
537
|
|
|
306
538
|
---
|
|
307
539
|
|
|
308
|
-
##
|
|
540
|
+
## How do I see what my agent did?
|
|
541
|
+
|
|
542
|
+
<p align="center">
|
|
543
|
+
<img src="docs/assets/lens-run.png" alt="A real agent run in the Lens: the conversation (with live PII redaction), the executed path lit on the merge-tree flowchart, the WHAT-HAPPENED timeline of every iteration/context/LLM turn/route, run stats, and the step inspector — all generated from the run's own trace." width="100%">
|
|
544
|
+
</p>
|
|
545
|
+
<p align="center">
|
|
546
|
+
<sub>One real run, fully explained — the <a href="https://github.com/footprintjs/agentfootprint-lens"><b>Lens</b></a> (<code>npm i agentfootprint-lens</code>): conversation · executed path · per-step timeline · stats, every pixel from the trace.</sub>
|
|
547
|
+
</p>
|
|
309
548
|
|
|
310
549
|
Because we own the loop (Beat 2), every decision and execution is captured during traversal — not bolted on. The default capture is the **causal trace**: every stage, read, write, and decision evidence, as a JSON-portable, scrubbable, queryable, exportable artifact. Beyond the default, wire custom recorders for cost, latency, or quality scoring — any observation hook fires on the same stream.
|
|
311
550
|
|
|
@@ -427,42 +666,6 @@ off the hot path.
|
|
|
427
666
|
|
|
428
667
|
---
|
|
429
668
|
|
|
430
|
-
## Quick start — runs offline, no API key
|
|
431
|
-
|
|
432
|
-
```bash
|
|
433
|
-
npm install agentfootprint footprintjs
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
```typescript
|
|
437
|
-
import { Agent, defineTool, mock } from 'agentfootprint';
|
|
438
|
-
|
|
439
|
-
const weather = defineTool({
|
|
440
|
-
name: 'weather',
|
|
441
|
-
description: 'Get current weather for a city.',
|
|
442
|
-
inputSchema: {
|
|
443
|
-
type: 'object',
|
|
444
|
-
properties: { city: { type: 'string' } },
|
|
445
|
-
required: ['city'],
|
|
446
|
-
},
|
|
447
|
-
execute: async ({ city }: { city: string }) => `${city}: 72°F, sunny`,
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
const agent = Agent.create({
|
|
451
|
-
provider: mock({ reply: 'I checked: it is 72°F and sunny.' }),
|
|
452
|
-
model: 'mock',
|
|
453
|
-
})
|
|
454
|
-
.system('You answer weather questions using the weather tool.')
|
|
455
|
-
.tool(weather)
|
|
456
|
-
.build();
|
|
457
|
-
|
|
458
|
-
const result = await agent.run({ message: 'Weather in Paris?' });
|
|
459
|
-
console.log(result); // → "I checked: it is 72°F and sunny."
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
For production, import a real provider from `agentfootprint/llm-providers` and swap it in — `anthropic(...)` / `openai(...)` / `bedrock(...)` / `ollama(...)`. Only the import line changes; the agent code stays the same. (The vendor-SDK providers live on the `agentfootprint/llm-providers` subpath so the main `agentfootprint` barrel stays free of optional peer-dep requires; `mock`, `browserAnthropic`, and `browserOpenai` are on the main barrel.)
|
|
463
|
-
|
|
464
|
-
---
|
|
465
|
-
|
|
466
669
|
## Mocks first, production second
|
|
467
670
|
|
|
468
671
|
Build the entire app against in-memory mocks with **zero API cost**, then swap real infrastructure one boundary at a time.
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export { llmEdgeWeigher, stepOutputText, } from './llmEdgeWeigher.js';
|
|
18
18
|
export { defaultSuspectClassifier, formatContextBugReport, llmCallIdsFromEvents, localizeContextBug, suspectLabel, } from './localize.js';
|
|
19
|
+
export { toBacktrackTrace, } from './toBacktrackTrace.js';
|
|
19
20
|
export { ablationForSuspect, applyAblations, defaultOutcomeComparator, probeFlipped, runAblationProbe, verdictFor, } from './ablation.js';
|
|
20
21
|
export { bisectCulprits, } from './bisect.js';
|
|
21
22
|
export { CONTEXT_BISECT_DEFAULTS, } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,GAIf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,GAKb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,UAAU,GAGX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,GAIf,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,GAoBxB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,GAIf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,GAKb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,GAOjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,UAAU,GAGX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,GAIf,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,GAoBxB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* toBacktrackTrace — serialize a ContextBugReport into the BacktrackTrace
|
|
3
|
+
* shape that agentThinkingUI's <BacktrackView>/<BacktrackOverlay> renders
|
|
4
|
+
* (the "why?" board: suspects → influence meters → ablation stamps →
|
|
5
|
+
* chain-of-custody rewind).
|
|
6
|
+
*
|
|
7
|
+
* Pure mapping, no UI dependency — the BacktrackTrace interfaces below
|
|
8
|
+
* MIRROR agentthinkingui's `types/index.d.ts` contract; both sides are
|
|
9
|
+
* framework-agnostic JSON. The report carries everything except two
|
|
10
|
+
* things only the caller knows:
|
|
11
|
+
*
|
|
12
|
+
* - `answer` (REQUIRED): the report localizes a decision but does not
|
|
13
|
+
* hold the decision's output text — pass what the agent said/chose.
|
|
14
|
+
* - `custody` (optional): the rewind player replays RECORDED STATE
|
|
15
|
+
* (the assembled prompt, the mutating commit). That content lives in
|
|
16
|
+
* the caller's artifacts (snapshot/events), not in the report — pass
|
|
17
|
+
* a callback to enrich confirmed suspects with evidence panes.
|
|
18
|
+
*
|
|
19
|
+
* Honesty is preserved, not added: ranks are TRUE report positions even
|
|
20
|
+
* when the cards are a subset (`rank`), path-only scores carry
|
|
21
|
+
* `upperBound` (hatched meter + starred value in the UI), honesty flags
|
|
22
|
+
* map verbatim, and the claims-discipline lines ride along. The mapper
|
|
23
|
+
* never invents a causal claim: `verdict` exists only where the report's
|
|
24
|
+
* ablation produced one ('inconclusive' maps to NO stamp, not a verdict).
|
|
25
|
+
*/
|
|
26
|
+
/* ── mapping ──────────────────────────────────────────────────────────── */
|
|
27
|
+
const BORN_VIA = {
|
|
28
|
+
injection: 'injection engine',
|
|
29
|
+
tool: 'tool result',
|
|
30
|
+
arg: 'run args/env (untracked)',
|
|
31
|
+
stage: 'stage commit',
|
|
32
|
+
};
|
|
33
|
+
/** The report's claims-discipline lines — same tier language as formatContextBugReport. */
|
|
34
|
+
const CLAIMS_LINES = [
|
|
35
|
+
'scores/weights are deterministic embedding-geometry proxies — semantic alignment, not model internals.',
|
|
36
|
+
'only ablation verdicts make causal claims.',
|
|
37
|
+
];
|
|
38
|
+
function suspectName(s) {
|
|
39
|
+
return s.detail?.injectionId ?? s.detail?.toolName ?? s.source;
|
|
40
|
+
}
|
|
41
|
+
function toCard(s, trueRank, custody) {
|
|
42
|
+
// edgePath walks decision → suspect; the suspect-adjacent hop is last
|
|
43
|
+
const adjacent = s.edgePath.length > 0 ? s.edgePath[s.edgePath.length - 1] : undefined;
|
|
44
|
+
const verdict = s.verdict && s.verdict.verdict !== 'inconclusive'
|
|
45
|
+
? {
|
|
46
|
+
kind: s.verdict.verdict,
|
|
47
|
+
flips: s.runs?.flips,
|
|
48
|
+
samples: s.runs?.samples,
|
|
49
|
+
claim: s.verdict.claim,
|
|
50
|
+
}
|
|
51
|
+
: undefined;
|
|
52
|
+
return {
|
|
53
|
+
kind: s.kind,
|
|
54
|
+
flavor: s.detail?.flavor,
|
|
55
|
+
name: suspectName(s),
|
|
56
|
+
text: s.detail?.text,
|
|
57
|
+
score: s.score,
|
|
58
|
+
rank: trueRank,
|
|
59
|
+
upperBound: s.hasContentEvidence ? undefined : true,
|
|
60
|
+
edge: adjacent
|
|
61
|
+
? { key: adjacent.key, weight: adjacent.weight, kind: adjacent.kind }
|
|
62
|
+
: undefined,
|
|
63
|
+
path: s.edgePath.length > 1
|
|
64
|
+
? s.edgePath.map((h) => ({
|
|
65
|
+
key: h.key ?? '',
|
|
66
|
+
kind: h.kind,
|
|
67
|
+
via: `${h.from} ← ${h.to}`,
|
|
68
|
+
}))
|
|
69
|
+
: undefined,
|
|
70
|
+
bornAt: { id: s.source, label: s.stageName, via: BORN_VIA[s.kind] },
|
|
71
|
+
custody: custody?.(s, trueRank),
|
|
72
|
+
verdict,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Serialize a localizer report for agentThinkingUI's BacktrackView.
|
|
77
|
+
* See module doc — `answer` is required; `custody` enriches the rewind.
|
|
78
|
+
*/
|
|
79
|
+
export function toBacktrackTrace(report, opts) {
|
|
80
|
+
const max = opts.maxSuspects ?? 6;
|
|
81
|
+
const prefer = opts.preferContentEvidence ?? true;
|
|
82
|
+
// selection — true report rank rides on every card either way
|
|
83
|
+
const indexed = report.suspects.map((s, i) => ({ s, trueRank: i + 1 }));
|
|
84
|
+
let selected;
|
|
85
|
+
if (indexed.length <= max) {
|
|
86
|
+
selected = indexed;
|
|
87
|
+
}
|
|
88
|
+
else if (prefer) {
|
|
89
|
+
const content = indexed.filter((e) => e.s.hasContentEvidence);
|
|
90
|
+
const structural = indexed.filter((e) => !e.s.hasContentEvidence);
|
|
91
|
+
selected = [...content, ...structural].slice(0, max);
|
|
92
|
+
selected.sort((a, b) => a.trueRank - b.trueRank); // cards stay in rank order
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
selected = indexed.slice(0, max);
|
|
96
|
+
}
|
|
97
|
+
const selectedRanks = new Set(selected.map((e) => e.trueRank));
|
|
98
|
+
const dropped = indexed.filter((e) => !selectedRanks.has(e.trueRank));
|
|
99
|
+
const folded = dropped.length > 0
|
|
100
|
+
? `${dropped.length} more suspect${dropped.length === 1 ? '' : 's'} folded — ` +
|
|
101
|
+
dropped.map((e) => `#${e.trueRank} ${e.s.source}`).join(' · ') +
|
|
102
|
+
(dropped.every((e) => !e.s.hasContentEvidence)
|
|
103
|
+
? ' (path-only upper bounds)'
|
|
104
|
+
: '') +
|
|
105
|
+
' — every id drillable with the trace toolpack'
|
|
106
|
+
: undefined;
|
|
107
|
+
// auto tie-warning: only when the report's top two genuinely crowd each other
|
|
108
|
+
let scoreNote = opts.scoreNote;
|
|
109
|
+
if (scoreNote === undefined && report.suspects.length >= 2) {
|
|
110
|
+
const margin = report.suspects[0].score - report.suspects[1].score;
|
|
111
|
+
if (margin < 0.05) {
|
|
112
|
+
scoreNote = `top-2 margin ${margin.toFixed(2)} — proxy scores alone cannot separate them${report.mode === 'causal' ? '; the ablation test can' : ''}.`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const honesty = [
|
|
116
|
+
...report.honestyFlags.map((f) => `⚠ ${f.flag}: ${f.note}`),
|
|
117
|
+
...CLAIMS_LINES,
|
|
118
|
+
];
|
|
119
|
+
return {
|
|
120
|
+
claim: opts.claim ?? `Why did ${report.stepName} (${report.step}) decide this?`,
|
|
121
|
+
mode: report.mode,
|
|
122
|
+
modeLabel: opts.modeLabel,
|
|
123
|
+
agent: opts.agent,
|
|
124
|
+
model: opts.model,
|
|
125
|
+
answer: opts.answer,
|
|
126
|
+
decidedAt: { id: report.step, label: report.stepName, kind: opts.decidedAtKind ?? 'llm' },
|
|
127
|
+
suspects: selected.map((e) => toCard(e.s, e.trueRank, opts.custody)),
|
|
128
|
+
trail: opts.trail,
|
|
129
|
+
folded,
|
|
130
|
+
scoreNote,
|
|
131
|
+
baseline: report.baseline
|
|
132
|
+
? `${report.baseline.flips}/${report.baseline.samples} flipped with no ablation`
|
|
133
|
+
: undefined,
|
|
134
|
+
honesty,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=toBacktrackTrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toBacktrackTrace.js","sourceRoot":"","sources":["../../../../src/lib/context-bisect/toBacktrackTrace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAwGH,6EAA6E;AAE7E,MAAM,QAAQ,GAAuC;IACnD,SAA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,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,IAAI,KAAK,EAAE;QACzF,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACpE,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM;QACN,SAAS;QACT,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACvB,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,2BAA2B;YAChF,CAAC,CAAC,SAAS;QACb,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
* embedder gating, use `analyzeToolCatalog` from
|
|
26
26
|
* `agentfootprint/observe` in a small script instead.
|
|
27
27
|
*/
|
|
28
|
-
import { readFile } from 'node:fs/promises';
|
|
29
28
|
import { mockEmbedder } from '../../memory/embedding/mockEmbedder.js';
|
|
30
29
|
import { analyzeToolCatalog, MOCK_EMBEDDER_CALIBRATION } from './analyze.js';
|
|
31
30
|
import { formatToolCatalogReport } from './format.js';
|
|
@@ -159,6 +158,12 @@ export async function runToolLintCli(argv, io = {
|
|
|
159
158
|
}
|
|
160
159
|
let catalog;
|
|
161
160
|
try {
|
|
161
|
+
// Lazy node:fs import (browser-compat): `agentfootprint/observe`
|
|
162
|
+
// re-exports this module, and a TOP-LEVEL node:fs/promises import
|
|
163
|
+
// detonates any browser bundle at module-eval (found by the
|
|
164
|
+
// agent-playground; same lazy-gating pattern as audit's node:crypto).
|
|
165
|
+
// The CLI path is the only consumer that touches the filesystem.
|
|
166
|
+
const { readFile } = await import('node:fs/promises');
|
|
162
167
|
catalog = coerceCatalog(JSON.parse(await readFile(args.file, 'utf8')));
|
|
163
168
|
}
|
|
164
169
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/lib/tool-lint/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/lib/tool-lint/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAQtD,MAAM,KAAK,GAAG;;;;;;;;;0CAS4B,yBAAyB,CAAC,sBAAsB;;qEAErB,yBAAyB,CAAC,SAAS;;;;;;oEAMpC,CAAC;AAErE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAAa;IACzC,uDAAuD;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,KAAK,IAAI;YACb,OAAO,IAAI,KAAK,QAAQ;YACxB,KAAK,CAAC,OAAO,CAAE,IAA4B,CAAC,KAAK,CAAC;YACpD,CAAC,CAAE,IAA6B,CAAC,KAAK;YACtC,CAAC,CAAC,SAAS,CAAC;IACd,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CA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,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,EAAE,CAAC,MAAM,CACP,gBAAgB;gBACd,CAAC,CAAC,2EAA2E;oBACzE,8EAA8E;oBAC9E,sDAAsD;gBAC1D,CAAC,CAAC,2EAA2E;oBACzE,2EAA2E;oBAC3E,wBAAwB,yBAAyB,CAAC,sBAAsB,gCAAgC,CAC/G,CAAC;YACF,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC;QACD,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/esm/observe.js
CHANGED
|
@@ -77,6 +77,10 @@ export { callTraceTool, TOOLPACK_HARD_CAPS, traceToolpack, } from './lib/trace-t
|
|
|
77
77
|
// embedding-geometry PROXIES; ablation verdicts are the ONLY causal
|
|
78
78
|
// claims; slice completeness is bounded by tracking — and says so.
|
|
79
79
|
export { ablationForSuspect, applyAblations, bisectCulprits, CONTEXT_BISECT_DEFAULTS, defaultOutcomeComparator, defaultSuspectClassifier, formatContextBugReport, llmCallIdsFromEvents, llmEdgeWeigher, localizeContextBug, probeFlipped, runAblationProbe, stepOutputText, suspectLabel, verdictFor, } from './lib/context-bisect/index.js';
|
|
80
|
+
// BacktrackTrace serializer — feeds agentThinkingUI's <BacktrackView>
|
|
81
|
+
// (the "why?" board) straight off a localizer report. Pure mapping, no
|
|
82
|
+
// UI dependency; the interfaces mirror agentthinkingui's contract.
|
|
83
|
+
export { toBacktrackTrace, } from './lib/context-bisect/index.js';
|
|
80
84
|
// Tool-catalog confusability lint (RFC-002 tier 1, C1–C3) — build-time,
|
|
81
85
|
// CI-gateable, framework-agnostic: plain { name, description?, inputSchema? }
|
|
82
86
|
// tools in (OpenAI/Anthropic/MCP lists coerce via coerceCatalog; the
|
package/dist/esm/observe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../../src/observe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,4BAA4B;AAC5B,OAAO,EAAE,eAAe,EAA+B,MAAM,qCAAqC,CAAC;AACnG,OAAO,EAAE,cAAc,EAA8B,MAAM,oCAAoC,CAAC;AAEhG,+BAA+B;AAC/B,OAAO,EACL,mBAAmB,GAEpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,aAAa,EAA6B,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GAgBjB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,GAQhB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,eAAe,EACf,cAAc,GAQf,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,oBAAoB,GAKrB,MAAM,gDAAgD,CAAC;AAExD,6BAA6B;AAC7B,OAAO,EAAE,YAAY,EAA4B,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAA6B,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EACL,wBAAwB,GAEzB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,YAAY,EAA4B,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,cAAc,EAA8B,MAAM,oCAAoC,CAAC;AAChG,OAAO,EACL,kBAAkB,GAEnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,aAAa,EAA6B,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EACL,aAAa,E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c,EACd,YAAY,EACZ,UAAU,GA+BX,MAAM,+BAA+B,CAAC;AACvC,sEAAsE;AACtE,uEAAuE;AACvE,mEAAmE;AACnE,OAAO,EACL,gBAAgB,GAOjB,MAAM,+BAA+B,CAAC;AACvC,wEAAwE;AACxE,8EAA8E;AAC9E,qEAAqE;AACrE,wEAAwE;AACxE,uEAAuE;AACvE,gEAAgE;AAChE,gDAAgD;AAChD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GAepB,MAAM,0BAA0B,CAAC;AAClC,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AACpE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAOnB,MAAM,iDAAiD,CAAC"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* claims; slice completeness is bounded by tracking — and says so.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.CONTEXT_BISECT_DEFAULTS = exports.bisectCulprits = exports.verdictFor = exports.runAblationProbe = exports.probeFlipped = exports.defaultOutcomeComparator = exports.applyAblations = exports.ablationForSuspect = exports.suspectLabel = exports.localizeContextBug = exports.llmCallIdsFromEvents = exports.formatContextBugReport = exports.defaultSuspectClassifier = exports.stepOutputText = exports.llmEdgeWeigher = void 0;
|
|
19
|
+
exports.CONTEXT_BISECT_DEFAULTS = exports.bisectCulprits = exports.verdictFor = exports.runAblationProbe = exports.probeFlipped = exports.defaultOutcomeComparator = exports.applyAblations = exports.ablationForSuspect = exports.toBacktrackTrace = exports.suspectLabel = exports.localizeContextBug = exports.llmCallIdsFromEvents = exports.formatContextBugReport = exports.defaultSuspectClassifier = exports.stepOutputText = exports.llmEdgeWeigher = void 0;
|
|
20
20
|
var llmEdgeWeigher_js_1 = require("./llmEdgeWeigher.js");
|
|
21
21
|
Object.defineProperty(exports, "llmEdgeWeigher", { enumerable: true, get: function () { return llmEdgeWeigher_js_1.llmEdgeWeigher; } });
|
|
22
22
|
Object.defineProperty(exports, "stepOutputText", { enumerable: true, get: function () { return llmEdgeWeigher_js_1.stepOutputText; } });
|
|
@@ -26,6 +26,8 @@ Object.defineProperty(exports, "formatContextBugReport", { enumerable: true, get
|
|
|
26
26
|
Object.defineProperty(exports, "llmCallIdsFromEvents", { enumerable: true, get: function () { return localize_js_1.llmCallIdsFromEvents; } });
|
|
27
27
|
Object.defineProperty(exports, "localizeContextBug", { enumerable: true, get: function () { return localize_js_1.localizeContextBug; } });
|
|
28
28
|
Object.defineProperty(exports, "suspectLabel", { enumerable: true, get: function () { return localize_js_1.suspectLabel; } });
|
|
29
|
+
var toBacktrackTrace_js_1 = require("./toBacktrackTrace.js");
|
|
30
|
+
Object.defineProperty(exports, "toBacktrackTrace", { enumerable: true, get: function () { return toBacktrackTrace_js_1.toBacktrackTrace; } });
|
|
29
31
|
var ablation_js_1 = require("./ablation.js");
|
|
30
32
|
Object.defineProperty(exports, "ablationForSuspect", { enumerable: true, get: function () { return ablation_js_1.ablationForSuspect; } });
|
|
31
33
|
Object.defineProperty(exports, "applyAblations", { enumerable: true, get: function () { return ablation_js_1.applyAblations; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,yDAM6B;AAL3B,mHAAA,cAAc,OAAA;AACd,mHAAA,cAAc,OAAA;AAMhB,6CAUuB;AATrB,uHAAA,wBAAwB,OAAA;AACxB,qHAAA,sBAAsB,OAAA;AACtB,mHAAA,oBAAoB,OAAA;AACpB,iHAAA,kBAAkB,OAAA;AAClB,2GAAA,YAAY,OAAA;AAOd,6CASuB;AARrB,iHAAA,kBAAkB,OAAA;AAClB,6GAAA,cAAc,OAAA;AACd,uHAAA,wBAAwB,OAAA;AACxB,2GAAA,YAAY,OAAA;AACZ,+GAAA,gBAAgB,OAAA;AAChB,yGAAA,UAAU,OAAA;AAKZ,yCAKqB;AAJnB,2GAAA,cAAc,OAAA;AAMhB,uCAqBoB;AApBlB,mHAAA,uBAAuB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,yDAM6B;AAL3B,mHAAA,cAAc,OAAA;AACd,mHAAA,cAAc,OAAA;AAMhB,6CAUuB;AATrB,uHAAA,wBAAwB,OAAA;AACxB,qHAAA,sBAAsB,OAAA;AACtB,mHAAA,oBAAoB,OAAA;AACpB,iHAAA,kBAAkB,OAAA;AAClB,2GAAA,YAAY,OAAA;AAOd,6DAQ+B;AAP7B,uHAAA,gBAAgB,OAAA;AASlB,6CASuB;AARrB,iHAAA,kBAAkB,OAAA;AAClB,6GAAA,cAAc,OAAA;AACd,uHAAA,wBAAwB,OAAA;AACxB,2GAAA,YAAY,OAAA;AACZ,+GAAA,gBAAgB,OAAA;AAChB,yGAAA,UAAU,OAAA;AAKZ,yCAKqB;AAJnB,2GAAA,cAAc,OAAA;AAMhB,uCAqBoB;AApBlB,mHAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* toBacktrackTrace — serialize a ContextBugReport into the BacktrackTrace
|
|
4
|
+
* shape that agentThinkingUI's <BacktrackView>/<BacktrackOverlay> renders
|
|
5
|
+
* (the "why?" board: suspects → influence meters → ablation stamps →
|
|
6
|
+
* chain-of-custody rewind).
|
|
7
|
+
*
|
|
8
|
+
* Pure mapping, no UI dependency — the BacktrackTrace interfaces below
|
|
9
|
+
* MIRROR agentthinkingui's `types/index.d.ts` contract; both sides are
|
|
10
|
+
* framework-agnostic JSON. The report carries everything except two
|
|
11
|
+
* things only the caller knows:
|
|
12
|
+
*
|
|
13
|
+
* - `answer` (REQUIRED): the report localizes a decision but does not
|
|
14
|
+
* hold the decision's output text — pass what the agent said/chose.
|
|
15
|
+
* - `custody` (optional): the rewind player replays RECORDED STATE
|
|
16
|
+
* (the assembled prompt, the mutating commit). That content lives in
|
|
17
|
+
* the caller's artifacts (snapshot/events), not in the report — pass
|
|
18
|
+
* a callback to enrich confirmed suspects with evidence panes.
|
|
19
|
+
*
|
|
20
|
+
* Honesty is preserved, not added: ranks are TRUE report positions even
|
|
21
|
+
* when the cards are a subset (`rank`), path-only scores carry
|
|
22
|
+
* `upperBound` (hatched meter + starred value in the UI), honesty flags
|
|
23
|
+
* map verbatim, and the claims-discipline lines ride along. The mapper
|
|
24
|
+
* never invents a causal claim: `verdict` exists only where the report's
|
|
25
|
+
* ablation produced one ('inconclusive' maps to NO stamp, not a verdict).
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.toBacktrackTrace = void 0;
|
|
29
|
+
/* ── mapping ──────────────────────────────────────────────────────────── */
|
|
30
|
+
const BORN_VIA = {
|
|
31
|
+
injection: 'injection engine',
|
|
32
|
+
tool: 'tool result',
|
|
33
|
+
arg: 'run args/env (untracked)',
|
|
34
|
+
stage: 'stage commit',
|
|
35
|
+
};
|
|
36
|
+
/** The report's claims-discipline lines — same tier language as formatContextBugReport. */
|
|
37
|
+
const CLAIMS_LINES = [
|
|
38
|
+
'scores/weights are deterministic embedding-geometry proxies — semantic alignment, not model internals.',
|
|
39
|
+
'only ablation verdicts make causal claims.',
|
|
40
|
+
];
|
|
41
|
+
function suspectName(s) {
|
|
42
|
+
return s.detail?.injectionId ?? s.detail?.toolName ?? s.source;
|
|
43
|
+
}
|
|
44
|
+
function toCard(s, trueRank, custody) {
|
|
45
|
+
// edgePath walks decision → suspect; the suspect-adjacent hop is last
|
|
46
|
+
const adjacent = s.edgePath.length > 0 ? s.edgePath[s.edgePath.length - 1] : undefined;
|
|
47
|
+
const verdict = s.verdict && s.verdict.verdict !== 'inconclusive'
|
|
48
|
+
? {
|
|
49
|
+
kind: s.verdict.verdict,
|
|
50
|
+
flips: s.runs?.flips,
|
|
51
|
+
samples: s.runs?.samples,
|
|
52
|
+
claim: s.verdict.claim,
|
|
53
|
+
}
|
|
54
|
+
: undefined;
|
|
55
|
+
return {
|
|
56
|
+
kind: s.kind,
|
|
57
|
+
flavor: s.detail?.flavor,
|
|
58
|
+
name: suspectName(s),
|
|
59
|
+
text: s.detail?.text,
|
|
60
|
+
score: s.score,
|
|
61
|
+
rank: trueRank,
|
|
62
|
+
upperBound: s.hasContentEvidence ? undefined : true,
|
|
63
|
+
edge: adjacent
|
|
64
|
+
? { key: adjacent.key, weight: adjacent.weight, kind: adjacent.kind }
|
|
65
|
+
: undefined,
|
|
66
|
+
path: s.edgePath.length > 1
|
|
67
|
+
? s.edgePath.map((h) => ({
|
|
68
|
+
key: h.key ?? '',
|
|
69
|
+
kind: h.kind,
|
|
70
|
+
via: `${h.from} ← ${h.to}`,
|
|
71
|
+
}))
|
|
72
|
+
: undefined,
|
|
73
|
+
bornAt: { id: s.source, label: s.stageName, via: BORN_VIA[s.kind] },
|
|
74
|
+
custody: custody?.(s, trueRank),
|
|
75
|
+
verdict,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Serialize a localizer report for agentThinkingUI's BacktrackView.
|
|
80
|
+
* See module doc — `answer` is required; `custody` enriches the rewind.
|
|
81
|
+
*/
|
|
82
|
+
function toBacktrackTrace(report, opts) {
|
|
83
|
+
const max = opts.maxSuspects ?? 6;
|
|
84
|
+
const prefer = opts.preferContentEvidence ?? true;
|
|
85
|
+
// selection — true report rank rides on every card either way
|
|
86
|
+
const indexed = report.suspects.map((s, i) => ({ s, trueRank: i + 1 }));
|
|
87
|
+
let selected;
|
|
88
|
+
if (indexed.length <= max) {
|
|
89
|
+
selected = indexed;
|
|
90
|
+
}
|
|
91
|
+
else if (prefer) {
|
|
92
|
+
const content = indexed.filter((e) => e.s.hasContentEvidence);
|
|
93
|
+
const structural = indexed.filter((e) => !e.s.hasContentEvidence);
|
|
94
|
+
selected = [...content, ...structural].slice(0, max);
|
|
95
|
+
selected.sort((a, b) => a.trueRank - b.trueRank); // cards stay in rank order
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
selected = indexed.slice(0, max);
|
|
99
|
+
}
|
|
100
|
+
const selectedRanks = new Set(selected.map((e) => e.trueRank));
|
|
101
|
+
const dropped = indexed.filter((e) => !selectedRanks.has(e.trueRank));
|
|
102
|
+
const folded = dropped.length > 0
|
|
103
|
+
? `${dropped.length} more suspect${dropped.length === 1 ? '' : 's'} folded — ` +
|
|
104
|
+
dropped.map((e) => `#${e.trueRank} ${e.s.source}`).join(' · ') +
|
|
105
|
+
(dropped.every((e) => !e.s.hasContentEvidence)
|
|
106
|
+
? ' (path-only upper bounds)'
|
|
107
|
+
: '') +
|
|
108
|
+
' — every id drillable with the trace toolpack'
|
|
109
|
+
: undefined;
|
|
110
|
+
// auto tie-warning: only when the report's top two genuinely crowd each other
|
|
111
|
+
let scoreNote = opts.scoreNote;
|
|
112
|
+
if (scoreNote === undefined && report.suspects.length >= 2) {
|
|
113
|
+
const margin = report.suspects[0].score - report.suspects[1].score;
|
|
114
|
+
if (margin < 0.05) {
|
|
115
|
+
scoreNote = `top-2 margin ${margin.toFixed(2)} — proxy scores alone cannot separate them${report.mode === 'causal' ? '; the ablation test can' : ''}.`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const honesty = [
|
|
119
|
+
...report.honestyFlags.map((f) => `⚠ ${f.flag}: ${f.note}`),
|
|
120
|
+
...CLAIMS_LINES,
|
|
121
|
+
];
|
|
122
|
+
return {
|
|
123
|
+
claim: opts.claim ?? `Why did ${report.stepName} (${report.step}) decide this?`,
|
|
124
|
+
mode: report.mode,
|
|
125
|
+
modeLabel: opts.modeLabel,
|
|
126
|
+
agent: opts.agent,
|
|
127
|
+
model: opts.model,
|
|
128
|
+
answer: opts.answer,
|
|
129
|
+
decidedAt: { id: report.step, label: report.stepName, kind: opts.decidedAtKind ?? 'llm' },
|
|
130
|
+
suspects: selected.map((e) => toCard(e.s, e.trueRank, opts.custody)),
|
|
131
|
+
trail: opts.trail,
|
|
132
|
+
folded,
|
|
133
|
+
scoreNote,
|
|
134
|
+
baseline: report.baseline
|
|
135
|
+
? `${report.baseline.flips}/${report.baseline.samples} flipped with no ablation`
|
|
136
|
+
: undefined,
|
|
137
|
+
honesty,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
exports.toBacktrackTrace = toBacktrackTrace;
|
|
141
|
+
//# sourceMappingURL=toBacktrackTrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toBacktrackTrace.js","sourceRoot":"","sources":["../../../src/lib/context-bisect/toBacktrackTrace.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AAwGH,6EAA6E;AAE7E,MAAM,QAAQ,GAAuC;IACnD,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,0BAA0B;IAC/B,KAAK,EAAE,cAAc;CACtB,CAAC;AAEF,2FAA2F;AAC3F,MAAM,YAAY,GAAsB;IACtC,wGAAwG;IACxG,4CAA4C;CAC7C,CAAC;AAEF,SAAS,WAAW,CAAC,CAAU;IAC7B,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC;AACjE,CAAC;AAED,SAAS,MAAM,CACb,CAAU,EACV,QAAgB,EAChB,OAA4C;IAE5C,sEAAsE;IACtE,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,GAA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CAAC,KAAK;QACjB,MAAM;QACN,SAAS;QACT,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACvB,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,2BAA2B;YAChF,CAAC,CAAC,SAAS;QACb,OAAO;KACR,CAAC;AACJ,CAAC;AAlED,4CAkEC"}
|
|
@@ -26,9 +26,31 @@
|
|
|
26
26
|
* embedder gating, use `analyzeToolCatalog` from
|
|
27
27
|
* `agentfootprint/observe` in a small script instead.
|
|
28
28
|
*/
|
|
29
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
33
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(o, k2, desc);
|
|
36
|
+
}) : (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
o[k2] = m[k];
|
|
39
|
+
}));
|
|
40
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
41
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
42
|
+
}) : function(o, v) {
|
|
43
|
+
o["default"] = v;
|
|
44
|
+
});
|
|
45
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
46
|
+
if (mod && mod.__esModule) return mod;
|
|
47
|
+
var result = {};
|
|
48
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
49
|
+
__setModuleDefault(result, mod);
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
29
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
53
|
exports.runToolLintCli = exports.coerceCatalog = void 0;
|
|
31
|
-
const promises_1 = require("node:fs/promises");
|
|
32
54
|
const mockEmbedder_js_1 = require("../../memory/embedding/mockEmbedder.js");
|
|
33
55
|
const analyze_js_1 = require("./analyze.js");
|
|
34
56
|
const format_js_1 = require("./format.js");
|
|
@@ -163,7 +185,13 @@ async function runToolLintCli(argv, io = {
|
|
|
163
185
|
}
|
|
164
186
|
let catalog;
|
|
165
187
|
try {
|
|
166
|
-
|
|
188
|
+
// Lazy node:fs import (browser-compat): `agentfootprint/observe`
|
|
189
|
+
// re-exports this module, and a TOP-LEVEL node:fs/promises import
|
|
190
|
+
// detonates any browser bundle at module-eval (found by the
|
|
191
|
+
// agent-playground; same lazy-gating pattern as audit's node:crypto).
|
|
192
|
+
// The CLI path is the only consumer that touches the filesystem.
|
|
193
|
+
const { readFile } = await Promise.resolve().then(() => __importStar(require('node:fs/promises')));
|
|
194
|
+
catalog = coerceCatalog(JSON.parse(await readFile(args.file, 'utf8')));
|
|
167
195
|
}
|
|
168
196
|
catch (error) {
|
|
169
197
|
io.stderr(`agentfootprint-lint-tools: ${args.file}: ${error.message}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/lib/tool-lint/cli.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/lib/tool-lint/cli.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4EAAsE;AACtE,6CAA6E;AAC7E,2CAAsD;AAQtD,MAAM,KAAK,GAAG;;;;;;;;;0CAS4B,sCAAyB,CAAC,sBAAsB;;qEAErB,sCAAyB,CAAC,SAAS;;;;;;oEAMpC,CAAC;AAErE;;;;GAIG;AACH,SAAgB,aAAa,CAAC,IAAa;IACzC,uDAAuD;IACvD,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C/C,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAA,8BAAY,GAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,sBAAsB,EAAE,SAAS;QACjC,SAAS;QACT,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;KACvC,CAAC,CAAC;IAEH,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,EAAE,CAAC,MAAM,CACP,gBAAgB;gBACd,CAAC,CAAC,2EAA2E;oBACzE,8EAA8E;oBAC9E,sDAAsD;gBAC1D,CAAC,CAAC,2EAA2E;oBACzE,2EAA2E;oBAC3E,wBAAwB,sCAAyB,CAAC,sBAAsB,gCAAgC,CAC/G,CAAC;YACF,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC;QACD,EAAE,CAAC,MAAM,CAAC,IAAA,mCAAuB,EAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAhED,wCAgEC"}
|
package/dist/observe.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
*/
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.bisectCulprits = exports.applyAblations = exports.ablationForSuspect = exports.traceToolpack = exports.TOOLPACK_HARD_CAPS = exports.callTraceTool = exports.structuralProximity = exports.scoreMargin = exports.scoreInfluence = exports.persistence = exports.pairwiseSimilarity = exports.finalAnswerSimilarity = exports.embeddingCache = exports.EmbeddingCache = exports.DEFAULT_PERSISTENCE_THRESHOLD = exports.DEFAULT_MARGIN_THRESHOLD = exports.DEFAULT_INFLUENCE_WEIGHTS = exports.contentHash = exports.compositeScore = exports.averageRelevancy = exports.adaptWeights = exports.typedEmit = exports.agentThinkingTrace = exports.toolLineageRecorder = exports.attachStatus = exports.LoggingDomains = exports.attachLogging = exports.skillRecorder = exports.permissionRecorder = exports.memoryRecorder = exports.evalRecorder = exports.contextEvaluatedRecorder = exports.toolsRecorder = exports.costRecorder = exports.LiveAgentTurnTracker = exports.LiveToolTracker = exports.LiveLLMTracker = exports.LiveStateRecorder = exports.liveStateRecorder = exports.buildStepGraph = exports.attachFlowchart = exports.runStepRecorder = exports.RunStepRecorder = exports.buildRunSteps = exports.BoundaryRecorder = exports.boundaryRecorder = exports.agentRecorder = exports.compositionRecorder = exports.streamRecorder = exports.ContextRecorder = void 0;
|
|
36
|
-
exports.toolChoiceRecorder = exports.buildChoiceContext = exports.saysWhatNotWhenRule = exports.runToolLintCli = exports.optionalParamRule = exports.MOCK_EMBEDDER_CALIBRATION = exports.formatToolCatalogReport = exports.enumInProseRule = exports.differentiationHint = exports.descriptionRule = exports.defaultStructuralRules = exports.DEFAULT_WHEN_CUES = exports.DEFAULT_WATCH_BAND = exports.DEFAULT_OMISSION_CUES = exports.DEFAULT_CONFUSABILITY_THRESHOLD = exports.confusabilityText = exports.coerceCatalog = exports.catalogFromTools = exports.analyzeToolCatalog = exports.verdictFor = exports.suspectLabel = exports.stepOutputText = exports.runAblationProbe = exports.probeFlipped = exports.localizeContextBug = exports.llmEdgeWeigher = exports.llmCallIdsFromEvents = exports.formatContextBugReport = exports.defaultSuspectClassifier = exports.defaultOutcomeComparator = exports.CONTEXT_BISECT_DEFAULTS = void 0;
|
|
36
|
+
exports.toolChoiceRecorder = exports.buildChoiceContext = exports.saysWhatNotWhenRule = exports.runToolLintCli = exports.optionalParamRule = exports.MOCK_EMBEDDER_CALIBRATION = exports.formatToolCatalogReport = exports.enumInProseRule = exports.differentiationHint = exports.descriptionRule = exports.defaultStructuralRules = exports.DEFAULT_WHEN_CUES = exports.DEFAULT_WATCH_BAND = exports.DEFAULT_OMISSION_CUES = exports.DEFAULT_CONFUSABILITY_THRESHOLD = exports.confusabilityText = exports.coerceCatalog = exports.catalogFromTools = exports.analyzeToolCatalog = exports.toBacktrackTrace = exports.verdictFor = exports.suspectLabel = exports.stepOutputText = exports.runAblationProbe = exports.probeFlipped = exports.localizeContextBug = exports.llmEdgeWeigher = exports.llmCallIdsFromEvents = exports.formatContextBugReport = exports.defaultSuspectClassifier = exports.defaultOutcomeComparator = exports.CONTEXT_BISECT_DEFAULTS = void 0;
|
|
37
37
|
// Tier 1 — context + stream
|
|
38
38
|
var ContextRecorder_js_1 = require("./recorders/core/ContextRecorder.js");
|
|
39
39
|
Object.defineProperty(exports, "ContextRecorder", { enumerable: true, get: function () { return ContextRecorder_js_1.ContextRecorder; } });
|
|
@@ -143,6 +143,11 @@ Object.defineProperty(exports, "runAblationProbe", { enumerable: true, get: func
|
|
|
143
143
|
Object.defineProperty(exports, "stepOutputText", { enumerable: true, get: function () { return index_js_3.stepOutputText; } });
|
|
144
144
|
Object.defineProperty(exports, "suspectLabel", { enumerable: true, get: function () { return index_js_3.suspectLabel; } });
|
|
145
145
|
Object.defineProperty(exports, "verdictFor", { enumerable: true, get: function () { return index_js_3.verdictFor; } });
|
|
146
|
+
// BacktrackTrace serializer — feeds agentThinkingUI's <BacktrackView>
|
|
147
|
+
// (the "why?" board) straight off a localizer report. Pure mapping, no
|
|
148
|
+
// UI dependency; the interfaces mirror agentthinkingui's contract.
|
|
149
|
+
var index_js_4 = require("./lib/context-bisect/index.js");
|
|
150
|
+
Object.defineProperty(exports, "toBacktrackTrace", { enumerable: true, get: function () { return index_js_4.toBacktrackTrace; } });
|
|
146
151
|
// Tool-catalog confusability lint (RFC-002 tier 1, C1–C3) — build-time,
|
|
147
152
|
// CI-gateable, framework-agnostic: plain { name, description?, inputSchema? }
|
|
148
153
|
// tools in (OpenAI/Anthropic/MCP lists coerce via coerceCatalog; the
|
|
@@ -150,24 +155,24 @@ Object.defineProperty(exports, "verdictFor", { enumerable: true, get: function (
|
|
|
150
155
|
// out. Pluggable structural rule pack; thresholds + embedder consumer-
|
|
151
156
|
// injected with our defaults. Bin: `agentfootprint-lint-tools`.
|
|
152
157
|
// Front door: docs/guides/tool-catalog-lint.md.
|
|
153
|
-
var
|
|
154
|
-
Object.defineProperty(exports, "analyzeToolCatalog", { enumerable: true, get: function () { return
|
|
155
|
-
Object.defineProperty(exports, "catalogFromTools", { enumerable: true, get: function () { return
|
|
156
|
-
Object.defineProperty(exports, "coerceCatalog", { enumerable: true, get: function () { return
|
|
157
|
-
Object.defineProperty(exports, "confusabilityText", { enumerable: true, get: function () { return
|
|
158
|
-
Object.defineProperty(exports, "DEFAULT_CONFUSABILITY_THRESHOLD", { enumerable: true, get: function () { return
|
|
159
|
-
Object.defineProperty(exports, "DEFAULT_OMISSION_CUES", { enumerable: true, get: function () { return
|
|
160
|
-
Object.defineProperty(exports, "DEFAULT_WATCH_BAND", { enumerable: true, get: function () { return
|
|
161
|
-
Object.defineProperty(exports, "DEFAULT_WHEN_CUES", { enumerable: true, get: function () { return
|
|
162
|
-
Object.defineProperty(exports, "defaultStructuralRules", { enumerable: true, get: function () { return
|
|
163
|
-
Object.defineProperty(exports, "descriptionRule", { enumerable: true, get: function () { return
|
|
164
|
-
Object.defineProperty(exports, "differentiationHint", { enumerable: true, get: function () { return
|
|
165
|
-
Object.defineProperty(exports, "enumInProseRule", { enumerable: true, get: function () { return
|
|
166
|
-
Object.defineProperty(exports, "formatToolCatalogReport", { enumerable: true, get: function () { return
|
|
167
|
-
Object.defineProperty(exports, "MOCK_EMBEDDER_CALIBRATION", { enumerable: true, get: function () { return
|
|
168
|
-
Object.defineProperty(exports, "optionalParamRule", { enumerable: true, get: function () { return
|
|
169
|
-
Object.defineProperty(exports, "runToolLintCli", { enumerable: true, get: function () { return
|
|
170
|
-
Object.defineProperty(exports, "saysWhatNotWhenRule", { enumerable: true, get: function () { return
|
|
158
|
+
var index_js_5 = require("./lib/tool-lint/index.js");
|
|
159
|
+
Object.defineProperty(exports, "analyzeToolCatalog", { enumerable: true, get: function () { return index_js_5.analyzeToolCatalog; } });
|
|
160
|
+
Object.defineProperty(exports, "catalogFromTools", { enumerable: true, get: function () { return index_js_5.catalogFromTools; } });
|
|
161
|
+
Object.defineProperty(exports, "coerceCatalog", { enumerable: true, get: function () { return index_js_5.coerceCatalog; } });
|
|
162
|
+
Object.defineProperty(exports, "confusabilityText", { enumerable: true, get: function () { return index_js_5.confusabilityText; } });
|
|
163
|
+
Object.defineProperty(exports, "DEFAULT_CONFUSABILITY_THRESHOLD", { enumerable: true, get: function () { return index_js_5.DEFAULT_CONFUSABILITY_THRESHOLD; } });
|
|
164
|
+
Object.defineProperty(exports, "DEFAULT_OMISSION_CUES", { enumerable: true, get: function () { return index_js_5.DEFAULT_OMISSION_CUES; } });
|
|
165
|
+
Object.defineProperty(exports, "DEFAULT_WATCH_BAND", { enumerable: true, get: function () { return index_js_5.DEFAULT_WATCH_BAND; } });
|
|
166
|
+
Object.defineProperty(exports, "DEFAULT_WHEN_CUES", { enumerable: true, get: function () { return index_js_5.DEFAULT_WHEN_CUES; } });
|
|
167
|
+
Object.defineProperty(exports, "defaultStructuralRules", { enumerable: true, get: function () { return index_js_5.defaultStructuralRules; } });
|
|
168
|
+
Object.defineProperty(exports, "descriptionRule", { enumerable: true, get: function () { return index_js_5.descriptionRule; } });
|
|
169
|
+
Object.defineProperty(exports, "differentiationHint", { enumerable: true, get: function () { return index_js_5.differentiationHint; } });
|
|
170
|
+
Object.defineProperty(exports, "enumInProseRule", { enumerable: true, get: function () { return index_js_5.enumInProseRule; } });
|
|
171
|
+
Object.defineProperty(exports, "formatToolCatalogReport", { enumerable: true, get: function () { return index_js_5.formatToolCatalogReport; } });
|
|
172
|
+
Object.defineProperty(exports, "MOCK_EMBEDDER_CALIBRATION", { enumerable: true, get: function () { return index_js_5.MOCK_EMBEDDER_CALIBRATION; } });
|
|
173
|
+
Object.defineProperty(exports, "optionalParamRule", { enumerable: true, get: function () { return index_js_5.optionalParamRule; } });
|
|
174
|
+
Object.defineProperty(exports, "runToolLintCli", { enumerable: true, get: function () { return index_js_5.runToolLintCli; } });
|
|
175
|
+
Object.defineProperty(exports, "saysWhatNotWhenRule", { enumerable: true, get: function () { return index_js_5.saysWhatNotWhenRule; } });
|
|
171
176
|
// Tool-choice margin recorder (RFC-002 tier 2, C4–C6) — per LLM call,
|
|
172
177
|
// ranks the OFFERED catalog against the choice context (user message +
|
|
173
178
|
// latest assistant reasoning) via influence-core scoreMargin; embeds
|
package/dist/observe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../src/observe.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;;AAEH,4BAA4B;AAC5B,0EAAmG;AAA1F,qHAAA,eAAe,OAAA;AACxB,wEAAgG;AAAvF,mHAAA,cAAc,OAAA;AAEvB,+BAA+B;AAC/B,kFAGiD;AAF/C,6HAAA,mBAAmB,OAAA;AAGrB,sEAA6F;AAApF,iHAAA,aAAa,OAAA;AACtB,qFAkBuD;AAjBrD,uHAAA,gBAAgB,OAAA;AAChB,uHAAA,gBAAgB,OAAA;AAiBlB,mFAWsD;AAVpD,mHAAA,aAAa,OAAA;AACb,qHAAA,eAAe,OAAA;AACf,qHAAA,eAAe,OAAA;AASjB,uFAUwD;AATtD,uHAAA,eAAe,OAAA;AACf,sHAAA,cAAc,OAAA;AAShB,uFAUwD;AATtD,yHAAA,iBAAiB,OAAA;AACjB,yHAAA,iBAAiB,OAAA;AACjB,sHAAA,cAAc,OAAA;AACd,uHAAA,eAAe,OAAA;AACf,4HAAA,oBAAoB,OAAA;AAOtB,6BA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E,uEAAuE;AACvE,mEAAmE;AACnE,0DAQuC;AAPrC,4GAAA,gBAAgB,OAAA;AAQlB,wEAAwE;AACxE,8EAA8E;AAC9E,qEAAqE;AACrE,wEAAwE;AACxE,uEAAuE;AACvE,gEAAgE;AAChE,gDAAgD;AAChD,qDAgCkC;AA/BhC,8GAAA,kBAAkB,OAAA;AAClB,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,6GAAA,iBAAiB,OAAA;AACjB,2HAAA,+BAA+B,OAAA;AAC/B,iHAAA,qBAAqB,OAAA;AACrB,8GAAA,kBAAkB,OAAA;AAClB,6GAAA,iBAAiB,OAAA;AACjB,kHAAA,sBAAsB,OAAA;AACtB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,2GAAA,eAAe,OAAA;AACf,mHAAA,uBAAuB,OAAA;AACvB,qHAAA,yBAAyB,OAAA;AACzB,6GAAA,iBAAiB,OAAA;AACjB,0GAAA,cAAc,OAAA;AACd,+GAAA,mBAAmB,OAAA;AAgBrB,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AACpE,yFASyD;AARvD,2HAAA,kBAAkB,OAAA;AAClB,2HAAA,kBAAkB,OAAA"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export { llmEdgeWeigher, stepOutputText, type LlmEdgeWeigherHandle, type LlmEdgeWeigherOptions, type RankedParentEdge, } from './llmEdgeWeigher.js';
|
|
18
18
|
export { defaultSuspectClassifier, formatContextBugReport, llmCallIdsFromEvents, localizeContextBug, suspectLabel, type ClassifyContext, type LocalizeContextBugOptions, type SuspectClassifier, type SuspectSeed, } from './localize.js';
|
|
19
|
+
export { toBacktrackTrace, type BacktrackCustodyHop, type BacktrackHop, type BacktrackSuspectCard, type BacktrackTrace, type BacktrackTrail, type ToBacktrackTraceOptions, } from './toBacktrackTrace.js';
|
|
19
20
|
export { ablationForSuspect, applyAblations, defaultOutcomeComparator, probeFlipped, runAblationProbe, verdictFor, type AblationTargets, type ProbeConfig, } from './ablation.js';
|
|
20
21
|
export { bisectCulprits, type BisectCulpritsOptions, type BisectionProbe, type BisectionResult, } from './bisect.js';
|
|
21
22
|
export { CONTEXT_BISECT_DEFAULTS, type AblationRerun, type AblationRunner, type AblationRunStats, type AblationSpec, type AblationVerdict, type AblationVerdictKind, type CapturedEventLike, type ContextBugArtifacts, type ContextBugReport, type EdgePathStep, type HonestyFlag, type HonestyFlagKind, type OutcomeComparator, type QualityTriggerLookup, type SimilarityStats, type SliceStats, type Suspect, type SuspectDetail, type SuspectKind, } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* toBacktrackTrace — serialize a ContextBugReport into the BacktrackTrace
|
|
3
|
+
* shape that agentThinkingUI's <BacktrackView>/<BacktrackOverlay> renders
|
|
4
|
+
* (the "why?" board: suspects → influence meters → ablation stamps →
|
|
5
|
+
* chain-of-custody rewind).
|
|
6
|
+
*
|
|
7
|
+
* Pure mapping, no UI dependency — the BacktrackTrace interfaces below
|
|
8
|
+
* MIRROR agentthinkingui's `types/index.d.ts` contract; both sides are
|
|
9
|
+
* framework-agnostic JSON. The report carries everything except two
|
|
10
|
+
* things only the caller knows:
|
|
11
|
+
*
|
|
12
|
+
* - `answer` (REQUIRED): the report localizes a decision but does not
|
|
13
|
+
* hold the decision's output text — pass what the agent said/chose.
|
|
14
|
+
* - `custody` (optional): the rewind player replays RECORDED STATE
|
|
15
|
+
* (the assembled prompt, the mutating commit). That content lives in
|
|
16
|
+
* the caller's artifacts (snapshot/events), not in the report — pass
|
|
17
|
+
* a callback to enrich confirmed suspects with evidence panes.
|
|
18
|
+
*
|
|
19
|
+
* Honesty is preserved, not added: ranks are TRUE report positions even
|
|
20
|
+
* when the cards are a subset (`rank`), path-only scores carry
|
|
21
|
+
* `upperBound` (hatched meter + starred value in the UI), honesty flags
|
|
22
|
+
* map verbatim, and the claims-discipline lines ride along. The mapper
|
|
23
|
+
* never invents a causal claim: `verdict` exists only where the report's
|
|
24
|
+
* ablation produced one ('inconclusive' maps to NO stamp, not a verdict).
|
|
25
|
+
*/
|
|
26
|
+
import type { ContextBugReport, Suspect } from './types.js';
|
|
27
|
+
export interface BacktrackCustodyHop {
|
|
28
|
+
readonly step: string;
|
|
29
|
+
readonly detail: string;
|
|
30
|
+
readonly at?: string;
|
|
31
|
+
readonly variable?: string;
|
|
32
|
+
/** recorded state at this hop — prompt text, commit payload, code, rule operands */
|
|
33
|
+
readonly content?: string;
|
|
34
|
+
/** exact substring of `content` highlighted as the culprit span */
|
|
35
|
+
readonly highlight?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface BacktrackHop {
|
|
38
|
+
readonly key: string;
|
|
39
|
+
readonly kind?: 'data' | 'control';
|
|
40
|
+
readonly via?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface BacktrackSuspectCard {
|
|
43
|
+
readonly kind: string;
|
|
44
|
+
readonly flavor?: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly text?: string;
|
|
47
|
+
readonly score: number;
|
|
48
|
+
/** true position in the report's ranking (cards may be a subset) */
|
|
49
|
+
readonly rank: number;
|
|
50
|
+
/** score is a path-only upper bound — no content signal */
|
|
51
|
+
readonly upperBound?: boolean;
|
|
52
|
+
/** the hop adjacent to the suspect (what fed the decision side) */
|
|
53
|
+
readonly edge?: {
|
|
54
|
+
readonly key?: string;
|
|
55
|
+
readonly weight?: number;
|
|
56
|
+
readonly kind?: 'data' | 'control';
|
|
57
|
+
};
|
|
58
|
+
/** the full hop chain, decision → suspect (multi-hop paths only) */
|
|
59
|
+
readonly path?: readonly BacktrackHop[];
|
|
60
|
+
readonly bornAt?: {
|
|
61
|
+
readonly id: string;
|
|
62
|
+
readonly label?: string;
|
|
63
|
+
readonly via?: string;
|
|
64
|
+
};
|
|
65
|
+
readonly custody?: readonly BacktrackCustodyHop[];
|
|
66
|
+
readonly verdict?: {
|
|
67
|
+
readonly kind: 'confirmed' | 'not-confirmed';
|
|
68
|
+
readonly flips?: number;
|
|
69
|
+
readonly samples?: number;
|
|
70
|
+
readonly claim?: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export interface BacktrackTrail {
|
|
74
|
+
readonly title?: string;
|
|
75
|
+
readonly custody?: readonly BacktrackCustodyHop[];
|
|
76
|
+
readonly claim?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface BacktrackTrace {
|
|
79
|
+
readonly claim: string;
|
|
80
|
+
readonly mode: 'causal' | 'correlational';
|
|
81
|
+
readonly modeLabel?: string;
|
|
82
|
+
readonly agent?: string;
|
|
83
|
+
readonly model?: string;
|
|
84
|
+
readonly answer: {
|
|
85
|
+
readonly text: string;
|
|
86
|
+
readonly label?: string;
|
|
87
|
+
readonly tone?: 'error' | 'question';
|
|
88
|
+
};
|
|
89
|
+
readonly decidedAt: {
|
|
90
|
+
readonly id: string;
|
|
91
|
+
readonly label?: string;
|
|
92
|
+
readonly kind?: 'llm' | 'rule';
|
|
93
|
+
};
|
|
94
|
+
readonly suspects: readonly BacktrackSuspectCard[];
|
|
95
|
+
readonly trail?: BacktrackTrail;
|
|
96
|
+
readonly folded?: string;
|
|
97
|
+
readonly scoreNote?: string;
|
|
98
|
+
readonly baseline?: string;
|
|
99
|
+
readonly honesty?: readonly string[];
|
|
100
|
+
}
|
|
101
|
+
export interface ToBacktrackTraceOptions {
|
|
102
|
+
/** The decision's output text — the report doesn't hold it. */
|
|
103
|
+
readonly answer: {
|
|
104
|
+
readonly text: string;
|
|
105
|
+
readonly label?: string;
|
|
106
|
+
readonly tone?: 'error' | 'question';
|
|
107
|
+
};
|
|
108
|
+
/** Headline question. Default: derived from the trigger step. */
|
|
109
|
+
readonly claim?: string;
|
|
110
|
+
/** 'rule' renders the decision diamond instead of the brain. Default 'llm'. */
|
|
111
|
+
readonly decidedAtKind?: 'llm' | 'rule';
|
|
112
|
+
/** Override the mode chip (e.g. "exact chain · proxy ranking"). */
|
|
113
|
+
readonly modeLabel?: string;
|
|
114
|
+
readonly agent?: string;
|
|
115
|
+
readonly model?: string;
|
|
116
|
+
/** Max suspect cards. Default 6. The rest fold into one disclosed line. */
|
|
117
|
+
readonly maxSuspects?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Card selection when the report has more suspects than `maxSuspects`.
|
|
120
|
+
* Default TRUE: content-evidence suspects fill the cards first (they are
|
|
121
|
+
* what a human can act on), structural path-only hops fold — but every
|
|
122
|
+
* card keeps its TRUE report rank, and the folded line discloses what
|
|
123
|
+
* was left out and that it ranked where it ranked. FALSE: strictly the
|
|
124
|
+
* report's top-N.
|
|
125
|
+
*/
|
|
126
|
+
readonly preferContentEvidence?: boolean;
|
|
127
|
+
/** Enrich a suspect's chain of custody with recorded-state panes. */
|
|
128
|
+
readonly custody?: (suspect: Suspect, trueRank: number) => readonly BacktrackCustodyHop[] | undefined;
|
|
129
|
+
/** Exact recorded hops for deterministic decisions (no ablation verdict). */
|
|
130
|
+
readonly trail?: BacktrackTrail;
|
|
131
|
+
/** Override the auto score note (top-2 margin tie warning). */
|
|
132
|
+
readonly scoreNote?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Serialize a localizer report for agentThinkingUI's BacktrackView.
|
|
136
|
+
* See module doc — `answer` is required; `custody` enriches the rewind.
|
|
137
|
+
*/
|
|
138
|
+
export declare function toBacktrackTrace(report: ContextBugReport, opts: ToBacktrackTraceOptions): BacktrackTrace;
|
|
139
|
+
//# sourceMappingURL=toBacktrackTrace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toBacktrackTrace.d.ts","sourceRoot":"","sources":["../../../../src/lib/context-bisect/toBacktrackTrace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,OAAO,EACR,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,C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,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AA8DD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,uBAAuB,GAC5B,cAAc,CA+DhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/lib/tool-lint/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/lib/tool-lint/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAqBD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,WAAW,EAAE,CAuCnE;AAmDD;;;GAGG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,aAKH,GACA,OAAO,CAAC,MAAM,CAAC,CAwDjB"}
|
package/dist/types/observe.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export { typedEmit } from './recorders/core/typedEmit.js';
|
|
|
53
53
|
export { adaptWeights, averageRelevancy, compositeScore, contentHash, DEFAULT_INFLUENCE_WEIGHTS, DEFAULT_MARGIN_THRESHOLD, DEFAULT_PERSISTENCE_THRESHOLD, EmbeddingCache, embeddingCache, finalAnswerSimilarity, pairwiseSimilarity, persistence, scoreInfluence, scoreMargin, structuralProximity, type CandidateScore, type Embedder, type EmbeddingCacheOptions, type EmbeddingCacheStats, type EvidenceInput, type InfluenceScore, type InfluenceWeights, type MarginCandidate, type MarginResult, type PairwiseSimilarityArgs, type PairwiseSimilarityResult, type ScoreInfluenceArgs, type ScoreMarginArgs, type SignalScores, type SimilarityItem, type SimilarityPair, } from './lib/influence-core/index.js';
|
|
54
54
|
export { callTraceTool, TOOLPACK_HARD_CAPS, traceToolpack, type TraceToolpackArtifacts, type TraceToolpackOptions, } from './lib/trace-toolpack/index.js';
|
|
55
55
|
export { ablationForSuspect, applyAblations, bisectCulprits, CONTEXT_BISECT_DEFAULTS, defaultOutcomeComparator, defaultSuspectClassifier, formatContextBugReport, llmCallIdsFromEvents, llmEdgeWeigher, localizeContextBug, probeFlipped, runAblationProbe, stepOutputText, suspectLabel, verdictFor, type AblationRerun, type AblationRunner, type AblationRunStats, type AblationSpec, type AblationTargets, type AblationVerdict, type AblationVerdictKind, type BisectCulpritsOptions, type BisectionProbe, type BisectionResult, type CapturedEventLike, type ClassifyContext, type ContextBugArtifacts, type ContextBugReport, type EdgePathStep, type HonestyFlag, type HonestyFlagKind, type LlmEdgeWeigherHandle, type LlmEdgeWeigherOptions, type LocalizeContextBugOptions, type OutcomeComparator, type QualityTriggerLookup, type RankedParentEdge, type SimilarityStats, type SliceStats, type Suspect, type SuspectClassifier, type SuspectDetail, type SuspectKind, type SuspectSeed, } from './lib/context-bisect/index.js';
|
|
56
|
+
export { toBacktrackTrace, type BacktrackCustodyHop, type BacktrackHop, type BacktrackSuspectCard, type BacktrackTrace, type BacktrackTrail, type ToBacktrackTraceOptions, } from './lib/context-bisect/index.js';
|
|
56
57
|
export { analyzeToolCatalog, catalogFromTools, coerceCatalog, confusabilityText, DEFAULT_CONFUSABILITY_THRESHOLD, DEFAULT_OMISSION_CUES, DEFAULT_WATCH_BAND, DEFAULT_WHEN_CUES, defaultStructuralRules, descriptionRule, differentiationHint, enumInProseRule, formatToolCatalogReport, MOCK_EMBEDDER_CALIBRATION, optionalParamRule, runToolLintCli, saysWhatNotWhenRule, type AnalyzeToolCatalogOptions, type CatalogTool, type ConfusablePairFinding, type DescriptionRuleOptions, type FormatReportOptions, type LintRule, type LintSeverity, type OptionalParamRuleOptions, type PairVerdict, type SaysWhatNotWhenRuleOptions, type SimilarityReport, type StructuralFinding, type ToolCatalogReport, type ToolLintCliIO, } from './lib/tool-lint/index.js';
|
|
57
58
|
export { buildChoiceContext, toolChoiceRecorder, type OfferedTool, type ToolChoiceCall, type ToolChoiceRecorderHandle, type ToolChoiceRecorderOptions, type ToolChoiceSkipReason, type ToolChoiceSummary, } from './recorders/observability/ToolChoiceRecorder.js';
|
|
58
59
|
//# sourceMappingURL=observe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../src/observe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAGhG,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL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