agentfootprint 9.123.0 → 9.125.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/AGENTS.md +15 -2
- package/CAPABILITIES.md +3 -1
- package/ai-instructions/claude-code/SKILL.md +15 -2
- package/canonical-notes.json +12 -1
- package/dist/conventions.js +40 -0
- package/dist/conventions.js.map +1 -1
- package/dist/core/Agent.js +154 -16
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +179 -1
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/arguments/serve.js +31 -7
- package/dist/core/agent/arguments/serve.js.map +1 -1
- package/dist/core/agent/assessment/assess.js +135 -1
- package/dist/core/agent/assessment/assess.js.map +1 -1
- package/dist/core/agent/assessment/compose.js +290 -0
- package/dist/core/agent/assessment/compose.js.map +1 -0
- package/dist/core/agent/assessment/reasons.js +40 -6
- package/dist/core/agent/assessment/reasons.js.map +1 -1
- package/dist/core/agent/assessment/stage.js +125 -0
- package/dist/core/agent/assessment/stage.js.map +1 -0
- package/dist/core/agent/assessment/witness.js +100 -0
- package/dist/core/agent/assessment/witness.js.map +1 -0
- package/dist/core/agent/buildAgentChart.js +20 -20
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart.js +17 -20
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/coverage/absent.js +35 -2
- package/dist/core/agent/coverage/absent.js.map +1 -1
- package/dist/core/agent/coverage/answer.js +132 -17
- package/dist/core/agent/coverage/answer.js.map +1 -1
- package/dist/core/agent/coverage/evidence.js +10 -1
- package/dist/core/agent/coverage/evidence.js.map +1 -1
- package/dist/core/agent/coverage/index.js +6 -1
- package/dist/core/agent/coverage/index.js.map +1 -1
- package/dist/core/agent/coverage/ledger.js +33 -4
- package/dist/core/agent/coverage/ledger.js.map +1 -1
- package/dist/core/agent/coverage/period.js +536 -0
- package/dist/core/agent/coverage/period.js.map +1 -0
- package/dist/core/agent/coverage/read.js +131 -17
- package/dist/core/agent/coverage/read.js.map +1 -1
- package/dist/core/agent/coverage/types.js +5 -1
- package/dist/core/agent/coverage/types.js.map +1 -1
- package/dist/core/agent/findings/judge.js +1 -1
- package/dist/core/agent/findings/ledger.js +17 -0
- package/dist/core/agent/findings/ledger.js.map +1 -1
- package/dist/core/agent/findings/types.js.map +1 -1
- package/dist/core/agent/honesty/armed.js +19 -4
- package/dist/core/agent/honesty/armed.js.map +1 -1
- package/dist/core/agent/honesty/mounts.js +246 -1
- package/dist/core/agent/honesty/mounts.js.map +1 -1
- package/dist/core/agent/results/subflow.js +183 -0
- package/dist/core/agent/results/subflow.js.map +1 -0
- package/dist/core/agent/stages/answerCoverage.js +63 -13
- package/dist/core/agent/stages/answerCoverage.js.map +1 -1
- package/dist/core/agent/stages/prepareFinal.js +112 -8
- package/dist/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/core/agent/stages/route.js +108 -44
- package/dist/core/agent/stages/route.js.map +1 -1
- package/dist/core/agent/stages/seed.js +45 -3
- package/dist/core/agent/stages/seed.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +108 -8
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/agent/stages/window.js +3 -1
- package/dist/core/agent/stages/window.js.map +1 -1
- package/dist/core/runCheckpoint.js +45 -4
- package/dist/core/runCheckpoint.js.map +1 -1
- package/dist/esm/conventions.d.ts +24 -0
- package/dist/esm/conventions.js +40 -0
- package/dist/esm/conventions.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +50 -6
- package/dist/esm/core/Agent.js +154 -16
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +98 -0
- package/dist/esm/core/agent/AgentBuilder.js +179 -1
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/arguments/serve.d.ts +27 -2
- package/dist/esm/core/agent/arguments/serve.js +34 -3
- package/dist/esm/core/agent/arguments/serve.js.map +1 -1
- package/dist/esm/core/agent/assessment/assess.js +135 -1
- package/dist/esm/core/agent/assessment/assess.js.map +1 -1
- package/dist/esm/core/agent/assessment/compose.d.ts +127 -0
- package/dist/esm/core/agent/assessment/compose.js +282 -0
- package/dist/esm/core/agent/assessment/compose.js.map +1 -0
- package/dist/esm/core/agent/assessment/reasons.d.ts +10 -6
- package/dist/esm/core/agent/assessment/reasons.js +40 -6
- package/dist/esm/core/agent/assessment/reasons.js.map +1 -1
- package/dist/esm/core/agent/assessment/stage.d.ts +57 -0
- package/dist/esm/core/agent/assessment/stage.js +98 -0
- package/dist/esm/core/agent/assessment/stage.js.map +1 -0
- package/dist/esm/core/agent/assessment/types.d.ts +28 -6
- package/dist/esm/core/agent/assessment/witness.d.ts +128 -0
- package/dist/esm/core/agent/assessment/witness.js +94 -0
- package/dist/esm/core/agent/assessment/witness.js.map +1 -0
- package/dist/esm/core/agent/buildAgentChart.d.ts +20 -1
- package/dist/esm/core/agent/buildAgentChart.js +22 -22
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildDynamicAgentChart.js +19 -22
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/coverage/absent.d.ts +17 -0
- package/dist/esm/core/agent/coverage/absent.js +34 -1
- package/dist/esm/core/agent/coverage/absent.js.map +1 -1
- package/dist/esm/core/agent/coverage/answer.d.ts +75 -6
- package/dist/esm/core/agent/coverage/answer.js +129 -16
- package/dist/esm/core/agent/coverage/answer.js.map +1 -1
- package/dist/esm/core/agent/coverage/evidence.js +9 -0
- package/dist/esm/core/agent/coverage/evidence.js.map +1 -1
- package/dist/esm/core/agent/coverage/index.d.ts +2 -1
- package/dist/esm/core/agent/coverage/index.js +2 -1
- package/dist/esm/core/agent/coverage/index.js.map +1 -1
- package/dist/esm/core/agent/coverage/ledger.d.ts +8 -3
- package/dist/esm/core/agent/coverage/ledger.js +34 -5
- package/dist/esm/core/agent/coverage/ledger.js.map +1 -1
- package/dist/esm/core/agent/coverage/period.d.ts +344 -0
- package/dist/esm/core/agent/coverage/period.js +519 -0
- package/dist/esm/core/agent/coverage/period.js.map +1 -0
- package/dist/esm/core/agent/coverage/read.d.ts +40 -2
- package/dist/esm/core/agent/coverage/read.js +131 -18
- package/dist/esm/core/agent/coverage/read.js.map +1 -1
- package/dist/esm/core/agent/coverage/types.d.ts +57 -1
- package/dist/esm/core/agent/coverage/types.js +5 -1
- package/dist/esm/core/agent/coverage/types.js.map +1 -1
- package/dist/esm/core/agent/findings/judge.d.ts +1 -1
- package/dist/esm/core/agent/findings/judge.js +1 -1
- package/dist/esm/core/agent/findings/ledger.js +17 -0
- package/dist/esm/core/agent/findings/ledger.js.map +1 -1
- package/dist/esm/core/agent/findings/types.d.ts +10 -8
- package/dist/esm/core/agent/findings/types.js.map +1 -1
- package/dist/esm/core/agent/honesty/armed.d.ts +24 -3
- package/dist/esm/core/agent/honesty/armed.js +19 -4
- package/dist/esm/core/agent/honesty/armed.js.map +1 -1
- package/dist/esm/core/agent/honesty/mounts.d.ts +120 -1
- package/dist/esm/core/agent/honesty/mounts.js +240 -0
- package/dist/esm/core/agent/honesty/mounts.js.map +1 -1
- package/dist/esm/core/agent/results/subflow.d.ts +155 -0
- package/dist/esm/core/agent/results/subflow.js +173 -0
- package/dist/esm/core/agent/results/subflow.js.map +1 -0
- package/dist/esm/core/agent/stages/answerCoverage.d.ts +35 -11
- package/dist/esm/core/agent/stages/answerCoverage.js +41 -14
- package/dist/esm/core/agent/stages/answerCoverage.js.map +1 -1
- package/dist/esm/core/agent/stages/prepareFinal.d.ts +49 -0
- package/dist/esm/core/agent/stages/prepareFinal.js +109 -7
- package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/esm/core/agent/stages/route.d.ts +19 -1
- package/dist/esm/core/agent/stages/route.js +108 -44
- package/dist/esm/core/agent/stages/route.js.map +1 -1
- package/dist/esm/core/agent/stages/seed.d.ts +7 -0
- package/dist/esm/core/agent/stages/seed.js +45 -3
- package/dist/esm/core/agent/stages/seed.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +25 -0
- package/dist/esm/core/agent/stages/toolCalls.js +106 -7
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/stages/window.d.ts +3 -1
- package/dist/esm/core/agent/stages/window.js +3 -1
- package/dist/esm/core/agent/stages/window.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +69 -5
- package/dist/esm/core/runCheckpoint.d.ts +28 -1
- package/dist/esm/core/runCheckpoint.js +45 -4
- package/dist/esm/core/runCheckpoint.js.map +1 -1
- package/dist/esm/events/dispatcher.d.ts +1 -1
- package/dist/esm/events/dispatcher.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +146 -0
- package/dist/esm/events/registry.d.ts +7 -1
- package/dist/esm/events/registry.js +8 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/answer-account/account.js +159 -24
- package/dist/esm/lib/answer-account/account.js.map +1 -1
- package/dist/esm/lib/answer-account/facts/howSure.js +17 -0
- package/dist/esm/lib/answer-account/facts/howSure.js.map +1 -1
- package/dist/esm/lib/answer-account/shown.js +5 -1
- package/dist/esm/lib/answer-account/shown.js.map +1 -1
- package/dist/esm/lib/answer-account/templates.d.ts +7 -1
- package/dist/esm/lib/answer-account/templates.js +10 -1
- package/dist/esm/lib/answer-account/templates.js.map +1 -1
- package/dist/esm/lib/answer-account/types.d.ts +31 -2
- package/dist/esm/lib/semantics/check.js +5 -3
- package/dist/esm/lib/semantics/check.js.map +1 -1
- package/dist/esm/lib/semantics/described.d.ts +34 -1
- package/dist/esm/lib/semantics/described.js +53 -3
- package/dist/esm/lib/semantics/described.js.map +1 -1
- package/dist/esm/lib/semantics/envelope.d.ts +27 -0
- package/dist/esm/lib/semantics/envelope.js +160 -51
- package/dist/esm/lib/semantics/envelope.js.map +1 -1
- package/dist/esm/lib/semantics/types.d.ts +12 -0
- package/dist/esm/lib/semantics/types.js.map +1 -1
- package/dist/esm/recorders/observability/BoundaryRecorder.js +1 -0
- package/dist/esm/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/events/dispatcher.js.map +1 -1
- package/dist/events/registry.js +8 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/answer-account/account.js +157 -22
- package/dist/lib/answer-account/account.js.map +1 -1
- package/dist/lib/answer-account/facts/howSure.js +17 -0
- package/dist/lib/answer-account/facts/howSure.js.map +1 -1
- package/dist/lib/answer-account/shown.js +5 -1
- package/dist/lib/answer-account/shown.js.map +1 -1
- package/dist/lib/answer-account/templates.js +10 -1
- package/dist/lib/answer-account/templates.js.map +1 -1
- package/dist/lib/semantics/check.js +5 -3
- package/dist/lib/semantics/check.js.map +1 -1
- package/dist/lib/semantics/described.js +55 -3
- package/dist/lib/semantics/described.js.map +1 -1
- package/dist/lib/semantics/envelope.js +165 -54
- package/dist/lib/semantics/envelope.js.map +1 -1
- package/dist/lib/semantics/types.js.map +1 -1
- package/dist/recorders/observability/BoundaryRecorder.js +1 -0
- package/dist/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/types/conventions.d.ts +24 -0
- package/dist/types/conventions.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +50 -6
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +98 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/serve.d.ts +27 -2
- package/dist/types/core/agent/arguments/serve.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/assess.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/compose.d.ts +128 -0
- package/dist/types/core/agent/assessment/compose.d.ts.map +1 -0
- package/dist/types/core/agent/assessment/reasons.d.ts +10 -6
- package/dist/types/core/agent/assessment/reasons.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/stage.d.ts +58 -0
- package/dist/types/core/agent/assessment/stage.d.ts.map +1 -0
- package/dist/types/core/agent/assessment/types.d.ts +28 -6
- package/dist/types/core/agent/assessment/types.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/witness.d.ts +129 -0
- package/dist/types/core/agent/assessment/witness.d.ts.map +1 -0
- package/dist/types/core/agent/buildAgentChart.d.ts +20 -1
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/absent.d.ts +17 -0
- package/dist/types/core/agent/coverage/absent.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/answer.d.ts +75 -6
- package/dist/types/core/agent/coverage/answer.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/evidence.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/index.d.ts +2 -1
- package/dist/types/core/agent/coverage/index.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/ledger.d.ts +8 -3
- package/dist/types/core/agent/coverage/ledger.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/period.d.ts +345 -0
- package/dist/types/core/agent/coverage/period.d.ts.map +1 -0
- package/dist/types/core/agent/coverage/read.d.ts +40 -2
- package/dist/types/core/agent/coverage/read.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/types.d.ts +57 -1
- package/dist/types/core/agent/coverage/types.d.ts.map +1 -1
- package/dist/types/core/agent/findings/judge.d.ts +1 -1
- package/dist/types/core/agent/findings/ledger.d.ts.map +1 -1
- package/dist/types/core/agent/findings/types.d.ts +10 -8
- package/dist/types/core/agent/findings/types.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/armed.d.ts +24 -3
- package/dist/types/core/agent/honesty/armed.d.ts.map +1 -1
- package/dist/types/core/agent/honesty/mounts.d.ts +120 -1
- package/dist/types/core/agent/honesty/mounts.d.ts.map +1 -1
- package/dist/types/core/agent/results/subflow.d.ts +156 -0
- package/dist/types/core/agent/results/subflow.d.ts.map +1 -0
- package/dist/types/core/agent/stages/answerCoverage.d.ts +35 -11
- package/dist/types/core/agent/stages/answerCoverage.d.ts.map +1 -1
- package/dist/types/core/agent/stages/prepareFinal.d.ts +49 -0
- package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
- package/dist/types/core/agent/stages/route.d.ts +19 -1
- package/dist/types/core/agent/stages/route.d.ts.map +1 -1
- package/dist/types/core/agent/stages/seed.d.ts +7 -0
- package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +25 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/stages/window.d.ts +3 -1
- package/dist/types/core/agent/stages/window.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +69 -5
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/runCheckpoint.d.ts +28 -1
- package/dist/types/core/runCheckpoint.d.ts.map +1 -1
- package/dist/types/events/dispatcher.d.ts +1 -1
- package/dist/types/events/dispatcher.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +146 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +7 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/answer-account/account.d.ts.map +1 -1
- package/dist/types/lib/answer-account/facts/howSure.d.ts.map +1 -1
- package/dist/types/lib/answer-account/shown.d.ts.map +1 -1
- package/dist/types/lib/answer-account/templates.d.ts +7 -1
- package/dist/types/lib/answer-account/templates.d.ts.map +1 -1
- package/dist/types/lib/answer-account/types.d.ts +31 -2
- package/dist/types/lib/answer-account/types.d.ts.map +1 -1
- package/dist/types/lib/semantics/check.d.ts.map +1 -1
- package/dist/types/lib/semantics/described.d.ts +34 -1
- package/dist/types/lib/semantics/described.d.ts.map +1 -1
- package/dist/types/lib/semantics/envelope.d.ts +27 -0
- package/dist/types/lib/semantics/envelope.d.ts.map +1 -1
- package/dist/types/lib/semantics/types.d.ts +12 -0
- package/dist/types/lib/semantics/types.d.ts.map +1 -1
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts.map +1 -1
- package/package.json +2 -1
package/AGENTS.md
CHANGED
|
@@ -246,6 +246,16 @@ execute: ({ vm, summary }) => {
|
|
|
246
246
|
},
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
+
All three take a `period` — what time the READ covered: `{ queried: { from, to }, held:
|
|
250
|
+
{ from, to } | 'unknown', readAt? }`, ISO 8601 instants WITH a zone, computed by the tool
|
|
251
|
+
from its own data (the library never parses "last hour"). `absent()` also takes
|
|
252
|
+
`describedResult()`'s `provenance: { measuredAt, source }`. The results layer files one
|
|
253
|
+
verdict per call (`covered` · `partly-held` · `not-held` · `unknown` · `undeclared`) and
|
|
254
|
+
the answer's standing reads "not sure" for all but `covered`; a tool that declares a period
|
|
255
|
+
argument (`defineTool({ …, period: { argument: 'window' } })`, needs an `askOrAssume` rule)
|
|
256
|
+
arms it and gets `undeclared` when its result says nothing; `.resultsLayer()` arms it for
|
|
257
|
+
tools that declare a period only on their results.
|
|
258
|
+
|
|
249
259
|
`describedResult()` is camelCase throughout (`measuredAt`, `ageSeconds`, `isCounter`,
|
|
250
260
|
`filterNote`); the envelope the model reads stays snake_case. Series need `grain`
|
|
251
261
|
(`{ interval, aggregation, isCounter }` — state `isCounter` for `sum`/`count`-like
|
|
@@ -254,7 +264,10 @@ refusal. `semantic()` is the deprecated name for the same envelope with a snake_
|
|
|
254
264
|
declaration — do not use it in new code.
|
|
255
265
|
|
|
256
266
|
A helper that cannot honor its declaration throws inside `execute`: the model reads text
|
|
257
|
-
starting `refused: ` in place of the data, and the run continues.
|
|
267
|
+
starting `refused: ` in place of the data, and the run continues. A data list is never
|
|
268
|
+
empty — `describedResult({ facts: [] })` is refused with "`facts` is empty — if nothing
|
|
269
|
+
matched, return absent({ what, checked }) instead" — so every `execute` that returns rows
|
|
270
|
+
writes both branches: `rows.length ? describedResult({ … }) : absent({ … })`. An absence gets the
|
|
258
271
|
delivered status `'absent'` (route it with `onToolStatus: 'absent'`) and grounds only its
|
|
259
272
|
COVERAGE in the evidence gate — so an id the model invented does not become grounded by one
|
|
260
273
|
lookup that found nothing. It is never an error: nothing retries it, nothing refuses it, no
|
|
@@ -275,7 +288,7 @@ const agent = Agent.create({ provider, model })
|
|
|
275
288
|
agent.on('agentfootprint.context.evaluated', (e) => console.log(e.payload.activeIds));
|
|
276
289
|
```
|
|
277
290
|
|
|
278
|
-
**
|
|
291
|
+
**124 typed events across 28 domains.** Two subscription shapes and no third:
|
|
279
292
|
`'*'` (every event) and `'agentfootprint.<domain>.*'` (one domain). **`'agentfootprint.*'`
|
|
280
293
|
is not a pattern** — TypeScript rejects it, and at runtime it would match nothing.
|
|
281
294
|
|
package/CAPABILITIES.md
CHANGED
|
@@ -26,7 +26,7 @@ not in this table, search `src/index.ts` for the nearest noun before writing cod
|
|
|
26
26
|
| speaking MCP from a BROWSER — the SDK is browser-clean (its client + streamableHttp bundle at `platform:'browser'` with zero `node:` edges and never pull in `client/stdio.js`); the one barrier was that `lazyRequire` gets CALLED there, so the fix is to let the caller supply what the loader would have found | `mcpClient({ sdk })` (`McpSdk` = the two SDK modules you imported statically; the library STILL builds the transport, so headers/fetch/gateway vending/`retryOnThrottle`/`_meta` all keep working) · `mcpClient({ connection })` (`McpConnection` = listTools/callTool/close, deliberately NO `connect` — you already did; the only arm that reaches the SDK's `jsonSchemaValidator`, i.e. CSP) + `McpConnectionOptions`; `refuseConflictingOptions` REFUSES at construction every option a transport would have consumed, naming where it moved (a knob naming a behaviour that no longer happens is the defect class); `transportUrl` resolves a relative `url` against `globalThis.location.href` (absolute takes the identical branch, Node refuses by name); `sdkLoadFailure` classifies the seven load sites so a browser is never told to install a package it has (resolution failure ⇒ byte-identical historical message); `retryingFetch` + `ThrottleFetch` promoted out of `@internal` so the connection arm keeps its 429 handling. stdio keeps `lazyRequire` FOREVER — it spawns a subprocess. ZERO packaging change: no subpath, no `browser` condition (TypeScript is blind to it), peer stays optional (no literal dynamic `import()`). Fenced by `test/lib/mcp/browserGraph.test.ts` | `src/lib/mcp/` | 9.81.0 |
|
|
27
27
|
| calling ANOTHER registered tool from inside a tool's `execute` — composition over the agent's own dispatch map instead of importing the module and building a second query stack | `agentToolDispatch` + `ctx.tools` (ToolDispatch has/call) — sees static and skill-carried tools, NEVER ToolProvider-delivered ones (no build-time list, the 9.72.0 caveat); inner calls get the outer facts with hasArtifacts false and a derived toolCallId, `needs` resolved fail-closed non-interactively, `checkIn` and `wants` tools refused by name, no nested dispatch; declare ingredients via `composedOf` (and `gates` for a pausing procedure) — both travel MCP `_meta` | `src/core/agent/toolDispatch.ts` | 9.76.0 |
|
|
28
28
|
| a tool returning numbers WITH the caveats that make them honest — interval/aggregation grain, is-it-a-counter, when the world was measured, which ground was NOT covered — as typed data the model reads compactly and the record keeps whole | `semantic()` + `tools.semantics_declared` (model sees `semanticsForModel` projection; `coverage` field absorbed by the coverage()/absent() channel; `semantic()` is the deprecated name — use `describedResult()`, next row) | `src/lib/semantics/` | 9.53.0 |
|
|
29
|
-
| the same typed tool result declared in ONE spelling — camelCase `measuredAt`/`isCounter`/`filterNote`, respelled to the unchanged snake_case wire — with a missing source a COMPILE error; which result helper to return (rows → describedResult, a value with limits → coverage, nothing → absent) | `describedResult()` + `DescribedResultDeclaration` (`provenance` required whenever `series`/`facts` is present; the snake_case spelling refused, naming the camelCase one) | `src/lib/semantics/described.ts` | 9.119.0 |
|
|
29
|
+
| the same typed tool result declared in ONE spelling — camelCase `measuredAt`/`isCounter`/`filterNote`, respelled to the unchanged snake_case wire — with a missing source a COMPILE error; which result helper to return (rows → describedResult, a value with limits → coverage, nothing → absent); an EMPTY data list refused with the branch to write ("if nothing matched, return absent({ what, checked }) instead"), both doors and the gate | `describedResult()` + `DescribedResultDeclaration` (`provenance` required whenever `series`/`facts` is present; the snake_case spelling refused, naming the camelCase one) | `src/lib/semantics/described.ts` | 9.119.0, empty-list refusal 9.125.0 |
|
|
30
30
|
| a build gate that refuses a triage/inventory tool that forgot its caveats, by tool name and field name | `checkSemantics` + `defineTool({ resultClass })` (`'triage'`/`'inventory'`, the closed set) + bin `agentfootprint-check-semantics` | `src/lib/semantics/check.ts` | 9.53.0 |
|
|
31
31
|
| an agent that runs out of `maxIterations` mid-task handing back a HALF-SENTENCE as its answer — and nothing saying the budget ran out | `wrapUpAtMaxIterations` (default ON) + `WRAP_UP_INSTRUCTION` + `agent.budget_exhausted` + `stoppedEarly.wrappedUp` | `src/core/agent/stages/wrapUp.ts` | 9.56.0 |
|
|
32
32
|
| the conversation outgrowing the context window — dropping, summarizing or token-budgeting old turns, every removal on the record (the three refusal rows below all guard this window) | `.window()` + `slidingWindow` / `summarizeOldest` (= `.compaction()`) / `tokenBudget` + `keepRecentTurns` (default 6) + `thresholdTokens` (required, deliberately no default) + `retain: 'conversation'` (default) / `'discard'` | `src/core/agent/window/` | 7.17.0 |
|
|
@@ -71,7 +71,9 @@ not in this table, search `src/index.ts` for the nearest noun before writing cod
|
|
|
71
71
|
| explaining ONE answer to a person in plain words — what was asked, how it was routed, what each tool checked and did not check, what it found, how sure, and anything wrong — every line from the record by a fixed versioned template (never a model), each with its template id and who vouches for it (person / library / tool / model / app), "not recorded" instead of a guess, own-run events only, three checks with the ones that could not run said aloud | `accountForAnswer` + `AnswerAccount` | `src/lib/answer-account/` | 9.116.0 |
|
|
72
72
|
| a tool whose default NOBODY CHOSE (a log search that quietly defaults to 2 hours) — the LIBRARY fills a value the call left out from the tool's declared rule, never the tool; files one `argument` row per ruled argument per call on the findings ledger (`source: 'default'` filled or echoed — `proposed` tells them apart — or `'model'`), stamped with the conversation `turn`; tells the model in a past-tense note (only for a value the call ran with) behind a `toolChars` boundary every reader of a result reads through, so the note grounds nothing and hides no empty result; the answer's standing reads "not sure — assumed"; an "Assumed" block under `.limitsTravelWithTheAnswer()`; carried over MCP `_meta`; a ruled tool on an agent without the layer is REFUSED before any middleware asks, never run unruled; `{ ask }` is the batch ask (next row) | `Tool.askOrAssume` + `Tool.period` (`ToolPeriod`) + `ArgumentRow` + `agentfootprint.findings.argument` + `AgentBuilder.inputsLayer()` + `allow(value, why, { from })` | `src/core/agent/arguments/` | 9.122.0 |
|
|
73
73
|
| a value the PERSON must give (a look-back period, a site, a row limit) that the model left out — the library asks ONCE for everything the batch needs, before anything in it runs, through the typed ask `requestInput` uses (`isInputPause`, `agent.resume(cp, { requestId, values })`, `standingAgent`): one field per distinct (tool, argument), positional ids, the author's question and choices, `context.agentfootprint` naming each field's calls, one period asked once across spellings (`24h` ↔ `-24h`); the answer re-checked against the property's own schema and asked again (at most three times) when it does not fit; `asked` then `answered` rows; the standing reads "ask" while it waits (`argument-asked`); the resume adds no model call; one human question per resume — a call refused a second pause in the batch that asked keeps the person's answer, so proposed again it runs with it and pauses for its own step (the person is asked once); the resume event carries the reply's shape, never a value | `askOrAssume: { x: { ask, choices? } }` + `argumentAskContext` + `ArgumentRow` (`asked`, `answered`, `free`) | `src/core/agent/arguments/` | 9.123.0 |
|
|
74
|
+
| a result that does not say WHAT TIME its read covered — "no failed backups in the last hour" answered from an export that ends at 02:00 — the result declares its period on the doors it already returns (`absent()`, `coverage()`, `describedResult()`: `period: { queried, held, readAt? }` with `held` a range or `'unknown'`, ISO 8601 instants with a zone, never parsed durations) and an absence its source and time (`provenance`, `describedResult()`'s shape); one rule set refuses a malformed one at the mint and reads a foreign one without repair; the coverage channel carries it (`coverageDeclared`, `tools.absent` / `tools.coverage_declared`); the results layer (`src/core/agent/results/`) at the loop head files ONE verdict per call — covered · partly-held · not-held · unknown · undeclared (a tool with a period argument whose result said nothing) — and the answer's standing reads "not sure" for all but covered, joined to the inputs layer's row for who chose the period; a `Period:` line under `.limitsTravelWithTheAnswer()` and `periods` in a typed answer's limits; `canonical-notes.json` publishes the wire spelling for foreign minters | `period` on `absent`/`coverage`/`describedResult` + `DeclaredPeriod` + `periodVerdict` + `PeriodRow` + `PERIOD_WIRE` + `AgentBuilder.resultsLayer()` + `agentfootprint.findings.period` | `src/core/agent/coverage/period.ts` | 9.125.0 |
|
|
74
75
|
| how far an answer STANDS — known · consistent with the record · not sure (with the reasons) · ask · not assessed — folded from the run's COMMITTED record (never from the model's confidence, never from events, never "known" from silence: only a passed enforce answer check supports it); each reason names the row it rests on, `checked` counts what ran, this turn only; a pause of any kind reads `ask` from the recording alone, a run with no answer has no standing; one emptiness reader shared with the answer account (`coverage/emptiness.ts`: a `coverage()` envelope read through, a described result counted, an undeclared empty rowset said aloud) | `assessAnswer` + `AnswerAssessment` (on the observe door), `agent.assessment()` | `src/core/agent/assessment/` | 9.120.0 |
|
|
76
|
+
| the answer's standing INSIDE the run, the moment the answer exists — the same fold as `agent.assessment()`, run as the first stage of the final branch and served as DATA (`turn_end` and one event: the value, its word, the reason kinds, the checks that ran — never a value or a quote); the evidence gate's clean pass and an answer given before a skill's declared steps finished committed as witness rows (so a clean gate reads "consistent", never "known"); an opt-in line appended to a PROSE answer (refused beside `.answerValidation()` and `.outputSchema()`); the in-run standing equals the fold of the saved recording; a typed answer's limits carry the values a tool's rule assumed | `AgentBuilder.answerLayer({ standingLine? })` + `turn_end.answerAssessment` + `agentfootprint.answer.assessed` + `GroundedRow` / `StepsUnfinishedRow` + `AnswerCoverage.assumed` | `src/core/agent/assessment/` | 9.124.0 |
|
|
75
77
|
| serving that explanation to a browser without the recording: one opt-in wire op returns the account plus allow-listed "show me" leaves, owner-only on the `artifact-get` path, lane-free, cached and single-flight, a stated size ceiling, and a swept record answering "not available" even when cached | `standingAgent({ answerAccounts })` + `{ op: 'answer-account', ref }` + `answerAccountPointerKey` | `src/hosting/answerAccounts.ts` | 9.116.0 |
|
|
76
78
|
| bounding what one session can ask of the artifact door at once: `artifact-head`, `artifact-get` and `answer-account` counted together per session, after the ownership check, refused 429 by name while every other session is served | `standingAgent({ artifactOpsPerSession })` + `ArtifactOpsBusyError` | `src/hosting/standingAgent.ts` | 9.116.0 |
|
|
77
79
|
| minting one of those shapes from a tool that is NOT JavaScript — the canonical note sentences and reserved marker keys as DATA, so a Python/Go/Rust sidecar reads a file instead of regex-scraping `dist/esm` (which a consumer really did) | `canonical-notes.json` at the package root + the `./canonical-notes.json` exports entry, GENERATED from the built barrel by `scripts/gen-canonical-notes.mjs` | `scripts/gen-canonical-notes.mjs` | 9.70.0 |
|
|
@@ -246,6 +246,16 @@ execute: ({ vm, summary }) => {
|
|
|
246
246
|
},
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
+
All three take a `period` — what time the READ covered: `{ queried: { from, to }, held:
|
|
250
|
+
{ from, to } | 'unknown', readAt? }`, ISO 8601 instants WITH a zone, computed by the tool
|
|
251
|
+
from its own data (the library never parses "last hour"). `absent()` also takes
|
|
252
|
+
`describedResult()`'s `provenance: { measuredAt, source }`. The results layer files one
|
|
253
|
+
verdict per call (`covered` · `partly-held` · `not-held` · `unknown` · `undeclared`) and
|
|
254
|
+
the answer's standing reads "not sure" for all but `covered`; a tool that declares a period
|
|
255
|
+
argument (`defineTool({ …, period: { argument: 'window' } })`, needs an `askOrAssume` rule)
|
|
256
|
+
arms it and gets `undeclared` when its result says nothing; `.resultsLayer()` arms it for
|
|
257
|
+
tools that declare a period only on their results.
|
|
258
|
+
|
|
249
259
|
`describedResult()` is camelCase throughout (`measuredAt`, `ageSeconds`, `isCounter`,
|
|
250
260
|
`filterNote`); the envelope the model reads stays snake_case. Series need `grain`
|
|
251
261
|
(`{ interval, aggregation, isCounter }` — state `isCounter` for `sum`/`count`-like
|
|
@@ -254,7 +264,10 @@ refusal. `semantic()` is the deprecated name for the same envelope with a snake_
|
|
|
254
264
|
declaration — do not use it in new code.
|
|
255
265
|
|
|
256
266
|
A helper that cannot honor its declaration throws inside `execute`: the model reads text
|
|
257
|
-
starting `refused: ` in place of the data, and the run continues.
|
|
267
|
+
starting `refused: ` in place of the data, and the run continues. A data list is never
|
|
268
|
+
empty — `describedResult({ facts: [] })` is refused with "`facts` is empty — if nothing
|
|
269
|
+
matched, return absent({ what, checked }) instead" — so every `execute` that returns rows
|
|
270
|
+
writes both branches: `rows.length ? describedResult({ … }) : absent({ … })`. An absence gets the
|
|
258
271
|
delivered status `'absent'` (route it with `onToolStatus: 'absent'`) and grounds only its
|
|
259
272
|
COVERAGE in the evidence gate — so an id the model invented does not become grounded by one
|
|
260
273
|
lookup that found nothing. It is never an error: nothing retries it, nothing refuses it, no
|
|
@@ -275,7 +288,7 @@ const agent = Agent.create({ provider, model })
|
|
|
275
288
|
agent.on('agentfootprint.context.evaluated', (e) => console.log(e.payload.activeIds));
|
|
276
289
|
```
|
|
277
290
|
|
|
278
|
-
**
|
|
291
|
+
**124 typed events across 28 domains.** Two subscription shapes and no third:
|
|
279
292
|
`'*'` (every event) and `'agentfootprint.<domain>.*'` (one domain). **`'agentfootprint.*'`
|
|
280
293
|
is not a pattern** — TypeScript rejects it, and at runtime it would match nothing.
|
|
281
294
|
|
package/canonical-notes.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "GENERATED by scripts/gen-canonical-notes.mjs from this package's own built exports - do not edit by hand. These are the strings a tool written in another language must reproduce byte for byte: the static notes each result shape carries, the reserved marker keys that make those shapes recognizable,
|
|
2
|
+
"$comment": "GENERATED by scripts/gen-canonical-notes.mjs from this package's own built exports - do not edit by hand. These are the strings a tool written in another language must reproduce byte for byte: the static notes each result shape carries, the reserved marker keys that make those shapes recognizable, the coverage block's heading, and the wire spelling of a result's period (every reserved key and the literal 'unknown'). Keys are the exported constant names, so the same value is reachable as a TypeScript import from the package's main entry point. The package version lives in package.json.",
|
|
3
3
|
"notes": {
|
|
4
4
|
"ABSENCE_NOTE": "The search ran and matched nothing. This is an ANSWER, not an error: nothing failed, nothing was substituted for what was asked, and calling this tool again with the same arguments returns this same result. `checked` is the ground this answer covers; anything under `not_checked` or `cannot_cover` is ground it does NOT cover, and reaching that needs a different question, not a retry.",
|
|
5
5
|
"COVERAGE_NOTE": "This result covers only what `checked` lists. `not_checked` is ground the call this result answers did not look at, and `cannot_cover` is ground this tool can never see — a clean result here is NOT evidence about either, and no retry changes `cannot_cover`. Carry these limits into any answer you build on this result.",
|
|
@@ -12,5 +12,16 @@
|
|
|
12
12
|
},
|
|
13
13
|
"headings": {
|
|
14
14
|
"COVERAGE_BLOCK_HEADING": "Coverage of this answer"
|
|
15
|
+
},
|
|
16
|
+
"wire": {
|
|
17
|
+
"PERIOD_WIRE": {
|
|
18
|
+
"key": "period",
|
|
19
|
+
"queried": "queried",
|
|
20
|
+
"held": "held",
|
|
21
|
+
"from": "from",
|
|
22
|
+
"to": "to",
|
|
23
|
+
"readAt": "read_at",
|
|
24
|
+
"heldUnknown": "unknown"
|
|
25
|
+
}
|
|
15
26
|
}
|
|
16
27
|
}
|
package/dist/conventions.js
CHANGED
|
@@ -67,6 +67,14 @@ exports.SUBFLOW_IDS = {
|
|
|
67
67
|
* per call and handing ToolCalls the values the library fills. Absent on
|
|
68
68
|
* every other agent — the chart is byte-identical. */
|
|
69
69
|
INPUTS: 'sf-inputs',
|
|
70
|
+
/** The results layer (honesty layer 3, step 7b) — mounted at the LOOP HEAD
|
|
71
|
+
* (before `Compact`, which it precedes as the loop target) ONLY when armed
|
|
72
|
+
* (a registered tool declares a `ToolPeriod`, or the agent was built with
|
|
73
|
+
* `.resultsLayer()`). Reads the batch ToolCalls just ran — Declare → Verify
|
|
74
|
+
* → Record → Resolve — and files one `period` row per call that declared a
|
|
75
|
+
* period or whose tool declares a `ToolPeriod`. Absent on every other agent
|
|
76
|
+
* — the chart is byte-identical. */
|
|
77
|
+
RESULTS: 'sf-results',
|
|
70
78
|
};
|
|
71
79
|
// ─── The reserved subflow namespace ──────────────────────────────────
|
|
72
80
|
/**
|
|
@@ -224,6 +232,22 @@ exports.STAGE_IDS = {
|
|
|
224
232
|
RECORD_ARGUMENTS: 'record-arguments',
|
|
225
233
|
/** … and the fills and refusals ToolCalls applies. */
|
|
226
234
|
RESOLVE_ARGUMENTS: 'resolve-arguments',
|
|
235
|
+
/** The results layer's four stages, inside `sf-results` (honesty layer 3):
|
|
236
|
+
* which calls of the batch just run declared a period, or come from a tool
|
|
237
|
+
* that declares a `ToolPeriod` … */
|
|
238
|
+
DECLARE_RESULTS: 'declare-results',
|
|
239
|
+
/** … the verdict on each one's period … */
|
|
240
|
+
VERIFY_RESULTS: 'verify-results',
|
|
241
|
+
/** … one `period` row per call, and its event … */
|
|
242
|
+
RECORD_RESULTS: 'record-results',
|
|
243
|
+
/** … and what the layer does about them: flag (the rows are the flags). */
|
|
244
|
+
RESOLVE_RESULTS: 'resolve-results',
|
|
245
|
+
/** The answer layer (honesty layer 4) — mounted as the FIRST stage of the
|
|
246
|
+
* final branch ONLY when armed (`.answerLayer()`): the answer's standing,
|
|
247
|
+
* folded from the committed record, filed as data for PrepareFinal and
|
|
248
|
+
* announced once (`agentfootprint.answer.assessed`). Absent on every other
|
|
249
|
+
* agent — the final branch starts at PrepareFinal, byte-identical. */
|
|
250
|
+
ASSESS_ANSWER: 'assess-answer',
|
|
227
251
|
};
|
|
228
252
|
// ─── Type guards ─────────────────────────────────────────────────────
|
|
229
253
|
/** True when a subflow id corresponds to one of the 3 context slots. */
|
|
@@ -310,6 +334,18 @@ const PLUMBING_LOCAL_IDS = new Set([
|
|
|
310
334
|
exports.STAGE_IDS.VERIFY_ARGUMENTS,
|
|
311
335
|
exports.STAGE_IDS.RECORD_ARGUMENTS,
|
|
312
336
|
exports.STAGE_IDS.RESOLVE_ARGUMENTS,
|
|
337
|
+
// The results layer (honesty layer 3): its verdicts ride the ledger's
|
|
338
|
+
// `period` rows and `agentfootprint.findings.period`; the mount and its
|
|
339
|
+
// stages are mechanism.
|
|
340
|
+
exports.SUBFLOW_IDS.RESULTS,
|
|
341
|
+
exports.STAGE_IDS.DECLARE_RESULTS,
|
|
342
|
+
exports.STAGE_IDS.VERIFY_RESULTS,
|
|
343
|
+
exports.STAGE_IDS.RECORD_RESULTS,
|
|
344
|
+
exports.STAGE_IDS.RESOLVE_RESULTS,
|
|
345
|
+
// The answer layer (honesty layer 4): its verdict rides `turn_end` and
|
|
346
|
+
// `agentfootprint.answer.assessed`; the stage that folds it is mechanism —
|
|
347
|
+
// the answer itself is PrepareFinal's milestone, one stage later.
|
|
348
|
+
exports.STAGE_IDS.ASSESS_ANSWER,
|
|
313
349
|
]);
|
|
314
350
|
/** Neutral chart boundaries — entry/exit, rendered normally (not muted). */
|
|
315
351
|
const BOUNDARY_LOCAL_IDS = new Set([
|
|
@@ -391,6 +427,10 @@ const MILESTONES = new Map([
|
|
|
391
427
|
// library filled a value the call left out — a stop a reader scrubs to when
|
|
392
428
|
// asking whose value a call ran with.
|
|
393
429
|
[exports.SUBFLOW_IDS.INPUTS, milestone('decision', 'Inputs')],
|
|
430
|
+
// The results layer (honesty layer 3), mounted only when armed at the loop
|
|
431
|
+
// head: where the record says what the batch just run covered in time — a
|
|
432
|
+
// stop a reader scrubs to when asking whether the data held the period.
|
|
433
|
+
[exports.SUBFLOW_IDS.RESULTS, milestone('decision', 'Results')],
|
|
394
434
|
// The answer failed its schema and the loop asked again — a stop worth
|
|
395
435
|
// scrubbing to, because everything after it is a second attempt.
|
|
396
436
|
[exports.STAGE_IDS.OUTPUT_RETRY, milestone('decision', 'Schema retry')],
|
package/dist/conventions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conventions.js","sourceRoot":"","sources":["../src/conventions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,6CAAiD;AAGjD,gEAAgE;AACnD,QAAA,WAAW,GAAG;IACzB;0EACsE;IACtE,gBAAgB,EAAE,qBAAqB;IACvC;;qDAEiD;IACjD,QAAQ,EAAE,aAAa;IACvB,+DAA+D;IAC/D,aAAa,EAAE,kBAAkB;IACjC,6BAA6B;IA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Q,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,IAAI,IAAI,CAAC;IACvF,OAAO,EAAE,IAAI,EAAE,IAAqB,EAAE,KAAK,EAAE,CAAC;AAChD,CAAC;AAlBD,8CAkBC;AAED;;;;;;;;GAQG;AACU,QAAA,cAAc,GAAG;IAC5B,aAAa,EAAE,wBAAwB;IACvC,QAAQ,EAAE,oBAAoB;IAC9B,KAAK,EAAE,iBAAiB;CAChB,CAAC;AAIX,6CAA6C;AAC7C,SAAgB,mBAAmB,CAAC,IAA4C;IAC9E,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,eAAe;YAClB,OAAO,sBAAc,CAAC,aAAa,CAAC;QACtC,KAAK,UAAU;YACb,OAAO,sBAAc,CAAC,QAAQ,CAAC;QACjC,KAAK,OAAO;YACV,OAAO,sBAAc,CAAC,KAAK,CAAC;IAChC,CAAC;AACH,CAAC;AATD,kDASC;AAED,gEAAgE;AAChE,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAQ,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACnE,CAAC;AAFD,wCAEC"}
|
package/dist/core/Agent.js
CHANGED
|
@@ -168,6 +168,7 @@ const toolResolver_js_1 = require("./agent/stages/toolResolver.js");
|
|
|
168
168
|
const route_js_2 = require("./agent/stages/route.js");
|
|
169
169
|
const declare_js_1 = require("./agent/arguments/declare.js");
|
|
170
170
|
const armed_js_1 = require("./agent/honesty/armed.js");
|
|
171
|
+
const mounts_js_1 = require("./agent/honesty/mounts.js");
|
|
171
172
|
const toolResultCap_js_1 = require("./agent/toolResultCap.js");
|
|
172
173
|
const buildAgentChart_js_1 = require("./agent/buildAgentChart.js");
|
|
173
174
|
const buildDynamicAgentChart_js_1 = require("./agent/buildDynamicAgentChart.js");
|
|
@@ -339,6 +340,22 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
339
340
|
* `.inputsLayer()` was set. Gates the findings event bridge and the
|
|
340
341
|
* widened ledger restore. */
|
|
341
342
|
inputsLayerArmed = false;
|
|
343
|
+
/** `.resultsLayer()` (honesty layer 3, step 7b): mount the results layer
|
|
344
|
+
* even when no registered tool declares a `ToolPeriod` — for tools a
|
|
345
|
+
* ToolProvider serves, and for tools that declare a period only on their
|
|
346
|
+
* results. */
|
|
347
|
+
resultsLayerOption;
|
|
348
|
+
/** Whether this agent's chart mounts the results layer (`sf-results`) —
|
|
349
|
+
* decided ONCE, in `buildChart`: a registered tool declares a `ToolPeriod`,
|
|
350
|
+
* or `.resultsLayer()` was set. Gates the findings event bridge and the
|
|
351
|
+
* widened ledger restore, as the inputs layer's flag does. */
|
|
352
|
+
resultsLayerArmed = false;
|
|
353
|
+
/** `.answerLayer()` (honesty layer 4): the answer's standing folded at the
|
|
354
|
+
* head of the final branch and served as data; `standingLine` — also one
|
|
355
|
+
* line appended to a prose answer. Undefined on every agent that did not
|
|
356
|
+
* ask, and that undefined is the whole zero-cost guarantee: no stage, no
|
|
357
|
+
* witness row, no stamp, no event, no bridge. */
|
|
358
|
+
answerLayerOption;
|
|
342
359
|
/** Tool choice by classifier (9.105.0, `.toolChoice()`): the classifier,
|
|
343
360
|
* the serve dial and the app's own doors. Threaded to the tools slot (the
|
|
344
361
|
* pick and the narrowing), to call-llm (`toolChoice: true`, the outcome
|
|
@@ -758,6 +775,13 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
758
775
|
this.findingsOptions = opts.findings;
|
|
759
776
|
if (opts.inputsLayer === true)
|
|
760
777
|
this.inputsLayerOption = true;
|
|
778
|
+
if (opts.resultsLayer === true)
|
|
779
|
+
this.resultsLayerOption = true;
|
|
780
|
+
if (opts.answerLayer === true)
|
|
781
|
+
this.answerLayerOption = {};
|
|
782
|
+
else if (typeof opts.answerLayer === 'object' && opts.answerLayer !== null) {
|
|
783
|
+
this.answerLayerOption = opts.answerLayer.standingLine === true ? { standingLine: true } : {};
|
|
784
|
+
}
|
|
761
785
|
if (opts.argumentAskContext !== undefined)
|
|
762
786
|
this.argumentAskContext = opts.argumentAskContext;
|
|
763
787
|
if (opts.toolChoice !== undefined)
|
|
@@ -1582,7 +1606,10 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
1582
1606
|
this.continuityCursorOf(this.getLastSnapshot()?.sharedState), this.evidenceRecoveryOf(this.getLastSnapshot()?.sharedState),
|
|
1583
1607
|
// …and the findings ledger (9.101.0), from the same snapshot reader
|
|
1584
1608
|
// `checkpoint()` uses — one reader, two carriers.
|
|
1585
|
-
this.findingsLedgerOf(this.getLastSnapshot()?.sharedState)
|
|
1609
|
+
this.findingsLedgerOf(this.getLastSnapshot()?.sharedState),
|
|
1610
|
+
// …and the turn the failing run was on (honesty layers), so the
|
|
1611
|
+
// retry is stamped the same turn — one reader, two carriers.
|
|
1612
|
+
this.turnNumberOf(this.getLastSnapshot()?.sharedState));
|
|
1586
1613
|
throw new runCheckpoint_js_1.RunCheckpointError(cause, checkpoint);
|
|
1587
1614
|
}
|
|
1588
1615
|
throw cause;
|
|
@@ -2086,6 +2113,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
2086
2113
|
const skillCursor = this.continuityCursorOf(state);
|
|
2087
2114
|
const evidenceRecovery = this.evidenceRecoveryOf(state);
|
|
2088
2115
|
const findingsLedger = this.findingsLedgerOf(state);
|
|
2116
|
+
const turnNumber = this.turnNumberOf(state);
|
|
2089
2117
|
return {
|
|
2090
2118
|
version: 1,
|
|
2091
2119
|
runId: this.currentRunContext.runId,
|
|
@@ -2108,6 +2136,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
2108
2136
|
// The model's standings (9.101.0) — absent unless the run recorded any,
|
|
2109
2137
|
// by the `folded` rule: an optional key, never a format change.
|
|
2110
2138
|
...(findingsLedger !== undefined && { findingsLedger }),
|
|
2139
|
+
// The turn this history ends on (honesty layers) — absent unless a
|
|
2140
|
+
// layer is armed, so every other checkpoint keeps its byte shape.
|
|
2141
|
+
...(turnNumber !== undefined && { turnNumber }),
|
|
2111
2142
|
};
|
|
2112
2143
|
}
|
|
2113
2144
|
/** Both checkpoint doors keep the repair budget separately from conversation text. */
|
|
@@ -2175,6 +2206,22 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
2175
2206
|
return undefined;
|
|
2176
2207
|
return structuredClone(ledger);
|
|
2177
2208
|
}
|
|
2209
|
+
/**
|
|
2210
|
+
* The turn a checkpoint's history ends on — `findingsLedgerOf`'s twin, one
|
|
2211
|
+
* reader for `checkpoint()` and the crash carrier. Only while an honesty
|
|
2212
|
+
* layer is armed (the run constant `honestyLayers`, read from the same
|
|
2213
|
+
* snapshot): that is when every ledger row carries its `turn` and the next
|
|
2214
|
+
* run's stamp must continue from it (`AgentRunCheckpoint.turnNumber`).
|
|
2215
|
+
* `undefined` otherwise, so the key stays absent.
|
|
2216
|
+
*
|
|
2217
|
+
* @internal
|
|
2218
|
+
*/
|
|
2219
|
+
turnNumberOf(state) {
|
|
2220
|
+
if (state?.honestyLayers === undefined)
|
|
2221
|
+
return undefined;
|
|
2222
|
+
const turn = state.turnNumber;
|
|
2223
|
+
return typeof turn === 'number' && Number.isSafeInteger(turn) && turn >= 1 ? turn : undefined;
|
|
2224
|
+
}
|
|
2178
2225
|
/**
|
|
2179
2226
|
* The two owner facts every conversation carrier stamps — who the run was
|
|
2180
2227
|
* for, and which agent ran it (9.2.0).
|
|
@@ -2221,6 +2268,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
2221
2268
|
this.pendingResumeHistory = {
|
|
2222
2269
|
history: cp.history,
|
|
2223
2270
|
appendsUserTurn,
|
|
2271
|
+
// The turn the stored history ends on (honesty layers) — seed continues
|
|
2272
|
+
// the turn stamp from it only while a layer is armed.
|
|
2273
|
+
...(cp.turnNumber !== undefined && { turn: cp.turnNumber }),
|
|
2224
2274
|
};
|
|
2225
2275
|
// The folded spans beside it. A conversation stored before 8.2 has none,
|
|
2226
2276
|
// and `undefined` is the right answer there — it means "this conversation
|
|
@@ -2815,8 +2865,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
2815
2865
|
// per-event work, and `agent.on('agentfootprint.findings.*')` can only
|
|
2816
2866
|
// ever fire on an agent that could have filed a row.
|
|
2817
2867
|
// Also under the inputs layer (honesty layer 2): its `argument` rows are
|
|
2818
|
-
// filed through the same writer and ride the same domain
|
|
2819
|
-
|
|
2868
|
+
// filed through the same writer and ride the same domain — and under the
|
|
2869
|
+
// results layer (honesty layer 3), whose `period` rows do the same.
|
|
2870
|
+
if (this.findingsOptions !== undefined || this.inputsLayerArmed || this.resultsLayerArmed) {
|
|
2820
2871
|
attachObserver(new EmitBridge_js_1.EmitBridge({
|
|
2821
2872
|
id: 'agentfootprint.findings-bridge',
|
|
2822
2873
|
prefix: 'agentfootprint.findings.',
|
|
@@ -2824,6 +2875,17 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
2824
2875
|
getRunContext: getRunCtx,
|
|
2825
2876
|
}));
|
|
2826
2877
|
}
|
|
2878
|
+
// Same wiring for `agentfootprint.answer.*` (honesty layer 4) — the one
|
|
2879
|
+
// event the answer layer's stage fires per answer. Attached only under
|
|
2880
|
+
// `.answerLayer()`, shipped WITH the domain (the credential.* lesson).
|
|
2881
|
+
if (this.answerLayerOption !== undefined) {
|
|
2882
|
+
attachObserver(new EmitBridge_js_1.EmitBridge({
|
|
2883
|
+
id: 'agentfootprint.answer-bridge',
|
|
2884
|
+
prefix: 'agentfootprint.answer.',
|
|
2885
|
+
dispatcher,
|
|
2886
|
+
getRunContext: getRunCtx,
|
|
2887
|
+
}));
|
|
2888
|
+
}
|
|
2827
2889
|
// Same wiring for `agentfootprint.tool_choice.*` (9.105.0) — the three
|
|
2828
2890
|
// events `recordToolChoice` files on scope. Attached only under
|
|
2829
2891
|
// `.toolChoice()`, for the same reason.
|
|
@@ -3201,6 +3263,11 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
3201
3263
|
* trace), each stamped with its conversation `turn` — WITHOUT `.findings()`.
|
|
3202
3264
|
* A reader that switches over every row kind must skip one it does not know.
|
|
3203
3265
|
*
|
|
3266
|
+
* THE RESULTS LAYER files here too (honesty layer 3, step 7b): `period` rows
|
|
3267
|
+
* — one per call whose result declared the period its read covered, or whose
|
|
3268
|
+
* tool declares a period argument: `covered`, `partly-held`, `not-held`,
|
|
3269
|
+
* `unknown`, or `undeclared` (the result said nothing about its period).
|
|
3270
|
+
*
|
|
3204
3271
|
* Detached from the execution record (`structuredClone`), so a caller may
|
|
3205
3272
|
* keep or mutate it without touching the run's state.
|
|
3206
3273
|
*
|
|
@@ -3238,10 +3305,22 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
3238
3305
|
* `getLastSnapshot().sharedState.answerCoverage`, one value three ways. The
|
|
3239
3306
|
* answer string, and so `runTyped()`, is exactly the model's.
|
|
3240
3307
|
*
|
|
3241
|
-
*
|
|
3242
|
-
*
|
|
3243
|
-
*
|
|
3244
|
-
* the
|
|
3308
|
+
* On an agent whose inputs layer is armed (a tool declares `askOrAssume`),
|
|
3309
|
+
* `assumed` lists the values a tool's rule filled this turn — the same rows,
|
|
3310
|
+
* read the same way, that a prose answer's "Assumed" block prints — each in
|
|
3311
|
+
* the tool's own argument view (`'REDACTED'` with `hidden` when that view
|
|
3312
|
+
* hides it).
|
|
3313
|
+
*
|
|
3314
|
+
* `undefined` when the run's tools declared no limits and nothing was
|
|
3315
|
+
* assumed, on a prose answer (the block is in the answer string there;
|
|
3316
|
+
* `sharedState.coverageDeclared` holds the raw rows either way), and before
|
|
3317
|
+
* the first run. Detached from the execution record, so a caller may keep
|
|
3318
|
+
* or mutate it.
|
|
3319
|
+
*
|
|
3320
|
+
* `periods` (honesty step 7b) — present only when a call's result declared
|
|
3321
|
+
* the period its read covered: one entry per declaring call, `{ toolName,
|
|
3322
|
+
* toolCallId, queried, held, readAt? }`, the period as the tool declared it
|
|
3323
|
+
* — the data twin of the prose block's `Period:` lines.
|
|
3245
3324
|
*
|
|
3246
3325
|
* @example
|
|
3247
3326
|
* ```ts
|
|
@@ -3762,10 +3841,28 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
3762
3841
|
const ruledTools = new Map([...registryByName.entries()].filter(([, tool]) => tool.askOrAssume !== undefined || tool.period !== undefined));
|
|
3763
3842
|
const inputsArmed = ruledTools.size > 0 || this.inputsLayerOption === true;
|
|
3764
3843
|
this.inputsLayerArmed = inputsArmed;
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3844
|
+
// ── The results layer (honesty layer 3, step 7b) — armed ONCE, here ──
|
|
3845
|
+
// A registered tool that declares a `ToolPeriod` (the inputs layer's
|
|
3846
|
+
// declaration: which argument sets the period) arms the mount, over the
|
|
3847
|
+
// same catalog: its results owe a period, and a result that declares none
|
|
3848
|
+
// is recorded as silence. `.resultsLayer()` arms it for tools the build
|
|
3849
|
+
// cannot see and for tools that declare a period only on their results.
|
|
3850
|
+
// Unarmed: nothing below is mounted, read or written.
|
|
3851
|
+
const resultsArmed = [...registryByName.values()].some((tool) => tool.period !== undefined) ||
|
|
3852
|
+
this.resultsLayerOption === true;
|
|
3853
|
+
this.resultsLayerArmed = resultsArmed;
|
|
3854
|
+
if (inputsArmed && ruledTools.size > 0)
|
|
3855
|
+
seededRuledTools = ruledTools;
|
|
3856
|
+
// ── The answer layer (honesty layer 4) — armed by its option alone ─────
|
|
3857
|
+
const answerArmed = this.answerLayerOption !== undefined;
|
|
3858
|
+
// The run constant names every armed layer; the restore is wired whenever
|
|
3859
|
+
// one is (adopted Q6) — still value-conditional inside seed.
|
|
3860
|
+
if (inputsArmed || resultsArmed || answerArmed) {
|
|
3861
|
+
seededHonestyLayers = (0, armed_js_1.honestyLayersOf)({
|
|
3862
|
+
inputs: inputsArmed,
|
|
3863
|
+
results: resultsArmed,
|
|
3864
|
+
answer: answerArmed,
|
|
3865
|
+
});
|
|
3769
3866
|
ledgerRestoreArmed = true;
|
|
3770
3867
|
}
|
|
3771
3868
|
// The gate's admissible set, for the record (9.50.0): declared hops from
|
|
@@ -4180,10 +4277,13 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
4180
4277
|
// trailing positional: the rows this decider files carry the turn
|
|
4181
4278
|
// stamp, and with the evidence gate armed too, the gate's exempt corpus
|
|
4182
4279
|
// gains this turn's assumed values, read from the tools' declarations,
|
|
4183
|
-
// and the values the person gave the layer's batch ask (step 4).
|
|
4184
|
-
|
|
4280
|
+
// and the values the person gave the layer's batch ask (step 4). The
|
|
4281
|
+
// results layer (step 7b) arms the stamp alone — "while any layer is
|
|
4282
|
+
// armed, the one writer stamps the turn" — and nothing else.
|
|
4283
|
+
inputsArmed || resultsArmed
|
|
4185
4284
|
? {
|
|
4186
|
-
...(
|
|
4285
|
+
...(inputsArmed &&
|
|
4286
|
+
this.evidenceGate !== undefined && {
|
|
4187
4287
|
declaredDefaults: (0, route_js_2.declaredDefaultsFrom)((toolName, argument) => {
|
|
4188
4288
|
const rules = (0, declare_js_1.rulesOf)(resolveForLayer(toolName).tool);
|
|
4189
4289
|
if (rules === undefined || (0, declare_js_1.isRefused)(rules))
|
|
@@ -4193,7 +4293,11 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
4193
4293
|
answeredValues: route_js_2.answeredValuesOf,
|
|
4194
4294
|
}),
|
|
4195
4295
|
}
|
|
4196
|
-
: undefined
|
|
4296
|
+
: undefined,
|
|
4297
|
+
// THE ANSWER LAYER (honesty layer 4) — the same value-conditional
|
|
4298
|
+
// trailing positional: the judges file the answer's witness rows, and
|
|
4299
|
+
// every row this decider files carries the turn stamp.
|
|
4300
|
+
answerArmed ? true : undefined);
|
|
4197
4301
|
const routeDecider = this.answerValidationConfig === undefined
|
|
4198
4302
|
? baseRouteDecider
|
|
4199
4303
|
: (0, answerValidation_js_1.withAnswerValidation)(baseRouteDecider, this.answerValidationConfig, this.outputSchemaParser, artifactStore, () => this.consentOutstanding.size > 0);
|
|
@@ -4205,7 +4309,13 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
4205
4309
|
// `turn_end`. A prose answer keeps the block; an agent that asked for
|
|
4206
4310
|
// neither is handed the decider it always had.
|
|
4207
4311
|
const limitsAsData = this.limitsTravelWithTheAnswerValue && this.outputSchemaParser !== undefined;
|
|
4208
|
-
|
|
4312
|
+
// With the inputs layer armed, the typed answer's limits carry this
|
|
4313
|
+
// turn's assumed values too — the same rows the prose "Assumed" block
|
|
4314
|
+
// prints (`withAnswerCoverage`'s second argument); a rewrite by a
|
|
4315
|
+
// before-tool chain is read only when the agent has one.
|
|
4316
|
+
const terminalRouteDecider = limitsAsData
|
|
4317
|
+
? (0, answerCoverage_js_1.withAnswerCoverage)(routeDecider, inputsArmed ? { rewrites: this.toolMiddleware.length > 0 } : undefined)
|
|
4318
|
+
: routeDecider;
|
|
4209
4319
|
// toolCallsHandler extracted to ./agent/stages/toolCalls.ts (v2.11.2).
|
|
4210
4320
|
const toolCallsHandler = (0, toolCalls_js_1.buildToolCallsHandler)({
|
|
4211
4321
|
registryByName,
|
|
@@ -4224,6 +4334,13 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
4224
4334
|
// The inputs layer (honesty layer 2) — the fills, the refusals and the
|
|
4225
4335
|
// note; absent → a ruled tool's call is refused (fail closed).
|
|
4226
4336
|
...(inputsArmed && { inputsLayer: true }),
|
|
4337
|
+
// The results layer (honesty layer 3, step 7b) — read in one place: a
|
|
4338
|
+
// period a result declares with NO layer mounted is dev-warned (nobody
|
|
4339
|
+
// will file its verdict). And the turn stamp, as under any layer.
|
|
4340
|
+
...(resultsArmed && { resultsLayer: true }),
|
|
4341
|
+
// The answer layer (honesty layer 4) — only the turn stamp on the rows
|
|
4342
|
+
// this handler files (adopted Q6).
|
|
4343
|
+
...(answerArmed && { answerLayer: true }),
|
|
4227
4344
|
// …and the host's own context for the layer's batch ask (step 4),
|
|
4228
4345
|
// value-conditional inside the arm.
|
|
4229
4346
|
...(inputsArmed &&
|
|
@@ -4447,6 +4564,27 @@ class Agent extends RunnerBase_js_1.RunnerBase {
|
|
|
4447
4564
|
...(this.toolMiddleware.length > 0 && { rewrites: true }),
|
|
4448
4565
|
},
|
|
4449
4566
|
}),
|
|
4567
|
+
// The results layer (honesty layer 3, step 7b): `sf-results` at the loop
|
|
4568
|
+
// head, in both builders through one helper, reading each call's
|
|
4569
|
+
// `ToolPeriod` off the implementation that answered it; absent → untouched.
|
|
4570
|
+
...(resultsArmed && {
|
|
4571
|
+
resultsLayer: { toolOf: (toolName) => resolveForLayer(toolName).tool },
|
|
4572
|
+
}),
|
|
4573
|
+
// The answer layer (honesty layer 4): its stage heads the final branch
|
|
4574
|
+
// in both builders through one helper, reading only the committed keys
|
|
4575
|
+
// this agent's arms can write; absent → the branch is untouched.
|
|
4576
|
+
...(this.answerLayerOption !== undefined && {
|
|
4577
|
+
answerLayer: {
|
|
4578
|
+
reads: (0, mounts_js_1.answerFoldReads)({
|
|
4579
|
+
tools: canCallTools,
|
|
4580
|
+
evidenceGate: this.evidenceGate !== undefined,
|
|
4581
|
+
answerValidation: this.answerValidationConfig !== undefined,
|
|
4582
|
+
inputs: inputsArmed,
|
|
4583
|
+
toolMiddleware: this.toolMiddleware.length > 0,
|
|
4584
|
+
}),
|
|
4585
|
+
...(this.answerLayerOption.standingLine === true && { standingLine: true }),
|
|
4586
|
+
},
|
|
4587
|
+
}),
|
|
4450
4588
|
// Tool choice by classifier (9.105.0): the mount args on the Tools
|
|
4451
4589
|
// branch and the key across the sf-llm-call boundary, under the arm.
|
|
4452
4590
|
...(this.toolChoiceOptions !== undefined && { hasToolChoice: true }),
|