attenu-guard 0.4.0 → 0.5.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 CHANGED
@@ -6,7 +6,240 @@ follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## [0.4.0] 2026-08-31
9
+ ## [0.5.0] - 2026-08-31
10
+
11
+ ### Fixed
12
+ - **Adapter mirror of the Python batch-1/batch-2 adversarial review.** The TS package ships
13
+ exactly one adapter surface (`src/adapters/langgraph.ts` — `package.json`'s `exports` map
14
+ declares nothing besides `.` and `./adapters/langgraph`; no A2A, no generic wrapper, no
15
+ separate LangChain.js seam), and execution binding was already fully wired into both
16
+ `guardNode` and `guardTool` as of 0.4.0. Each Python defect class was checked against this
17
+ specific adapter, against pinned `@langchain/core@1.2.9`/`@langchain/langgraph@1.4.13` source
18
+ (installed and grepped directly, not assumed), rather than ported by analogy — see the module
19
+ doc comment's own "Adversarial review" section for the full per-class evidence. Six of the
20
+ seven classes came back genuinely inapplicable to this adapter's architecture (no composable
21
+ middleware chain in either pinned framework package; one wrapper per call, no second gate; no
22
+ cross-hook correlation map to collide or grow unbounded; `isDeferredResult` already covers
23
+ JavaScript's whole lazy-result landscape; no external multi-phase hook dispatch to lose an
24
+ event across; `src/`'s only runtime import is a lazy `@langchain/langgraph`, correctly
25
+ undeclared as a hard dependency, matching the README's own "zero runtime dependencies" claim).
26
+ One real, TS-specific gap was found in the snapshot-commitment family and fixed:
27
+ - `snapshotParams`/`snapshotToolParams`'s fallback, taken when `structuredClone` cannot clone
28
+ the value being snapshotted (a function, a class instance it refuses, anything sharing an
29
+ object graph with one of those), was a bare shallow copy — `{args: [...args]}` makes a fresh
30
+ OUTER array, but every element INSIDE it is the same live reference as the real call
31
+ arguments. Reproduced directly before fixing: `snapshot.args[0] === liveArg` was `true`, and
32
+ a mutation of `liveArg` after the call was visible through the "snapshot" — violating the
33
+ adapter's own documented guarantee ("an IMMUTABLE snapshot... taken BEFORE the wrapped
34
+ callable runs"). Checked the specific `toJSON` vector first: `structuredClone` does NOT
35
+ consult a `toJSON` method or any other user-overridable protocol the way Python's
36
+ `copy.deepcopy` consults `__deepcopy__` (verified empirically — a hostile class's own
37
+ `toJSON` returning fabricated data is simply ignored, and the clone is never the same
38
+ OBJECT reference for that specific case); only the FAILURE path aliased for a hostile
39
+ `toJSON`. See the release-gate correction below for why "a successful clone never aliases"
40
+ was still wrong as a general claim (a `SharedArrayBuffer` clones "successfully" to a
41
+ DIFFERENT object that shares the SAME underlying memory).
42
+ - Fixed with a new `freeze()` function (exported for direct testing, the same reason every
43
+ Python adapter's own `_freeze()` is imported directly by its tests — the audit log never
44
+ exposes the raw snapshot value, only its hash, so "does this alias" is not otherwise
45
+ observable): safe JSON-primitive leaves pass through verbatim, plain objects/arrays are
46
+ rebuilt fresh and recursively, and anything else (a function, a class instance, a
47
+ `Map`/`Set`/`Date`/`RegExp`, a `Symbol`, a `BigInt`) becomes a safe string representation —
48
+ never the live reference. This is `structuredClone`'s support matrix happening to overlap
49
+ with what the audit log's own JCS canonicalizer (`params.ts`) can hash, unconditionally,
50
+ matching the same invariant every Python adapter's `_freeze()` already holds, rather than
51
+ scoped narrowly to only the cases proven to reach a hash mismatch. Guards a circular
52
+ reference with a `WeakSet` (`structuredClone` handles cycles natively; the whole point of
53
+ this function is the cases it could NOT handle, one of which could still be cyclic). A
54
+ welcome side effect: because `freeze()` sanitizes an otherwise-unsupported value BEFORE it
55
+ is ever handed to `params.ts`'s `commit()`, a call that used to commit no hash at all
56
+ (`paramsHashReason: "unsupported"`) now commits a real, verifiable one.
57
+ - Tests added in `test/adapter-langgraph.test.ts`: two direct unit tests on `freeze()` itself
58
+ (never aliases the unclonable value's own case; never aliases a mutable SIBLING sharing the
59
+ same object graph as an unclonable value — the mixed case), one guarding the circular
60
+ reference, and one end-to-end test per wrapper (`guardNode`, `guardTool`) driving an
61
+ unclonable argument through the real call path and asserting a genuine, matching
62
+ `authorizedParamsHash`/`invokedParamsHash` pair is committed rather than `"unsupported"`.
63
+ - **Delta review, two more edits to `freeze()` itself:**
64
+ - **Medium-low, required:** the plain-object branch built the rebuilt object with an
65
+ `out[k] = freeze(v, seen)` accumulation loop. A plain `JSON.parse('{"__proto__": {...}}')`
66
+ result genuinely has `"__proto__"` as an OWN, ENUMERABLE data property (`Object.keys`
67
+ lists it — JSON has no notion of prototypes, so this is reachable from ordinary untrusted
68
+ input, not a contrived shape) — but assigning through `out[k] = v` for that specific key
69
+ name does not create a data property at all; it sets the accumulator's own `[[Prototype]]`
70
+ via `Object.prototype`'s own `__proto__` accessor instead. The key then vanished from the
71
+ rebuilt object's own enumerable keys entirely — a params-commitment completeness gap
72
+ (substitution on that key would be invisible to a params mismatch) that `structuredClone`'s
73
+ own success path, and Python's `_freeze()`, do not have. Fixed with
74
+ `Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, freeze(v, seen)]))`, which
75
+ always defines genuine data properties, `__proto__` included. Test added: a
76
+ `JSON.parse`-created `__proto__` own key beside an unclonable sibling (forcing the
77
+ fallback) — the key survives into the snapshot with its value, and the rebuilt object's
78
+ own prototype is unaffected.
79
+ - **Nit, ride-along:** the array branch used `value.map((v) => freeze(v, seen))` —
80
+ `Array.prototype.map` SKIPS a hole in a sparse array rather than visiting it, so a hole
81
+ would survive into the snapshot as a hole too, unlike every other absent value `freeze()`
82
+ turns into a plain `null`. Fixed with `Array.from(value, (v) => freeze(v, seen))`, which
83
+ visits every index up to `.length`, densifying a hole to `undefined` (then `null`, same as
84
+ any other `undefined`). Test added: `freeze([1, , 3])` equals `[1, null, 3]`, with a real
85
+ (densified) element at index 1, not a hole.
86
+ - **Release-gate correction (CRITICAL + HIGH): `freeze()` was still only a FALLBACK, run only
87
+ when `structuredClone` THREW — a successful clone bypassed it entirely, and "a successful
88
+ clone never aliases" (asserted above) was not actually true.** Three bypasses, each
89
+ reproduced directly before fixing: (1) a circular object clones successfully —
90
+ `structuredClone` handles cycles natively — so `freeze()` never ran on it at all; the
91
+ circularity then reached `params.ts`'s own hash-commitment walk, which has NO cycle guard,
92
+ and crashed with `RangeError: Maximum call stack size exceeded` before authorization or the
93
+ tool body ever ran. (2) A sparse array clones successfully too, holes preserved, bypassing
94
+ `freeze()`'s own densification (added above) entirely — it reached `params.ts` as
95
+ `paramsHashReason: "unsupported"` instead of a real, densified, hashable snapshot. (3) A
96
+ `SharedArrayBuffer` clones to a DISTINCT wrapper object that shares the SAME underlying
97
+ memory, by design — a "successful" clone that is not independent at all. Fixed by making
98
+ `freeze()` the ONLY snapshot path, unconditionally: `structuredClone` is no longer called
99
+ anywhere in this adapter. Also fixed in the same pass: the cycle guard (`seen`) was a
100
+ single, MUTABLE `WeakSet` shared across the whole call, added to but never removed from —
101
+ so a DAG's repeated sibling reference (the SAME object appearing twice as two different
102
+ keys' values, never as its own ancestor) was wrongly reported `"<circular>"` on its second
103
+ occurrence, reproduced directly: `freeze({a: shared, b: shared})` came back
104
+ `{"a": {...}, "b": "<circular>"}`. Renamed to `active`, a PATH-ACTIVE `ReadonlySet` — a
105
+ fresh `Set` unioned in at each recursive call, never mutated in place or shared across
106
+ sibling branches. Separately, HIGH: the array and object branches (`Array.from`/`.map()` and
107
+ `Object.entries()`) invoke the value's OWN protocols — a hostile `[Symbol.iterator]`
108
+ override can yield ANYTHING regardless of an array's real indexed properties (reproduced:
109
+ `[1, , 3]` with a hostile iterator froze as `[999]`), and a getter is INVOKED by
110
+ `Object.entries()`, with no guarantee of being invoked only once (reproduced: with an
111
+ unclonable sibling forcing the old fallback, a getter with a side effect was observed three
112
+ times across the old clone-attempt/freeze/body sequence, and the committed snapshot was the
113
+ SECOND of three observations, not the first). Fixed: both branches now walk
114
+ `Object.getOwnPropertyDescriptor` directly (arrays by a `.length`-bounded index loop, objects
115
+ by `Object.keys`) — pure introspection, never invoking user code — and an accessor property
116
+ (`.get`/`.set` present) is encoded as the literal string `"<accessor>"` rather than read at
117
+ all. **A regression caught and fixed before this same commit landed:** rewriting the
118
+ object branch's write-back re-introduced the EXACT `out[key] = value` bug the `__proto__`
119
+ fix above had already closed (a bracket assignment to the literal key `"__proto__"` sets the
120
+ accumulator's prototype instead of a data property) — caught by running the existing
121
+ `__proto__` test against the rewrite, not assumed fixed; corrected with
122
+ `Object.defineProperty` in the loop instead. Six new tests added, each driving the REAL
123
+ wrapper (`guardNode`/`guardTool`), not `freeze()` directly — the earlier circular test
124
+ guarded the wrong path (it passed even while the actual wrapper crashed): circular input,
125
+ sparse array, hostile custom iterator, getter, `SharedArrayBuffer`, and a DAG's repeated
126
+ reference, all via `test/adapter-langgraph.test.ts`.
127
+ - **Release-gate correction (HIGH): `isDeferredResult` missed a plain `AsyncIterable`.** The
128
+ async branch required the result to have its OWN `.next` method, matching a self-iterating
129
+ async generator — but the JavaScript async-iterable protocol only requires a callable
130
+ `[Symbol.asyncIterator]()`, which can return a SEPARATE object that has `.next`, without the
131
+ iterable itself ever having one. Reproduced directly before fixing: a plain object
132
+ implementing only `[Symbol.asyncIterator]()` was recorded `BodyState.RETURNED`, not
133
+ `DEFERRED`. Fixed: the async check no longer requires an own `.next` (the sync check, which
134
+ DOES require it, was deliberately left alone — dropping it there would misdetect a plain
135
+ `Array`/`Set`/`Map` as deferred, since those implement `Symbol.iterator` too without their
136
+ contents being lazily produced; there is no equivalent JavaScript built-in that implements
137
+ `Symbol.asyncIterator` over already-computed values, so this asymmetry is not itself a gap).
138
+ The module doc comment's own "whole lazy-result landscape" claim is narrowed to list exactly
139
+ what `isDeferredResult` checks, rather than asserting completeness. Two tests added: the
140
+ async-iterable case now scores `DEFERRED`; a plain array result is confirmed to still score
141
+ `RETURNED` (pinning that the sync branch's requirement was deliberately kept).
142
+ - **Release-gate correction (HIGH): three disagreeing version fields.** `package.json` said
143
+ `0.4.0`; `package-lock.json`'s root `"version"` said `0.3.1` (stale since before the 0.4.0
144
+ bump — `npm install` never re-synced it); `src/version.ts`'s exported `VERSION` — the
145
+ constant `guard.ts` and both `adapters/langgraph.ts` wrappers use to attribute every v2
146
+ ledger entry's `adapter.version` field — said `0.3.0`. The release workflow
147
+ (`.github/workflows/release.yml`) only ever checks the pushed tag against `package.json`, so
148
+ it would have published while shipped ledger attribution was still wrong. Every v2 ledger
149
+ entry produced by the shipped 0.4.0 release has been misreporting `adapter.version` as
150
+ `"0.3.0"`. Fixed: all three aligned to the CURRENT `0.4.0` (no version bump as part of this
151
+ fix — that is the operator's call at release time). Added
152
+ `test/version-consistency.test.ts`, a new CI-run test (not only a release-time check)
153
+ asserting `package.json`, `package-lock.json`'s root version (both the top-level field and
154
+ its `packages[""].version` copy, which have drifted independently before), and the exported
155
+ `VERSION` all agree, every run, not only at tag time.
156
+ - **Release-gate finding, MEDIUM: `test/wire-vectors.test.ts` enumerated and scored 19 of the
157
+ 20 published interop vectors, silently.** `reject_unsafe_integer` — anticipated in this
158
+ package's own `[0.3.1]` CHANGELOG entry below ("will show 20 vectors... once the Python
159
+ package ships them") and shipped by Python's own `[0.9.0]` — has had its fixture file
160
+ present on disk (byte-identical to Python's) since, but `VECTOR_NAMES` itself was never
161
+ updated to include it, and the test's own count assertion (`19`) masked the omission rather
162
+ than catching it. Fixed: added to `VECTOR_NAMES`, the count and test name updated to `20`,
163
+ and the stale `.github/workflows/ci.yml` comment ("19-vector... >=0.8 ships this") corrected
164
+ to `20-vector`/`>=0.9` (Python's own `[0.9.0]` CHANGELOG entry is where
165
+ `reject_unsafe_integer.json` shipped, matching the pip constraint
166
+ `attenu-guard>=0.9,<0.10` already pinned two lines below that comment).
167
+ - **Release-gate finding, LOW: the interop matrix had no early warning for the NEXT Python
168
+ minor.** `ci.yml`'s `interop` job pins `attenu-guard>=0.9,<0.10` deliberately — the committed
169
+ fixtures match that release, and the job's own last step re-generates and diffs them, so
170
+ pinning to it is correct, not stale. But nothing in this repo would notice a 0.10.0 that
171
+ breaks wire compatibility until someone widened that pin by hand. Added a second job,
172
+ `interop-next`, that runs the same cross-language suite against `attenu-guard>=0.10,<0.11` —
173
+ gated on a `pip index versions` check so it reports success without running anything while
174
+ 0.10.0 is unpublished (confirmed against the live PyPI index: 0.9.0 is current, no 0.10.x
175
+ yet), and starts actually exercising the suite the moment the operator ships it, with no
176
+ workflow edit required either way.
177
+ - **D14 — `Guard.check()` registered a `PRE_HOOK_ONLY` allow as pending, wedging `complete()`
178
+ forever.** Mirrors the fix landing in the Python `attenu-guard` reference implementation
179
+ (`guard.py`, same defect, same root cause): `registerPending` ran unconditionally for every
180
+ `schemaVersion: 2` allow, in both the normal commit path and the `CommittedAuditError` path,
181
+ with no regard for `capture`. A bare `check()` (or any explicit `capture: Capture.PRE_HOOK_ONLY`)
182
+ is an honest promise of NO terminal observation — nothing is ever going to call `recordOutcome`
183
+ for it — yet it was registered pending exactly like a `WRAPPER_SYNC`/`WRAPPER_ASYNC`/
184
+ `FRAMEWORK_POST_HOOK` allow, so `complete()` refused forever for a node with only
185
+ `PRE_HOOK_ONLY` calls. The offline verifier already treated a missing `PRE_HOOK_ONLY` outcome
186
+ as merely `unobserved` (`evidence.ts`'s execution-binding report), so runtime and offline
187
+ semantics disagreed. Fixed: a call is now registered pending only when its capture is one of
188
+ `WRAPPER_SYNC`/`WRAPPER_ASYNC`/`FRAMEWORK_POST_HOOK` — in both the normal path and the
189
+ `CommittedAuditError` path. A bare/`PRE_HOOK_ONLY` allow never enters the pending set, so
190
+ `complete()` finalizes immediately, and the verifier's `unobserved` classification for it now
191
+ matches the runtime's own view.
192
+ - **Re-gate correction (HIGH): `freeze()` still executed attacker-controlled code BEFORE
193
+ authorization, on three separate exotic-value paths, all reproduced directly before this fix.**
194
+ (1) A `Proxy` is not inert under reflection: `Object.getPrototypeOf`, `Object.keys`, and
195
+ `Object.getOwnPropertyDescriptor` are each real, user-definable traps — walking an ordinary
196
+ Proxy through the property-descriptor logic fired four of them before authorization was ever
197
+ decided, and `Array.isArray` on a REVOKED Proxy throws `TypeError` outright rather than
198
+ degrading cleanly. (2) The bottom fallback still called `String(value)` for anything not a
199
+ plain object/array — a boxed primitive (`new Number(...)`) with a hostile `Symbol.toPrimitive`,
200
+ or a `TypedArray` with a hostile own `toString`, each ran attacker code exactly once per
201
+ snapshot. (3) No general safety net: an unanticipated reflection failure would have propagated
202
+ an exception out of a snapshot taken before authorization, rather than degrading. None of this
203
+ was an aliasing or authorization-bypass defect — ordinary frozen/accessor-only objects never
204
+ leaked references, and policy evaluation still fully controlled whether the wrapped body ran —
205
+ the defect was pre-authorization code execution and exception propagation. Fixed: `freeze()`
206
+ now recognizes a Proxy FIRST, via `util.types.isProxy` (an internal engine-slot check that
207
+ invokes nothing, live or revoked — verified directly), before `Array.isArray` or any other
208
+ reflection; every value that is not a safe JSON primitive and not a plain object/array (a
209
+ Proxy, a boxed primitive, a TypedArray/`ArrayBuffer`/`SharedArrayBuffer`/`DataView`, a
210
+ `Map`/`Set`/`Date`/`RegExp`, a function, a `Symbol`, a `BigInt`, or anything else) becomes the
211
+ new `FREEZE_UNSUPPORTED` sentinel instead of a string — never `String()`, never any other
212
+ protocol; the whole reflective walk runs inside one `try`/`catch`, degrading any other
213
+ reflection failure the same way. `paramsHashReason: "unsupported"` for the whole call, never a
214
+ partial commitment — the same degradation this library already uses for an out-of-domain
215
+ number, not a new failure mode.
216
+ - **Re-gate correction (MEDIUM): `"<accessor>"` was a real commitment collision, and so was
217
+ `"<circular>"` by the identical reasoning.** Two real wrapper calls — one with an enumerable
218
+ getter, one with the literal string `"<accessor>"` as an ordinary value — produced the
219
+ IDENTICAL `authorizedParamsHash`, reproduced directly: an evidence-integrity ambiguity in a
220
+ supposedly cryptographic commitment (two materially different inputs, one commitment), even
221
+ though the getter itself correctly stayed uninvoked and this was never an authorization
222
+ bypass. Audited the sibling sentinel `"<circular>"` for the exact same collision class rather
223
+ than leaving it unexamined — it has the identical problem (a genuinely circular object and a
224
+ plain object holding the literal string `"<circular>"` produce the same commitment); there is
225
+ no reason a cycle's position makes the collision infeasible, so it gets the same fix. Both an
226
+ accessor property and a genuine cycle now become `FREEZE_UNSUPPORTED` (above) — the same
227
+ private `Symbol` every other unrepresentable value degrades to, which cannot equal any real
228
+ call argument by construction. Regression test added: zero getter calls, no hash,
229
+ `params_hash_reason: "unsupported"`; plus a direct test that a real getter-bearing object and
230
+ the old literal-string sentinel no longer freeze to the same shape.
231
+ - **Re-gate correction (MEDIUM): `interop-next`'s "is 0.10.x published yet?" check failed OPEN.**
232
+ `set -eu` alone does not catch a failing `pip index versions` inside an
233
+ `if PIPE | grep -q ...; then` compound command — a compound `if` condition is exempt from
234
+ `set -e` by design, and without `pipefail` a pipeline's exit status is its LAST command's
235
+ only. Reproduced directly: a simulated exit 42 from the query flowed straight through to
236
+ `published=false`, the same output as "0.10.x genuinely does not exist yet" — a PyPI outage
237
+ silently read as a fact about what has been released, with the step still exiting 0. Fixed by
238
+ extracting the check into `tools/check-next-python-published.sh`, which captures the query's
239
+ exit code in its own statement (not inside an `if`) and exits non-zero — without ever printing
240
+ `false` — before reaching the match logic. Added a probe step to `ci.yml`'s `interop-next` job,
241
+ run on every CI invocation, that points the script at a stub `python3` simulating a query
242
+ failure and asserts the script fails rather than reporting `false`.
10
243
 
11
244
  ### Added
12
245
  - **Execution binding**, opt-in per chain via `Guard.issue(agentId, authority, {schemaVersion: 2})`
@@ -51,6 +51,69 @@
51
51
  * adapter behaves exactly as it did before 0.9.0: no `capture`/`authorizedParams`, no
52
52
  * `recordOutcome` call. Every other framework adapter is unchanged in this release.
53
53
  *
54
+ * ## Adversarial review: the Python batch-1/batch-2 defect classes, checked against this
55
+ * adapter specifically (not assumed absent by analogy)
56
+ *
57
+ * The Python `attenu-guard` adapters went through two rounds of adversarial review that found
58
+ * several defect classes across their (many) framework adapters. This TS package ships exactly
59
+ * ONE adapter surface (this file — verified against `package.json`'s own `exports` map, which
60
+ * declares nothing besides `.` and `./adapters/langgraph`), so each class was checked against
61
+ * THIS adapter specifically, not inherited by assumption:
62
+ *
63
+ * - **Composable middleware / sibling short-circuit or retry** (a sibling wrapper positioned
64
+ * closer to the tool body than this one, able to fabricate or repeat what it observes) — NOT
65
+ * APPLICABLE. Verified directly against pinned `@langchain/core@1.2.9` and
66
+ * `@langchain/langgraph@1.4.13` (installed and grepped, not read off documentation): zero
67
+ * `"middleware"` hits anywhere near tool invocation in either package, and
68
+ * `ToolNode.prototype.runTool` (`dist/prebuilt/tool_node.js`) calls `tool.invoke(toolCall,
69
+ * runtime)` directly — `guardTool`'s `Proxy` IS what gets called, nothing sits between it and
70
+ * `ToolNode`. Neither framework has a composable per-call hook chain the way LangChain-Python's
71
+ * `create_agent(middleware=[...])` or AG2's `FunctionTool.register()` do.
72
+ * - **Double authorization via a second, independent gate** (e.g. Python's `claude_sdk`
73
+ * adapter's `can_use_tool` calling `authorize()` a second time for the same call) — NOT
74
+ * APPLICABLE. There is no second entry point here: `guardNode`/`guardTool` are each the ONLY
75
+ * caller-facing wrapper for their call, and there is nothing in either framework analogous to
76
+ * a second permission callback for a call this adapter already gated.
77
+ * - **Snapshot double-evaluation / narrow-projection commitment** — NOT APPLICABLE in the
78
+ * double-evaluation shape (`snapshotParams`/`snapshotToolParams` already compute ONE snapshot,
79
+ * reused unchanged for both `authorizedParams` and `invokedParams`), but a DIFFERENT,
80
+ * TS-specific gap in the same family was found and fixed — see `freeze()`'s own doc comment
81
+ * above and the CHANGELOG.
82
+ * - **Correlation-key collision across hooks** (e.g. Python's `claude_sdk` `tool_use_id`
83
+ * collision) — NOT APPLICABLE. `guard.recordOutcome` is called synchronously inside the same
84
+ * closure that owns the whole call, from `authorize()`'s own returned `Decision.callId` — no
85
+ * external pending-map keyed by a framework-supplied correlation id exists to collide on.
86
+ * - **Lazy-result detection gaps** (e.g. Python's `smolagents` adapter missing a coroutine or a
87
+ * `concurrent.futures.Future`) — `isDeferredResult` catches generators (an object with its own
88
+ * `.next` AND `[Symbol.iterator]` — "self-iterating", the shape a native generator has, but
89
+ * deliberately NOT the shape a plain `Array`/`Set`/`Map` has, since those implement
90
+ * `[Symbol.iterator]` too without an own `.next`, and their contents are already fully
91
+ * computed), a genuine ASYNC ITERABLE (anything implementing a callable
92
+ * `[Symbol.asyncIterator]`, self-iterating async generators included — see the RELEASE-GATE
93
+ * CORRECTION on this function's own body for why this does NOT require an own `.next` the way
94
+ * the sync branch does), and anything thenable. A plain (non-`async`) function that manually
95
+ * returns a bare `Promise` is also caught correctly, via the thenable check, in the sync
96
+ * branch of both wrappers. This is NOT a claim of covering "the whole lazy-result landscape" —
97
+ * only what this function's own checks actually implement, listed above; a class implementing
98
+ * some OTHER deferred-consumption protocol this function does not check for would not be
99
+ * caught.
100
+ * - **Lost-terminal-event / "fires unconditionally" false claims** (e.g. Python's `strands`
101
+ * adapter's before-hook interrupt paths) — NOT APPLICABLE. There is no external, multi-phase
102
+ * hook-dispatch loop for an event to be lost across; one wrapper function's own `try`/`catch`
103
+ * (or `await`ed async path) owns authorize-through-`recordOutcome` for the whole call
104
+ * synchronously. Structurally this adapter was already closest to Python's own `langgraph.py`
105
+ * reference wiring, not any of the adapters that needed this class of fix.
106
+ * - **Unbounded correlation cache** (Python's `claude_sdk` `_recentVerdicts`) — NOT APPLICABLE,
107
+ * for the same reason as the correlation-collision point above: no cache or pending-map exists
108
+ * in this adapter to bound.
109
+ * - **Wrong dependency declaration** (Python's `semantic-kernel` `protobuf` lesson: check what
110
+ * the RESOLVED version actually requires, not what is assumed) — checked: `src/` imports only
111
+ * `@langchain/langgraph` (lazily, in `isLangGraphAvailable()`); it never imports
112
+ * `@langchain/core` at all (only this file's own tests do, to build fixtures). `package.json`
113
+ * declares zero `dependencies` and no `peerDependencies` — matching the README's own "zero
114
+ * runtime dependencies" claim — and both `@langchain/core`/`@langchain/langgraph` are correctly
115
+ * `devDependencies`-only. Nothing this package's `src/` needs at runtime is undeclared.
116
+ *
54
117
  * ## Delegation
55
118
  *
56
119
  * Handing work to a sub-agent is the delegation moment. `delegateTo` mints the
@@ -67,6 +130,7 @@
67
130
  */
68
131
  import { type Guard } from "../guard.js";
69
132
  import type { Authority } from "../authority.js";
133
+ import type { Json } from "../canonical.js";
70
134
  import type { Context } from "../ceilings.js";
71
135
  import { type Decision } from "../reasons.js";
72
136
  /** Options shared by every guarded wrapper. */
@@ -90,6 +154,129 @@ export type GuardedNode<F extends (...args: any[]) => any> = F & {
90
154
  readonly toolScope: string;
91
155
  readonly unwrapped: F;
92
156
  };
157
+ /**
158
+ * A private, freeze()-only sentinel for "could not be represented as a JSON leaf" — a Proxy, an
159
+ * accessor property, a genuine cycle, a boxed primitive, a TypedArray, a function, or anything
160
+ * else this module does not know how to rebuild as plain JSON. NEVER a JSON-representable
161
+ * value (a string, `null`, …): a second release-gate finding showed a literal string sentinel
162
+ * (`"<accessor>"`) genuinely COLLIDES — a real getter-bearing object and a plain object holding
163
+ * the literal string `"<accessor>"` produced the IDENTICAL `authorizedParamsHash`, an
164
+ * evidence-integrity ambiguity in a supposedly cryptographic commitment (two materially
165
+ * different inputs, one commitment). A fresh, private `Symbol` cannot equal any real call
166
+ * argument, so it cannot collide with one — and it makes the SAME degradation apply uniformly
167
+ * everywhere this function cannot represent something, rather than inventing a new
168
+ * JSON-shaped sentinel (with its own collision risk) per case.
169
+ *
170
+ * Declared as `Json` even though a `Symbol` is not one — a deliberate escape from that type's
171
+ * nominal domain, not an oversight: `canonical.ts`'s own JCS `serialize()` already runtime-checks
172
+ * `typeof` for exactly this reason (its switch handles `"undefined"`/`"bigint"`/`"symbol"`/
173
+ * `"function"` despite `CJson`'s declared type not admitting any of them either), because the
174
+ * type system cannot fully describe this module's actual runtime domain. Once this sentinel
175
+ * reaches `params.ts`'s `commit()` — inside a plain object or array, same as any other frozen
176
+ * leaf — `canonicalBytes` hits that `"symbol"` case, throws `UnsupportedTypeError`, and `commit()`
177
+ * turns that into `paramsHashReason: "unsupported"` for the WHOLE params value, never a partial
178
+ * or per-field one: there is no such thing as "this one nested field is unsupported," only
179
+ * "this whole call's arguments are, or are not, representable."
180
+ *
181
+ * Exported for the same reason `freeze` itself is: not part of this adapter's semantic
182
+ * contract, but its own tests need to assert directly that a given leaf became this exact
183
+ * sentinel (by identity — nothing else can equal it) rather than inferring it indirectly.
184
+ */
185
+ export declare const FREEZE_UNSUPPORTED: Json;
186
+ /**
187
+ * A genuinely immutable, fully decoupled rebuild of `value` — the ONE, UNCONDITIONAL sanitizer
188
+ * every snapshot in this adapter goes through. Safe JSON-primitive leaves
189
+ * (`string`/`number`/`boolean`/`null`) pass through verbatim; plain objects and arrays are
190
+ * rebuilt fresh, recursively, by inspecting their REAL own property descriptors directly
191
+ * (`Object.getOwnPropertyDescriptor`), never by invoking anything the value itself controls (a
192
+ * getter, an iterator, a copy protocol, a Proxy trap, a `toString`/`valueOf`/`Symbol.toPrimitive`
193
+ * override); anything this function cannot represent becomes `UNSUPPORTED` (above) — never a
194
+ * string, never the live object.
195
+ *
196
+ * RELEASE-GATE CORRECTION (CRITICAL): this used to run ONLY as a fallback, after
197
+ * `structuredClone` had already been tried and had THROWN — the previous revision of this
198
+ * comment documented that carefully, but never asked whether `structuredClone` SUCCEEDING was
199
+ * itself a sufficient guarantee. It is not, on three counts, each reproduced directly before
200
+ * that fix: (1) a circular object clones successfully — `structuredClone` handles cycles
201
+ * natively — so this function never ran on it at all, and the circularity later reached
202
+ * `params.ts`'s own cycle-guard-less hash walk and crashed with `RangeError`; (2) a sparse
203
+ * array clones successfully too, bypassing this function's own densification; (3) a
204
+ * `SharedArrayBuffer` clones to a DISTINCT wrapper object sharing the SAME underlying memory —
205
+ * a "successful" clone that is not independent at all. Fixed by making this function the ONLY
206
+ * snapshot path, unconditionally — `structuredClone` is not called anywhere in this adapter.
207
+ *
208
+ * A SECOND release-gate pass then found that "pure introspection" was not fully true either —
209
+ * three more code-execution paths, all reproduced directly before this fix:
210
+ *
211
+ * 1. A `Proxy` is not inert under reflection. `Object.getPrototypeOf`, `Object.keys`
212
+ * (`[[OwnPropertyKeys]]` + a `[[GetOwnProperty]]` per key to check enumerability), and
213
+ * `Object.getOwnPropertyDescriptor` are each real, user-definable traps — reproduced
214
+ * directly: walking an ordinary handler-tracked Proxy through the OLD version of this
215
+ * function fired four separate traps before authorization was ever decided. `Array.isArray`
216
+ * is worse: called on a REVOKED Proxy, it throws `TypeError` outright (its spec algorithm,
217
+ * `IsArray`, unwraps `[[ProxyTarget]]`, which does not exist on a revoked handle) —
218
+ * reproduced directly. Fixed: `require("node:util").types.isProxy(value)` recognizes a
219
+ * Proxy — live OR revoked — via an internal engine slot, invoking NOTHING (verified
220
+ * directly: zero trap calls, no throw on a revoked handle either) — checked FIRST, before
221
+ * `Array.isArray` or any other reflection, and routed straight to `UNSUPPORTED`.
222
+ * 2. The bottom fallback used `String(value)` for anything not a plain object/array — a boxed
223
+ * primitive (`new Number(...)`) with a hostile `Symbol.toPrimitive`, or a `TypedArray` with
224
+ * a hostile own `toString`, each ran attacker code exactly once per snapshot, reproduced
225
+ * directly both ways — BEFORE `Guard.check` had decided allow or deny. The same is true, in
226
+ * principle, of ANY object-typed exotic value (a function's own `.toString` is just as
227
+ * overridable) — there is no way to distinguish "safe to stringify" from "hostile" by
228
+ * inspection alone, so none of them are stringified any more. Fixed: every value that is
229
+ * not a safe JSON primitive and not a plain object/array — a Proxy, a boxed primitive, a
230
+ * TypedArray/`ArrayBuffer`/`SharedArrayBuffer`/`DataView`, a `Map`/`Set`/`Date`/`RegExp`, a
231
+ * function, a `Symbol`, a `BigInt`, anything else — becomes `UNSUPPORTED` (never `String()`,
232
+ * never any other protocol) — see the confirmed-good note above: stringification itself
233
+ * was never unsafe as a RESULT (a `SharedArrayBuffer` never retained live memory as a
234
+ * string), the defect was invoking attacker-controlled code to PRODUCE that string before
235
+ * authorization ran, and `UNSUPPORTED` avoids that entirely rather than picking a "safer"
236
+ * string.
237
+ * 3. Any OTHER reflection failure — an exotic value this pass did not specifically anticipate,
238
+ * still throwing from `Object.getPrototypeOf`/`Object.keys`/`Object.getOwnPropertyDescriptor`
239
+ * despite the Proxy check above — must degrade the same way, not propagate an exception out
240
+ * of a snapshot taken before authorization. The whole reflective walk (everything past the
241
+ * Proxy/primitive fast paths) runs inside one `try`/`catch`; any throw there becomes
242
+ * `UNSUPPORTED` too.
243
+ *
244
+ * `active` is the PATH-ACTIVE cycle guard: the set of containers on the CURRENT recursion path,
245
+ * passed as a NEW `Set` at each recursive call rather than mutated in place and shared across
246
+ * sibling branches (an earlier revision DID share one mutable `WeakSet` across the whole call,
247
+ * which meant a DAG's repeated reference — the SAME object appearing twice as sibling values,
248
+ * never as its own ancestor — was wrongly flagged on its second occurrence; reproduced directly
249
+ * before that fix too). A genuine cycle's own leaf value is `UNSUPPORTED`, not a literal string
250
+ * `"<circular>"` — audited for the same collision class as `"<accessor>"` below, and it has the
251
+ * identical problem: a self-referential object and a plain object holding the literal string
252
+ * `"<circular>"` would otherwise produce the same commitment. There is no position-based reason
253
+ * a cycle's collision is any less real than an accessor's, so it gets the same fix.
254
+ *
255
+ * The property-descriptor walk ALSO closes a separate, protocol-driven gap: the previous
256
+ * revision used `Array.from`/`.map()` (which invoke `[Symbol.iterator]()` — a hostile array's
257
+ * own override can yield ANYTHING regardless of its real indexed properties; reproduced
258
+ * directly: `[1, , 3]` with a hostile iterator froze as `[999]`) and `Object.entries()` (which
259
+ * reads each property's VALUE directly, invoking a getter if one is defined there — reproduced
260
+ * directly: a getter with a side effect was observed three times across the old clone-attempt/
261
+ * freeze/body sequence, and the committed snapshot was the SECOND of three observations, not the
262
+ * first). `Object.getOwnPropertyDescriptor` and a `.length`-bounded index loop are pure
263
+ * introspection — they never invoke user code — and an accessor property (`.get`/`.set` present)
264
+ * becomes `UNSUPPORTED` rather than read at all: a getter can have arbitrary side effects, throw,
265
+ * or return something different on every call, so there is no single "correct" observation of it
266
+ * to commit, and (release-gate correction) the earlier `"<accessor>"` string sentinel this
267
+ * function used instead genuinely collided — reproduced directly: a real getter-bearing object
268
+ * and a plain object holding the literal string `"<accessor>"` produced the identical
269
+ * `authorizedParamsHash`. Both now degrade the same commitment to `unsupported` via `UNSUPPORTED`
270
+ * (see its own doc comment above), never a JSON-representable stand-in.
271
+ *
272
+ * Exported — not part of this adapter's semantic contract (it is an internal sanitizer, not a
273
+ * feature callers configure), but its own aliasing-safety invariant is worth a direct unit
274
+ * test in isolation, the same way every Python adapter's `_freeze()` is imported directly by
275
+ * its own tests: the audit log never exposes the raw snapshot value it produces (only its
276
+ * hash — see `params.ts`'s own doc comment), so "does this alias a live mutable object" is
277
+ * not otherwise observable from outside this module.
278
+ */
279
+ export declare function freeze(value: unknown, active?: ReadonlySet<unknown>): Json;
93
280
  /**
94
281
  * Wrap a callable so every call is authorized through `guard` first.
95
282
  *
@@ -1 +1 @@
1
- {"version":3,"file":"langgraph.d.ts","sourceRoot":"","sources":["../../../src/adapters/langgraph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAEH,OAAO,EAAqC,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlE,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC;IACxC,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,8EAA8E;AAC9E,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CA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