agentfootprint 9.112.2 → 9.113.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/CHANGELOG.md +296 -0
- package/CLAUDE.md +1 -0
- package/dist/adapters/observability/audit.js +8 -0
- package/dist/adapters/observability/audit.js.map +1 -1
- package/dist/adapters/observability/otel.js +44 -2
- package/dist/adapters/observability/otel.js.map +1 -1
- package/dist/adapters/observability/xray.js +19 -0
- package/dist/adapters/observability/xray.js.map +1 -1
- package/dist/adapters/types.js.map +1 -1
- package/dist/core/Agent.js +11 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/composeRequest.js +19 -11
- package/dist/core/agent/composeRequest.js.map +1 -1
- package/dist/core/agent/coverage/absent.js +163 -7
- package/dist/core/agent/coverage/absent.js.map +1 -1
- package/dist/core/agent/coverage/answer.js +3 -1
- package/dist/core/agent/coverage/answer.js.map +1 -1
- package/dist/core/agent/coverage/read.js +15 -11
- package/dist/core/agent/coverage/read.js.map +1 -1
- package/dist/core/agent/findings/ledger.js +27 -5
- package/dist/core/agent/findings/ledger.js.map +1 -1
- package/dist/core/agent/findings/offer.js +29 -9
- package/dist/core/agent/findings/offer.js.map +1 -1
- package/dist/core/agent/findings/serve.js +76 -7
- package/dist/core/agent/findings/serve.js.map +1 -1
- package/dist/core/agent/findings/types.js.map +1 -1
- package/dist/core/agent/findings/unsettled.js +276 -0
- package/dist/core/agent/findings/unsettled.js.map +1 -0
- package/dist/core/agent/stages/callLLM.js +30 -8
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/route.js +10 -2
- package/dist/core/agent/stages/route.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +247 -31
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/agent/stages/window.js +5 -2
- package/dist/core/agent/stages/window.js.map +1 -1
- package/dist/core/agent/toolResultCap.js +0 -0
- package/dist/core/agent/toolResultCap.js.map +1 -1
- package/dist/core/agent/window/ledgerFactPins.js +13 -2
- package/dist/core/agent/window/ledgerFactPins.js.map +1 -1
- package/dist/core/agent/window/toolNames.js +17 -2
- package/dist/core/agent/window/toolNames.js.map +1 -1
- package/dist/core/checkin.js +5 -1
- package/dist/core/checkin.js.map +1 -1
- package/dist/core/runCheckpoint.js +26 -2
- package/dist/core/runCheckpoint.js.map +1 -1
- package/dist/esm/adapters/observability/audit.d.ts +8 -0
- package/dist/esm/adapters/observability/audit.js +8 -0
- package/dist/esm/adapters/observability/audit.js.map +1 -1
- package/dist/esm/adapters/observability/otel.d.ts +17 -2
- package/dist/esm/adapters/observability/otel.js +44 -2
- package/dist/esm/adapters/observability/otel.js.map +1 -1
- package/dist/esm/adapters/observability/xray.d.ts +8 -0
- package/dist/esm/adapters/observability/xray.js +19 -0
- package/dist/esm/adapters/observability/xray.js.map +1 -1
- package/dist/esm/adapters/types.d.ts +49 -0
- package/dist/esm/adapters/types.js.map +1 -1
- package/dist/esm/core/Agent.js +11 -1
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/composeRequest.d.ts +10 -7
- package/dist/esm/core/agent/composeRequest.js +19 -11
- package/dist/esm/core/agent/composeRequest.js.map +1 -1
- package/dist/esm/core/agent/coverage/absent.d.ts +31 -4
- package/dist/esm/core/agent/coverage/absent.js +160 -6
- package/dist/esm/core/agent/coverage/absent.js.map +1 -1
- package/dist/esm/core/agent/coverage/answer.js +3 -1
- package/dist/esm/core/agent/coverage/answer.js.map +1 -1
- package/dist/esm/core/agent/coverage/index.d.ts +1 -1
- package/dist/esm/core/agent/coverage/read.d.ts +9 -1
- package/dist/esm/core/agent/coverage/read.js +16 -12
- package/dist/esm/core/agent/coverage/read.js.map +1 -1
- package/dist/esm/core/agent/coverage/types.d.ts +42 -0
- package/dist/esm/core/agent/findings/ledger.d.ts +23 -6
- package/dist/esm/core/agent/findings/ledger.js +27 -5
- package/dist/esm/core/agent/findings/ledger.js.map +1 -1
- package/dist/esm/core/agent/findings/offer.d.ts +23 -6
- package/dist/esm/core/agent/findings/offer.js +27 -8
- package/dist/esm/core/agent/findings/offer.js.map +1 -1
- package/dist/esm/core/agent/findings/serve.d.ts +19 -6
- package/dist/esm/core/agent/findings/serve.js +77 -8
- package/dist/esm/core/agent/findings/serve.js.map +1 -1
- package/dist/esm/core/agent/findings/types.d.ts +81 -1
- package/dist/esm/core/agent/findings/types.js.map +1 -1
- package/dist/esm/core/agent/findings/unsettled.d.ts +121 -0
- package/dist/esm/core/agent/findings/unsettled.js +271 -0
- package/dist/esm/core/agent/findings/unsettled.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM.js +30 -8
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/stages/route.js +10 -2
- package/dist/esm/core/agent/stages/route.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +90 -2
- package/dist/esm/core/agent/stages/toolCalls.js +244 -31
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/stages/window.js +5 -2
- package/dist/esm/core/agent/stages/window.js.map +1 -1
- package/dist/esm/core/agent/toolResultCap.d.ts +4 -1
- package/dist/esm/core/agent/toolResultCap.js +0 -0
- package/dist/esm/core/agent/toolResultCap.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +5 -0
- package/dist/esm/core/agent/window/ledgerFactPins.d.ts +10 -1
- package/dist/esm/core/agent/window/ledgerFactPins.js +13 -2
- package/dist/esm/core/agent/window/ledgerFactPins.js.map +1 -1
- package/dist/esm/core/agent/window/strategy.d.ts +2 -1
- package/dist/esm/core/agent/window/toolNames.d.ts +16 -1
- package/dist/esm/core/agent/window/toolNames.js +17 -2
- package/dist/esm/core/agent/window/toolNames.js.map +1 -1
- package/dist/esm/core/checkin.js +5 -1
- package/dist/esm/core/checkin.js.map +1 -1
- package/dist/esm/core/runCheckpoint.js +26 -2
- package/dist/esm/core/runCheckpoint.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +76 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/bug-report/transcript.d.ts +5 -0
- package/dist/esm/lib/bug-report/transcript.js +1 -0
- package/dist/esm/lib/bug-report/transcript.js.map +1 -1
- package/dist/esm/lib/semantics/projection.js +1 -0
- package/dist/esm/lib/semantics/projection.js.map +1 -1
- package/dist/esm/lib/time-travel/receipt.d.ts +4 -3
- package/dist/esm/lib/time-travel/receipt.js +4 -3
- package/dist/esm/lib/time-travel/receipt.js.map +1 -1
- package/dist/esm/lib/time-travel/servedView.js +13 -9
- package/dist/esm/lib/time-travel/servedView.js.map +1 -1
- package/dist/esm/lib/trace-toolpack/traceToolpack.js +130 -17
- package/dist/esm/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/esm/memory/causal/evidenceRecorder.d.ts +2 -0
- package/dist/esm/memory/causal/evidenceRecorder.js +13 -0
- package/dist/esm/memory/causal/evidenceRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.d.ts +2 -0
- package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.js +11 -0
- package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/BoundaryRecorder.d.ts +10 -1
- package/dist/esm/recorders/observability/BoundaryRecorder.js +9 -1
- package/dist/esm/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +4 -1
- package/dist/esm/recorders/observability/FlowchartRecorder.js +13 -1
- package/dist/esm/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/LiveStateRecorder.d.ts +2 -0
- package/dist/esm/recorders/observability/LiveStateRecorder.js +9 -0
- package/dist/esm/recorders/observability/LiveStateRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/RouteRecorder.js +5 -0
- package/dist/esm/recorders/observability/RouteRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/StatusRecorder.js +7 -0
- package/dist/esm/recorders/observability/StatusRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/ToolChoiceRecorder.js +5 -0
- package/dist/esm/recorders/observability/ToolChoiceRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/commentary/commentaryTemplates.js +18 -2
- package/dist/esm/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
- package/dist/esm/recorders/observability/status/statusTemplates.js +5 -0
- package/dist/esm/recorders/observability/status/statusTemplates.js.map +1 -1
- package/dist/esm/security/extractSequence.d.ts +36 -5
- package/dist/esm/security/extractSequence.js +99 -26
- package/dist/esm/security/extractSequence.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/bug-report/transcript.js +1 -0
- package/dist/lib/bug-report/transcript.js.map +1 -1
- package/dist/lib/semantics/projection.js +1 -0
- package/dist/lib/semantics/projection.js.map +1 -1
- package/dist/lib/time-travel/receipt.js +4 -3
- package/dist/lib/time-travel/receipt.js.map +1 -1
- package/dist/lib/time-travel/servedView.js +13 -9
- package/dist/lib/time-travel/servedView.js.map +1 -1
- package/dist/lib/trace-toolpack/traceToolpack.js +130 -17
- package/dist/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/memory/causal/evidenceRecorder.js +13 -0
- package/dist/memory/causal/evidenceRecorder.js.map +1 -1
- package/dist/recorders/observability/AgentThinkingTraceRecorder.js +11 -0
- package/dist/recorders/observability/AgentThinkingTraceRecorder.js.map +1 -1
- package/dist/recorders/observability/BoundaryRecorder.js +9 -1
- package/dist/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/recorders/observability/FlowchartRecorder.js +13 -1
- package/dist/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/recorders/observability/LiveStateRecorder.js +9 -0
- package/dist/recorders/observability/LiveStateRecorder.js.map +1 -1
- package/dist/recorders/observability/RouteRecorder.js +5 -0
- package/dist/recorders/observability/RouteRecorder.js.map +1 -1
- package/dist/recorders/observability/StatusRecorder.js +7 -0
- package/dist/recorders/observability/StatusRecorder.js.map +1 -1
- package/dist/recorders/observability/ToolChoiceRecorder.js +5 -0
- package/dist/recorders/observability/ToolChoiceRecorder.js.map +1 -1
- package/dist/recorders/observability/commentary/commentaryTemplates.js +18 -2
- package/dist/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
- package/dist/recorders/observability/status/statusTemplates.js +5 -0
- package/dist/recorders/observability/status/statusTemplates.js.map +1 -1
- package/dist/security/extractSequence.js +99 -26
- package/dist/security/extractSequence.js.map +1 -1
- package/dist/types/adapters/observability/audit.d.ts +8 -0
- package/dist/types/adapters/observability/audit.d.ts.map +1 -1
- package/dist/types/adapters/observability/otel.d.ts +17 -2
- package/dist/types/adapters/observability/otel.d.ts.map +1 -1
- package/dist/types/adapters/observability/xray.d.ts +8 -0
- package/dist/types/adapters/observability/xray.d.ts.map +1 -1
- package/dist/types/adapters/types.d.ts +49 -0
- package/dist/types/adapters/types.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/composeRequest.d.ts +10 -7
- package/dist/types/core/agent/composeRequest.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/absent.d.ts +31 -4
- package/dist/types/core/agent/coverage/absent.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/answer.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/index.d.ts +1 -1
- package/dist/types/core/agent/coverage/index.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/read.d.ts +9 -1
- package/dist/types/core/agent/coverage/read.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/types.d.ts +42 -0
- package/dist/types/core/agent/coverage/types.d.ts.map +1 -1
- package/dist/types/core/agent/findings/ledger.d.ts +23 -6
- package/dist/types/core/agent/findings/ledger.d.ts.map +1 -1
- package/dist/types/core/agent/findings/offer.d.ts +23 -6
- package/dist/types/core/agent/findings/offer.d.ts.map +1 -1
- package/dist/types/core/agent/findings/serve.d.ts +19 -6
- package/dist/types/core/agent/findings/serve.d.ts.map +1 -1
- package/dist/types/core/agent/findings/types.d.ts +81 -1
- package/dist/types/core/agent/findings/types.d.ts.map +1 -1
- package/dist/types/core/agent/findings/unsettled.d.ts +122 -0
- package/dist/types/core/agent/findings/unsettled.d.ts.map +1 -0
- package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
- package/dist/types/core/agent/stages/route.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +90 -2
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/stages/window.d.ts.map +1 -1
- package/dist/types/core/agent/toolResultCap.d.ts +4 -1
- package/dist/types/core/agent/toolResultCap.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +5 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/agent/window/ledgerFactPins.d.ts +10 -1
- package/dist/types/core/agent/window/ledgerFactPins.d.ts.map +1 -1
- package/dist/types/core/agent/window/strategy.d.ts +2 -1
- package/dist/types/core/agent/window/strategy.d.ts.map +1 -1
- package/dist/types/core/agent/window/toolNames.d.ts +16 -1
- package/dist/types/core/agent/window/toolNames.d.ts.map +1 -1
- package/dist/types/core/checkin.d.ts.map +1 -1
- package/dist/types/core/runCheckpoint.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +76 -1
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/bug-report/transcript.d.ts +5 -0
- package/dist/types/lib/bug-report/transcript.d.ts.map +1 -1
- package/dist/types/lib/semantics/projection.d.ts.map +1 -1
- package/dist/types/lib/time-travel/receipt.d.ts +4 -3
- package/dist/types/lib/time-travel/receipt.d.ts.map +1 -1
- package/dist/types/lib/time-travel/servedView.d.ts.map +1 -1
- package/dist/types/lib/trace-toolpack/traceToolpack.d.ts.map +1 -1
- package/dist/types/memory/causal/evidenceRecorder.d.ts +2 -0
- package/dist/types/memory/causal/evidenceRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/AgentThinkingTraceRecorder.d.ts +2 -0
- package/dist/types/recorders/observability/AgentThinkingTraceRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts +10 -1
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/FlowchartRecorder.d.ts +4 -1
- package/dist/types/recorders/observability/FlowchartRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/LiveStateRecorder.d.ts +2 -0
- package/dist/types/recorders/observability/LiveStateRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/RouteRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/ToolChoiceRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/commentary/commentaryTemplates.d.ts.map +1 -1
- package/dist/types/recorders/observability/status/statusTemplates.d.ts.map +1 -1
- package/dist/types/security/extractSequence.d.ts +36 -5
- package/dist/types/security/extractSequence.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -38,12 +38,27 @@
|
|
|
38
38
|
* The gate therefore withholds `looked_for`, and only `looked_for` (see
|
|
39
39
|
* `coverage/evidence.ts`): it is the one field whose job is to quote the
|
|
40
40
|
* request. Everything else the absence carries — the coverage lists, the
|
|
41
|
-
* author's `tryInstead`, any extra key the tool attached
|
|
42
|
-
* the TOOL speaking about the world and does ground,
|
|
43
|
-
* follows the absence's own advice must not be called
|
|
41
|
+
* author's `tryInstead` and `tryInsteadTool`, any extra key the tool attached
|
|
42
|
+
* to the envelope — is the TOOL speaking about the world and does ground,
|
|
43
|
+
* because an answer that follows the absence's own advice must not be called
|
|
44
|
+
* ungrounded for doing so.
|
|
44
45
|
* The note is kept free of interpolation for the same reason the exclusion
|
|
45
46
|
* exists: static library text has nothing of the caller's to leak.
|
|
47
|
+
*
|
|
48
|
+
* ## A suggestion to try another tool is typed, never parsed (9.113.0)
|
|
49
|
+
*
|
|
50
|
+
* `tryInstead` is ONE sentence, for the model; nothing in this library reads
|
|
51
|
+
* a tool name out of it. When the sentence points at another tool, the author
|
|
52
|
+
* names that tool beside it — `tryInsteadTool: { tool, why? }` — and the
|
|
53
|
+
* envelope carries it under its OWN key, `try_instead_tool`. Its own key, not
|
|
54
|
+
* `try_instead`: that field has been a string since it shipped and every
|
|
55
|
+
* reader typed against `ToolAbsence` reads it as one, so a second shape there
|
|
56
|
+
* would be dropped by each of them without a word. `tools.absent` carries
|
|
57
|
+
* both, as declared. ONE rule set decides what each is ({@link readSentence},
|
|
58
|
+
* {@link readToolSuggestion}): `absent()` refuses by it and the recognizer
|
|
59
|
+
* reads by it, so a mint and a read cannot disagree.
|
|
46
60
|
*/
|
|
61
|
+
import { warnIfInvalidToolName } from '../../tools.js';
|
|
47
62
|
import { normalizeCoverageList } from './items.js';
|
|
48
63
|
/**
|
|
49
64
|
* The reserved key that makes an absence recognizable. Exported because tests,
|
|
@@ -62,6 +77,115 @@ export const ABSENCE_NOTE = 'The search ran and matched nothing. This is an ANSW
|
|
|
62
77
|
'arguments returns this same result. `checked` is the ground this answer covers; anything ' +
|
|
63
78
|
'under `not_checked` or `cannot_cover` is ground it does NOT cover, and reaching that ' +
|
|
64
79
|
'needs a different question, not a retry.';
|
|
80
|
+
/**
|
|
81
|
+
* The typed tool's keys, tied to {@link TryInsteadTool} in BOTH directions: a
|
|
82
|
+
* key the interface gains, or one listed here that it does not have, fails to
|
|
83
|
+
* compile. Any other key on a value is refused, so a misspelt `why` cannot
|
|
84
|
+
* vanish without a word.
|
|
85
|
+
*/
|
|
86
|
+
const TOOL_SUGGESTION_KEYS = Object.keys({
|
|
87
|
+
tool: true,
|
|
88
|
+
why: true,
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* `undefined` and `null` both mean "not given" for the typed tool and its
|
|
92
|
+
* `why`. A JSON producer writes a missing optional value as `null`, and
|
|
93
|
+
* `tryInstead: null` read as no suggestion before 9.113.0 — refusing it would
|
|
94
|
+
* turn a nothing-found into a tool error, the direction of error this file
|
|
95
|
+
* exists to prevent.
|
|
96
|
+
*/
|
|
97
|
+
const notGiven = (raw) => raw === undefined || raw === null;
|
|
98
|
+
/** An object literal's shape — `{…}` or `Object.create(null)`; never an
|
|
99
|
+
* array, a Date, a boxed string or any other class instance. */
|
|
100
|
+
const isPlainObject = (raw) => {
|
|
101
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw))
|
|
102
|
+
return false;
|
|
103
|
+
const prototype = Object.getPrototypeOf(raw);
|
|
104
|
+
return prototype === Object.prototype || prototype === null;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* The rule for the SENTENCE (`tryInstead`, `try_instead` on the wire):
|
|
108
|
+
* trimmed, and one that trims to nothing is no suggestion, as it always was.
|
|
109
|
+
*
|
|
110
|
+
* ONE non-string is refused: a plain object. That is the typed form
|
|
111
|
+
* `{ tool, why? }` written into the sentence's slot, and the refusal points it
|
|
112
|
+
* at `tryInsteadTool` rather than drop the author's tool without a word. Any
|
|
113
|
+
* OTHER value that is not a string — `null`, `false` from
|
|
114
|
+
* `tryInstead: cond && '…'`, a number, a list, a Date — reads as no
|
|
115
|
+
* suggestion, exactly as it did before 9.113.0: `absent()` runs inside a
|
|
116
|
+
* tool's `execute`, so refusing it would turn a nothing-found the 9.112.2
|
|
117
|
+
* loop delivered as an absence into that call's error result.
|
|
118
|
+
*/
|
|
119
|
+
function readSentence(raw) {
|
|
120
|
+
if (typeof raw === 'string') {
|
|
121
|
+
const sentence = raw.trim();
|
|
122
|
+
return { value: sentence === '' ? undefined : sentence };
|
|
123
|
+
}
|
|
124
|
+
if (isPlainObject(raw)) {
|
|
125
|
+
return {
|
|
126
|
+
problem: '`tryInstead` is the sentence the model reads, and only that. To name the other ' +
|
|
127
|
+
'tool as data, give { tool, why? } as `tryInsteadTool`, beside the sentence.',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return { value: undefined };
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The rule for the TYPED TOOL (`tryInsteadTool`, `try_instead_tool` on the
|
|
134
|
+
* wire): `{ tool, why? }`, where `tool` is a non-empty name and `why`, when
|
|
135
|
+
* given, says something. Both are trimmed; `why: null` reads as omitted. The
|
|
136
|
+
* name is recorded as declared: never looked up (a provider may serve it on a
|
|
137
|
+
* later iteration), and held to no charset here — which names a provider
|
|
138
|
+
* accepts is `core/tools.ts` · `assertValidToolName`'s question, and
|
|
139
|
+
* `absent` asks the dev-mode warning that owns it.
|
|
140
|
+
*
|
|
141
|
+
* Why ONE tool and not a list: every suggestion on record names at most one
|
|
142
|
+
* other tool, and where a sentence joins that tool to "or widen the window",
|
|
143
|
+
* the rest of the advice stays in the sentence. A list would be a second
|
|
144
|
+
* shape of this field for every reader to narrow — the cost this key exists
|
|
145
|
+
* to spare `try_instead`.
|
|
146
|
+
*/
|
|
147
|
+
function readToolSuggestion(raw) {
|
|
148
|
+
if (notGiven(raw))
|
|
149
|
+
return { value: undefined };
|
|
150
|
+
if (Array.isArray(raw)) {
|
|
151
|
+
return {
|
|
152
|
+
problem: '`tryInsteadTool` names ONE tool — { tool, why? }, never a list. Say the rest of the ' +
|
|
153
|
+
'advice in the `tryInstead` sentence.',
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (typeof raw !== 'object') {
|
|
157
|
+
return {
|
|
158
|
+
problem: `\`tryInsteadTool\` must be { tool, why? } — got ${typeof raw}. For a sentence, use ` +
|
|
159
|
+
'`tryInstead`; to suggest nothing, omit the field.',
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const value = raw;
|
|
163
|
+
const unknownKey = Object.keys(value).find((key) => !TOOL_SUGGESTION_KEYS.includes(key));
|
|
164
|
+
if (unknownKey !== undefined) {
|
|
165
|
+
return {
|
|
166
|
+
problem: `\`tryInsteadTool\` has an unknown key '${unknownKey}' — the form is { tool, why? }, ` +
|
|
167
|
+
'and a misspelt `why` would otherwise vanish without a word.',
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const { tool, why } = value;
|
|
171
|
+
if (typeof tool !== 'string' || tool.trim() === '') {
|
|
172
|
+
return {
|
|
173
|
+
problem: '`tryInsteadTool.tool` must name the tool to try — its registered name, e.g. ' +
|
|
174
|
+
"{ tool: 'cluster_inventory', why: 'it lists the collected names' }. The name is " +
|
|
175
|
+
'recorded as declared and never looked up (a provider may serve it).',
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const name = tool.trim();
|
|
179
|
+
if (notGiven(why))
|
|
180
|
+
return { value: { tool: name } };
|
|
181
|
+
if (typeof why !== 'string' || why.trim() === '') {
|
|
182
|
+
return {
|
|
183
|
+
problem: `\`tryInsteadTool.why\` (for '${name}') must be a sentence — say why that tool, or ` +
|
|
184
|
+
'omit the field.',
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return { value: { tool: name, why: why.trim() } };
|
|
188
|
+
}
|
|
65
189
|
/**
|
|
66
190
|
* Say "I looked, and there is nothing" in a way a model cannot read as a
|
|
67
191
|
* failure — and cannot productively retry.
|
|
@@ -97,7 +221,8 @@ export const ABSENCE_NOTE = 'The search ran and matched nothing. This is an ANSW
|
|
|
97
221
|
export function absent(decl) {
|
|
98
222
|
const fn = 'absent';
|
|
99
223
|
if (typeof decl !== 'object' || decl === null) {
|
|
100
|
-
throw new Error(`${fn}: takes a declaration — { what, checked, notChecked?, cannotCover?, tryInstead
|
|
224
|
+
throw new Error(`${fn}: takes a declaration — { what, checked, notChecked?, cannotCover?, tryInstead?, ` +
|
|
225
|
+
`tryInsteadTool? }.`);
|
|
101
226
|
}
|
|
102
227
|
const what = typeof decl.what === 'string' ? decl.what.trim() : '';
|
|
103
228
|
if (what === '') {
|
|
@@ -115,7 +240,18 @@ export function absent(decl) {
|
|
|
115
240
|
}
|
|
116
241
|
const notChecked = normalizeCoverageList(fn, 'notChecked', decl.notChecked, false);
|
|
117
242
|
const cannotCover = normalizeCoverageList(fn, 'cannotCover', decl.cannotCover, true);
|
|
118
|
-
const
|
|
243
|
+
const sentence = readSentence(decl.tryInstead);
|
|
244
|
+
if (sentence.problem !== undefined)
|
|
245
|
+
throw new Error(`${fn}: '${what}' — ${sentence.problem}`);
|
|
246
|
+
const tool = readToolSuggestion(decl.tryInsteadTool);
|
|
247
|
+
if (tool.problem !== undefined)
|
|
248
|
+
throw new Error(`${fn}: '${what}' — ${tool.problem}`);
|
|
249
|
+
const tryInstead = sentence.value;
|
|
250
|
+
const tryInsteadTool = tool.value;
|
|
251
|
+
// The name's charset is the tool registry's question: the owner warns in
|
|
252
|
+
// dev mode and never throws — the verdict a `defineTool` of it would get.
|
|
253
|
+
if (tryInsteadTool !== undefined)
|
|
254
|
+
warnIfInvalidToolName(tryInsteadTool.tool);
|
|
119
255
|
return {
|
|
120
256
|
af_absent: true,
|
|
121
257
|
outcome: 'nothing_found',
|
|
@@ -124,7 +260,8 @@ export function absent(decl) {
|
|
|
124
260
|
...(notChecked.length > 0 && { not_checked: notChecked }),
|
|
125
261
|
...(cannotCover.length > 0 && { cannot_cover: cannotCover }),
|
|
126
262
|
retry_returns_the_same: true,
|
|
127
|
-
...(tryInstead !== undefined &&
|
|
263
|
+
...(tryInstead !== undefined && { try_instead: tryInstead }),
|
|
264
|
+
...(tryInsteadTool !== undefined && { try_instead_tool: tryInsteadTool }),
|
|
128
265
|
note: ABSENCE_NOTE,
|
|
129
266
|
};
|
|
130
267
|
}
|
|
@@ -157,4 +294,21 @@ export function coverageOfAbsence(absence) {
|
|
|
157
294
|
cannotCover: absence.cannot_cover ?? [],
|
|
158
295
|
};
|
|
159
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* The absence's sentence, read by the rules `absent()` mints by. `undefined`
|
|
299
|
+
* when it declared none, AND when it declared one those rules refuse: an
|
|
300
|
+
* envelope minted elsewhere (a non-JS tool, a hand-built value) is read,
|
|
301
|
+
* never repaired, and the absence itself is still an absence either way.
|
|
302
|
+
*/
|
|
303
|
+
export function tryInsteadOfAbsence(absence) {
|
|
304
|
+
return readSentence(absence.try_instead).value;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* The absence's typed tool, read by the same rules — a copy, never the
|
|
308
|
+
* object the envelope holds. `undefined` when it declared none, or one those
|
|
309
|
+
* rules refuse (see {@link tryInsteadOfAbsence}).
|
|
310
|
+
*/
|
|
311
|
+
export function tryInsteadToolOfAbsence(absence) {
|
|
312
|
+
return readToolSuggestion(absence.try_instead_tool).value;
|
|
313
|
+
}
|
|
160
314
|
//# sourceMappingURL=absent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absent.js","sourceRoot":"","sources":["../../../../../src/core/agent/coverage/absent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"absent.js","sourceRoot":"","sources":["../../../../../src/core/agent/coverage/absent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GACvB,uFAAuF;IACvF,wFAAwF;IACxF,2FAA2F;IAC3F,uFAAuF;IACvF,0CAA0C,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,oBAAoB,GAAsB,MAAM,CAAC,IAAI,CAAC;IAC1D,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,IAAI;CACmC,CAAC,CAAC;AAYhD;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,GAAY,EAAW,EAAE,CAAC,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC;AAE9E;iEACiE;AACjE,MAAM,aAAa,GAAG,CAAC,GAAY,EAAW,EAAE;IAC9C,IAAI,OAAO,GAAG,KA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AiB,CAAC,OAAoB;IACpD,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;QAC9B,UAAU,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;QACrC,WAAW,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;KACxC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAoB;IACtD,OAAO,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAoB;IAC1D,OAAO,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC;AAC5D,CAAC"}
|
|
@@ -58,7 +58,9 @@ function renderSection(label, items) {
|
|
|
58
58
|
}
|
|
59
59
|
// LENS · injected-turn · persistent-history
|
|
60
60
|
// reads: scope.coverageDeclared ← read once by ../stages/prepareFinal.ts · captureTurnPayload — the ONE reader that COMPOSES from it,
|
|
61
|
-
// folded and capped. Not the only read of the key: ../stages/toolCalls.ts · declareCoverage reads it to append to it
|
|
61
|
+
// folded and capped. Not the only read of the key: ../stages/toolCalls.ts · declareCoverage reads it to append to it,
|
|
62
|
+
// and ../findings/unsettled.ts · withUnsettledRows (9.113.0) reads one call's rows for their `kind` — the witness
|
|
63
|
+
// that the tool returned an absence — and composes nothing from them (its row's words come from the served result).
|
|
62
64
|
// law: may omit, never deny; every clause anchored to the call it was composed on.
|
|
63
65
|
/**
|
|
64
66
|
* Fold the run's declarations into one block and append it to the answer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answer.js","sourceRoot":"","sources":["../../../../../src/core/agent/coverage/answer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,wEAAwE;AACxE,MAAM,CA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AAM,KAAK,GACT,GAAG,sBAAsB,8DAA8D;QACvF,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxC,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,cAAc,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAChE,CAAC"}
|
|
@@ -14,4 +14,4 @@ export { absenceEvidenceProjection } from './evidence.js';
|
|
|
14
14
|
export { mergeItems, normalizeCoverageList, sameItem } from './items.js';
|
|
15
15
|
export { coverage, COVERAGE_MARKER, COVERAGE_NOTE, coverageOfLedger, readCoverageLedger, } from './ledger.js';
|
|
16
16
|
export { readCoverageResult, type CoverageFacts, type CoverageReading } from './read.js';
|
|
17
|
-
export type { AbsenceDeclaration, Coverage, CoverageDeclaration, CoverageInput, CoverageItem, CoveredResult, DeclaredCoverage, ToolAbsence, } from './types.js';
|
|
17
|
+
export type { AbsenceDeclaration, Coverage, CoverageDeclaration, CoverageInput, CoverageItem, CoveredResult, DeclaredCoverage, ToolAbsence, TryInsteadTool, } from './types.js';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* returned — byte for byte.
|
|
16
16
|
*/
|
|
17
17
|
import type { ToolResultStatus } from '../../../lib/injection-engine/toolOutcome.js';
|
|
18
|
-
import type { Coverage } from './types.js';
|
|
18
|
+
import type { Coverage, TryInsteadTool } from './types.js';
|
|
19
19
|
/** One coverage statement found in a result, before the caller stamps it with
|
|
20
20
|
* the call it came from. */
|
|
21
21
|
export interface CoverageFacts {
|
|
@@ -23,6 +23,14 @@ export interface CoverageFacts {
|
|
|
23
23
|
readonly coverage: Coverage;
|
|
24
24
|
/** Present for `'absence'` — what the search was for. */
|
|
25
25
|
readonly lookedFor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Present for `'absence'` when it declared a sentence (9.113.0) — trimmed,
|
|
28
|
+
* as `absent()` mints it, and never parsed for a tool name. Not a piece of
|
|
29
|
+
* coverage, so it sits beside `coverage` rather than inside it.
|
|
30
|
+
*/
|
|
31
|
+
readonly tryInstead?: string;
|
|
32
|
+
/** Present for `'absence'` when it declared a typed tool (9.113.0) — a copy. */
|
|
33
|
+
readonly tryInsteadTool?: TryInsteadTool;
|
|
26
34
|
}
|
|
27
35
|
/** What one recognized result declares. `undefined` from
|
|
28
36
|
* {@link readCoverageResult} means "neither shape": untouched path. */
|
|
@@ -15,8 +15,21 @@
|
|
|
15
15
|
* returned — byte for byte.
|
|
16
16
|
*/
|
|
17
17
|
import { coverageOfSemantics, readSemantics } from '../../../lib/semantics/envelope.js';
|
|
18
|
-
import { coverageOfAbsence, readAbsence } from './absent.js';
|
|
18
|
+
import { coverageOfAbsence, readAbsence, tryInsteadOfAbsence, tryInsteadToolOfAbsence, } from './absent.js';
|
|
19
19
|
import { coverageOfLedger, readCoverageLedger } from './ledger.js';
|
|
20
|
+
/** The facts one absence declares — the same for a bare absence and for one
|
|
21
|
+
* a ledger bounds, so the two sites cannot drift. */
|
|
22
|
+
function absenceFacts(absence) {
|
|
23
|
+
const tryInstead = tryInsteadOfAbsence(absence);
|
|
24
|
+
const tryInsteadTool = tryInsteadToolOfAbsence(absence);
|
|
25
|
+
return {
|
|
26
|
+
kind: 'absence',
|
|
27
|
+
coverage: coverageOfAbsence(absence),
|
|
28
|
+
lookedFor: absence.looked_for,
|
|
29
|
+
...(tryInstead !== undefined && { tryInstead }),
|
|
30
|
+
...(tryInsteadTool !== undefined && { tryInsteadTool }),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
20
33
|
const ABSENT_STATUS = 'absent';
|
|
21
34
|
/**
|
|
22
35
|
* Read one finalized tool result for coverage declarations.
|
|
@@ -29,12 +42,7 @@ const ABSENT_STATUS = 'absent';
|
|
|
29
42
|
export function readCoverageResult(value) {
|
|
30
43
|
const absence = readAbsence(value);
|
|
31
44
|
if (absence !== undefined) {
|
|
32
|
-
return {
|
|
33
|
-
status: ABSENT_STATUS,
|
|
34
|
-
declared: [
|
|
35
|
-
{ kind: 'absence', coverage: coverageOfAbsence(absence), lookedFor: absence.looked_for },
|
|
36
|
-
],
|
|
37
|
-
};
|
|
45
|
+
return { status: ABSENT_STATUS, declared: [absenceFacts(absence)] };
|
|
38
46
|
}
|
|
39
47
|
// A semantic envelope's `coverage` field (9.53.0) is ABSORBED here — the
|
|
40
48
|
// one recognizer funnel — so the boundary a semantic tool declared flows
|
|
@@ -55,11 +63,7 @@ export function readCoverageResult(value) {
|
|
|
55
63
|
const inner = readAbsence(covered.result);
|
|
56
64
|
if (inner === undefined)
|
|
57
65
|
return { declared };
|
|
58
|
-
declared.push(
|
|
59
|
-
kind: 'absence',
|
|
60
|
-
coverage: coverageOfAbsence(inner),
|
|
61
|
-
lookedFor: inner.looked_for,
|
|
62
|
-
});
|
|
66
|
+
declared.push(absenceFacts(inner));
|
|
63
67
|
return { status: ABSENT_STATUS, declared };
|
|
64
68
|
}
|
|
65
69
|
//# sourceMappingURL=read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../src/core/agent/coverage/read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../src/core/agent/coverage/read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAoB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O,SAAS,CAAC;IAC5C,MAAM,QAAQ,GAAoB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC5F,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -58,6 +58,29 @@ export interface CoverageDeclaration {
|
|
|
58
58
|
readonly notChecked?: readonly CoverageInput[];
|
|
59
59
|
readonly cannotCover?: readonly CoverageInput[];
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* The other TOOL a suggestion points at, typed (9.113.0) — `tryInsteadTool`
|
|
63
|
+
* on the declaration, `try_instead_tool` on the envelope.
|
|
64
|
+
*
|
|
65
|
+
* The `tryInstead` sentence puts a tool's name inside prose ("…or check
|
|
66
|
+
* cluster_inventory for the collected names."), and a reader that wants to
|
|
67
|
+
* know WHICH tool was suggested could only find out by parsing that sentence.
|
|
68
|
+
* This library never parses a tool name out of prose, so the name rides here
|
|
69
|
+
* as data — BESIDE the sentence, never in its place: `try_instead` stays a
|
|
70
|
+
* string, so every reader of it reads what it always read.
|
|
71
|
+
*
|
|
72
|
+
* `tool` is NOT looked up. The tool may be served by a provider that resolves
|
|
73
|
+
* per iteration, or be offered on a later turn; `absent()` requires a
|
|
74
|
+
* non-empty name and records it as declared. Which names a provider accepts is
|
|
75
|
+
* `core/tools.ts` · `assertValidToolName`'s question, and the library only
|
|
76
|
+
* warns about it (dev mode), here as at `defineTool`.
|
|
77
|
+
*/
|
|
78
|
+
export interface TryInsteadTool {
|
|
79
|
+
/** The tool's registered name, as a call would name it. */
|
|
80
|
+
readonly tool: string;
|
|
81
|
+
/** Why that tool, in the author's words ("it lists the collected names"). */
|
|
82
|
+
readonly why?: string;
|
|
83
|
+
}
|
|
61
84
|
/** What a tool author passes to {@link import('./absent.js').absent}. */
|
|
62
85
|
export interface AbsenceDeclaration {
|
|
63
86
|
/**
|
|
@@ -83,8 +106,22 @@ export interface AbsenceDeclaration {
|
|
|
83
106
|
* `window: '7d'`, or ask for a different interface"). Optional, and the
|
|
84
107
|
* highest-value optional field in the shape: the loop this primitive stops
|
|
85
108
|
* is a model with nowhere else to go.
|
|
109
|
+
*
|
|
110
|
+
* Prose for the model. Nothing in this library reads a tool name out of it:
|
|
111
|
+
* when the sentence points at another tool, name that tool in
|
|
112
|
+
* {@link AbsenceDeclaration.tryInsteadTool} as well.
|
|
86
113
|
*/
|
|
87
114
|
readonly tryInstead?: string;
|
|
115
|
+
/**
|
|
116
|
+
* The other TOOL the suggestion points at, as data (9.113.0) —
|
|
117
|
+
* `{ tool, why? }`. Beside the sentence, not instead of it: the sentence is
|
|
118
|
+
* what the model is told, this is what a reader reads without parsing
|
|
119
|
+
* prose. Either may be given without the other; when both are given they
|
|
120
|
+
* must name the same tool, and the library cannot check that they do — it
|
|
121
|
+
* would have to read a tool name out of the sentence. ONE tool; a list is
|
|
122
|
+
* refused (see `absent.ts` · `readToolSuggestion` for why).
|
|
123
|
+
*/
|
|
124
|
+
readonly tryInsteadTool?: TryInsteadTool;
|
|
88
125
|
}
|
|
89
126
|
/**
|
|
90
127
|
* The rendered absence — the exact object a tool hands back and the model
|
|
@@ -109,7 +146,12 @@ export interface ToolAbsence {
|
|
|
109
146
|
/** Stated as data as well as prose — the note can be skimmed past, a
|
|
110
147
|
* `true` in a field named for the question cannot. */
|
|
111
148
|
readonly retry_returns_the_same: true;
|
|
149
|
+
/** The author's sentence. A string, always — the typed tool rides its own
|
|
150
|
+
* key, so a reader of this one never has to narrow it. */
|
|
112
151
|
readonly try_instead?: string;
|
|
152
|
+
/** The typed tool the suggestion points at (9.113.0), as declared — the
|
|
153
|
+
* author's words, `{ tool, why? }`. The model reads it as written. */
|
|
154
|
+
readonly try_instead_tool?: TryInsteadTool;
|
|
113
155
|
/** The static sentence. Never interpolated — see `absent.ts`. */
|
|
114
156
|
readonly note: string;
|
|
115
157
|
}
|
|
@@ -19,9 +19,14 @@
|
|
|
19
19
|
* filed by the two moments `contingent.ts` serves: the route
|
|
20
20
|
* decider's answer and the dispatch loop's call) — identities,
|
|
21
21
|
* enums and numbers only. Assertion values, `settles`, `line`, the
|
|
22
|
-
* judged state
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* judged state, the contingent VALUE and — on an
|
|
23
|
+
* `unsettled-by-absence` row — a TOOL's own words (its envelope's
|
|
24
|
+
* `notChecked`, `cannotCover` and `tryInstead`) live in the
|
|
25
|
+
* committed key under whatever redaction the run configured; an
|
|
26
|
+
* event stream fans out to sinks we do not control. That row
|
|
27
|
+
* (9.113.0, filed by the same two moments through
|
|
28
|
+
* `unsettled.ts · withUnsettledRows`) emits nothing of its own, as
|
|
29
|
+
* a conflict row emits nothing of its own.
|
|
25
30
|
*
|
|
26
31
|
* ## Append only, last wins, conflicts are a fold
|
|
27
32
|
*
|
|
@@ -43,7 +48,7 @@
|
|
|
43
48
|
*/
|
|
44
49
|
import { type Conflict } from '../../../integrity/assertion/conflicts.js';
|
|
45
50
|
import { type Assertion } from '../../../integrity/assertion/types.js';
|
|
46
|
-
import { type BasisRow, type DeclaredOn, type FindingsDeclaration, type FindingsLedger, type FindingsRow, type JudgmentRow, type StandingRow } from './types.js';
|
|
51
|
+
import { type BasisRow, type DeclaredOn, type FindingsDeclaration, type FindingsLedger, type FindingsRow, type JudgmentRow, type StandingRow, type UnsettledByAbsenceRow } from './types.js';
|
|
47
52
|
/** The scope surface this file needs. Structurally a `TypedScope<AgentState>`. */
|
|
48
53
|
export interface FindingsScope {
|
|
49
54
|
findingsLedger?: FindingsLedger;
|
|
@@ -77,6 +82,16 @@ export interface LedgerFold {
|
|
|
77
82
|
readonly conflicts: readonly Conflict[];
|
|
78
83
|
/** Whether any result has a standing at all. */
|
|
79
84
|
readonly hasStanding: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The ruled-out standings that rest on an absence (9.113.0): the LAST
|
|
87
|
+
* `unsettled-by-absence` row per result, kept only while that result's
|
|
88
|
+
* CURRENT standing (`standingOf`) is still `ruled-out` — a later `fact`,
|
|
89
|
+
* `open` or `noise` moved the model's word, and a row beside the earlier
|
|
90
|
+
* word describes a standing that no longer stands. In the order each
|
|
91
|
+
* result first got a row. The piece's `unsettled by absence` section reads
|
|
92
|
+
* this and nothing else (`serve.ts · findingsLedgerPiece`).
|
|
93
|
+
*/
|
|
94
|
+
readonly unsettled: ReadonlyMap<string, UnsettledByAbsenceRow>;
|
|
80
95
|
}
|
|
81
96
|
/**
|
|
82
97
|
* Fold a ledger to its current reading. Pure; safe on a spread of the
|
|
@@ -89,8 +104,10 @@ export declare function foldLedger(rows: readonly FindingsRow[]): LedgerFold;
|
|
|
89
104
|
* key that first disagreed at this write, and emit one event per basis or
|
|
90
105
|
* standing row. No-op on an empty list, so an armed agent whose model
|
|
91
106
|
* declared nothing never writes the key — its commit log is the one it
|
|
92
|
-
* always had. Callers pass basis and standing rows
|
|
93
|
-
*
|
|
107
|
+
* always had. Callers pass basis and standing rows — each standing followed
|
|
108
|
+
* by the `unsettled-by-absence` row the rule files beside it, when it files
|
|
109
|
+
* one (`unsettled.ts · withUnsettledRows`); conflict rows are this function's
|
|
110
|
+
* to write.
|
|
94
111
|
*/
|
|
95
112
|
export declare function recordFindings(scope: FindingsScope, rows: readonly FindingsRow[]): void;
|
|
96
113
|
/**
|
|
@@ -19,9 +19,14 @@
|
|
|
19
19
|
* filed by the two moments `contingent.ts` serves: the route
|
|
20
20
|
* decider's answer and the dispatch loop's call) — identities,
|
|
21
21
|
* enums and numbers only. Assertion values, `settles`, `line`, the
|
|
22
|
-
* judged state
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* judged state, the contingent VALUE and — on an
|
|
23
|
+
* `unsettled-by-absence` row — a TOOL's own words (its envelope's
|
|
24
|
+
* `notChecked`, `cannotCover` and `tryInstead`) live in the
|
|
25
|
+
* committed key under whatever redaction the run configured; an
|
|
26
|
+
* event stream fans out to sinks we do not control. That row
|
|
27
|
+
* (9.113.0, filed by the same two moments through
|
|
28
|
+
* `unsettled.ts · withUnsettledRows`) emits nothing of its own, as
|
|
29
|
+
* a conflict row emits nothing of its own.
|
|
25
30
|
*
|
|
26
31
|
* ## Append only, last wins, conflicts are a fold
|
|
27
32
|
*
|
|
@@ -55,23 +60,32 @@ import { PROPOSITION_CHARS, } from './types.js';
|
|
|
55
60
|
export function foldLedger(rows) {
|
|
56
61
|
const standingOf = new Map();
|
|
57
62
|
const judgments = new Map();
|
|
63
|
+
const lastUnsettled = new Map();
|
|
58
64
|
for (const row of rows) {
|
|
59
65
|
if (row.kind === 'standing')
|
|
60
66
|
standingOf.set(row.toolCallId, row);
|
|
61
67
|
else if (row.kind === 'judgment')
|
|
62
68
|
judgments.set(row.toolCallId, row);
|
|
69
|
+
else if (row.kind === 'unsettled-by-absence')
|
|
70
|
+
lastUnsettled.set(row.toolCallId, row);
|
|
63
71
|
}
|
|
64
72
|
const asserted = [];
|
|
65
73
|
for (const row of standingOf.values()) {
|
|
66
74
|
if (row.standing === 'fact')
|
|
67
75
|
asserted.push(...row.assertions);
|
|
68
76
|
}
|
|
77
|
+
const unsettled = new Map();
|
|
78
|
+
for (const [toolCallId, row] of lastUnsettled) {
|
|
79
|
+
if (standingOf.get(toolCallId)?.standing === 'ruled-out')
|
|
80
|
+
unsettled.set(toolCallId, row);
|
|
81
|
+
}
|
|
69
82
|
return {
|
|
70
83
|
standingOf,
|
|
71
84
|
judgments,
|
|
72
85
|
asserted,
|
|
73
86
|
conflicts: conflictsOf(asserted),
|
|
74
87
|
hasStanding: standingOf.size > 0,
|
|
88
|
+
unsettled,
|
|
75
89
|
};
|
|
76
90
|
}
|
|
77
91
|
/**
|
|
@@ -103,8 +117,10 @@ function witnessesOf(conflict, standingOf) {
|
|
|
103
117
|
* key that first disagreed at this write, and emit one event per basis or
|
|
104
118
|
* standing row. No-op on an empty list, so an armed agent whose model
|
|
105
119
|
* declared nothing never writes the key — its commit log is the one it
|
|
106
|
-
* always had. Callers pass basis and standing rows
|
|
107
|
-
*
|
|
120
|
+
* always had. Callers pass basis and standing rows — each standing followed
|
|
121
|
+
* by the `unsettled-by-absence` row the rule files beside it, when it files
|
|
122
|
+
* one (`unsettled.ts · withUnsettledRows`); conflict rows are this function's
|
|
123
|
+
* to write.
|
|
108
124
|
*/
|
|
109
125
|
export function recordFindings(scope, rows) {
|
|
110
126
|
if (rows.length === 0)
|
|
@@ -195,6 +211,12 @@ function emitRow(scope, row, newConflicts, judgments) {
|
|
|
195
211
|
});
|
|
196
212
|
return;
|
|
197
213
|
}
|
|
214
|
+
// The row beside a ruled-out standing that rests on an absence (9.113.0)
|
|
215
|
+
// emits nothing of its own — the conflict row's precedent: it is on the
|
|
216
|
+
// committed key, the served piece is its reader, and no event field ships
|
|
217
|
+
// without a reader in the same release.
|
|
218
|
+
if (row.kind === 'unsettled-by-absence')
|
|
219
|
+
return;
|
|
198
220
|
if (row.kind !== 'standing')
|
|
199
221
|
return;
|
|
200
222
|
const conflictKeys = newConflicts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../../../../src/core/agent/findings/ledger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../../../../src/core/agent/findings/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAiB,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,YA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A8B;YACnF,6CAA6C,CAChD,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,EAAE,CAAC,EAAE;QACjB,QAAQ,EAAE,EAAE,CAAC,IAAI;QACjB,SAAS;QACT,KAAK,EAAE,WAAW,CAAC,KAAK;QACxB,GAAG,CAAC,WAAW,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;QACvE,GAAG,CAAC,WAAW,CAAC,WAAW,KAAK,SAAS,IAAI;YAC3C,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC;SAC/C,CAAC;QACF,GAAG,CAAC,WAAW,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvF,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,SAAS,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,IAAI,CAAC,MAAM,IAAI,iBAAiB;QAAE,OAAO,IAAI,CAAC;IAClD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,cAAc,IAAI,CAAC,MAAM,GAAG,iBAAiB,SAAS,CAAC;AACnG,CAAC"}
|
|
@@ -18,7 +18,11 @@
|
|
|
18
18
|
* standingRowsFrom` resolves a named id against. The offer and the
|
|
19
19
|
* identity source read the SAME served history, so every id the
|
|
20
20
|
* offer lists resolves: the law "the offer is what the model may
|
|
21
|
-
* COPY" holds at the row, not only at the schema.
|
|
21
|
+
* COPY" holds at the row, not only at the schema. All of them ask
|
|
22
|
+
* ONE predicate, `isResultMessage`: a message the batch settlement
|
|
23
|
+
* wrote (9.113.0, `LLMMessage.notDispatched`) is served — the model
|
|
24
|
+
* reads its sentence — and is no result, so it is never offered,
|
|
25
|
+
* resolved or counted undeclared.
|
|
22
26
|
*
|
|
23
27
|
* WHY AN OFFER. On a hosted model the ask "by its tool_result id" produced
|
|
24
28
|
* standings named by ORDINAL ("0", "1"), recorded as `unknownId` and settling
|
|
@@ -62,10 +66,21 @@ import type { FindingsLedger, Standing, StandingRow } from './types.js';
|
|
|
62
66
|
*/
|
|
63
67
|
export declare const RETIRING_STANDINGS: readonly Standing[];
|
|
64
68
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* the
|
|
69
|
+
* Is this message a tool's RESULT — the only thing a standing can be about?
|
|
70
|
+
* A `role: 'tool'` message the batch settlement wrote (9.113.0,
|
|
71
|
+
* `LLMMessage.notDispatched`) is not: the call never ran, so there is nothing
|
|
72
|
+
* to stand on. Read off the marker, never the sentence — which is why every
|
|
73
|
+
* caller hands these functions the COMMITTED conversation, not the wire,
|
|
74
|
+
* where `stripFrameworkFields` has already removed the marker (ids and order
|
|
75
|
+
* are the same either way).
|
|
76
|
+
*/
|
|
77
|
+
export declare function isResultMessage(m: LLMMessage): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The `role: 'tool'` ids on a message list, in wire order, each once — a
|
|
80
|
+
* settled message excluded (`isResultMessage`). A message without an id, or
|
|
81
|
+
* with an empty one, contributes nothing. The collapse (`serve.ts ·
|
|
82
|
+
* collapseJudged`) never changes an id, so the list is the same before and
|
|
83
|
+
* after it.
|
|
69
84
|
*/
|
|
70
85
|
export declare function servedToolCallIds(messages: readonly LLMMessage[]): readonly string[];
|
|
71
86
|
/**
|
|
@@ -107,6 +122,8 @@ export declare function offeredResultIds(messages: readonly LLMMessage[], rows:
|
|
|
107
122
|
* order changes no row; it is the source the rows resolved against before
|
|
108
123
|
* the history joined). An id in neither is `unknownId`, as written. A tool
|
|
109
124
|
* message with no `toolName` yields a result with none: nothing is invented
|
|
110
|
-
* for it.
|
|
125
|
+
* for it. A settled message (`isResultMessage`) is no result, so a model that
|
|
126
|
+
* names its id anyway files `unknownId` — the batch never holds one: a
|
|
127
|
+
* settled call never joins `toolResults`.
|
|
111
128
|
*/
|
|
112
129
|
export declare function knownResults(messages: readonly LLMMessage[], previousBatch?: readonly PreviousResult[]): readonly PreviousResult[];
|