agentfootprint 9.82.0 → 9.84.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 +718 -504
- package/CLAUDE.md +1 -0
- package/README.md +15 -15
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/dist/core/Agent.js +43 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/evidence/evidenceIndex.js +96 -11
- package/dist/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/core/agent/evidence/frames.js +15 -6
- package/dist/core/agent/evidence/frames.js.map +1 -1
- package/dist/core/agent/evidence/gate.js +66 -6
- package/dist/core/agent/evidence/gate.js.map +1 -1
- package/dist/core/agent/outputEnforcement.js +7 -4
- package/dist/core/agent/outputEnforcement.js.map +1 -1
- package/dist/core/agent/selfCallNotice.js +174 -0
- package/dist/core/agent/selfCallNotice.js.map +1 -0
- package/dist/core/agent/stages/route.js +71 -12
- package/dist/core/agent/stages/route.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +87 -2
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/agent/window/currentRequest.js +11 -13
- package/dist/core/agent/window/currentRequest.js.map +1 -1
- package/dist/core/agent/window/notice.js +9 -9
- package/dist/core/agent/window/notice.js.map +1 -1
- package/dist/core/agent/window/summarize.js +9 -9
- package/dist/core/agent/window/summarize.js.map +1 -1
- package/dist/doors/skill-graph.js +2 -1
- package/dist/doors/skill-graph.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +4 -0
- package/dist/esm/core/Agent.js +43 -1
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +15 -0
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/evidence/evidenceIndex.d.ts +91 -5
- package/dist/esm/core/agent/evidence/evidenceIndex.js +96 -11
- package/dist/esm/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/esm/core/agent/evidence/frames.d.ts +9 -4
- package/dist/esm/core/agent/evidence/frames.js +13 -5
- package/dist/esm/core/agent/evidence/frames.js.map +1 -1
- package/dist/esm/core/agent/evidence/gate.d.ts +27 -0
- package/dist/esm/core/agent/evidence/gate.js +66 -6
- package/dist/esm/core/agent/evidence/gate.js.map +1 -1
- package/dist/esm/core/agent/evidence/types.d.ts +12 -0
- package/dist/esm/core/agent/outputEnforcement.d.ts +1 -2
- package/dist/esm/core/agent/outputEnforcement.js +4 -2
- package/dist/esm/core/agent/outputEnforcement.js.map +1 -1
- package/dist/esm/core/agent/selfCallNotice.d.ts +140 -0
- package/dist/esm/core/agent/selfCallNotice.js +169 -0
- package/dist/esm/core/agent/selfCallNotice.js.map +1 -0
- package/dist/esm/core/agent/stages/route.d.ts +6 -1
- package/dist/esm/core/agent/stages/route.js +69 -10
- package/dist/esm/core/agent/stages/route.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +6 -0
- package/dist/esm/core/agent/stages/toolCalls.js +87 -2
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +66 -0
- package/dist/esm/core/agent/window/currentRequest.d.ts +9 -3
- package/dist/esm/core/agent/window/currentRequest.js +11 -13
- package/dist/esm/core/agent/window/currentRequest.js.map +1 -1
- package/dist/esm/core/agent/window/notice.d.ts +1 -4
- package/dist/esm/core/agent/window/notice.js +5 -6
- package/dist/esm/core/agent/window/notice.js.map +1 -1
- package/dist/esm/core/agent/window/summarize.d.ts +1 -4
- package/dist/esm/core/agent/window/summarize.js +5 -6
- package/dist/esm/core/agent/window/summarize.js.map +1 -1
- package/dist/esm/doors/skill-graph.d.ts +1 -1
- package/dist/esm/doors/skill-graph.js +1 -1
- package/dist/esm/doors/skill-graph.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +15 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrity/disposition/lifecycle.d.ts +17 -1
- package/dist/esm/integrity/disposition/lifecycle.js +26 -1
- package/dist/esm/integrity/disposition/lifecycle.js.map +1 -1
- package/dist/esm/integrity/finding/types.d.ts +12 -2
- package/dist/esm/integrity/finding/types.js.map +1 -1
- package/dist/esm/integrity/prior-turn-evidence/check.d.ts +145 -0
- package/dist/esm/integrity/prior-turn-evidence/check.js +200 -0
- package/dist/esm/integrity/prior-turn-evidence/check.js.map +1 -0
- package/dist/esm/lib/injection-engine/index.d.ts +1 -0
- package/dist/esm/lib/injection-engine/index.js +6 -0
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillToolDescriptors.d.ts +29 -0
- package/dist/esm/lib/injection-engine/skillToolDescriptors.js +90 -7
- package/dist/esm/lib/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/esm/lib/injection-engine/types.d.ts +54 -0
- package/dist/esm/lib/injection-engine/types.js +28 -0
- package/dist/esm/lib/injection-engine/types.js.map +1 -1
- package/dist/esm/lib/saidByPerson.d.ts +99 -0
- package/dist/esm/lib/saidByPerson.js +104 -0
- package/dist/esm/lib/saidByPerson.js.map +1 -0
- package/dist/esm/lib/trace-toolpack/traceToolpack.js +3 -2
- package/dist/esm/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/integrity/disposition/lifecycle.js +26 -1
- package/dist/integrity/disposition/lifecycle.js.map +1 -1
- package/dist/integrity/finding/types.js.map +1 -1
- package/dist/integrity/prior-turn-evidence/check.js +204 -0
- package/dist/integrity/prior-turn-evidence/check.js.map +1 -0
- package/dist/lib/injection-engine/index.js +9 -2
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/lib/injection-engine/skillToolDescriptors.js +92 -8
- package/dist/lib/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/lib/injection-engine/types.js +30 -1
- package/dist/lib/injection-engine/types.js.map +1 -1
- package/dist/lib/saidByPerson.js +111 -0
- package/dist/lib/saidByPerson.js.map +1 -0
- package/dist/lib/trace-toolpack/traceToolpack.js +3 -2
- package/dist/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/types/core/Agent.d.ts +4 -0
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +15 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/evidenceIndex.d.ts +91 -5
- package/dist/types/core/agent/evidence/evidenceIndex.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/frames.d.ts +9 -4
- package/dist/types/core/agent/evidence/frames.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/gate.d.ts +27 -0
- package/dist/types/core/agent/evidence/gate.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/types.d.ts +12 -0
- package/dist/types/core/agent/evidence/types.d.ts.map +1 -1
- package/dist/types/core/agent/outputEnforcement.d.ts +1 -2
- package/dist/types/core/agent/outputEnforcement.d.ts.map +1 -1
- package/dist/types/core/agent/selfCallNotice.d.ts +141 -0
- package/dist/types/core/agent/selfCallNotice.d.ts.map +1 -0
- package/dist/types/core/agent/stages/route.d.ts +6 -1
- package/dist/types/core/agent/stages/route.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +6 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +66 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/agent/window/currentRequest.d.ts +9 -3
- package/dist/types/core/agent/window/currentRequest.d.ts.map +1 -1
- package/dist/types/core/agent/window/notice.d.ts +1 -4
- package/dist/types/core/agent/window/notice.d.ts.map +1 -1
- package/dist/types/core/agent/window/summarize.d.ts +1 -4
- package/dist/types/core/agent/window/summarize.d.ts.map +1 -1
- package/dist/types/doors/skill-graph.d.ts +1 -1
- package/dist/types/doors/skill-graph.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +15 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integrity/disposition/lifecycle.d.ts +17 -1
- package/dist/types/integrity/disposition/lifecycle.d.ts.map +1 -1
- package/dist/types/integrity/finding/types.d.ts +12 -2
- package/dist/types/integrity/finding/types.d.ts.map +1 -1
- package/dist/types/integrity/prior-turn-evidence/check.d.ts +146 -0
- package/dist/types/integrity/prior-turn-evidence/check.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/index.d.ts +1 -0
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillToolDescriptors.d.ts +29 -0
- package/dist/types/lib/injection-engine/skillToolDescriptors.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/types.d.ts +54 -0
- package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
- package/dist/types/lib/saidByPerson.d.ts +100 -0
- package/dist/types/lib/saidByPerson.d.ts.map +1 -0
- package/dist/types/lib/trace-toolpack/traceToolpack.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -18,8 +18,18 @@
|
|
|
18
18
|
*
|
|
19
19
|
* ## What counts as evidence, and what deliberately does not
|
|
20
20
|
*
|
|
21
|
-
* • **Tool results** — the `role: 'tool'` turns in
|
|
22
|
-
*
|
|
21
|
+
* • **Tool results** — the `role: 'tool'` turns in `scope.history` AS IT
|
|
22
|
+
* STANDS AT JUDGEMENT. A value the model read from a tool is grounded.
|
|
23
|
+
*
|
|
24
|
+
* Say that precisely, because "the whole conversation" is only true for an
|
|
25
|
+
* agent with no window strategy. `.window()` / `.compaction()` /
|
|
26
|
+
* `tokenBudget` REWRITE `scope.history` in place (window.ts, `scope.history
|
|
27
|
+
* = result.window`), so on those agents this corpus is the LIVE WINDOW and
|
|
28
|
+
* a result the window has dropped is not in it — the same value then reads
|
|
29
|
+
* as ungrounded. `keepLastToolResults` (default 2) is what keeps the most
|
|
30
|
+
* recent observations pinned; nothing pins the rest. Anything computed from
|
|
31
|
+
* this index therefore describes what the run can still SEE, never
|
|
32
|
+
* everything it ever read.
|
|
23
33
|
* • **Object KEYS count.** A map keyed by WWN puts real identifiers in key
|
|
24
34
|
* position, and the model saw them exactly as it saw the values.
|
|
25
35
|
* • **Tool call ARGUMENTS do not count.** The model typed those. Grounding a
|
|
@@ -40,12 +50,61 @@
|
|
|
40
50
|
* system-prompt content this turn was built from. A value the user supplied is
|
|
41
51
|
* not a fabrication — the user gave it — and neither is one the app's own
|
|
42
52
|
* prompt or skill body put in front of the model.
|
|
53
|
+
*
|
|
54
|
+
* ## WHEN a value was read, and why the corpus is still conversation-wide
|
|
55
|
+
*
|
|
56
|
+
* The corpus above answers "did the run read this?" and says nothing about
|
|
57
|
+
* WHEN. That gap has a measured cost: an agent answered a fresh question with
|
|
58
|
+
* ZERO tool calls, and the gate approved it because all seven values appeared
|
|
59
|
+
* in an inventory result fetched four turns earlier for a different question.
|
|
60
|
+
* Grounded, and four turns out of date.
|
|
61
|
+
*
|
|
62
|
+
* The fix is NOT to narrow the corpus to this turn. "And what about that
|
|
63
|
+
* disk?" legitimately leans on the previous turn's rows, and flagging those
|
|
64
|
+
* would make the gate cry wolf until somebody switched it off. So the corpus
|
|
65
|
+
* stays whole and every indexed form carries the TURN it was last served in
|
|
66
|
+
* — one number, stamped during the walk that was happening anyway.
|
|
67
|
+
*
|
|
68
|
+
* A TURN starts at each `role: 'user'` message the library did NOT author.
|
|
69
|
+
* `isLibraryAuthoredTurn` (frames.ts) is a statement about AUTHORSHIP, not
|
|
70
|
+
* about time — it exists to keep the exempt corpus from swallowing the gate's
|
|
71
|
+
* own corrections — and it is reused here for a different reason that happens
|
|
72
|
+
* to need the same predicate: a frame the library wrote is not a person asking
|
|
73
|
+
* something new. Excluding them is load-bearing rather than tidy. The evidence
|
|
74
|
+
* recheck appends a `role: 'user'` turn MID-RUN, so counting it as a boundary
|
|
75
|
+
* would push this turn's own tool results into the "earlier" bucket and file a
|
|
76
|
+
* notice against every revised answer.
|
|
77
|
+
*
|
|
78
|
+
* Turn 1 is the first user message still in the window; anything indexed
|
|
79
|
+
* before one (a history with no user turn at all) is turn 0, which is also
|
|
80
|
+
* `currentTurn`, so nothing can read as earlier and no notice can be filed
|
|
81
|
+
* from a conversation with no boundary in it.
|
|
82
|
+
*
|
|
83
|
+
* **The ordinals are WINDOW-RELATIVE**, and that is the honest bound: they
|
|
84
|
+
* count the user turns the run can still see, so under a window strategy
|
|
85
|
+
* "turn 2 of 4" may be the conversation's turn 9 of 13. The BOUNDARY is
|
|
86
|
+
* exact regardless — the current request is un-droppable by every window
|
|
87
|
+
* strategy (`'current-request'`, window/currentRequest.ts) — so "this turn
|
|
88
|
+
* versus earlier" holds; only the DISTANCE is a floor.
|
|
43
89
|
*/
|
|
44
90
|
import type { LLMMessage } from '../../../adapters/types.js';
|
|
45
91
|
import type { InjectionRecord } from '../../../recorders/core/types.js';
|
|
46
92
|
/** A finished index plus the honesty flag that says whether it is complete. */
|
|
47
93
|
export interface EvidenceCorpus {
|
|
48
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Every indexed form, stamped with the LATEST turn whose tool result
|
|
96
|
+
* carried it.
|
|
97
|
+
*
|
|
98
|
+
* A Map rather than a Set plus a second structure: the walk already visits
|
|
99
|
+
* each leaf once, so the turn is an attribute of the entry it was going to
|
|
100
|
+
* write anyway. `.has()` reads exactly as it did when this was a Set, which
|
|
101
|
+
* is all the grounding decision ever needed; `.get()` is the new half.
|
|
102
|
+
*
|
|
103
|
+
* LATEST, not first, and the direction is the whole point: the question is
|
|
104
|
+
* "could this turn's own results have supplied this value?", so a form
|
|
105
|
+
* served in turn 2 and again in turn 7 is turn 7's.
|
|
106
|
+
*/
|
|
107
|
+
readonly values: ReadonlyMap<string, number>;
|
|
49
108
|
/**
|
|
50
109
|
* True when the ceiling was hit and the index is INCOMPLETE. The gate
|
|
51
110
|
* downgrades itself to record-only when this is set: a partial corpus can
|
|
@@ -53,14 +112,28 @@ export interface EvidenceCorpus {
|
|
|
53
112
|
* corpus is worse than no accusation at all.
|
|
54
113
|
*/
|
|
55
114
|
readonly truncated: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* The turn in progress — the ordinal every stamp above is compared against.
|
|
117
|
+
* `0` means the history carries no user turn at all, so there is no
|
|
118
|
+
* boundary and nothing can be attributed to an earlier one.
|
|
119
|
+
*/
|
|
120
|
+
readonly currentTurn: number;
|
|
121
|
+
/**
|
|
122
|
+
* How many `role: 'tool'` results this turn served. `0` is the sharp case:
|
|
123
|
+
* a turn that fetched nothing sourced every value in its answer from
|
|
124
|
+
* history, by construction and without needing the index to prove it.
|
|
125
|
+
*/
|
|
126
|
+
readonly toolResultsThisTurn: number;
|
|
56
127
|
}
|
|
57
128
|
/**
|
|
58
|
-
* Build the evidence corpus from
|
|
129
|
+
* Build the evidence corpus from the history AS IT STANDS: every `role: 'tool'`
|
|
130
|
+
* turn still in it, each indexed form stamped with the turn that served it.
|
|
59
131
|
*
|
|
60
132
|
* In a single-turn run these are exactly this turn's tool results. In a
|
|
61
133
|
* continued conversation the earlier turns' results are in here too, and that
|
|
62
134
|
* is deliberate: the model really did read them, and calling a value from turn
|
|
63
|
-
* one a fabrication in turn two would be false.
|
|
135
|
+
* one a fabrication in turn two would be false. Which earlier turns are still
|
|
136
|
+
* here is the WINDOW's decision, not this function's — see the header.
|
|
64
137
|
*/
|
|
65
138
|
export declare function evidenceFromHistory(history: readonly LLMMessage[]): EvidenceCorpus;
|
|
66
139
|
/**
|
|
@@ -73,6 +146,19 @@ export declare function evidenceFromHistory(history: readonly LLMMessage[]): Evi
|
|
|
73
146
|
* summarised or redacted contributes what it has. That direction is the safe
|
|
74
147
|
* one: a missing exemption can only cost a false flag on a value the app
|
|
75
148
|
* supplied, and the caller can name it in `exempt`.
|
|
149
|
+
*
|
|
150
|
+
* STATED REACH, because `systemPromptInjections` is broader than "the app's
|
|
151
|
+
* own prompt": it also carries `.memory()` recall and RAG passages. A value
|
|
152
|
+
* that reached the model through memory or retrieval is therefore EXEMPT from
|
|
153
|
+
* grounding — never flagged, and never counted as tool evidence of any turn,
|
|
154
|
+
* so it is invisible to the recency read too. That is the correct call for the
|
|
155
|
+
* fabrication question (the run really did put those words in front of the
|
|
156
|
+
* model) and a real blind spot for the recency one, and it is deliberately NOT
|
|
157
|
+
* fixed here: recall is its own seam, with its own record
|
|
158
|
+
* (`retrievalEvidence_<id>`, `agentfootprint.memory.attached`), and giving a
|
|
159
|
+
* recalled passage a turn stamp means deciding whose turn it belongs to — the
|
|
160
|
+
* one it was written in or the one it was recalled in — which is a question
|
|
161
|
+
* this file has no standing to answer.
|
|
76
162
|
*/
|
|
77
163
|
export declare function exemptFromRun(args: {
|
|
78
164
|
readonly userMessage?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidenceIndex.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/evidenceIndex.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"evidenceIndex.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/evidenceIndex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAYxE,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC;AAuFD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,cAAc,CAsBlF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CAC9D,GAAG,WAAW,CAAC,MAAM,CAAC,CAwBtB"}
|
|
@@ -22,16 +22,21 @@
|
|
|
22
22
|
* from the exempt corpus. The frames are stable exported constants for this
|
|
23
23
|
* reason as much as for the tests that match on them.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
* and readers match on it. */
|
|
27
|
-
export declare const EVIDENCE_CHECK_FRAME_PREFIX = "[evidence check";
|
|
25
|
+
export { EVIDENCE_CHECK_FRAME_PREFIX } from '../../../lib/saidByPerson.js';
|
|
28
26
|
/**
|
|
29
|
-
* True when this message content is a
|
|
27
|
+
* True when this message content is a CORRECTION the library wrote.
|
|
30
28
|
*
|
|
31
29
|
* Both in-loop corrections are listed: the schema re-ask quotes a validator's
|
|
32
30
|
* message about the model's own output, and the evidence recheck quotes the
|
|
33
31
|
* model's own values. Neither is a person supplying data, and treating either
|
|
34
32
|
* as one would exempt the very text it was written to challenge.
|
|
33
|
+
*
|
|
34
|
+
* DELIBERATELY NARROWER than `isSaidByPerson` (9.84.0), which excludes all
|
|
35
|
+
* four authored frames. This one is the exempt corpus's rule, and the exempt
|
|
36
|
+
* corpus is about who SUPPLIED a value, not who typed the message: widening it
|
|
37
|
+
* to the drop notice and the compaction frame would change which values the
|
|
38
|
+
* evidence gate exempts, which is a decision about the gate and not about
|
|
39
|
+
* authorship. Read `LIBRARY_AUTHORED_PREFIXES` if you want the whole list.
|
|
35
40
|
*/
|
|
36
41
|
export declare function isLibraryAuthoredTurn(content: string): boolean;
|
|
37
42
|
//# sourceMappingURL=frames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAUH,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI9D"}
|
|
@@ -42,6 +42,13 @@
|
|
|
42
42
|
* unexamined. A missed fabrication is a miss; a false accusation costs a real
|
|
43
43
|
* turn and can refuse a good answer, so the bias points the way it does.
|
|
44
44
|
*
|
|
45
|
+
* **And it does not ask WHEN.** A value read four turns ago for a different
|
|
46
|
+
* question is as grounded here as one read a second ago — which is a measured
|
|
47
|
+
* failure, not a hypothetical (see `../../../integrity/prior-turn-evidence`).
|
|
48
|
+
* That fact is reported beside this check, never folded into it: the gate's
|
|
49
|
+
* job is "was this read at all", and answering a second question through the
|
|
50
|
+
* same verdict would make one dial control two decisions.
|
|
51
|
+
*
|
|
45
52
|
* ## Why the check is DETERMINISTIC
|
|
46
53
|
*
|
|
47
54
|
* No model call, no embedding, no judge. The library's thesis is that
|
|
@@ -69,6 +76,13 @@ export declare function resolveEvidenceGate(opts?: NamesAndNumbersOptions): Reso
|
|
|
69
76
|
*
|
|
70
77
|
* `exempt` is checked BEFORE the evidence: a value the user supplied is not a
|
|
71
78
|
* fabrication whether or not a tool ever echoed it back.
|
|
79
|
+
*
|
|
80
|
+
* The same pass reports WHEN each grounded value was read (`grounding`) — the
|
|
81
|
+
* time axis the corpus gained in 9.83.0. Three buckets, and an exempt value is
|
|
82
|
+
* in none of them: exemption is a statement about who SUPPLIED a value, and a
|
|
83
|
+
* value the app or the person put in front of the model was never something
|
|
84
|
+
* the run had to go and look up. Counting one as tool evidence — of any turn —
|
|
85
|
+
* would answer a question nobody asked.
|
|
72
86
|
*/
|
|
73
87
|
export declare function checkAnswer(answer: string, args: {
|
|
74
88
|
readonly gate: ResolvedEvidenceGate;
|
|
@@ -92,6 +106,19 @@ export declare function describeValues(values: readonly UnsupportedValue[]): str
|
|
|
92
106
|
* compaction frame and the schema frame follow, and a rule with an exception
|
|
93
107
|
* is not a rule.
|
|
94
108
|
*
|
|
109
|
+
* ## The scope this sentence used to claim, and no longer does (9.83.0)
|
|
110
|
+
*
|
|
111
|
+
* Both this frame and {@link evidenceRefusalSentence} said the flagged values
|
|
112
|
+
* "appear in NO tool result FROM THIS TURN". The index they are written from
|
|
113
|
+
* has never been turn-scoped — it walks every `role: 'tool'` turn in
|
|
114
|
+
* `scope.history` — so the sentence named a boundary the check did not honour,
|
|
115
|
+
* in the two places the claim is read by a model and by an operator. It was
|
|
116
|
+
* also needlessly weak: a flagged value appears in no tool result the run can
|
|
117
|
+
* point at AT ALL, which is a stronger and true thing to say. So the words
|
|
118
|
+
* changed to the check's real reach. The recency fact the old wording gestured
|
|
119
|
+
* at is now reported where it can be measured — `prior-turn-evidence`, off by
|
|
120
|
+
* default — instead of asserted here where it could not be.
|
|
121
|
+
*
|
|
95
122
|
* `stagedRefs` (optional) is the staged-refs join computed by the recheck
|
|
96
123
|
* stage: when this turn holds placed artifact tickets a served `wants` tool
|
|
97
124
|
* can spend, the frame names the refs and the spender by their declared names
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+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AAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAetF;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,OAAO,GACf,MAAM,CAgBR"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Role: core/ layer. Nothing here runs; it is the contract.
|
|
7
7
|
* Emits: N/A.
|
|
8
8
|
*/
|
|
9
|
+
import type { AnswerGroundingReading } from '../../../integrity/prior-turn-evidence/check.js';
|
|
9
10
|
/**
|
|
10
11
|
* How hard the check pushes back. **Same three words as the skill-graph
|
|
11
12
|
* routing dial, deliberately** — one posture vocabulary across the library —
|
|
@@ -138,5 +139,16 @@ export interface EvidenceVerdict {
|
|
|
138
139
|
* accusation.
|
|
139
140
|
*/
|
|
140
141
|
readonly evidenceTruncated: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* WHEN the answer's grounded values were read (9.83.0) — the same pass,
|
|
144
|
+
* one time axis.
|
|
145
|
+
*
|
|
146
|
+
* Always computed, because it is three counters over a loop that was
|
|
147
|
+
* already running. It is only READ when the operator armed
|
|
148
|
+
* `AgentOptions.noticePriorTurnEvidence`, which is what turns it into a
|
|
149
|
+
* `prior-turn-evidence` finding; nothing else in the gate consults it and
|
|
150
|
+
* no posture changes because of it.
|
|
151
|
+
*/
|
|
152
|
+
readonly grounding: AnswerGroundingReading;
|
|
141
153
|
}
|
|
142
154
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAE3D;;;;;;;;;;;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;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C,uEAAuE;IACvE,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAC;CAC5C"}
|
|
@@ -105,8 +105,7 @@ export interface OutputFailure {
|
|
|
105
105
|
* the two paths report a failure the same way.
|
|
106
106
|
*/
|
|
107
107
|
export declare function describeFailure(err: unknown): OutputFailure;
|
|
108
|
-
|
|
109
|
-
export declare const SCHEMA_CHECK_FRAME_PREFIX = "[schema check";
|
|
108
|
+
export { SCHEMA_CHECK_FRAME_PREFIX } from '../../lib/saidByPerson.js';
|
|
110
109
|
/**
|
|
111
110
|
* The two messages a failed attempt adds to the conversation: the answer
|
|
112
111
|
* that failed, and the correction.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputEnforcement.d.ts","sourceRoot":"","sources":["../../../../src/core/agent/outputEnforcement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,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3C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAe/C;AAID;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC7C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC;;0EAEsE;IACtE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAClC,aAAa,GAAG,SAAS,CAO3B"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The answer a `read_skill` SELF-CALL gets back (9.84.0).
|
|
3
|
+
*
|
|
4
|
+
* A self-call is `read_skill("X")` from a cursor already standing on X. It used
|
|
5
|
+
* to fall through the skill-graph gate's reachability arm — `makeReachableSkills`
|
|
6
|
+
* filters the cursor out of its own successor set (a MOVE to where you already
|
|
7
|
+
* are is not a move) and `openSkillIds()` excludes every graph-wired skill, so
|
|
8
|
+
* the cursor's own id is in neither half of `hops ∪ open`. The model was told:
|
|
9
|
+
*
|
|
10
|
+
* read_skill("X") is not reachable from here. Reachable skills: …
|
|
11
|
+
*
|
|
12
|
+
* while X's body was in its system prompt and X's tools were in that very call's
|
|
13
|
+
* tool list. Read as a statement about AVAILABILITY — which is how a model reads
|
|
14
|
+
* "not reachable" — that is a flat contradiction of the request it arrived in,
|
|
15
|
+
* and the observed behaviour was to stop and answer that it could not help.
|
|
16
|
+
*
|
|
17
|
+
* ── THE LAW THIS FILE IS WRITTEN AGAINST ──────────────────────────────────
|
|
18
|
+
*
|
|
19
|
+
* A TOOL RESULT IS NOT READ ONCE. It is composed during iteration N, written
|
|
20
|
+
* into `history`, and then read by the model on call N+1 AND ON EVERY CALL
|
|
21
|
+
* AFTER IT for the rest of the turn — including the out-of-budget WRAP-UP,
|
|
22
|
+
* which `callLLM` serves with an EMPTY tool list under a user message saying
|
|
23
|
+
* "Do not request tools".
|
|
24
|
+
*
|
|
25
|
+
* The consequence is the whole design: NO COMPOSE-TIME CHECK CAN MAKE A
|
|
26
|
+
* FORWARD-LOOKING SENTENCE SAFE. A budget test, a posture test, a cursor test
|
|
27
|
+
* — each is true at the instant it runs and each is outlived by the sentence
|
|
28
|
+
* it admitted. Three rounds of this file fixed one clause at a time and each
|
|
29
|
+
* time a different clause was still false, because every one of them was a
|
|
30
|
+
* PREDICTION and the fix was always a better prediction.
|
|
31
|
+
*
|
|
32
|
+
* So the notice makes no predictions at all. Every clause is a fact about ONE
|
|
33
|
+
* already-finished event — the call the model made `read_skill` on — and every
|
|
34
|
+
* clause is anchored to that call by name ("that call"), never by deixis ("the
|
|
35
|
+
* call you just made", which denotes a different call each time it is re-read).
|
|
36
|
+
* A past fact about a named call cannot be falsified by anything that happens
|
|
37
|
+
* afterwards: not by the budget running out, not by a posture refusing a hop,
|
|
38
|
+
* not by a sibling tool in the same batch moving the cursor.
|
|
39
|
+
*
|
|
40
|
+
* ── WHAT WAS DELETED, AND WHY THE NOTICE STILL DOES ITS JOB ───────────────
|
|
41
|
+
*
|
|
42
|
+
* Gone: the exhortation ("Go ahead and act on the request"), the move offer
|
|
43
|
+
* ("read_skill MOVES you somewhere else — from here that would be: beta"), the
|
|
44
|
+
* open-skill offer ("These activate without moving you: gamma"), and the
|
|
45
|
+
* budget clause that was added to gate them. Each was false somewhere:
|
|
46
|
+
*
|
|
47
|
+
* • the exhortation, on the wrap-up call, beside "Do not request tools";
|
|
48
|
+
* • the move offer, on the wrap-up call (a hop is a tool call), under
|
|
49
|
+
* `strictness: 'rails'` (every model hop refused) and under `'guard'` on a
|
|
50
|
+
* decisively-routed turn (every hop not on an outstanding menu refused) —
|
|
51
|
+
* where the sibling posture arm answers a taken-up offer with "read_skill
|
|
52
|
+
* here reaches only the open skills: gamma", contradicting the notice from
|
|
53
|
+
* the arm immediately above it, and spending escalation budget to do so;
|
|
54
|
+
* • the budget clause, because a budget read at compose time is a claim
|
|
55
|
+
* about a call that has not happened.
|
|
56
|
+
*
|
|
57
|
+
* The notice's JOB is to stop a model concluding its capability is gone. It
|
|
58
|
+
* does that by stating what it held, not by promising what it may do: you were
|
|
59
|
+
* standing in this skill, its instructions were in that call's prompt, its
|
|
60
|
+
* tools were on that call's wire, and asking took nothing away. A model that
|
|
61
|
+
* reads those four facts has no ground left for "I cannot help".
|
|
62
|
+
*
|
|
63
|
+
* The forward-looking half had a rightful owner all along, and it is not a
|
|
64
|
+
* tool result: the `read_skill` DESCRIPTION is recomposed on every single call,
|
|
65
|
+
* so it can safely speak in the present ("You are in 'beta'."), it is filtered
|
|
66
|
+
* for per-role visibility at source, and it is absent from the wrap-up because
|
|
67
|
+
* the whole tool list is. One owner for the present tense, one for the past,
|
|
68
|
+
* and they can no longer disagree — which is the only property that survived
|
|
69
|
+
* every round of this bug.
|
|
70
|
+
*/
|
|
71
|
+
import type { ActiveInjection } from '../../lib/injection-engine/types.js';
|
|
72
|
+
import type { LLMToolSchema } from '../../adapters/types.js';
|
|
73
|
+
/** What the current skill's tools did on the call the model made `read_skill` on. */
|
|
74
|
+
export interface SelfSkillTools {
|
|
75
|
+
/** Every tool the skill declares — `[]` for a skill that declares none. */
|
|
76
|
+
readonly declared: readonly string[];
|
|
77
|
+
/** Those actually on that call's wire. A subset of `declared`. */
|
|
78
|
+
readonly served: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The skill's tools, as of the call the model just made — or `undefined` when
|
|
82
|
+
* that cannot be established, which is not the same answer and must not be
|
|
83
|
+
* reported as one.
|
|
84
|
+
*
|
|
85
|
+
* `undefined` means the notice says nothing about tools at all. It happens when
|
|
86
|
+
* the tools slot composed no per-iteration list (`reactMode: 'classic'` caches
|
|
87
|
+
* the slot, and `callLLM` falls back to its build-time schemas), or when the
|
|
88
|
+
* cursor's skill is not in the active set. Silence is the only honest output
|
|
89
|
+
* there: the alternative is a sentence naming tools the model may not have.
|
|
90
|
+
*
|
|
91
|
+
* The out-of-budget wrap-up is NOT one of these cases and must not be modelled
|
|
92
|
+
* as one. Its empty tool list belongs to a LATER call; the wire read here is
|
|
93
|
+
* always the one the model was really handed on the call being answered, and
|
|
94
|
+
* the notice speaks of that call and only that call.
|
|
95
|
+
*/
|
|
96
|
+
export declare function selfSkillTools(skillId: string, activeInjections: readonly ActiveInjection[] | undefined, wire: readonly LLMToolSchema[] | undefined): SelfSkillTools | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* The self-call's tool result.
|
|
99
|
+
*
|
|
100
|
+
* NOT a refusal to the MODEL, and deliberately so. The gate's other two arms
|
|
101
|
+
* refuse because the model asked for something it may not have; a self-call
|
|
102
|
+
* asks for a body it already holds, and the useful reply is the fact — where
|
|
103
|
+
* you stood, and what rode that call — not a decline. It is still counted as a
|
|
104
|
+
* refusal by the ESCALATION BUDGET (`noteSkillRefusal`, beside the emit), and
|
|
105
|
+
* those two facts do not fight: the budget is not measuring how the sentence
|
|
106
|
+
* reads, it is measuring a model that keeps asking the graph where it is
|
|
107
|
+
* instead of working, which is exactly the stuck run the budget escalates.
|
|
108
|
+
*
|
|
109
|
+
* It still OVERWRITES the tool's own result the way every other arm does,
|
|
110
|
+
* because that overwrite is what puts the authoritative sentence in front of
|
|
111
|
+
* the governance rules, the refusal cap and the after-tool moment, on both
|
|
112
|
+
* channels, before the model reads anything.
|
|
113
|
+
*
|
|
114
|
+
* The one thing not overwritten is a BODY. The live case is `surfaceMode:
|
|
115
|
+
* 'both'` — `'tool-only'` cannot arise here, because `skillBodyDelivery`
|
|
116
|
+
* refuses it at BUILD time for anything but an `llm-activated` skill and only a
|
|
117
|
+
* graph-wired skill can be the cursor. Under `'both'` the body is in the system
|
|
118
|
+
* prompt AND rides the tool result, and the second copy is the whole point of
|
|
119
|
+
* the mode: recency-first delivery, the body at the end of the window rather
|
|
120
|
+
* than only at the top of the prompt. Dropping it here would quietly demote
|
|
121
|
+
* `'both'` to `'system-prompt'` on the one call that asked to re-read.
|
|
122
|
+
*
|
|
123
|
+
* TENSE IS LOAD-BEARING, AND SO IS DEIXIS. Every clause below is past tense
|
|
124
|
+
* about a single named call, and every reference to that call is "that call" —
|
|
125
|
+
* bound by the opening clause, which says which call it was. "The call you just
|
|
126
|
+
* made" was the earlier wording and it is not safe: re-read four calls later it
|
|
127
|
+
* denotes call four, and the tools it names rode call one.
|
|
128
|
+
*
|
|
129
|
+
* There are exactly two present-tense phrases in the output and both are
|
|
130
|
+
* timeless rather than temporal: "It declares no tools of its own" (a
|
|
131
|
+
* declaration is fixed when the skill is defined and cannot vary within a run)
|
|
132
|
+
* and "Its instructions are repeated below" (the body is appended to this very
|
|
133
|
+
* string, so the sentence is true wherever the string is read).
|
|
134
|
+
*/
|
|
135
|
+
export declare function selfCallNotice(args: {
|
|
136
|
+
readonly skillId: string;
|
|
137
|
+
/** `undefined` when the wire could not be established — see `selfSkillTools`. */
|
|
138
|
+
readonly tools: SelfSkillTools | undefined;
|
|
139
|
+
readonly body?: string;
|
|
140
|
+
}): string;
|
|
141
|
+
//# sourceMappingURL=selfCallNotice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selfCallNotice.d.ts","sourceRoot":"","sources":["../../../../src/core/agent/selfCallNotice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EACxD,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,GACzC,cAAc,GAAG,SAAS,CAO5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAoCT"}
|
|
@@ -75,5 +75,10 @@ hasWrapUp?: boolean,
|
|
|
75
75
|
* Both absent → the claim seam never runs and not one line changes. */
|
|
76
76
|
claims?: readonly DeclaredClaim[], integrityLedger?: {
|
|
77
77
|
current: DispositionLedger | undefined;
|
|
78
|
-
}
|
|
78
|
+
},
|
|
79
|
+
/** `AgentOptions.noticePriorTurnEvidence` (9.83.0) — the claim seam's
|
|
80
|
+
* recency read. Needs the evidence gate to be armed too (it owns the
|
|
81
|
+
* extractor), so absent OR gate-less → not one row, not one event, and
|
|
82
|
+
* the decider a pre-9.83.0 chart was handed. */
|
|
83
|
+
noticePriorTurnEvidence?: boolean): (scope: TypedScope<AgentState>) => RouteBranch | Promise<RouteBranch>;
|
|
79
84
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/stages/route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAE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,iBAAiB,EAAE,EAChD,WAAW,CAAC,EAAE,yBAAyB,EACvC,WAAW,CAAC,EAAE,WAAW,EACzB,QAAQ,CAAC,EAAE,oBAAoB;AAC/B;;oEAEoE;AACpE,SAAS,UAAQ;AACjB;wEACwE;AACxE,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,EACjC,eAAe,CAAC,EAAE;IAAE,OAAO,EAAE,iBAAiB,GAAG,SAAS,CAAA;CAAE;AAC5D;;;iDAGiD;AACjD,uBAAuB,CAAC,EAAE,OAAO,GAChC,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAsEvE"}
|
|
@@ -251,6 +251,12 @@ export interface ToolCallsHandlerDeps {
|
|
|
251
251
|
* • `'rails'` — routing picks are refused outright: rules/scorer resolve
|
|
252
252
|
* turn starts, declared routes handle transitions.
|
|
253
253
|
* Same graph, same trace: postures change refusal behavior only.
|
|
254
|
+
*
|
|
255
|
+
* Read only by the `read_skill` gate below, and that is the whole scope:
|
|
256
|
+
* `applyToolEffects` never consults it, because a `propose-transition`
|
|
257
|
+
* comes from a tool — the author's own code — and is admitted under every
|
|
258
|
+
* posture against reachability alone. See `SkillGraphOptions.strictness`
|
|
259
|
+
* (AgentBuilder.ts), which states the exemption for authors.
|
|
254
260
|
*/
|
|
255
261
|
readonly skillStrictness?: 'guard' | 'rails';
|
|
256
262
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolCalls.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/stages/toolCalls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"toolCalls.d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
|
566
|
+
* Notice when the final answer's values were ALL read before this turn
|
|
567
|
+
* (9.83.0) — the claim seam's `prior-turn-evidence` advisory. **Default
|
|
568
|
+
* off.**
|
|
569
|
+
*
|
|
570
|
+
* The recorded failure: an agent answered a data question with ZERO tool
|
|
571
|
+
* calls, and the evidence gate approved it — "all 7 values in the answer
|
|
572
|
+
* were found in what the tools returned". They were: in an inventory result
|
|
573
|
+
* fetched four turns earlier for a different question. The user had asked
|
|
574
|
+
* about array performance; the answer recommended enabling a collector that
|
|
575
|
+
* had been running for months. Two turns did it back to back. The gate
|
|
576
|
+
* measures GROUNDEDNESS and had no notion of WHEN a value was grounded —
|
|
577
|
+
* while SAYING it did: both of its sentences claimed the flagged values
|
|
578
|
+
* "appear in no tool result from this turn", a boundary the index never
|
|
579
|
+
* honoured. 9.83.0 narrowed those sentences to what the gate really reaches
|
|
580
|
+
* and made the boundary measurable here instead.
|
|
581
|
+
*
|
|
582
|
+
* What the library CAN see, once every indexed form carries the turn that
|
|
583
|
+
* served it, is that every value the answer states was last served BEFORE
|
|
584
|
+
* the turn being answered — and that this turn contributed none of them.
|
|
585
|
+
* Turn this on and each such answer files one `advisory` finding on
|
|
586
|
+
* `agentfootprint.integrity.context_error`, naming the count, the newest
|
|
587
|
+
* turn they came from, how far back that is, and how many tool results this
|
|
588
|
+
* turn served (`0` is the sharp case: an answer assembled entirely from the
|
|
589
|
+
* conversation).
|
|
590
|
+
*
|
|
591
|
+
* THE CEILING, and it is why this never accuses: an answer that legitimately
|
|
592
|
+
* refers back to an earlier result is indistinguishable, by evidence alone,
|
|
593
|
+
* from one that has gone stale. This reports WHERE the values came from,
|
|
594
|
+
* never whether they were still the ones the reader wanted. The same
|
|
595
|
+
* advisory is filed for the honest follow-up and the stale answer, because
|
|
596
|
+
* nothing in this library can tell them apart. Every finding carries the
|
|
597
|
+
* ceiling sentence (`PRIOR_TURN_EVIDENCE_CEILING`) in its own message.
|
|
598
|
+
*
|
|
599
|
+
* WHAT IT CAN SEE, and it is narrower than "the conversation": the evidence
|
|
600
|
+
* corpus is `scope.history` as it stands at judgement, which on an agent
|
|
601
|
+
* with `.window()` / `.compaction()` / `tokenBudget` is the LIVE WINDOW. So
|
|
602
|
+
* the turn ordinals count the turns the run can still see and the distance
|
|
603
|
+
* is a FLOOR (the boundary itself is exact — the current request is
|
|
604
|
+
* un-droppable). And a value that reached the model through `.memory()`
|
|
605
|
+
* recall or RAG is exempt from grounding altogether, so it is invisible
|
|
606
|
+
* here: this can under-report, never over-report.
|
|
607
|
+
*
|
|
608
|
+
* WHAT KEEPS AN HONEST FOLLOW-UP QUIET. ONE grounded value from this turn's
|
|
609
|
+
* own results is enough to file nothing — the claim being tested is that
|
|
610
|
+
* EVERY value came from earlier, and one that did not falsifies it. A
|
|
611
|
+
* follow-up that calls a tool usually gets that for free: a lookup keyed on
|
|
612
|
+
* an earlier identifier echoes the identifier back in its own result, so the
|
|
613
|
+
* value is re-served this turn. The evidence corpus is deliberately NOT
|
|
614
|
+
* narrowed to this turn — "and what about that disk?" leans on the previous
|
|
615
|
+
* turn's rows legitimately, and flagging those would make the gate cry wolf
|
|
616
|
+
* until somebody switched it off.
|
|
617
|
+
*
|
|
618
|
+
* TWO HALVES ARM IT: this dial AND `.namesAndNumbersFromEvidence()`. The
|
|
619
|
+
* gate is not a policy companion here — it owns the extractor that decides
|
|
620
|
+
* which tokens in an answer are DATA at all, so without it there is nothing
|
|
621
|
+
* whose provenance could be read. Absent, the run is byte-identical: no
|
|
622
|
+
* finding, no event, no branch changes, and the posture decides exactly what
|
|
623
|
+
* it always decided. The one visible difference is the registered
|
|
624
|
+
* `prior-turn-evidence` row in the disposition report, filed
|
|
625
|
+
* `not-applicable` — registered-but-unarmed is a ROW, never silence.
|
|
626
|
+
*
|
|
627
|
+
* It REPORTS. Whether an answer is advised or refused stays the evidence
|
|
628
|
+
* gate's `posture`; nothing here blocks, revises or rewrites anything.
|
|
629
|
+
*/
|
|
630
|
+
readonly noticePriorTurnEvidence?: boolean;
|
|
565
631
|
/**
|
|
566
632
|
* Check a tool's rows against the columns it declared (9.78.0) — the write
|
|
567
633
|
* seam's COLUMN-TYPE CONTRACT. **Default `'off'`.**
|