dsh-completion-guard 0.4.0 → 0.4.2

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/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { $ as GOAL_HOST_PACKAGES, $t as COMMAND_SURFACE_MANIFEST, A as decideTurnStopping, At as classifyClause, B as isDeterministicCheck, Bt as CERTIFICATE_VERSION, C as executeRevalidatedGitEffect, Ct as bindingSatisfies, D as verifiedLinearCommitReadback, Dt as currentContractDigest, E as revalidateGitPrestate, Et as isVerifyingCapability, F as deriveProjection, Ft as segmentClauses, G as parseShellCommand, Gt as actionCompatible, H as canonicalArgvFromCommand, Ht as STATEFUL_ACTIONS, I as supersedeItem, It as canonicalRegistryBase, J as ALPHA2_DSHMARKET_139_HOST_PACKAGES, Jt as requestedTargetMatchesResolved, K as goalCompletionDenial, Kt as isStatefulAction, L as evidenceFromPersistedToolResult, Lt as npmEscapedPackageName, M as latestAssistantText, Mt as extractMethod, N as observeAssistantOutcome, Nt as extractOperation, O as classifyCompletionClaim, Ot as captureClause, P as PROTOCOL_V3_NOTICE, Pt as isInformationalMessage, Q as EXPECTED_HOST_PACKAGES, Qt as validateActionTarget, R as extractTextContent, Rt as ACTION_MANIFEST, S as createGitPrestateEnvelope, St as renderRecoveryPacket, T as parseGitCommandManifest, Tt as evidenceMatchesItem, U as isRunExecutable, Ut as STOP_PROTOCOL_VERSION, V as withDurability, Vt as SEMANTIC_ACTIONS, W as parsePwshCommand, Wt as SUPPORTED_EVIDENCE_ADAPTERS, X as BASE_HOST_PACKAGES, Xt as semanticActionFromText, Y as ALPHA2_HOST_PACKAGES, Yt as semanticActionFromCommand, Z as DEFAULT_HOST_LOCK, Zt as validateActionManifest, _ as resolveInstalledHostLock, _t as certifyCheckpoint, a as createProofManifest, an as sanitizeUrl, at as evaluateHostCapability, b as commitIndexSnapshotDigest, bt as openItems, c as sessionQuery, ct as selectHostCohort, d as hostLockContextFromComposedDump, dt as segmentAuthorityBlocks, en as validateManifest, et as HOST_CAPABILITY_PACKAGE_GROUPS, f as hostLockRowsFromComposedDump, ft as classifyUserInteraction, g as resolveActiveProfileHostLock, gt as qualifyBoundary, h as packageRowsFromPnpmLock, ht as isCurrentAcceptedBoundary, i as canonicalProjection, in as sanitizeClauseText, it as evaluateExternalWaitCapability, j as isWholeTaskCompletionClaim, jt as extractArtifactPaths, k as decideTurnBoundary, kt as captureItem, l as validateProofManifest, lt as ALPHA3_HOST_PACKAGES, m as packageRowsFromActiveGraph, mt as effectuateBoundary, n as PROOF_PROTOCOL_VERSION, nn as digestStrings, nt as bindExecutableIdentity, o as proofDigest, on as sha256, ot as evaluateHostLock, p as injectActiveProfileHostLock, pt as availableBoundaryQualifications, q as hasCurrentCertificate, qt as requestedTargetAuthorizesMutation, r as bindProofToProjection, rn as normalizeClause, rt as bindLiveGoalCapability, s as proofEvidenceConstraints, sn as createProjection, st as evaluateToolSurfaceCapability, t as PROOF_KINDS, tn as canonicalizePath, tt as HOST_COHORTS, u as HostProfileError, ut as authorityCaptureCounts, v as verifyComposedHostLockDump, vt as DEFAULT_RECOVERY_CHAR_BUDGET, w as gitCommandMatchesTarget, wt as evidenceCoverage, x as commitTreeSnapshotDigest, xt as recoveryDigest, y as GIT_COMMAND_MANIFEST_IDS, yt as closingHint, z as extractToolSubject, zt as ACTION_MANIFEST_VERSION } from "./domain-CHTQFIT8.js";
2
- import { boundContextSummary, createUserMessage } from "@deepseek-ai/dsh-llm";
1
+ import { $ as DEFAULT_HOST_LOCK, $t as SUPPORTED_EVIDENCE_ADAPTERS, A as decideTurnBoundary, At as bindingSatisfies, B as extractTextContent, Bt as extractArtifactPaths, C as createGitPrestateEnvelope, Ct as closingHint, D as revalidateGitPrestate, Dt as evidenceAvailabilityReason, E as parseGitCommandManifest, Et as renderRecoveryPacket, F as CAPTURE_V042_NOTICE, Ft as createProjection, G as isRunExecutable, Gt as canonicalRegistryBase, H as isDeterministicCheck, Ht as extractOperation, I as PROTOCOL_V3_NOTICE, It as rebindResponse, J as goalCompletionDenial, Jt as ACTION_MANIFEST_VERSION, K as parsePwshCommand, Kt as npmEscapedPackageName, L as deriveProjection, Lt as captureClause, M as isWholeTaskCompletionClaim, Mt as evidenceMatchesItem, N as latestAssistantText, Nt as isVerifyingCapability, O as verifiedLinearCommitReadback, Ot as itemDiagnosis, P as observeAssistantOutcome, Pt as currentContractDigest, Q as BASE_HOST_PACKAGES, Qt as STOP_PROTOCOL_VERSION, R as supersedeItem, Rt as captureItem, S as commitTreeSnapshotDigest, St as MIN_RECOVERY_CHAR_BUDGET, T as gitCommandMatchesTarget, Tt as recoveryDigest, U as withDurability, Ut as isInformationalMessage, V as extractToolSubject, Vt as extractMethod, W as canonicalArgvFromCommand, Wt as segmentClauses, X as ALPHA2_DSHMARKET_139_HOST_PACKAGES, Xt as SEMANTIC_ACTIONS, Y as hasCurrentCertificate, Yt as CERTIFICATE_VERSION, Z as ALPHA2_HOST_PACKAGES, Zt as STATEFUL_ACTIONS, _ as resolveInstalledHostLock, _t as effectuateBoundary, a as createProofManifest, an as semanticActionFromText, at as bindLiveGoalCapability, b as GIT_COMMAND_MANIFEST_IDS, bt as certifyCheckpoint, c as sessionQuery, cn as COMMAND_SURFACE_MANIFEST, ct as evaluateHostLock, d as hostLockContextFromComposedDump, dn as digestStrings, dt as RC1_HOST_PACKAGES, en as actionCompatible, et as EXPECTED_HOST_PACKAGES, f as hostLockRowsFromComposedDump, fn as normalizeClause, ft as ALPHA3_HOST_PACKAGES, g as resolveActiveProfileHostLock, gt as availableBoundaryQualifications, h as packageRowsFromPnpmLock, hn as sha256, ht as classifyUserInteraction, i as canonicalProjection, in as semanticActionFromCommand, it as bindExecutableIdentity, j as decideTurnStopping, jt as evidenceCoverage, k as classifyCompletionClaim, kt as relevantEvidence, l as validateProofManifest, ln as validateManifest, lt as evaluateToolSurfaceCapability, m as packageRowsFromActiveGraph, mn as sanitizeUrl, mt as segmentAuthorityBlocks, n as PROOF_PROTOCOL_VERSION, nn as requestedTargetAuthorizesMutation, nt as HOST_CAPABILITY_PACKAGE_GROUPS, o as proofDigest, on as validateActionManifest, ot as evaluateExternalWaitCapability, p as injectActiveProfileHostLock, pn as sanitizeClauseText, pt as authorityCaptureCounts, q as parseShellCommand, qt as ACTION_MANIFEST, r as bindProofToProjection, rn as requestedTargetMatchesResolved, rt as HOST_COHORTS, s as proofEvidenceConstraints, sn as validateActionTarget, st as evaluateHostCapability, t as PROOF_KINDS, tn as isStatefulAction, tt as GOAL_HOST_PACKAGES, u as HostProfileError, un as canonicalizePath, ut as selectHostCohort, v as verifyComposedHostLockDump, vt as isCurrentAcceptedBoundary, w as executeRevalidatedGitEffect, wt as openItems, x as commitIndexSnapshotDigest, xt as DEFAULT_RECOVERY_CHAR_BUDGET, y as snapshotSessionEvents, yt as qualifyBoundary, z as evidenceFromPersistedToolResult, zt as classifyClause } from "./domain-BXB_BPQg.js";
2
+ import { defineTool } from "@deepseek-ai/dsh-tools";
3
3
  import { createHash } from "node:crypto";
