dsh-completion-guard 0.5.3 → 0.6.1
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 +332 -0
- package/CHANGELOG.zh-CN.md +116 -0
- package/README.md +107 -9
- package/README.zh-CN.md +60 -9
- package/dist/domain/index.d.ts +2 -2
- package/dist/domain/index.js +2 -2
- package/dist/{domain-RuX9l07o.js → domain-DKr8sLZZ.js} +3306 -393
- package/dist/{index-BTaiOcE-.d.ts → index-C_N6DaSF.d.ts} +570 -7
- package/dist/index.d.ts +127 -3
- package/dist/index.js +1139 -87
- package/docs/ARCHITECTURE.md +88 -0
- package/docs/LOCAL_ACCEPTANCE.md +199 -0
- package/docs/NEXT_VERSION_REPAIR_NOTES.md +45 -2
- package/docs/PORTING_NOTES.md +36 -2
- package/docs/SEMANTIC_COMPATIBILITY.md +123 -0
- package/docs/WINDOWS_0_6_0_REPAIR_PLAN.md +92 -0
- package/docs/upstream-deltas.json +90 -9
- package/package.json +2 -2
|
@@ -18,6 +18,13 @@ declare function sanitizeUrl(value: string): string;
|
|
|
18
18
|
//#region src/domain/protocol-manifest.d.ts
|
|
19
19
|
declare const STOP_PROTOCOL_VERSION = "2.0.0";
|
|
20
20
|
declare const CERTIFICATE_VERSION = "1";
|
|
21
|
+
/**
|
|
22
|
+
* 0.6.0 v5-session identity (P0 §1): v2 certificates bind a work unit's
|
|
23
|
+
* closure instead of the whole session. Version-1 identity keeps its
|
|
24
|
+
* historical meaning for legacy sessions and is never silently re-read.
|
|
25
|
+
*/
|
|
26
|
+
declare const STOP_PROTOCOL_VERSION_V2 = "3.0.0";
|
|
27
|
+
declare const CERTIFICATE_VERSION_V2 = "2";
|
|
21
28
|
declare const ACTION_MANIFEST_VERSION = 1;
|
|
22
29
|
declare const SUPPORTED_EVIDENCE_ADAPTERS: Readonly<Record<string, string>>;
|
|
23
30
|
declare const SEMANTIC_ACTIONS: readonly ["inspect_remote_updates", "install", "apply", "create", "modify", "test", "verify", "pull", "fetch", "commit", "push", "restart", "publish", "generic_run"];
|
|
@@ -43,10 +50,29 @@ declare function semanticActionFromCommand(command: string): SemanticAction;
|
|
|
43
50
|
declare function isStatefulAction(action: SemanticAction): action is StatefulAction;
|
|
44
51
|
declare function actionCompatible(required: SemanticAction, observed: SemanticAction): boolean;
|
|
45
52
|
declare function validateActionTarget(action: SemanticAction, resolved: TargetTuple | undefined, observed: TargetTuple | undefined): boolean;
|
|
53
|
+
/** The single identity field a root instruction must name for this action. */
|
|
54
|
+
declare function requestedIdentityKey(action: SemanticAction): string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* The 0.6.0 bounded file-choice vocabulary (C07/S03): artifact-type nouns a
|
|
57
|
+
* root instruction may use instead of an exact path. The assistant may pick
|
|
58
|
+
* the exact file INSIDE the captured scope and inside the type, and the
|
|
59
|
+
* choice is frozen by the resolution producer before any effect. An absent
|
|
60
|
+
* extension set (`file`) admits any file the producer accepts.
|
|
61
|
+
*/
|
|
62
|
+
declare const BOUNDED_ARTIFACT_TYPES: Readonly<Record<string, ReadonlySet<string> | null>>;
|
|
63
|
+
/**
|
|
64
|
+
* Whether a bounded-choice requested target authorizes this resolved target:
|
|
65
|
+
* the resolved artifact must live inside the captured scope and match the
|
|
66
|
+
* captured type. The exact file name is the assistant's bounded decision,
|
|
67
|
+
* frozen by resolution — never a root-named identity substitution.
|
|
68
|
+
*/
|
|
69
|
+
declare function boundedArtifactChoiceMatches(action: SemanticAction, requested: TargetTuple | undefined, resolved: TargetTuple | undefined): boolean;
|
|
46
70
|
/**
|
|
47
71
|
* Compare identities captured from the root instruction with a complete
|
|
48
72
|
* adapter-resolved target. Requested targets are partial by design: only
|
|
49
73
|
* explicitly named identities (plus the active repository scope) are frozen.
|
|
74
|
+
* A bounded artifact choice (scope + type, C07) matches when the resolved
|
|
75
|
+
* exact file is inside the scope and of the captured type.
|
|
50
76
|
*/
|
|
51
77
|
declare function requestedTargetMatchesResolved(action: StatefulAction, requested: TargetTuple | undefined, resolved: TargetTuple | undefined): boolean;
|
|
52
78
|
/** A mutation requires every user-selectable identity field, not a partial match. */
|
|
@@ -95,7 +121,7 @@ interface InterpretOptions {
|
|
|
95
121
|
coordinationSplit?: boolean;
|
|
96
122
|
}
|
|
97
123
|
/** What one scope does with the action it names. */
|
|
98
|
-
type DirectiveClass = "directive" | "prohibition" | "conditional" | "informational" | "narrative";
|
|
124
|
+
type DirectiveClass = "directive" | "prohibition" | "conditional" | "informational" | "narrative" | "unresolved";
|
|
99
125
|
/** Who is expected to perform the action. */
|
|
100
126
|
type Executee = "agent" | "user" | "unresolved";
|
|
101
127
|
/** How the scope's authority reads. */
|
|
@@ -247,6 +273,153 @@ declare function replayRebindResult(p: GuardProjection, args: RebindArgs, record
|
|
|
247
273
|
* caller processes the remaining text afterwards with its own semantics. */
|
|
248
274
|
declare function confirmRebind(p: GuardProjection, proposalId: string, eventId: string, durable: boolean): boolean;
|
|
249
275
|
//#endregion
|
|
276
|
+
//#region src/domain/release.d.ts
|
|
277
|
+
declare const RELEASE_OPERATIONS: readonly ["npm_publish", "git_tag", "github_release_create", "github_release_update", "github_release_delete", "composite_runner"];
|
|
278
|
+
type ReleaseOperation = (typeof RELEASE_OPERATIONS)[number];
|
|
279
|
+
/**
|
|
280
|
+
* The candidate identity a release contract freezes. Each field names exactly
|
|
281
|
+
* one measurable identity; all are optional except the full commit, because a
|
|
282
|
+
* contract that names nothing cannot be checked against anything.
|
|
283
|
+
*/
|
|
284
|
+
interface ReleaseCandidate {
|
|
285
|
+
/** The commit the artifact was built from (the artifact's embedded gitHead). */
|
|
286
|
+
fullSha40: string;
|
|
287
|
+
/** The ref that commit must be on, when the surface can observe a ref. */
|
|
288
|
+
ref?: string;
|
|
289
|
+
/** Repository identity (owner/name or clone URL). */
|
|
290
|
+
repository?: string;
|
|
291
|
+
/** Package or artifact name. */
|
|
292
|
+
packageId?: string;
|
|
293
|
+
/** Exact released version. */
|
|
294
|
+
version?: string;
|
|
295
|
+
/** SHA-256 of the exact artifact bytes (64 lowercase hex). */
|
|
296
|
+
artifactSha256?: string;
|
|
297
|
+
/** npm integrity of the exact artifact bytes (`sha512-<base64>`). */
|
|
298
|
+
artifactSri?: string;
|
|
299
|
+
/** The registry the artifact is published to (canonical base URL). */
|
|
300
|
+
registry?: string;
|
|
301
|
+
}
|
|
302
|
+
interface ReleaseContract {
|
|
303
|
+
contractId: string;
|
|
304
|
+
adoptedBy: {
|
|
305
|
+
seq: number;
|
|
306
|
+
digest: string;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* The contract revision the candidate scope was FROZEN at. The closure
|
|
310
|
+
* certificate must be the one that certified exactly this revision: a later
|
|
311
|
+
* obligation (including the release instruction itself) does not invalidate
|
|
312
|
+
* the accepted candidate, while a certificate minted after the adoption — or
|
|
313
|
+
* a candidate whose content moved on — is refused.
|
|
314
|
+
*/
|
|
315
|
+
adoptedAtRevision: number;
|
|
316
|
+
operations: ReleaseOperation[];
|
|
317
|
+
candidate: ReleaseCandidate;
|
|
318
|
+
readinessRefs: string[];
|
|
319
|
+
closureCertRef?: string;
|
|
320
|
+
/**
|
|
321
|
+
* The closure certificate as it existed AT ADOPTION, frozen by identity.
|
|
322
|
+
*
|
|
323
|
+
* Comparing only the revision let a log entry ADD the certificate after the
|
|
324
|
+
* adoption and still ratify it: the adoption would be validated by evidence
|
|
325
|
+
* that did not exist when it was made. Freezing the certification digest (and
|
|
326
|
+
* its epoch/revision) pins the exact certificate the adopter relied on, so a
|
|
327
|
+
* certificate that appears later — even one that reuses the same id — is
|
|
328
|
+
* refused. Absent means the adopter named a closure that did not exist yet,
|
|
329
|
+
* which is equally refused: a later log entry can never supply it.
|
|
330
|
+
*/
|
|
331
|
+
frozenClosure?: {
|
|
332
|
+
id: string;
|
|
333
|
+
certificationDigest: string;
|
|
334
|
+
epoch: number;
|
|
335
|
+
contractRevision: number;
|
|
336
|
+
};
|
|
337
|
+
expiresAtEpochMs?: number;
|
|
338
|
+
/** Durable root revocation; the record is kept for audit, never deleted. */
|
|
339
|
+
revokedAtSeq?: number;
|
|
340
|
+
}
|
|
341
|
+
interface ReleaseReservation {
|
|
342
|
+
contractId: string;
|
|
343
|
+
operation: ReleaseOperation;
|
|
344
|
+
callId: string;
|
|
345
|
+
startedAtSeq: number;
|
|
346
|
+
status: "in_flight";
|
|
347
|
+
/**
|
|
348
|
+
* The npm SRI the trusted producer read when the reservation was written.
|
|
349
|
+
* Recorded so a contract that froze only the byte SHA-256 can still be
|
|
350
|
+
* reconciled by a registry readback: without it, a SHA-256-only contract
|
|
351
|
+
* would be permanently unsettleable.
|
|
352
|
+
*/
|
|
353
|
+
observedArtifactSri?: string;
|
|
354
|
+
}
|
|
355
|
+
type ReleaseOutcome = "settled" | "unconfirmed" | "unknown" | "failed" | "not_effected";
|
|
356
|
+
interface ReleaseSettlement {
|
|
357
|
+
contractId: string;
|
|
358
|
+
operation: ReleaseOperation;
|
|
359
|
+
callId: string;
|
|
360
|
+
settledAtSeq: number;
|
|
361
|
+
/** A trusted readback identity, or the reason no producer exists. */
|
|
362
|
+
readback: {
|
|
363
|
+
kind: "npm_integrity" | "git_ref" | "github_release";
|
|
364
|
+
identity: string;
|
|
365
|
+
} | "unavailable";
|
|
366
|
+
outcome: ReleaseOutcome;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* The identity a trusted producer observed for the candidate. Every field is
|
|
370
|
+
* optional because a given surface can observe only some of them; a field the
|
|
371
|
+
* contract declares but the producer does not observe is a refusal, never a
|
|
372
|
+
* silent pass.
|
|
373
|
+
*/
|
|
374
|
+
interface ReleaseObservedIdentity {
|
|
375
|
+
fullSha40?: string;
|
|
376
|
+
/** The ref NAME the candidate is expected to be on. */
|
|
377
|
+
ref?: string;
|
|
378
|
+
/** The commit that ref resolves to, read by the audited git producer. */
|
|
379
|
+
refSha?: string;
|
|
380
|
+
repository?: string;
|
|
381
|
+
packageId?: string;
|
|
382
|
+
version?: string;
|
|
383
|
+
artifactSha256?: string;
|
|
384
|
+
artifactSri?: string;
|
|
385
|
+
registry?: string;
|
|
386
|
+
}
|
|
387
|
+
interface ReleaseGateDecision {
|
|
388
|
+
status: "granted" | "denied";
|
|
389
|
+
reasonCode: string;
|
|
390
|
+
contractId?: string;
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/domain/host-selection.d.ts
|
|
394
|
+
/**
|
|
395
|
+
* Trusted host-native selection adapter (0.6.0 DS06-D, C07/S06).
|
|
396
|
+
*
|
|
397
|
+
* Only a PAIRED durable tool round-trip can form a trusted user selection:
|
|
398
|
+
* a `tool/call` whose arguments pose a question with explicit options, and
|
|
399
|
+
* its successful `tool/result` carrying the answer, bound by the same
|
|
400
|
+
* callId in the same session. Pasted answer text, a model restatement, or
|
|
401
|
+
* the answer of another call can never form a selection. Path selections
|
|
402
|
+
* and sandbox approvals are separate facts and are recorded separately.
|
|
403
|
+
*
|
|
404
|
+
* The question tool's name is a host tool-bundle surface: the adapter
|
|
405
|
+
* matches a bounded allowlist supplied by the caller (production wires the
|
|
406
|
+
* names audited for the running cohort; native acceptance pins them).
|
|
407
|
+
*/
|
|
408
|
+
interface TrustedSelection {
|
|
409
|
+
callId: string;
|
|
410
|
+
/** Sequence of the tool/result event that settled the selection. */
|
|
411
|
+
resultSeq: number;
|
|
412
|
+
turn: number | undefined;
|
|
413
|
+
toolName: string;
|
|
414
|
+
questionId: string | undefined;
|
|
415
|
+
question: string | undefined;
|
|
416
|
+
options: string[];
|
|
417
|
+
/** The answer the user actually chose, verbatim from the paired result. */
|
|
418
|
+
selected: string;
|
|
419
|
+
/** A directory selection narrows where bounded file choices may land. */
|
|
420
|
+
kind: "directory" | "value";
|
|
421
|
+
}
|
|
422
|
+
//#endregion
|
|
250
423
|
//#region src/domain/digest.d.ts
|
|
251
424
|
type TypedObject = {
|
|
252
425
|
k: "b" | "i" | "s" | "e" | "x";
|
|
@@ -297,7 +470,13 @@ interface PackageRow {
|
|
|
297
470
|
//#endregion
|
|
298
471
|
//#region src/domain/types.d.ts
|
|
299
472
|
type GuardItemKind = "requirement" | "acceptance" | "prohibition";
|
|
300
|
-
|
|
473
|
+
/**
|
|
474
|
+
* `answered` (0.6.0, C03) marks an information-slot obligation closed by a
|
|
475
|
+
* trusted delivery fact: the host-confirmed final answer of a completed turn.
|
|
476
|
+
* It certifies only that delivery happened — never accuracy, sufficiency, or
|
|
477
|
+
* that any execution happened. Legacy sessions (no v5 boundary) never mint it.
|
|
478
|
+
*/
|
|
479
|
+
type GuardItemStatus = "pending" | "answered" | "passed" | "superseded";
|
|
301
480
|
type GuardIntegrity = "valid" | "unknown" | "corrupt";
|
|
302
481
|
type EvidenceOutcome = "success" | "failure" | "unknown" | "durability-unknown";
|
|
303
482
|
type GuardOperation = "create" | "write" | "modify" | "read" | "run" | "verify";
|
|
@@ -315,6 +494,28 @@ interface GoalRef {
|
|
|
315
494
|
id: string;
|
|
316
495
|
revision: number;
|
|
317
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* 0.6.0 source span (C01): a UTF-8 byte half-open interval `[start, end)`
|
|
499
|
+
* inside the ORIGINAL root message text (before any normalization), bound to
|
|
500
|
+
* that message's content digest. Offsets are byte offsets computed with
|
|
501
|
+
* TextEncoder — never string indices — so Python and TypeScript agree on the
|
|
502
|
+
* same positions.
|
|
503
|
+
*/
|
|
504
|
+
interface SourceSpan {
|
|
505
|
+
/** Index of the message part the span anchors to (0 = text). */
|
|
506
|
+
partIndex: number;
|
|
507
|
+
start: number;
|
|
508
|
+
end: number;
|
|
509
|
+
class: "instruction" | "adoption" | "question" | "constraint";
|
|
510
|
+
}
|
|
511
|
+
/** 0.6.0 per-message coverage summary (C01), bounded to the last 16 messages. */
|
|
512
|
+
interface MessageCoverage {
|
|
513
|
+
seq: number;
|
|
514
|
+
rawTextSha256: string;
|
|
515
|
+
byteLength: number;
|
|
516
|
+
/** Number of obligation spans the message contributed to items. */
|
|
517
|
+
coveredSpans: number;
|
|
518
|
+
}
|
|
318
519
|
interface WaitAuthorization {
|
|
319
520
|
kind: "root_explicit_wait" | "user_decision_item";
|
|
320
521
|
id: string;
|
|
@@ -340,6 +541,37 @@ interface VerificationContract {
|
|
|
340
541
|
* on the same canonical subject — mentioning the file is not enough. */
|
|
341
542
|
operation?: GuardOperation;
|
|
342
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* 0.6.1 (W060-01): the durable identity of one non-text root input part. The
|
|
546
|
+
* asset obligation binds the exact message sequence, part index and content
|
|
547
|
+
* digest of the ORIGINAL input — never a model description of it — so an
|
|
548
|
+
* interpretation can only ever be recorded against the asset it interpreted.
|
|
549
|
+
*/
|
|
550
|
+
interface AssetObligation {
|
|
551
|
+
/** Sequence of the root message that carried the part. */
|
|
552
|
+
messageSeq: number;
|
|
553
|
+
/** Index of the non-text part inside that message. */
|
|
554
|
+
partIndex: number;
|
|
555
|
+
/** sha256 of the canonical JSON of the part: the media identity. */
|
|
556
|
+
mediaSha256: string;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* 0.6.1 (W060-01): one durable per-asset interpretation record, derived from a
|
|
560
|
+
* confirmed `context_guard_interpret` result that replay re-validated against
|
|
561
|
+
* the contract (call arguments, item, revision, asset identity). It is the
|
|
562
|
+
* model's explicit declaration that it read THAT obligation's asset in THAT
|
|
563
|
+
* host turn; it never proves the interpretation is correct, and it closes
|
|
564
|
+
* nothing by itself — an asset obligation closes only when a delivery of the
|
|
565
|
+
* interpretation's own turn exists. Absent from logs written before this
|
|
566
|
+
* entrypoint existed, which is what keeps upgrade replays from retroactively
|
|
567
|
+
* interpreting old assets.
|
|
568
|
+
*/
|
|
569
|
+
interface AssetInterpretationFact {
|
|
570
|
+
itemId: string;
|
|
571
|
+
resultSeq: number;
|
|
572
|
+
/** The host turn the interpretation happened in. */
|
|
573
|
+
turn: number;
|
|
574
|
+
}
|
|
343
575
|
interface GuardItem {
|
|
344
576
|
id: string;
|
|
345
577
|
revision: number;
|
|
@@ -395,6 +627,52 @@ interface GuardItem {
|
|
|
395
627
|
waitAuthorization?: WaitAuthorization;
|
|
396
628
|
deferAuthorization?: DeferAuthorization;
|
|
397
629
|
persistenceAuthorization?: PersistenceAuthorization;
|
|
630
|
+
/**
|
|
631
|
+
* 0.6.0 C01 provenance: the content digest of the original root message
|
|
632
|
+
* text and the UTF-8 byte spans inside it that this item's clause came
|
|
633
|
+
* from. Absent on legacy items, which keep their historical reading.
|
|
634
|
+
*/
|
|
635
|
+
rawTextSha256?: string;
|
|
636
|
+
spans?: SourceSpan[];
|
|
637
|
+
/**
|
|
638
|
+
* 0.6.0 work-unit assignment (C04), present only for obligations captured
|
|
639
|
+
* after a v5 protocol boundary in a non-delegated session. Legacy items keep
|
|
640
|
+
* the whole-session contract and carry no unit.
|
|
641
|
+
*/
|
|
642
|
+
unitId?: string;
|
|
643
|
+
/**
|
|
644
|
+
* The trusted delivery fact that closed an information-slot item: the host's
|
|
645
|
+
* completed turn and its final assistant message. Derived from durable
|
|
646
|
+
* events, never from assistant prose alone.
|
|
647
|
+
*/
|
|
648
|
+
answeredBy?: {
|
|
649
|
+
turn: number;
|
|
650
|
+
responseSeq: number;
|
|
651
|
+
responseSha256: string;
|
|
652
|
+
};
|
|
653
|
+
/**
|
|
654
|
+
* 0.6.0 C08: the pending obligation this item atomically superseded through
|
|
655
|
+
* a verbatim general clarification. Audit trail only — the superseded item
|
|
656
|
+
* keeps its own history.
|
|
657
|
+
*/
|
|
658
|
+
clarifiesItemId?: string;
|
|
659
|
+
/**
|
|
660
|
+
* 0.6.1 (W060-01 review round 10): set on the sub-items created when an
|
|
661
|
+
* unresolved clause is superseded by its recorded interpretation
|
|
662
|
+
* partition. Names the superseded unresolved obligation; the information
|
|
663
|
+
* sub-items close through the interpreting turn's delivery, while unknown
|
|
664
|
+
* and undeclared sub-spans stay pending.
|
|
665
|
+
*/
|
|
666
|
+
interpretedFromUnresolved?: string;
|
|
667
|
+
/**
|
|
668
|
+
* 0.6.1 (W060-01): present only on an asset-interpretation obligation. The
|
|
669
|
+
* item's information slot closes through the SAME trusted-delivery fact as
|
|
670
|
+
* any inquiry of its turn; the closing answers the request that carried the
|
|
671
|
+
* asset, never the correctness of the interpretation, and visual-comparison
|
|
672
|
+
* proof (strict surface 'visual') stays a separate obligation. Absent on
|
|
673
|
+
* every other item, so legacy and ordinary text items are unchanged.
|
|
674
|
+
*/
|
|
675
|
+
asset?: AssetObligation;
|
|
398
676
|
}
|
|
399
677
|
interface GuardEvidence {
|
|
400
678
|
id: string;
|
|
@@ -432,6 +710,13 @@ interface GuardEvidence {
|
|
|
432
710
|
adapterId?: string;
|
|
433
711
|
adapterVersion?: string;
|
|
434
712
|
externalOperationRef?: ExternalOperation;
|
|
713
|
+
/**
|
|
714
|
+
* 0.6.0 C04: this fact came from a delegated subagent/task round-trip. A
|
|
715
|
+
* delegated result is BOUNDED evidence for the parent unit — it is recorded
|
|
716
|
+
* and visible, and it can never close a parent obligation or a parent unit
|
|
717
|
+
* by itself. Set only by the derivation, never by a caller.
|
|
718
|
+
*/
|
|
719
|
+
delegatedSubtask?: true;
|
|
435
720
|
}
|
|
436
721
|
interface ExpectedTransition {
|
|
437
722
|
predicateId: string;
|
|
@@ -482,6 +767,58 @@ interface GuardCheckpoint {
|
|
|
482
767
|
goalRef?: GoalRef;
|
|
483
768
|
certificationDigest: string;
|
|
484
769
|
result: "certified" | "incomplete" | "unknown";
|
|
770
|
+
/**
|
|
771
|
+
* 0.6.0 v2 certificate (v5 sessions only): the unit whose closure was
|
|
772
|
+
* certified. Version-1 certificates keep the whole-session contract and
|
|
773
|
+
* never carry a unit.
|
|
774
|
+
*/
|
|
775
|
+
unitId?: string;
|
|
776
|
+
/** v2 certificates: the digest of the certified unit's open closure. */
|
|
777
|
+
unitClosureDigest?: string;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* One 0.6.0 work unit (C04): the obligations captured from one root task and
|
|
781
|
+
* their closure state. Units are derived from the durable message stream, so
|
|
782
|
+
* they replay deterministically; no unit state is ever written to the log.
|
|
783
|
+
*/
|
|
784
|
+
interface WorkUnit {
|
|
785
|
+
unitId: string;
|
|
786
|
+
/** Sequence of the root message that opened the unit. */
|
|
787
|
+
openedAtSeq: number;
|
|
788
|
+
/** Root messages folded into this unit, in source order. */
|
|
789
|
+
rootInputRefs: Array<{
|
|
790
|
+
seq: number;
|
|
791
|
+
}>;
|
|
792
|
+
/** The normalized text of the unit's opening instruction (bounded audit). */
|
|
793
|
+
headline: string;
|
|
794
|
+
/** Sequence at which a newer unit became current, when superseded as current. */
|
|
795
|
+
switchedAwayAtSeq?: number;
|
|
796
|
+
/**
|
|
797
|
+
* The unit this one descends from. A delegation-marked root message opens a
|
|
798
|
+
* CHILD unit of the current unit (C04): the child's open obligations are part
|
|
799
|
+
* of the parent's required closure, so the parent can never be certified
|
|
800
|
+
* while a delegated sub-unit still has open work. An ordinary task switch
|
|
801
|
+
* opens a sibling instead, which is why its residual work never blocks the
|
|
802
|
+
* newer unit's certificate.
|
|
803
|
+
*/
|
|
804
|
+
parentUnitId?: string;
|
|
805
|
+
/**
|
|
806
|
+
* Delegated round-trips that entered this unit as bounded evidence (C04).
|
|
807
|
+
* Recorded for audit only: a subagent's completion is never a parent
|
|
808
|
+
* completion.
|
|
809
|
+
*/
|
|
810
|
+
delegationRefs?: DelegationRef[];
|
|
811
|
+
}
|
|
812
|
+
/** One durable delegated round-trip observed inside a session. */
|
|
813
|
+
interface DelegationRef {
|
|
814
|
+
/** The tool call that requested the delegation. */
|
|
815
|
+
callId: string;
|
|
816
|
+
/** Sequence of the paired result event. */
|
|
817
|
+
resultSeq: number;
|
|
818
|
+
/** Audited delegation tool that produced the result. */
|
|
819
|
+
toolName: string;
|
|
820
|
+
/** Whether the delegated round-trip reported success. */
|
|
821
|
+
status: "completed" | "failed" | "unknown";
|
|
485
822
|
}
|
|
486
823
|
type BoundaryDisposition = "user_wait" | "external_wait" | "deferred" | "guard_bounded_stop";
|
|
487
824
|
type BoundaryQualificationKind = "user_decision_item" | "root_explicit_wait" | "external_operation_pending" | "root_explicit_defer" | "guard_no_progress";
|
|
@@ -516,6 +853,67 @@ interface GuardProjection {
|
|
|
516
853
|
checkpoints: GuardCheckpoint[];
|
|
517
854
|
boundaries: GuardBoundary[];
|
|
518
855
|
externalOperations: Map<string, ExternalOperation>;
|
|
856
|
+
/**
|
|
857
|
+
* 0.6.0 work units keyed by unit id, and the id of the unit currently
|
|
858
|
+
* receiving captured work. Derived; present only after a v5 boundary.
|
|
859
|
+
*/
|
|
860
|
+
units: Map<string, WorkUnit>;
|
|
861
|
+
currentUnitId?: string;
|
|
862
|
+
/**
|
|
863
|
+
* The session's rule mode: `5` once a v5 protocol boundary exists in the log,
|
|
864
|
+
* `undefined` (legacy) before it. Determines certificate version, closure
|
|
865
|
+
* scope, and whether delivery/unit semantics are active.
|
|
866
|
+
*/
|
|
867
|
+
boundaryProtocol?: 5;
|
|
868
|
+
/** 0.6.0 responsibility tier (C06), from the effective configuration. */
|
|
869
|
+
policy: "standard" | "strict" | "release";
|
|
870
|
+
/** 0.6.0 C01 coverage summaries, one per captured root message (last 16). */
|
|
871
|
+
coverage: MessageCoverage[];
|
|
872
|
+
/**
|
|
873
|
+
* 0.6.0 C10 explicit release records, derived from the durable plugin-notice
|
|
874
|
+
* channel. A release is never implicit: without an adopted contract the
|
|
875
|
+
* release gate denies every operation. A malformed record is reported through
|
|
876
|
+
* {@link releaseDiagnostics} and never makes the whole projection corrupt, so
|
|
877
|
+
* damaged release state cannot block unrelated ordinary work.
|
|
878
|
+
*/
|
|
879
|
+
releaseContracts: ReleaseContract[];
|
|
880
|
+
releaseReservations: ReleaseReservation[];
|
|
881
|
+
releaseSettlements: ReleaseSettlement[];
|
|
882
|
+
/** Bounded audit of rejected release records (never raw payloads). */
|
|
883
|
+
releaseDiagnostics: Array<{
|
|
884
|
+
seq: number;
|
|
885
|
+
reasonCode: string;
|
|
886
|
+
}>;
|
|
887
|
+
/**
|
|
888
|
+
* True when a release record could not be read back. Damaged release state
|
|
889
|
+
* blocks RELEASE operations with `release_state_damaged` while leaving the
|
|
890
|
+
* projection's own integrity and all ordinary work untouched: the plugin
|
|
891
|
+
* reports what it cannot read instead of quietly forgetting it.
|
|
892
|
+
*/
|
|
893
|
+
releaseStateDamaged: boolean;
|
|
894
|
+
/**
|
|
895
|
+
* 0.6.0 C07 trusted host selections, derived only from paired durable
|
|
896
|
+
* question-tool round-trips (last 16). A directory selection narrows where
|
|
897
|
+
* a bounded file choice may land for obligations of the same unit.
|
|
898
|
+
*/
|
|
899
|
+
trustedSelections: TrustedSelection[];
|
|
900
|
+
/**
|
|
901
|
+
* 0.6.1 (W060-01): the derived per-asset interpretation records (bounded to
|
|
902
|
+
* the last 64), one per confirmed `context_guard_interpret` result. Derived,
|
|
903
|
+
* never written by a caller.
|
|
904
|
+
*/
|
|
905
|
+
interpretationFacts: AssetInterpretationFact[];
|
|
906
|
+
/**
|
|
907
|
+
* 0.6.0 C07 sandbox approvals, derived from the host's own
|
|
908
|
+
* `approval/asked` + `approval/decided` audit pair (last 16). Recorded for
|
|
909
|
+
* provenance only: an approval is never a target authority.
|
|
910
|
+
*/
|
|
911
|
+
approvals: Array<{
|
|
912
|
+
id: string;
|
|
913
|
+
seq: number;
|
|
914
|
+
toolName?: string;
|
|
915
|
+
outcome: "allowed-once" | "rejected" | "cancelled" | "unavailable";
|
|
916
|
+
}>;
|
|
519
917
|
sessionRefDigest: string;
|
|
520
918
|
hostLockDigest: string;
|
|
521
919
|
hostStatus: HostStatus;
|
|
@@ -572,6 +970,16 @@ interface GuardProjection {
|
|
|
572
970
|
* of the same turn re-reads the same number.
|
|
573
971
|
*/
|
|
574
972
|
hostTurn?: number;
|
|
973
|
+
/**
|
|
974
|
+
* Runtime-owned durability watermark (0.6.0 fresh-projection contract): the
|
|
975
|
+
* result of the most recent flush performed by a public read/control entry.
|
|
976
|
+
* `confirmed` means the last entry observed a durable log, `failed` means a
|
|
977
|
+
* flush was refused or threw, and `unknown` means no flush has been observed
|
|
978
|
+
* yet. A `failed` watermark must make read entries report unavailability —
|
|
979
|
+
* never a stale-cache projection and never an empty ledger. Preserved
|
|
980
|
+
* across rebuilds like the other runtime-owned liveness state.
|
|
981
|
+
*/
|
|
982
|
+
durabilityWatermark: "confirmed" | "failed" | "unknown";
|
|
575
983
|
/** Log-derived count of rejected rebind attempts by stable attempt key; survives reload. */
|
|
576
984
|
rebindRejections: Map<string, number>;
|
|
577
985
|
integrity: GuardIntegrity;
|
|
@@ -584,6 +992,8 @@ interface DeriveScope {
|
|
|
584
992
|
}
|
|
585
993
|
interface DeriveConfig {
|
|
586
994
|
activation: "opt-in" | "always";
|
|
995
|
+
/** 0.6.0 responsibility tier (C06); standard by default. */
|
|
996
|
+
policy?: "standard" | "strict" | "release";
|
|
587
997
|
}
|
|
588
998
|
interface DeriveResult {
|
|
589
999
|
projection: GuardProjection;
|
|
@@ -597,6 +1007,8 @@ interface DeriveResult {
|
|
|
597
1007
|
realRootInputSeen: boolean;
|
|
598
1008
|
/** True when the durable log carries the 0.5 first-step protocol boundary. */
|
|
599
1009
|
protocolV4Present: boolean;
|
|
1010
|
+
/** True when the durable log carries the 0.6 first-step protocol boundary. */
|
|
1011
|
+
boundaryV5: boolean;
|
|
600
1012
|
}
|
|
601
1013
|
interface DerivedEnvelope {
|
|
602
1014
|
seq: number;
|
|
@@ -1088,6 +1500,15 @@ declare function bindExecutableIdentity(resolution: ExecutableIdentity | undefin
|
|
|
1088
1500
|
declare const DEFAULT_HOST_LOCK: HostLockEvaluation;
|
|
1089
1501
|
//#endregion
|
|
1090
1502
|
//#region src/domain/derive.d.ts
|
|
1503
|
+
/**
|
|
1504
|
+
* Audited delegation tool names (C04/DS06-B). A tool result from one of these
|
|
1505
|
+
* is a subagent's answer: bounded evidence for the unit that asked for it, and
|
|
1506
|
+
* never a parent completion. The real names are a host tool-bundle surface —
|
|
1507
|
+
* native acceptance pins the audited cohort, exactly like the question-tool
|
|
1508
|
+
* allowlist — so this list is the production default and can be overridden by
|
|
1509
|
+
* an audited cohort.
|
|
1510
|
+
*/
|
|
1511
|
+
declare const DEFAULT_DELEGATION_TOOL_NAMES: readonly string[];
|
|
1091
1512
|
declare const CAPTURE_V042_NOTICE = "Context Guard capture boundary: v0.4.2";
|
|
1092
1513
|
declare const PROTOCOL_V3_NOTICE = "Context Guard protocol boundary: v3.0.0";
|
|
1093
1514
|
/**
|
|
@@ -1099,6 +1520,15 @@ declare const PROTOCOL_V3_NOTICE = "Context Guard protocol boundary: v3.0.0";
|
|
|
1099
1520
|
*/
|
|
1100
1521
|
declare const PROTOCOL_V4_NOTICE = "Context Guard protocol boundary: v4.0.0";
|
|
1101
1522
|
/**
|
|
1523
|
+
* 0.6.0 first-step boundary: same placement discipline as v4. It cuts the
|
|
1524
|
+
* work-unit, delivery, and certificate-v2 semantics (P0 §1): messages before
|
|
1525
|
+
* it keep their historical rules, messages after it are captured into work
|
|
1526
|
+
* units and close through unit-closure certificates and trusted deliveries.
|
|
1527
|
+
* An old binary ignores this notice (plugin source, unmatched pattern), so the
|
|
1528
|
+
* fail direction on rollback is closed, never a misread.
|
|
1529
|
+
*/
|
|
1530
|
+
declare const PROTOCOL_V5_NOTICE = "Context Guard protocol boundary: v5.0.0";
|
|
1531
|
+
/**
|
|
1102
1532
|
* Pure, deterministic re-derivation of the guard projection from the DSH
|
|
1103
1533
|
* native event log. Context Guard never writes custom session events, so every
|
|
1104
1534
|
* piece of state is derived from `command/run`, `user/message`, `tool/call`,
|
|
@@ -1107,6 +1537,18 @@ declare const PROTOCOL_V4_NOTICE = "Context Guard protocol boundary: v4.0.0";
|
|
|
1107
1537
|
*/
|
|
1108
1538
|
declare function deriveProjection(sourceEvents: readonly DerivedEnvelope[], config: DeriveConfig, scope: DeriveScope, durableConfirmed: boolean, hostLock?: HostLockEvaluation): DeriveResult;
|
|
1109
1539
|
//#endregion
|
|
1540
|
+
//#region src/domain/reason-class.d.ts
|
|
1541
|
+
/**
|
|
1542
|
+
* The seven unified reason-class labels (0.6.0 C12).
|
|
1543
|
+
*
|
|
1544
|
+
* Every fine-grained `reason_code` maps onto exactly one class, so a caller can
|
|
1545
|
+
* branch on the class while the existing codes keep their exact meaning and
|
|
1546
|
+
* their existing tests. The mapping table below is the frozen table; the
|
|
1547
|
+
* fallback for an unmapped code is `source_insufficient`, never a new class —
|
|
1548
|
+
* an unknown code must not silently become a different kind of failure.
|
|
1549
|
+
*/
|
|
1550
|
+
type ReasonClass = "parameter_missing" | "source_insufficient" | "condition_unmet" | "producer_capability_unavailable" | "historical_gap" | "integrity_failure" | "policy_boundary";
|
|
1551
|
+
//#endregion
|
|
1110
1552
|
//#region src/domain/diagnostics.d.ts
|
|
1111
1553
|
type TaskKind = "inquiry" | "action" | "deliverable" | "constraint" | "unresolved";
|
|
1112
1554
|
type CertificationSupport = "supported" | "unsupported" | "needs_target" | "needs_evidence" | "unavailable";
|
|
@@ -1127,6 +1569,8 @@ interface UnifiedItemDiagnosis {
|
|
|
1127
1569
|
task_kind: TaskKind;
|
|
1128
1570
|
certification: CertificationSupport;
|
|
1129
1571
|
reason_code: string;
|
|
1572
|
+
/** The seven-class label this fine-grained reason code belongs to (C12). */
|
|
1573
|
+
reason_class: ReasonClass;
|
|
1130
1574
|
repairability: Repairability;
|
|
1131
1575
|
missing_fields: string[];
|
|
1132
1576
|
missing_facets: Array<"resolution" | "effect" | "state">;
|
|
@@ -1140,6 +1584,12 @@ interface UnifiedItemDiagnosis {
|
|
|
1140
1584
|
* adapter, an executed-without-evidence historical gap, or nothing to do —
|
|
1141
1585
|
* and it NEVER recommends a rebind that cannot change certification.
|
|
1142
1586
|
*/
|
|
1587
|
+
/**
|
|
1588
|
+
* The unified diagnosis, with the frozen seven-class label attached (C12).
|
|
1589
|
+
*
|
|
1590
|
+
* The class is derived from whatever `reason_code` the judge decides, so a new
|
|
1591
|
+
* branch cannot drift from the classification table.
|
|
1592
|
+
*/
|
|
1143
1593
|
declare function deriveItemDiagnosis(p: GuardProjection, item: GuardItem): UnifiedItemDiagnosis;
|
|
1144
1594
|
/** Legacy compact view, now derived from the single unified diagnosis. */
|
|
1145
1595
|
declare function itemDiagnosis(p: GuardProjection, item: GuardItem): {
|
|
@@ -1332,7 +1782,7 @@ interface GitEffectRunner {
|
|
|
1332
1782
|
}
|
|
1333
1783
|
interface GitEffectExecution {
|
|
1334
1784
|
status: "executed" | "rejected";
|
|
1335
|
-
reasonCode?: GitPrestateCheck["reasonCode"] | "repository_missing";
|
|
1785
|
+
reasonCode?: GitPrestateCheck["reasonCode"] | "repository_missing" | "effect_already_applied";
|
|
1336
1786
|
}
|
|
1337
1787
|
interface LinearCommitReadback {
|
|
1338
1788
|
/** Commit reached after the guarded effect. */
|
|
@@ -1488,10 +1938,14 @@ interface FirstStepPreviewInput {
|
|
|
1488
1938
|
activation: "opt-in" | "always";
|
|
1489
1939
|
/** Log-derived enablement: an explicit `off` suppresses `always` until `on`. */
|
|
1490
1940
|
enabled: boolean;
|
|
1941
|
+
/** The durable log already contains a v5 (0.6) Guard boundary. */
|
|
1942
|
+
boundaryV5Present?: boolean;
|
|
1491
1943
|
/** The durable log already contains a v4 (or newer) Guard boundary. */
|
|
1492
1944
|
boundaryPresent: boolean;
|
|
1493
1945
|
/** The session is a delegated/subagent session, never a root conversation. */
|
|
1494
1946
|
delegated: boolean;
|
|
1947
|
+
/** 0.6.1 (W060-05): the effective responsibility tier shapes the guidance. */
|
|
1948
|
+
policy?: "standard" | "strict" | "release";
|
|
1495
1949
|
}
|
|
1496
1950
|
/**
|
|
1497
1951
|
* Pure decision for the first-step activation injection when protection is enabled. The
|
|
@@ -1499,14 +1953,24 @@ interface FirstStepPreviewInput {
|
|
|
1499
1953
|
* persisted step batch; guidance is compact and never claims a recovery that
|
|
1500
1954
|
* did not happen. `opt-in` reaches this path only after its explicit `on` command. Delegated sessions receive neither: their
|
|
1501
1955
|
* scope arrives through the parent's delegation prompt (A04).
|
|
1956
|
+
*
|
|
1957
|
+
* A session without a v5 boundary receives the 0.6 boundary: it cuts the
|
|
1958
|
+
* work-unit/delivery/certificate-v2 semantics at exactly this message. A
|
|
1959
|
+
* session that already has v5 injects nothing.
|
|
1502
1960
|
*/
|
|
1503
1961
|
declare function previewFirstStepInjection(input: FirstStepPreviewInput, claimedRealInput: boolean): FirstStepInjection | undefined;
|
|
1504
1962
|
/**
|
|
1505
1963
|
* Compact first-step guidance: protection has started, what it protects, and
|
|
1506
|
-
* the
|
|
1507
|
-
*
|
|
1964
|
+
* when the guarded producer path is needed. 0.6.1 (W060-05): the stateful
|
|
1965
|
+
* workflow is stated CONDITIONALLY — only an obligation whose own clause
|
|
1966
|
+
* demands a certified stateful action runs through prepare/producer/checkpoint.
|
|
1967
|
+
* The 0.6.0 text demanded that order for every stateful action unconditionally,
|
|
1968
|
+
* which ordinary business work correctly read as a Guard approval gate.
|
|
1969
|
+
* Ordinary answers, investigations, and ordinary tool work are never gated, and
|
|
1970
|
+
* missing Guard evidence is never a reason to repeat a completed action.
|
|
1508
1971
|
*/
|
|
1509
|
-
declare
|
|
1972
|
+
declare function firstStepGuidance(policy?: "standard" | "strict" | "release"): string;
|
|
1973
|
+
declare const FIRST_STEP_GUIDANCE: string;
|
|
1510
1974
|
/**
|
|
1511
1975
|
* Lifecycle phase derived from durable facts. `enabled` is the log-derived
|
|
1512
1976
|
* enablement (`always`, or the explicit `on`/`off` command sequence), and
|
|
@@ -1648,6 +2112,105 @@ declare function bindProofToProjection(projection: GuardProjection, proof: Proof
|
|
|
1648
2112
|
declare function canonicalProjection(projection: GuardProjection): Record<string, unknown>;
|
|
1649
2113
|
declare function sessionQuery(projection: GuardProjection, proof?: ProofManifest): SessionQuery;
|
|
1650
2114
|
declare function proofEvidenceConstraints(evidence: GuardEvidence, obligation: ProofObligation): boolean;
|
|
2115
|
+
declare const PROOF_PROTOCOL_VERSION_V2 = "0.6.0";
|
|
2116
|
+
/** The v2 digest domain; the v1 domain string is untouched. */
|
|
2117
|
+
declare const PROOF_MANIFEST_DOMAIN_V2 = "ccg.proofManifest.v2";
|
|
2118
|
+
declare const PROOF_KINDS_V2: readonly ["subject_readback", "scope_coverage", "state_verification", "input_asset_check", "output_visual_readback", "object_url_readback", "execution_fact", "external_fact"];
|
|
2119
|
+
type ProofKindV2 = (typeof PROOF_KINDS_V2)[number];
|
|
2120
|
+
/** Host surfaces that can carry a proof producer in the audited cohort. */
|
|
2121
|
+
type ProofHostSurface = "native_read" | "native_write_edit" | "shell" | "web" | "jobs" | "subagent" | "visual_capture";
|
|
2122
|
+
interface ProofObligationV2 {
|
|
2123
|
+
obligationId: string;
|
|
2124
|
+
kind: ProofKindV2;
|
|
2125
|
+
surface: ProofSurface;
|
|
2126
|
+
/** The current subject identities this obligation binds. */
|
|
2127
|
+
subjectIds: string[];
|
|
2128
|
+
/** Producer/source identities a satisfying fact must originate from. */
|
|
2129
|
+
sourceIds: string[];
|
|
2130
|
+
/** The operation the fact must have actually performed. */
|
|
2131
|
+
operation: GuardOperation;
|
|
2132
|
+
evidenceIds: string[];
|
|
2133
|
+
expectedScopeDigest?: string;
|
|
2134
|
+
observedScopeDigest?: string;
|
|
2135
|
+
}
|
|
2136
|
+
interface ProofManifestV2 {
|
|
2137
|
+
proofProtocolVersion: typeof PROOF_PROTOCOL_VERSION_V2;
|
|
2138
|
+
obligations: ProofObligationV2[];
|
|
2139
|
+
proofSha256: string;
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* The frozen capability requirement per proof kind. `capabilities` is the set
|
|
2143
|
+
* a satisfying fact must intersect; `readbackRequired` demands an actual read
|
|
2144
|
+
* or verify operation (never a bare successful call); `requiredRole` pins the
|
|
2145
|
+
* fact to the resolution/effect/state role the semantics need; and
|
|
2146
|
+
* `supportedSurfaces` lists the audited host surfaces that can produce it.
|
|
2147
|
+
*/
|
|
2148
|
+
interface ProofKindCapability {
|
|
2149
|
+
kind: ProofKindV2;
|
|
2150
|
+
capabilities: string[];
|
|
2151
|
+
readbackRequired: boolean;
|
|
2152
|
+
requiredRole?: EvidenceRole;
|
|
2153
|
+
operationOnSubject: boolean;
|
|
2154
|
+
supportedSurfaces: ProofHostSurface[];
|
|
2155
|
+
/** Host surfaces in the audited cohort that CANNOT produce this fact. */
|
|
2156
|
+
unavailableSurfaces: ProofHostSurface[];
|
|
2157
|
+
}
|
|
2158
|
+
declare const PROOF_CAPABILITY_MATRIX: Readonly<Record<ProofKindV2, ProofKindCapability>>;
|
|
2159
|
+
/** The host surface names a fact's tool/adapter identity maps to. */
|
|
2160
|
+
declare function proofHostSurfacesOf(evidence: GuardEvidence): ProofHostSurface[];
|
|
2161
|
+
declare function proofDigestV2(obligations: readonly ProofObligationV2[]): string;
|
|
2162
|
+
declare function createProofManifestV2(obligations: readonly ProofObligationV2[]): ProofManifestV2;
|
|
2163
|
+
declare function validateProofManifestV2(manifest: unknown): string[];
|
|
2164
|
+
/**
|
|
2165
|
+
* Why one fact cannot discharge one v2 obligation, or `undefined` when it can.
|
|
2166
|
+
* The checks are ordered so the reported reason names the first unmet
|
|
2167
|
+
* requirement: missing producer capability, wrong role, absent readback, wrong
|
|
2168
|
+
* source, wrong subject, wrong operation.
|
|
2169
|
+
*/
|
|
2170
|
+
declare function proofV2Rejection(evidence: GuardEvidence, obligation: ProofObligationV2): string | undefined;
|
|
2171
|
+
/**
|
|
2172
|
+
* The subjects an item's own obligation requires. They come from the item's
|
|
2173
|
+
* frozen verification contract and captured target — never from the proof
|
|
2174
|
+
* manifest, which is exactly what a proof must be checked against.
|
|
2175
|
+
*/
|
|
2176
|
+
declare function requiredSubjectsOf(item: GuardItem): string[];
|
|
2177
|
+
/** The frozen coverage digest of a subject set: sorted, then hashed. */
|
|
2178
|
+
declare function scopeCoverageDigest(subjects: readonly string[]): string;
|
|
2179
|
+
/** Whether the fact performed an operation the kind accepts. */
|
|
2180
|
+
declare function proofOperationMatches(evidence: GuardEvidence, obligation: ProofObligationV2): boolean;
|
|
2181
|
+
/**
|
|
2182
|
+
* Bind a v2 manifest to the live projection; [] means every obligation binds.
|
|
2183
|
+
*
|
|
2184
|
+
* The binding is the whole chain the review demanded, in one place:
|
|
2185
|
+
* the user's obligation (frozen subject and scope on the ITEM) → the trusted
|
|
2186
|
+
* producer fact (qualified by the same availability rules ordinary evidence
|
|
2187
|
+
* uses) → the declared source → the declared operation and its order relative
|
|
2188
|
+
* to the effect → the real coverage set. Only then is the obligation
|
|
2189
|
+
* discharged. A manifest that describes a different subject than the item
|
|
2190
|
+
* asked about fails even when the manifest and the facts agree with each
|
|
2191
|
+
* other.
|
|
2192
|
+
*/
|
|
2193
|
+
declare function bindProofV2ToProjection(projection: GuardProjection, manifest: ProofManifestV2): string[];
|
|
2194
|
+
/** The v2 session query; the v1 `sessionQuery` keeps its own frozen behaviour. */
|
|
2195
|
+
interface SessionQueryV2 {
|
|
2196
|
+
sessionRefDigest: string;
|
|
2197
|
+
epoch: number;
|
|
2198
|
+
contractRevision: number;
|
|
2199
|
+
state: "valid" | "unknown" | "corrupt";
|
|
2200
|
+
proof?: ProofManifestV2;
|
|
2201
|
+
cohortId?: string;
|
|
2202
|
+
reasonCode?: "proof_invalid" | "proof_unbound";
|
|
2203
|
+
}
|
|
2204
|
+
declare function sessionQueryV2(projection: GuardProjection, proof?: ProofManifestV2): SessionQueryV2;
|
|
2205
|
+
/**
|
|
2206
|
+
* The capability report for one proof kind against the facts a cohort actually
|
|
2207
|
+
* produced: `unavailable` with a stable reason when no producer is observable,
|
|
2208
|
+
* never a silent pass.
|
|
2209
|
+
*/
|
|
2210
|
+
declare function proofCapabilityReport(kind: ProofKindV2, facts: Iterable<GuardEvidence>): {
|
|
2211
|
+
status: "supported" | "unavailable";
|
|
2212
|
+
reasonCode?: string;
|
|
2213
|
+
};
|
|
1651
2214
|
//#endregion
|
|
1652
2215
|
//#region src/domain/alpha3-host.d.ts
|
|
1653
2216
|
/** Exact 34-row alpha.3 runtime/web graph from the 2026-09-01 annex audit. */
|
|
@@ -1856,4 +2419,4 @@ declare function latestAssistantText(events: readonly {
|
|
|
1856
2419
|
//#region src/domain/supersession.d.ts
|
|
1857
2420
|
declare function supersedeItem(items: Map<string, GuardItem>, oldId: string, replacement: GuardItem): boolean;
|
|
1858
2421
|
//#endregion
|
|
1859
|
-
export {
|
|
2422
|
+
export { canonicalProjection as $, boundedArtifactChoiceMatches as $a, SourceSpan as $i, AuditedExecutable as $n, isFrozenV042RebindResponse as $r, GitCommandParseResult as $t, openItems as A, interpretMessage as Aa, DeriveConfig as Ai, extractToolSubject as An, HostVersionDecision as Ar, claimedBatchHasRealRootInput as At, ProofHostSurface as B, ActionManifest as Ba, GoalRef as Bi, itemDiagnosis as Bn, satisfiesSupportedHostRange as Br, injectActiveProfileHostLock as Bt, RC015_RC2_HOST_PACKAGES as C, replayRebindResult as Ca, AssetInterpretationFact as Ci, goalCompletionDenial as Cn, bindLiveGoalCapability as Cr, OperationVerbEntry as Ct, MIN_RECOVERY_CHAR_BUDGET as D, InterpretOptions as Da, BoundaryQualificationKind as Di, ToolSubject as Dn, evaluateToolSurfaceCapability as Dr, FirstStepInjection as Dt, DEFAULT_RECOVERY_CHAR_BUDGET as E, Executee as Ea, BoundaryDisposition as Ei, ToolResultInput as En, evaluateHostLock as Er, FIRST_STEP_GUIDANCE as Et, PROOF_KINDS as F, namedActions as Fa, EvidenceOutcome as Fi, Repairability as Fn, SUPPORTED_HOST_RANGE as Fr, HostProfileError as Ft, ProofManifestV2 as G, SEMANTIC_ACTIONS as Ga, GuardItem as Gi, PROTOCOL_V4_NOTICE as Gn, authorityCaptureCounts as Gr, resolveActiveProfileHostLock as Gt, ProofKindCapability as H, BOUNDED_ARTIFACT_TYPES as Ha, GuardCheckpoint as Hi, CAPTURE_V042_NOTICE as Hn, AuthorityBlock as Hr, packageRowsFromActiveGraph as Ht, PROOF_KINDS_V2 as I, semanticActionOfScope as Ia, EvidenceParseStatus as Ii, TaskKind as In, SUPPORTED_HOST_VERSIONS as Ir, TargetHostGraph as It, ProofSurface as J, STOP_PROTOCOL_VERSION_V2 as Ja, GuardOperation as Ji, ACTIVE_HOST_COHORT_ID as Jn, UserInteractionKind as Jr, GIT_COMMAND_MANIFEST_IDS as Jt, ProofObligation as K, STATEFUL_ACTIONS as Ka, GuardItemKind as Ki, PROTOCOL_V5_NOTICE as Kn, segmentAuthorityBlocks as Kr, resolveInstalledHostLock as Kt, PROOF_MANIFEST_DOMAIN_V2 as L, statefulActionsOfScope as La, EvidenceRole as Li, UnifiedItemDiagnosis as Ln, compareHostVersions as Lr, combineHostPolicy as Lt, renderRecoveryPacket as M, isOpenObligation as Ma, DeriveScope as Mi, withDurability as Mn, LATEST_SUPPORTED_HOST_VERSION as Mr, lifecyclePhase as Mt, ALPHA3_HOST_PACKAGES as N, kindOfScope as Na, DerivedEnvelope as Ni, CertificationSupport as Nn, MIN_SUPPORTED_HOST_VERSION as Nr, previewFirstStepInjection as Nt, RecoveryOptions as O, ScopeInterpretation as Oa, DeferAuthorization as Oi, evidenceFromPersistedToolResult as On, hostVersionFromPackages as Or, FirstStepPreviewInput as Ot, PROOF_CAPABILITY_MATRIX as P, maskCodeSpans as Pa, EvidenceBinding as Pi, DiagnosisNextAction as Pn, ParsedHostVersion as Pr, ActiveProfileHostLock as Pt, bindProofV2ToProjection as Q, actionCompatible as Qa, PersistenceAuthorization as Qi, ALPHA2_HOST_PACKAGES as Qn, ParsedConfirmation as Qr, GitCommandManifest as Qt, PROOF_PROTOCOL_VERSION as R, ACTION_MANIFEST as Ra, ExpectedTransition as Ri, deriveItemDiagnosis as Rn, evaluateMinimumHostVersion as Rr, hostLockContextFromComposedDump as Rt, snapshotSessionEvents as S, rebindResponse as Sa, qualifyBoundary as Si, parseShellCommand as Sn, bindExecutableIdentity as Sr, ManifestIssue as St, RC1_HOST_PACKAGES as T, DirectiveClass as Ta, BindingActionClosure as Ti, ToolCallInput as Tn, evaluateHostCapability as Tr, ClaimedMessage as Tt, ProofKindV2 as U, CERTIFICATE_VERSION as Ua, GuardEvidence as Ui, DEFAULT_DELEGATION_TOOL_NAMES as Un, AuthorityBlockKind as Ur, packageRowsFromPnpmLock as Ut, ProofKind as V, ActionSpec as Va, GuardBoundary as Vi, relevantEvidence as Vn, currentContractDigest as Vr, inspectTargetHostGraph as Vt, ProofManifest as W, CERTIFICATE_VERSION_V2 as Wa, GuardIntegrity as Wi, PROTOCOL_V3_NOTICE as Wn, AuthorityKind as Wr, readActiveHostGraph as Wt, SessionQueryV2 as X, SemanticAction as Xa, HostStatus as Xi, ACTIVE_HOST_LAUNCHER_VERSION as Xn, classifyUserInteraction as Xr, GitAdapterAction as Xt, SessionQuery as Y, SUPPORTED_EVIDENCE_ADAPTERS as Ya, GuardProjection as Yi, ACTIVE_HOST_COHORT_IDS as Yn, classifyTaskIntent as Yr, GIT_COMMAND_TEMPLATES as Yt, bindProofToProjection as Z, StatefulAction as Za, MessageCoverage as Zi, ALPHA2_DSHMARKET_139_HOST_PACKAGES as Zn, CONFIRM_LINE_PATTERN as Zr, GitCommandAccepted as Zt, progressFingerprint as _, confirmRebind as _a, GoalActivationState as _i, ParsedShell as _n, HostLockStatus as _r, evidenceCoverage as _t, NO_PROGRESS_RECORD_PREFIX as a, WaitAuthorization as aa, ClauseSegment as ai, GitTargetIdentity as an, semanticActionFromText as ao, GOAL_HOST_PACKAGES as ar, proofEvidenceConstraints as at, SessionApiError as b, proposeRebindV042 as ba, effectuateBoundary as bi, isRunExecutable as bn, HostToolSurface as br, COMMAND_SURFACE_MANIFEST as bt, classifyCompletionClaim as c, PackageRow as ca, classifyClause as ci, commitTreeSnapshotDigest as cn, canonicalizePath as co, HostAuditProvenance as cr, proofV2Rejection as ct, decisionBoundaryKey as d, ReleaseOperation as da, extractOperation as di, gitCommandMatchesTarget as dn, sanitizeClauseText as do, HostCapabilityRequest as dr, sessionQuery as dt, TargetCaptureReasonCode as ea, parseConfirmationMessage as ei, GitCommandRejected as en, isStatefulAction as eo, BASE_HOST_PACKAGES as er, createProofManifest as et, isRootPauseRequest as f, ReleaseSettlement as fa, isInformationalMessage as fi, parseGitCommandManifest as fn, sanitizeUrl as fo, HostCohort as fr, sessionQueryV2 as ft, observeAssistantOutcome as g, RebindProposal as ga, BoundaryRequest as gi, CanonicalCommandSurface as gn, HostLockEvaluation as gr, bindingSatisfies as gt, latestRootInstruction as h, RebindArgs as ha, BoundaryQualification as hi, CanonicalArgv as hn, HostLockContext as hr, EvidenceFacetCoverage as ht, CompletionDisposition as i, VerificationContract as ia, CaptureScope as ii, GitPrestateEnvelope as in, semanticActionFromCommand as io, ExecutableIdentityBinding as ir, proofDigestV2 as it, recoveryDigest as j, isExecutableItem as ja, DeriveResult as ji, isDeterministicCheck as jn, HostVersionStatus as jr, firstStepGuidance as jt, closingHint as k, interpretClause as ka, DelegationRef as ki, extractTextContent as kn, selectHostCohort as kr, LifecyclePhase as kt, decideTurnBoundary as l, ReleaseGateDecision as la, extractArtifactPaths as li, createGitPrestateEnvelope as ln, digestStrings as lo, HostCapabilityEvaluation as lr, requiredSubjectsOf as lt, latestAssistantText as m, ProposeOutcome as ma, BoundaryEffectuation as mi, verifiedLinearCommitReadback as mn, HostCohortSelectionReason as mr, validateProofManifestV2 as mt, AssistantOutcomeObservation as n, TargetTuple as na, RejectedBinding as ni, GitEffectRunner as nn, requestedTargetAuthorizesMutation as no, EXPECTED_HOST_PACKAGES as nr, proofCapabilityReport as nt, NO_PROGRESS_TURNS_BEFORE_STOP as o, WorkUnit as oa, captureClause as oi, LinearCommitReadback as on, validateActionManifest as oo, HOST_CAPABILITY_PACKAGE_GROUPS as or, proofHostSurfacesOf as ot, isWholeTaskCompletionClaim as p, BoundedSource as pa, segmentClauses as pi, revalidateGitPrestate as pn, sha256 as po, HostCohortSelection as pr, validateProofManifest as pt, ProofObligationV2 as q, STOP_PROTOCOL_VERSION as qa, GuardItemStatus as qi, deriveProjection as qn, TaskIntent as qr, verifyComposedHostLockDump as qt, CONTROL_RECORD_PREFIX as r, TargetValue as ra, certifyCheckpoint as ri, GitPrestateCheck as rn, requestedTargetMatchesResolved as ro, ExecutableIdentity as rr, proofDigest as rt, TurnStoppingDecision as s, createProjection as sa, captureItem as si, commitIndexSnapshotDigest as sn, validateActionTarget as so, HOST_COHORTS as sr, proofOperationMatches as st, supersedeItem as t, TargetCaptureStatus as ta, CheckpointResult as ti, GitEffectExecution as tn, requestedIdentityKey as to, DEFAULT_HOST_LOCK as tr, createProofManifestV2 as tt, decideTurnStopping as u, ReleaseObservedIdentity as ua, extractMethod as ui, executeRevalidatedGitEffect as un, normalizeClause as uo, HostCapabilityId as ur, scopeCoverageDigest as ut, SESSION_API_UNSUPPORTED as v, proposeRebind as va, GoalBoundaryAccess as vi, ShellParseStatus as vn, HostPlatform as vr, evidenceMatchesItem as vt, RC015_HOST_PACKAGES as w, AuthorityDisposition as wa, AssetObligation as wi, hasCurrentCertificate as wn, evaluateExternalWaitCapability as wr, validateManifest as wt, V3SessionLike as x, rebindAttemptKey as xa, isCurrentAcceptedBoundary as xi, parsePwshCommand as xn, LEGACY_HOST_COHORTS as xr, CommandSurfaceManifest as xt, SESSION_EVENT_ENVELOPE_INVALID as y, proposeRebindOutcome as ya, availableBoundaryQualifications as yi, canonicalArgvFromCommand as yn, HostProfileKind as yr, isVerifyingCapability as yt, PROOF_PROTOCOL_VERSION_V2 as z, ACTION_MANIFEST_VERSION as za, ExternalOperation as zi, evidenceAvailabilityReason as zn, parseHostVersion as zr, hostLockRowsFromComposedDump as zt };
|