4
4
  import { basename, delimiter, dirname, isAbsolute, join, resolve } from "node:path";
5
- import { defineTool } from "@deepseek-ai/dsh-tools";
5
+ import { boundContextSummary, createUserMessage } from "@deepseek-ai/dsh-llm";
6
6
  import { execFile } from "node:child_process";
7
7
  import { constants, existsSync, readFileSync } from "node:fs";
8
8
  import { access, readFile, realpath } from "node:fs/promises";
@@ -11,6 +11,213 @@ import { fileURLToPath } from "node:url";
11
11
  import { promisify } from "node:util";
12
12
  import { gunzip } from "node:zlib";
13
13
 
14
+ //#region src/tools/rebind.ts
15
+ function createRebindTool(getProjection, prepare) {
16
+ return defineTool({
17
+ name: "context_guard_rebind",
18
+ description: "Propose an exact source-clause partition, query, or withdraw it. Only a durable root-user confirmation can replace the contract; no execution authority is added.",
19
+ parameters: {
20
+ operation: {
21
+ type: "string",
22
+ required: true,
23
+ enum: [
24
+ "propose",
25
+ "query",
26
+ "withdraw"
27
+ ]
28
+ },
29
+ item_id: { type: "string" },
30
+ proposal_id: { type: "string" },
31
+ clauses: {
32
+ type: "array",
33
+ items: { type: "string" }
34
+ },
35
+ clarification_item_ids: {
36
+ type: "array",
37
+ items: { type: "string" }
38
+ }
39
+ },
40
+ output: {
41
+ schema: {
42
+ type: "object",
43
+ additionalProperties: true
44
+ },
45
+ render: (_args, value) => [{
46
+ type: "text",
47
+ text: JSON.stringify(value)
48
+ }]
49
+ },
50
+ async execute(rawArgs) {
51
+ if (!await prepare()) return {
52
+ status: "unknown",
53
+ reason_code: "persistence_unavailable"
54
+ };
55
+ const p = getProjection();
56
+ return p ? rebindResponse(p, rawArgs) : {
57
+ status: "unknown",
58
+ reason_code: "guard_unavailable"
59
+ };
60
+ }
61
+ });
62
+ }
63
+
64
+ //#endregion
65
+ //#region src/tools/checkpoint-page.ts
66
+ const LANES = [
67
+ "open_items",
68
+ "active_constraints",
69
+ "rejected_bindings",
70
+ "available_evidence",
71
+ "available_qualifications"
72
+ ];
73
+ const MAX_BYTES = 12288;
74
+ const size = (value) => Buffer.byteLength(JSON.stringify(value), "utf8");
75
+ const digest$1 = (value) => sha256(JSON.stringify(value));
76
+ const lookup = (id) => id.length <= 128 ? id : `sha256:${sha256(id)}`;
77
+ /** Changes only display. The caller already certified the complete contract. */
78
+ function checkpointPage(p, query, full) {
79
+ const { item_ids, evidence_ids, evidence_scope = "relevant", limit = 10, detail_id, detail_offset = 0 } = query;
80
+ const identity = digest$1({
81
+ session: p.sessionRefDigest,
82
+ epoch: p.epoch,
83
+ revision: p.contractRevision,
84
+ evidence: [...p.evidence.values()],
85
+ items: [...p.items.values()],
86
+ item_ids,
87
+ evidence_ids,
88
+ evidence_scope,
89
+ limit,
90
+ bindings: query.bindings,
91
+ rejections: full.rejected_bindings
92
+ });
93
+ const invalid = (reason) => ({
94
+ status: "unknown",
95
+ contract_revision: p.contractRevision,
96
+ reason_code: reason,
97
+ next_step: "Restart context_guard_checkpoint without cursor.",
98
+ open_items: [],
99
+ available_evidence: [],
100
+ rejected_bindings: []
101
+ });
102
+ if (!Number.isSafeInteger(limit) || limit < 1 || limit > 50 || !["relevant", "history"].includes(evidence_scope)) return invalid("invalid_query");
103
+ let lane;
104
+ let offset = 0;
105
+ if (query.cursor) try {
106
+ if (query.cursor.length > 1024) return invalid("malformed_cursor");
107
+ const parsed = JSON.parse(Buffer.from(query.cursor, "base64url").toString("utf8"));
108
+ if (!LANES.includes(parsed.lane) || !Number.isSafeInteger(parsed.offset) || parsed.offset < 0) return invalid("malformed_cursor");
109
+ if (parsed.identity !== identity) return invalid("stale_cursor");
110
+ lane = parsed.lane;
111
+ offset = parsed.offset;
112
+ } catch {
113
+ return invalid("malformed_cursor");
114
+ }
115
+ const rows = Object.fromEntries(LANES.map((key) => [key, full[key] ?? []]));
116
+ if (item_ids?.length) {
117
+ rows.open_items = rows.open_items.filter((row) => item_ids.includes(String(row.id)));
118
+ rows.active_constraints = rows.active_constraints.filter((row) => item_ids.includes(String(row.id)));
119
+ rows.rejected_bindings = rows.rejected_bindings.filter((row) => item_ids.includes(String(row.item_id)));
120
+ }
121
+ if (evidence_ids?.length) rows.available_evidence = rows.available_evidence.filter((row) => evidence_ids.includes(String(row.id)));
122
+ if (lane && offset > rows[lane].length) return invalid("invalid_cursor_offset");
123
+ if (detail_id) {
124
+ if (!Number.isSafeInteger(detail_offset) || detail_offset < 0) return invalid("invalid_detail_offset");
125
+ if (detail_offset > 0 && query.detail_snapshot !== identity) return invalid("stale_detail_snapshot");
126
+ const matches = LANES.flatMap((key) => rows[key].filter((row) => row.id === detail_id || row.item_id === detail_id || lookup(String(row.id ?? row.item_id)) === detail_id).map((row) => ({
127
+ kind: key,
128
+ ...row
129
+ })));
130
+ const data = JSON.stringify(matches);
131
+ if (detail_offset > data.length) return invalid("invalid_detail_offset");
132
+ let chunk = data.slice(detail_offset, detail_offset + 1600);
133
+ while (size(chunk) > 8e3) chunk = chunk.slice(0, -100);
134
+ return {
135
+ status: full.status,
136
+ contract_revision: p.contractRevision,
137
+ detail_id: lookup(detail_id),
138
+ detail_offset,
139
+ detail_chunk: chunk,
140
+ next_detail_offset: detail_offset + chunk.length < data.length ? detail_offset + chunk.length : null,
141
+ snapshot: identity
142
+ };
143
+ }
144
+ const reasons = /* @__PURE__ */ new Map();
145
+ for (const row of [...rows.open_items, ...rows.rejected_bindings]) {
146
+ const reason = String(row.reason_code ?? "missing_evidence").slice(0, 160);
147
+ reasons.set(reason, (reasons.get(reason) ?? 0) + 1);
148
+ }
149
+ const output = {
150
+ status: full.status,
151
+ contract_revision: p.contractRevision,
152
+ blockers: {
153
+ total: Number(full.blocking_total ?? full.open_items.length),
154
+ rejected: full.rejected_bindings.length,
155
+ reasons: [...reasons].slice(0, 8).map(([reason_code, count]) => ({
156
+ reason_code,
157
+ count
158
+ })),
159
+ folded_reason_count: Math.max(0, reasons.size - 8)
160
+ },
161
+ open_items: [],
162
+ active_constraints: [],
163
+ rejected_bindings: [],
164
+ available_evidence: [],
165
+ available_qualifications: []
166
+ };
167
+ if (full.certificate) output.certificate = full.certificate;
168
+ const pagination = {
169
+ snapshot: identity,
170
+ scope: evidence_scope,
171
+ counts: {
172
+ pending: [...p.items.values()].filter((i) => i.status === "pending").length,
173
+ passed: [...p.items.values()].filter((i) => i.status === "passed").length,
174
+ superseded: [...p.items.values()].filter((i) => i.status === "superseded").length
175
+ },
176
+ detail_query: "Use detail_id and detail_offset; evidence_scope=history includes non-citable evidence."
177
+ };
178
+ const summarize = (row) => {
179
+ if (size(row) <= 1800) return row;
180
+ return {
181
+ id: String(row.id ?? row.item_id).slice(0, 128),
182
+ reason_code: row.reason_code,
183
+ certifiable: row.certifiable,
184
+ next_step: typeof row.next_step === "string" ? row.next_step.slice(0, 240) : void 0,
185
+ adapter_disposition: row.adapter_disposition,
186
+ omitted: true,
187
+ detail_id: lookup(String(row.id ?? row.item_id))
188
+ };
189
+ };
190
+ for (const key of LANES) {
191
+ const start = lane === key ? offset : 0;
192
+ const cap = lane && lane !== key ? 0 : key === "open_items" ? Math.min(limit, 8) : key === "active_constraints" ? Math.min(limit, 8 - output.open_items.length) : limit;
193
+ const selected = [];
194
+ for (const row of rows[key].slice(start, start + cap)) {
195
+ const candidate = summarize(row);
196
+ if (size({
197
+ ...output,
198
+ [key]: [...selected, candidate]
199
+ }) > MAX_BYTES - 2400) break;
200
+ selected.push(candidate);
201
+ }
202
+ output[key] = selected;
203
+ const next = start + selected.length;
204
+ pagination[key] = {
205
+ total: rows[key].length,
206
+ returned: selected.length,
207
+ folded: rows[key].length - selected.length,
208
+ next_cursor: next < rows[key].length ? Buffer.from(JSON.stringify({
209
+ identity,
210
+ lane: key,
211
+ offset: next
212
+ })).toString("base64url") : null
213
+ };
214
+ }
215
+ output.pagination = pagination;
216
+ if (size(output) > MAX_BYTES) return invalid("response_budget_exceeded");
217
+ return JSON.parse(JSON.stringify(output));
218
+ }
219
+
220
+ //#endregion
14
221
  //#region src/tools/checkpoint.ts
15
222
  function targetForTool(target) {
16
223
  if (!target) return {};
@@ -58,7 +265,7 @@ function sameTuple(left, right) {
58
265
  return stable$1(left ?? {}) === stable$1(right ?? {});
59
266
  }
60
267
  function evidenceForAction(projection, item) {
61
- return [...projection.evidence.values()].filter((evidence) => evidence.epoch === projection.epoch && evidence.outcome === "success" && evidence.semanticAction === item.semanticAction);
268
+ return [...projection.evidence.values()].filter((evidence) => relevantEvidence(projection, item, evidence));
62
269
  }
63
270
  function bindingTemplate(projection, item) {
64
271
  const action = item.semanticAction;
@@ -103,10 +310,16 @@ function openItemForTool(projection, item) {
103
310
  const template = bindingTemplate(projection, item);
104
311
  return {
105
312
  id: item.id,
313
+ revision: item.revision,
314
+ status: item.status,
315
+ ...item.supersededByItems ? { superseded_by_items: item.supersededByItems } : {},
316
+ ...item.supersededBy ? { superseded_by: item.supersededBy } : {},
317
+ ...item.reboundFrom ? { rebound_from: item.reboundFrom } : {},
318
+ text: item.normalizedText,
106
319
  kind: item.kind,
107
320
  semantic_action: action,
108
321
  requested_target: targetForTool(item.requestedTarget),
109
- certifiable: action !== "generic_run" && ACTION_MANIFEST.actions[action].evidenceProducer === "supported" && !item.legacyFlags?.length && item.targetCaptureStatus !== "clarification_required",
322
+ ...itemDiagnosis(projection, item),
110
323
  producer_disposition: ACTION_MANIFEST.actions[action].evidenceProducer,
111
324
  ...item.targetCaptureStatus ? { target_capture_status: item.targetCaptureStatus } : {},
112
325
  ...item.targetCaptureReasonCode ? { target_capture_reason_code: item.targetCaptureReasonCode } : {},
@@ -125,73 +338,107 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
125
338
  return defineTool({
126
339
  name: "context_guard_checkpoint",
127
340
  description: "Request a completion certificate from existing durable evidence.",
128
- parameters: { bindings: {
129
- type: "array",
130
- required: true,
131
- items: {
132
- type: "object",
133
- additionalProperties: false,
134
- properties: {
135
- item_id: {
136
- type: "string",
137
- required: true
138
- },
139
- evidence_ids: {
140
- type: "array",
141
- required: true,
142
- items: { type: "string" }
143
- },
144
- semantic_action: { type: "string" },
145
- requested_target: {
146
- type: "object",
147
- additionalProperties: true
148
- },
149
- resolved_target: {
150
- type: "object",
151
- additionalProperties: true
152
- },
153
- observed_state: {
154
- type: "object",
155
- additionalProperties: true
156
- },
157
- expected_transition: {
158
- type: "object",
159
- additionalProperties: false,
160
- properties: {
161
- predicate_id: {
162
- type: "string",
163
- required: true
164
- },
165
- version: {
166
- type: "integer",
167
- required: true
168
- },
169
- pred_params_kind: {
170
- type: "string",
171
- required: true,
172
- enum: ["inline"]
173
- },
174
- parameters: {
175
- type: "object",
176
- additionalProperties: true
177
- },
178
- parameters_digest: { type: "string" }
341
+ parameters: {
342
+ item_ids: {
343
+ type: "array",
344
+ items: { type: "string" }
345
+ },
346
+ evidence_ids: {
347
+ type: "array",
348
+ items: { type: "string" }
349
+ },
350
+ evidence_scope: {
351
+ type: "string",
352
+ enum: ["relevant", "history"]
353
+ },
354
+ cursor: { type: "string" },
355
+ limit: { type: "integer" },
356
+ detail_id: { type: "string" },
357
+ detail_offset: { type: "integer" },
358
+ detail_snapshot: { type: "string" },
359
+ bindings: {
360
+ type: "array",
361
+ required: true,
362
+ items: {
363
+ type: "object",
364
+ additionalProperties: false,
365
+ properties: {
366
+ item_id: {
367
+ type: "string",
368
+ required: true
369
+ },
370
+ evidence_ids: {
371
+ type: "array",
372
+ required: true,
373
+ items: { type: "string" }
374
+ },
375
+ semantic_action: { type: "string" },
376
+ requested_target: {
377
+ type: "object",
378
+ additionalProperties: true
379
+ },
380
+ resolved_target: {
381
+ type: "object",
382
+ additionalProperties: true
383
+ },
384
+ observed_state: {
385
+ type: "object",
386
+ additionalProperties: true
387
+ },
388
+ expected_transition: {
389
+ type: "object",
390
+ additionalProperties: false,
391
+ properties: {
392
+ predicate_id: {
393
+ type: "string",
394
+ required: true
395
+ },
396
+ version: {
397
+ type: "integer",
398
+ required: true
399
+ },
400
+ pred_params_kind: {
401
+ type: "string",
402
+ required: true,
403
+ enum: ["inline"]
404
+ },
405
+ parameters: {
406
+ type: "object",
407
+ additionalProperties: true
408
+ },
409
+ parameters_digest: { type: "string" }
410
+ }
411
+ },
412
+ resolution_evidence_id: { type: "string" },
413
+ effect_evidence_id: { type: "string" },
414
+ state_evidence_ids: {
415
+ type: "array",
416
+ items: { type: "string" }
179
417
  }
180
- },
181
- resolution_evidence_id: { type: "string" },
182
- effect_evidence_id: { type: "string" },
183
- state_evidence_ids: {
184
- type: "array",
185
- items: { type: "string" }
186
418
  }
187
419
  }
188
420
  }
189
- } },
421
+ },
190
422
  output: {
191
423
  schema: {
192
424
  type: "object",
193
425
  additionalProperties: false,
194
426
  properties: {
427
+ blockers: {
428
+ type: "object",
429
+ additionalProperties: true
430
+ },
431
+ pagination: {
432
+ type: "object",
433
+ additionalProperties: true
434
+ },
435
+ reason_code: { type: "string" },
436
+ next_step: { type: "string" },
437
+ detail_id: { type: "string" },
438
+ detail_offset: { type: "integer" },
439
+ detail_chunk: { type: "string" },
440
+ next_detail_offset: { oneOf: [{ type: "integer" }, { type: "null" }] },
441
+ snapshot: { type: "string" },
195
442
  status: {
196
443
  type: "string",
197
444
  enum: [
@@ -201,6 +448,13 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
201
448
  ]
202
449
  },
203
450
  contract_revision: { type: "integer" },
451
+ active_constraints: {
452
+ type: "array",
453
+ items: {
454
+ type: "object",
455
+ additionalProperties: true
456
+ }
457
+ },
204
458
  open_items: {
205
459
  type: "array",
206
460
  items: {
@@ -212,7 +466,7 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
212
466
  type: "array",
213
467
  items: {
214
468
  type: "object",
215
- additionalProperties: false,
469
+ additionalProperties: true,
216
470
  properties: {
217
471
  id: { type: "string" },
218
472
  call_id: { type: "string" },
@@ -275,7 +529,7 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
275
529
  type: "array",
276
530
  items: {
277
531
  type: "object",
278
- additionalProperties: false,
532
+ additionalProperties: true,
279
533
  properties: {
280
534
  id: { type: "string" },
281
535
  kind: { type: "string" },
@@ -289,7 +543,7 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
289
543
  type: "array",
290
544
  items: {
291
545
  type: "object",
292
- additionalProperties: false,
546
+ additionalProperties: true,
293
547
  properties: {
294
548
  item_id: { type: "string" },
295
549
  reason: { type: "string" },
@@ -368,7 +622,7 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
368
622
  ...binding.state_evidence_ids ? { stateEvidenceIds: binding.state_evidence_ids } : {}
369
623
  })), `C${projection.checkpoints.length + 1}`, false);
370
624
  if (!result.checkpoint) onRejected();
371
- const available_evidence = [...projection.evidence.values()].filter((evidence) => evidence.epoch === projection.epoch && evidence.outcome === "success").sort((a, b) => a.id < b.id ? -1 : 1).map((evidence) => ({
625
+ const available_evidence = [...projection.evidence.values()].filter((evidence) => evidence.epoch === projection.epoch && (args.evidence_scope === "history" || [...projection.items.values()].some((item) => item.status === "pending" && relevantEvidence(projection, item, evidence)))).sort((a, b) => b.toolResultSeq - a.toolResultSeq || (a.id < b.id ? -1 : 1)).map((evidence) => ({
372
626
  id: evidence.id,
373
627
  call_id: evidence.callId,
374
628
  tool: evidence.toolName,
@@ -387,13 +641,15 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
387
641
  parse_status: evidence.parseStatus ?? "adapter_unavailable",
388
642
  ...evidence.adapterId ? { adapter_id: evidence.adapterId } : {},
389
643
  ...evidence.adapterVersion ? { adapter_version: evidence.adapterVersion } : {},
390
- adapter_disposition: evidence.parseStatus === "supported" ? "citable" : "unavailable",
391
- ...evidence.reasonCode ? { reason_code: evidence.reasonCode } : {}
644
+ adapter_disposition: evidenceAvailabilityReason(evidence) === void 0 ? "citable" : "unavailable",
645
+ ...evidenceAvailabilityReason(evidence) ? { reason_code: evidenceAvailabilityReason(evidence) } : {}
392
646
  }));
393
- return {
647
+ return checkpointPage(projection, args, {
394
648
  status: result.status,
395
649
  contract_revision: result.contractRevision,
396
- open_items: result.openItems.map((id) => projection.items.get(id)).filter((item) => Boolean(item)).map((item) => openItemForTool(projection, item)),
650
+ blocking_total: result.openItems.length,
651
+ open_items: (args.item_ids?.length ? args.item_ids : result.openItems).map((id) => projection.items.get(id)).filter((item) => Boolean(item)).sort((a, b) => b.revision - a.revision || a.id.localeCompare(b.id)).map((item) => openItemForTool(projection, item)),
652
+ active_constraints: [...projection.items.values()].filter((item) => item.kind === "prohibition" && item.status === "pending").map((item) => openItemForTool(projection, item)),
397
653
  available_evidence,
398
654
  available_qualifications: availableBoundaryQualifications(projection).map((row) => ({
399
655
  id: row.id,
@@ -423,7 +679,7 @@ function createCheckpointTool(getProjection, onRejected, prepare = async () => t
423
679
  certification_digest: result.checkpoint.certificationDigest,
424
680
  goal_ref: result.checkpoint.goalRef ?? null
425
681
  } } : {}
426
- };
682
+ });
427
683
  }
428
684
  });
429
685
  }
@@ -878,19 +1134,19 @@ async function tgzIdentity(path) {
878
1134
  const name$1 = header.subarray(0, 100).toString("utf8").replace(/\0.*$/, "");
879
1135
  const sizeText = header.subarray(124, 136).toString("ascii").replace(/\0.*$/, "").trim();
880
1136
  if (!/^[0-7]+$/.test(sizeText)) return void 0;
881
- const size = Number.parseInt(sizeText, 8);
1137
+ const size$1 = Number.parseInt(sizeText, 8);
882
1138
  const bodyStart = offset + 512;
883
- const bodyEnd = bodyStart + size;
884
- if (!Number.isSafeInteger(size) || size < 0 || bodyEnd > tar.length) return void 0;
1139
+ const bodyEnd = bodyStart + size$1;
1140
+ if (!Number.isSafeInteger(size$1) || size$1 < 0 || bodyEnd > tar.length) return void 0;
885
1141
  if (name$1 === "package/package.json") {
886
- if (manifest || size > 1024 * 1024) return void 0;
1142
+ if (manifest || size$1 > 1024 * 1024) return void 0;
887
1143
  try {
888
1144
  manifest = record(JSON.parse(tar.subarray(bodyStart, bodyEnd).toString("utf8")));
889
1145
  } catch {
890
1146
  return;
891
1147
  }
892
1148
  }
893
- offset = bodyStart + Math.ceil(size / 512) * 512;
1149
+ offset = bodyStart + Math.ceil(size$1 / 512) * 512;
894
1150
  }
895
1151
  if (typeof manifest?.name !== "string" || typeof manifest.version !== "string") return void 0;
896
1152
  return {
@@ -934,7 +1190,7 @@ function lockIntegrity(text, packageId, locator) {
934
1190
  if (start < 0) return void 0;
935
1191
  for (let index = start + 1; index < lines.length; index += 1) {
936
1192
  if (/^ \S/.test(lines[index])) break;
937
- const match = /^ resolution: \{integrity: ([^}]+)\}\s*$/.exec(lines[index]);
1193
+ const match = /^ resolution: \{integrity: ([^,\s}]+)(?:, tarball: .+)?\}\s*$/.exec(lines[index]);
938
1194
  if (match) return match[1];
939
1195
  }
940
1196
  }
@@ -1098,8 +1354,8 @@ async function executeGuardAction(action, resolution, roots, signal, executableI
1098
1354
  if (action === "restart") {
1099
1355
  const capabilities = await marketCapabilities(roots, signal);
1100
1356
  if (!capabilities || !roots.marketOrigin || !resolutionCallId || !agent) return "unavailable";
1101
- if (capabilities.bootId !== target.pre_generation) return restartIntent(agent.session.events, resolutionCallId, target) ? "completed" : "unavailable";
1102
- if (restartIntent(agent.session.events, resolutionCallId, target)) return "handoff_pending";
1357
+ if (capabilities.bootId !== target.pre_generation) return restartIntent(snapshotSessionEvents(agent.session), resolutionCallId, target) ? "completed" : "unavailable";
1358
+ if (restartIntent(snapshotSessionEvents(agent.session), resolutionCallId, target)) return "handoff_pending";
1103
1359
  if (!roots.persistRestartIntent || !await roots.persistRestartIntent(agent, {
1104
1360
  resolutionCallId,
1105
1361
  serviceId: String(target.service_id),
@@ -1726,7 +1982,7 @@ function createActionTool(options = {}) {
1726
1982
  reason_code: "mutation_durability_unavailable",
1727
1983
  ...empty
1728
1984
  };
1729
- const resolution = findResolution(agent.session.events, args.resolution_call_id, action);
1985
+ const resolution = findResolution(snapshotSessionEvents(agent.session), args.resolution_call_id, action);
1730
1986
  if (!resolution) return {
1731
1987
  status: "unavailable",
1732
1988
  reason_code: "resolution_evidence_missing",
@@ -2010,7 +2266,7 @@ function createEvidenceTool(options = {}) {
2010
2266
  return supported(action, role, resolved.target, {}, commandManifest, gitBinding, executableBinding, expectedTransition);
2011
2267
  }
2012
2268
  if (!args.resolution_call_id) return unavailable(action, role, "producer_reference_missing");
2013
- const resolution = findResolution(agent.session.events, args.resolution_call_id, action);
2269
+ const resolution = findResolution(snapshotSessionEvents(agent.session), args.resolution_call_id, action);
2014
2270
  if (!resolution) return unavailable(action, role, "persisted_effect_mismatch");
2015
2271
  const executable = executableFor(action);
2016
2272
  let currentExecutable;
@@ -2030,11 +2286,12 @@ function createEvidenceTool(options = {}) {
2030
2286
  ].includes(action);
2031
2287
  if (!args.effect_call_id) return unavailable(action, role, "producer_reference_missing");
2032
2288
  if (ownedEffect) {
2033
- const actionCall = actionCallMatches(agent.session.events, args.effect_call_id, action, args.resolution_call_id, resolution.target);
2034
- if (!(action === "restart" ? actionCall && restartIntent(agent.session.events, args.resolution_call_id, resolution.target) && (await marketCapabilities(roots, exec.signal))?.bootId !== resolution.target.pre_generation : actionCall && actionResultCompleted(agent.session.events, args.effect_call_id))) return unavailable(action, role, "persisted_effect_mismatch");
2289
+ const events = snapshotSessionEvents(agent.session);
2290
+ const actionCall = actionCallMatches(events, args.effect_call_id, action, args.resolution_call_id, resolution.target);
2291
+ if (!(action === "restart" ? actionCall && restartIntent(events, args.resolution_call_id, resolution.target) && (await marketCapabilities(roots, exec.signal))?.bootId !== resolution.target.pre_generation : actionCall && actionResultCompleted(events, args.effect_call_id))) return unavailable(action, role, "persisted_effect_mismatch");
2035
2292
  if (role === "effect") return supported(action, role, resolution.target, {}, resolution.commandManifest, void 0, currentExecutable);
2036
2293
  } else {
2037
- const effect = findEffect(agent.session.events, args.effect_call_id);
2294
+ const effect = findEffect(snapshotSessionEvents(agent.session), args.effect_call_id);
2038
2295
  if (!effect || !effectMatches(action, resolution, effect)) return unavailable(action, role, "persisted_effect_mismatch");
2039
2296
  if (role === "effect") return supported(action, role, resolution.target, {}, resolution.commandManifest, void 0, currentExecutable);
2040
2297
  }
@@ -3069,6 +3326,13 @@ function authorizeMutationFromProjection(projection, request) {
3069
3326
  status: "denied",
3070
3327
  reasonCode: "mutation_legacy_rebind_required"
3071
3328
  };
3329
+ if (item.reboundFrom) {
3330
+ const original = projection.items.get(item.reboundFrom.itemId);
3331
+ if (original?.sourceMessageId === item.sourceMessageId && (original.semanticAction !== request.action || !requestedTargetAuthorizesMutation(request.action, original.requestedTarget, request.resolvedTarget))) return {
3332
+ status: "denied",
3333
+ reasonCode: "rebind_does_not_authorize_mutation"
3334
+ };
3335
+ }
3072
3336
  if (item.semanticAction !== request.action) return {
3073
3337
  status: "denied",
3074
3338
  reasonCode: "mutation_semantic_action_mismatch"
@@ -3152,7 +3416,7 @@ function sessionHeaderForDigest(session) {
3152
3416
  ...typeof raw.seedLength === "number" ? { seedLength: raw.seedLength } : {},
3153
3417
  ...typeof raw.agentPreset === "string" ? { agentPreset: raw.agentPreset } : {},
3154
3418
  ...typeof raw.origin === "string" ? { origin: raw.origin } : {},
3155
- ...typeof raw.delegationDepth === "number" ? { delegationDepth: raw.delegationDepth } : {}
3419
+ delegationDepth: typeof raw.delegationDepth === "number" ? raw.delegationDepth : 0
3156
3420
  };
3157
3421
  }
3158
3422
  function createRuntime(agent, config, hostLock = DEFAULT_HOST_LOCK, readGoalState) {
@@ -3162,12 +3426,13 @@ function createRuntime(agent, config, hostLock = DEFAULT_HOST_LOCK, readGoalStat
3162
3426
  let durabilityConfirmed = false;
3163
3427
  let observedEpoch = -1;
3164
3428
  let observedCompactionSeq = -1;
3429
+ let observedContractRevision = -1;
3165
3430
  const continuationAttempts = projection.continuationAttempts;
3166
3431
  const persistenceCorrectionAttempts = projection.persistenceCorrectionAttempts;
3167
3432
  const rebuild = () => {
3168
3433
  const header = session.header;
3169
3434
  const priorRecoveryDigest = projection.lastRecoveryDigest;
3170
- const derived = deriveProjection(session.events, { activation: config.activation }, {
3435
+ const derived = deriveProjection(snapshotSessionEvents(session), { activation: config.activation }, {
3171
3436
  cwd: typeof header?.cwd === "string" ? header.cwd : "",
3172
3437
  sessionHeader: sessionHeaderForDigest(session)
3173
3438
  }, durabilityConfirmed, hostLock);
@@ -3190,8 +3455,11 @@ function createRuntime(agent, config, hostLock = DEFAULT_HOST_LOCK, readGoalStat
3190
3455
  projection.lastRecoveryDigest = void 0;
3191
3456
  }
3192
3457
  observedEpoch = derived.projection.epoch;
3458
+ if (observedContractRevision >= 0 && projection.contractRevision !== observedContractRevision) pendingRecovery = true;
3459
+ observedContractRevision = projection.contractRevision;
3193
3460
  if (derived.lastCompactionSeq > observedCompactionSeq) {
3194
3461
  pendingRecovery = true;
3462
+ projection.lastRecoveryDigest = void 0;
3195
3463
  observedCompactionSeq = derived.lastCompactionSeq;
3196
3464
  }
3197
3465
  };
@@ -3246,6 +3514,7 @@ function apply(ctx, rawConfig = {}) {
3246
3514
  ctx.commands.register(createContextGuardCommand((agent) => ensure(agent).projection, (agent, enabled) => ensure(agent).setEnabled(enabled), (agent) => ensure(agent).sync()));
3247
3515
  ctx.on("agent/session-start", ({ agent, source }) => {
3248
3516
  ensureProtocolBoundary(agent);
3517
+ ensureProtocolBoundary(agent, CAPTURE_V042_NOTICE);
3249
3518
  const runtime = ensure(agent);
3250
3519
  runtime.sync();
3251
3520
  if (source === "resume" || source === "compact") {
@@ -3254,6 +3523,12 @@ function apply(ctx, rawConfig = {}) {
3254
3523
  }
3255
3524
  if (registeredAgents.has(agent)) return;
3256
3525
  registeredAgents.add(agent);
3526
+ agent.ctx.tools.register(createRebindTool(() => runtime.projection, async () => {
3527
+ const durable = await ctx.sessions.flush(agent.session);
3528
+ runtime.setDurability(durable);
3529
+ runtime.sync();
3530
+ return durable;
3531
+ }));
3257
3532
  agent.ctx.tools.register(createCheckpointTool(() => runtime.projection, () => runtime.markRecoveryNeeded(), async () => {
3258
3533
  const durable = await ctx.sessions.flush(agent.session);
3259
3534
  runtime.setDurability(durable);
@@ -3317,9 +3592,9 @@ function apply(ctx, rawConfig = {}) {
3317
3592
  const decision = await next();
3318
3593
  if (decision.kind === "enter" && runtime.projection.enabled && runtime.consumeRecovery()) {
3319
3594
  const recovery = renderRecoveryPacket(runtime.projection, { charBudget: 4e3 });
3320
- const digest$1 = recovery ? recoveryDigest(recovery, runtime.projection) : void 0;
3321
- if (recovery && digest$1 !== runtime.projection.lastRecoveryDigest) {
3322
- runtime.projection.lastRecoveryDigest = digest$1;
3595
+ const digest$2 = recovery ? recoveryDigest(recovery, runtime.projection) : void 0;
3596
+ if (recovery && digest$2 !== runtime.projection.lastRecoveryDigest) {
3597
+ runtime.projection.lastRecoveryDigest = digest$2;
3323
3598
  decision.messages = [...decision.messages, createUserMessage({
3324
3599
  content: [{
3325
3600
  type: "text",
@@ -3375,24 +3650,24 @@ function optionalMarketOrigin(ctx, agent) {
3375
3650
  return `http://${service.host === "::1" ? "[::1]" : "127.0.0.1"}:${service.port}`;
3376
3651
  } catch {}
3377
3652
  }
3378
- function ensureProtocolBoundary(agent) {
3379
- if (agent.session.events.some((event) => {
3653
+ function ensureProtocolBoundary(agent, notice = PROTOCOL_V3_NOTICE) {
3654
+ if (snapshotSessionEvents(agent.session).some((event) => {
3380
3655
  if (event.type !== "user/message" || !event.data || typeof event.data !== "object") return false;
3381
3656
  const data = event.data;
3382
3657
  const source = data.source && typeof data.source === "object" ? data.source : void 0;
3383
3658
  const content = Array.isArray(data.content) ? data.content : [];
3384
- return (content.length === 1 && content[0] && typeof content[0] === "object" ? content[0].text : void 0) === PROTOCOL_V3_NOTICE && source?.kind === "plugin" && source.plugin === "context-guard" && source.form === "notice";
3659
+ return (content.length === 1 && content[0] && typeof content[0] === "object" ? content[0].text : void 0) === notice && source?.kind === "plugin" && source.plugin === "context-guard" && source.form === "notice";
3385
3660
  })) return;
3386
3661
  agent.session.append.bind(agent.session)("user/message", createUserMessage({
3387
3662
  content: [{
3388
3663
  type: "text",
3389
- text: PROTOCOL_V3_NOTICE
3664
+ text: notice
3390
3665
  }],
3391
3666
  source: {
3392
3667
  kind: "plugin",
3393
3668
  plugin: "context-guard",
3394
3669
  form: "notice",
3395
- summary: boundContextSummary("Context Guard upgraded its replay contract to v3")
3670
+ summary: boundContextSummary("Context Guard recorded a replay version boundary")
3396
3671
  }
3397
3672
  }), { surfaceOp: "append" });
3398
3673
  }
@@ -3466,4 +3741,4 @@ function normalizeGoalState(value) {
3466
3741
  }
3467
3742
 
3468
3743
  //#endregion
3469
- export { ACTION_MANIFEST, ACTION_MANIFEST_VERSION, ALPHA2_DSHMARKET_139_HOST_PACKAGES, ALPHA2_HOST_PACKAGES, ALPHA3_HOST_PACKAGES, BASE_HOST_PACKAGES, CERTIFICATE_VERSION, COMMAND_SURFACE_MANIFEST, Config, DEFAULT_HOST_LOCK, DEFAULT_RECOVERY_CHAR_BUDGET, EXPECTED_HOST_PACKAGES, GIT_COMMAND_MANIFEST_IDS, GOAL_HOST_PACKAGES, HOST_CAPABILITY_PACKAGE_GROUPS, HOST_COHORTS, HostProfileError, PROOF_KINDS, PROOF_PROTOCOL_VERSION, PROTOCOL_V3_NOTICE, SEMANTIC_ACTIONS, STATEFUL_ACTIONS, STOP_PROTOCOL_VERSION, SUPPORTED_EVIDENCE_ADAPTERS, actionCompatible, apply, authorityCaptureCounts, availableBoundaryQualifications, bindExecutableIdentity, bindLiveGoalCapability, bindProofToProjection, bindingSatisfies, canonicalArgvFromCommand, canonicalProjection, canonicalizePath, captureClause, captureItem, certifyCheckpoint, classifyClause, classifyCompletionClaim, classifyUserInteraction, closingHint, commitIndexSnapshotDigest, commitTreeSnapshotDigest, createGitPrestateEnvelope, createProjection, createProofManifest, currentContractDigest, decideTurnBoundary, decideTurnStopping, deriveProjection, digestStrings, effectuateBoundary, evaluateExternalWaitCapability, evaluateHostCapability, evaluateHostLock, evaluateToolSurfaceCapability, evidenceCoverage, evidenceFromPersistedToolResult, evidenceMatchesItem, executeRevalidatedGitEffect, extractArtifactPaths, extractMethod, extractOperation, extractTextContent, extractToolSubject, gitCommandMatchesTarget, goalCompletionDenial, hasCurrentCertificate, hostLockContextFromComposedDump, hostLockRowsFromComposedDump, inject, injectActiveProfileHostLock, isCurrentAcceptedBoundary, isDeterministicCheck, isInformationalMessage, isRunExecutable, isStatefulAction, isVerifyingCapability, isWholeTaskCompletionClaim, latestAssistantText, name, normalizeClause, observeAssistantOutcome, openItems, packageRowsFromActiveGraph, packageRowsFromPnpmLock, parseGitCommandManifest, parsePwshCommand, parseShellCommand, proofDigest, proofEvidenceConstraints, qualifyBoundary, recoveryDigest, renderRecoveryPacket, requestedTargetAuthorizesMutation, requestedTargetMatchesResolved, resolveActiveProfileHostLock, resolveInstalledHostLock, revalidateGitPrestate, sanitizeClauseText, sanitizeUrl, segmentAuthorityBlocks, segmentClauses, selectHostCohort, semanticActionFromCommand, semanticActionFromText, sessionQuery, sha256, supersedeItem, validateActionManifest, validateActionTarget, validateManifest, validateProofManifest, verifiedLinearCommitReadback, verifyComposedHostLockDump, withDurability };
3744
+ export { ACTION_MANIFEST, ACTION_MANIFEST_VERSION, ALPHA2_DSHMARKET_139_HOST_PACKAGES, ALPHA2_HOST_PACKAGES, ALPHA3_HOST_PACKAGES, BASE_HOST_PACKAGES, CAPTURE_V042_NOTICE, CERTIFICATE_VERSION, COMMAND_SURFACE_MANIFEST, Config, DEFAULT_HOST_LOCK, DEFAULT_RECOVERY_CHAR_BUDGET, EXPECTED_HOST_PACKAGES, GIT_COMMAND_MANIFEST_IDS, GOAL_HOST_PACKAGES, HOST_CAPABILITY_PACKAGE_GROUPS, HOST_COHORTS, HostProfileError, MIN_RECOVERY_CHAR_BUDGET, PROOF_KINDS, PROOF_PROTOCOL_VERSION, PROTOCOL_V3_NOTICE, RC1_HOST_PACKAGES, SEMANTIC_ACTIONS, STATEFUL_ACTIONS, STOP_PROTOCOL_VERSION, SUPPORTED_EVIDENCE_ADAPTERS, actionCompatible, apply, authorityCaptureCounts, availableBoundaryQualifications, bindExecutableIdentity, bindLiveGoalCapability, bindProofToProjection, bindingSatisfies, canonicalArgvFromCommand, canonicalProjection, canonicalizePath, captureClause, captureItem, certifyCheckpoint, classifyClause, classifyCompletionClaim, classifyUserInteraction, closingHint, commitIndexSnapshotDigest, commitTreeSnapshotDigest, createGitPrestateEnvelope, createProjection, createProofManifest, currentContractDigest, decideTurnBoundary, decideTurnStopping, deriveProjection, digestStrings, effectuateBoundary, evaluateExternalWaitCapability, evaluateHostCapability, evaluateHostLock, evaluateToolSurfaceCapability, evidenceCoverage, evidenceFromPersistedToolResult, evidenceMatchesItem, executeRevalidatedGitEffect, extractArtifactPaths, extractMethod, extractOperation, extractTextContent, extractToolSubject, gitCommandMatchesTarget, goalCompletionDenial, hasCurrentCertificate, hostLockContextFromComposedDump, hostLockRowsFromComposedDump, inject, injectActiveProfileHostLock, isCurrentAcceptedBoundary, isDeterministicCheck, isInformationalMessage, isRunExecutable, isStatefulAction, isVerifyingCapability, isWholeTaskCompletionClaim, latestAssistantText, name, normalizeClause, observeAssistantOutcome, openItems, packageRowsFromActiveGraph, packageRowsFromPnpmLock, parseGitCommandManifest, parsePwshCommand, parseShellCommand, proofDigest, proofEvidenceConstraints, qualifyBoundary, recoveryDigest, renderRecoveryPacket, requestedTargetAuthorizesMutation, requestedTargetMatchesResolved, resolveActiveProfileHostLock, resolveInstalledHostLock, revalidateGitPrestate, sanitizeClauseText, sanitizeUrl, segmentAuthorityBlocks, segmentClauses, selectHostCohort, semanticActionFromCommand, semanticActionFromText, sessionQuery, sha256, snapshotSessionEvents, supersedeItem, validateActionManifest, validateActionTarget, validateManifest, validateProofManifest, verifiedLinearCommitReadback, verifyComposedHostLockDump, withDurability };