@fro.bot/systematic 3.23.0 → 3.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATTRIBUTIONS.md +2 -2
- package/dist/cli.js +2 -4
- package/dist/{index-pdbqekxp.js → index-vkmdceqk.js} +30 -54
- package/dist/index.js +252 -14503
- package/dist/lib/capability-snapshot.d.ts +1 -1
- package/dist/lib/config-protected-fields.d.ts +1 -1
- package/dist/lib/config-schema.d.ts +2 -24
- package/dist/lib/config.d.ts +1 -7
- package/dist/lib/removed-names.d.ts +10 -0
- package/dist/pi.js +29 -52
- package/package.json +5 -7
- package/skills/agent-browser/SKILL.md +1 -0
- package/dist/lib/opencode-operation-observer.d.ts +0 -170
- package/dist/lib/opencode-workflow-guard.d.ts +0 -126
- package/dist/lib/question-attestation.d.ts +0 -94
- package/dist/lib/receipt-classifier.d.ts +0 -44
- package/dist/lib/receipt-ledger.d.ts +0 -146
- package/dist/lib/receipt-readback.d.ts +0 -186
- package/dist/lib/workflow-guard.d.ts +0 -157
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
export declare const CANONICAL_QUESTION_WORDING: 'Confirm the requested guarded transition.';
|
|
2
|
-
export type QuestionPurpose = 'transition' | 'session-disablement';
|
|
3
|
-
export type QuestionAnswerClassification = 'affirmative' | 'non-affirmative';
|
|
4
|
-
export type QuestionAttestationReasonCode = 'already-bound' | 'already-consumed' | 'already-disabled' | 'call-session-mismatch' | 'challenge-expired' | 'challenge-consumed' | 'invalid-input' | 'no-attestation' | 'non-affirmative' | 'rejected' | 'replay' | 'scope-mismatch' | 'substitution' | 'unknown-challenge' | 'unknown-request';
|
|
5
|
-
export interface QuestionAttestationOptions {
|
|
6
|
-
clock?: () => number;
|
|
7
|
-
maxChallengeAgeMs?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface QuestionChallengeRecord {
|
|
10
|
-
readonly challengeId: string;
|
|
11
|
-
readonly sessionId: string;
|
|
12
|
-
readonly resourceDigest: string;
|
|
13
|
-
readonly transitionKey: string;
|
|
14
|
-
readonly purpose: QuestionPurpose;
|
|
15
|
-
readonly createdAt: number;
|
|
16
|
-
readonly question: {
|
|
17
|
-
readonly wording: typeof CANONICAL_QUESTION_WORDING;
|
|
18
|
-
readonly args: {
|
|
19
|
-
readonly challengeId: string;
|
|
20
|
-
readonly purpose: QuestionPurpose;
|
|
21
|
-
readonly resourceDigest: string;
|
|
22
|
-
readonly transitionKey: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export interface QuestionAttestation {
|
|
27
|
-
readonly purpose: QuestionPurpose;
|
|
28
|
-
readonly sessionId: string;
|
|
29
|
-
readonly resourceDigest: string;
|
|
30
|
-
readonly transitionKey: string;
|
|
31
|
-
readonly requestId: string;
|
|
32
|
-
readonly answer: 'affirmed';
|
|
33
|
-
readonly timestamp: number;
|
|
34
|
-
readonly consumption: 'available' | 'consumed';
|
|
35
|
-
}
|
|
36
|
-
export type ChallengeResult = {
|
|
37
|
-
readonly status: 'pending';
|
|
38
|
-
readonly challenge: QuestionChallengeRecord;
|
|
39
|
-
} | RejectedResult;
|
|
40
|
-
export type BindAskedResult = {
|
|
41
|
-
readonly status: 'bound';
|
|
42
|
-
readonly challengeId: string;
|
|
43
|
-
readonly requestId: string;
|
|
44
|
-
} | RejectedResult;
|
|
45
|
-
export type ObserveReplyResult = {
|
|
46
|
-
readonly status: 'accepted';
|
|
47
|
-
readonly attestation: QuestionAttestation;
|
|
48
|
-
} | RejectedResult;
|
|
49
|
-
export type ObserveRejectResult = {
|
|
50
|
-
readonly status: 'rejected';
|
|
51
|
-
readonly reasonCode: 'rejected';
|
|
52
|
-
} | RejectedResult;
|
|
53
|
-
export type ConsumeAttestationResult = {
|
|
54
|
-
readonly status: 'consumed';
|
|
55
|
-
readonly projection: 'attested' | 'disabled';
|
|
56
|
-
readonly attestation: QuestionAttestation;
|
|
57
|
-
} | RejectedResult;
|
|
58
|
-
export type QuestionAttestationProjection = KnownQuestionAttestationProjection | {
|
|
59
|
-
readonly status: 'unknown';
|
|
60
|
-
readonly reasonCode: QuestionAttestationReasonCode;
|
|
61
|
-
};
|
|
62
|
-
interface KnownQuestionAttestationProjection {
|
|
63
|
-
readonly status: 'pending' | 'bound' | 'attested' | 'denied' | 'disabled';
|
|
64
|
-
readonly challengeId: string;
|
|
65
|
-
readonly purpose: QuestionPurpose;
|
|
66
|
-
readonly sessionId: string;
|
|
67
|
-
readonly resourceDigest: string;
|
|
68
|
-
readonly transitionKey: string;
|
|
69
|
-
readonly requestId?: string;
|
|
70
|
-
readonly consumption?: 'available' | 'consumed';
|
|
71
|
-
}
|
|
72
|
-
export type SessionDisablementProjection = {
|
|
73
|
-
readonly status: 'enabled' | 'pending' | 'bound' | 'disabled';
|
|
74
|
-
readonly sessionId: string;
|
|
75
|
-
} | {
|
|
76
|
-
readonly status: 'unknown';
|
|
77
|
-
readonly reasonCode: QuestionAttestationReasonCode;
|
|
78
|
-
};
|
|
79
|
-
export interface QuestionAttestationMachine {
|
|
80
|
-
challenge(input: unknown): ChallengeResult;
|
|
81
|
-
bindAsked(input: unknown): BindAskedResult;
|
|
82
|
-
observeReply(input: unknown): ObserveReplyResult;
|
|
83
|
-
observeReject(input: unknown): ObserveRejectResult;
|
|
84
|
-
consumeAttestation(input: unknown): ConsumeAttestationResult;
|
|
85
|
-
status(input: unknown): QuestionAttestationProjection;
|
|
86
|
-
sessionStatus(input: unknown): SessionDisablementProjection;
|
|
87
|
-
}
|
|
88
|
-
interface RejectedResult {
|
|
89
|
-
readonly status: 'rejected';
|
|
90
|
-
readonly reasonCode: QuestionAttestationReasonCode;
|
|
91
|
-
}
|
|
92
|
-
export declare function classifyQuestionAnswer(answer: unknown): QuestionAnswerClassification;
|
|
93
|
-
export declare function createQuestionAttestation(options?: QuestionAttestationOptions): QuestionAttestationMachine;
|
|
94
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ReceiptClassification, ReceiptContext, ReceiptObservationAfter, ReceiptOperation, TerminalObservation } from './receipt-ledger.js';
|
|
2
|
-
export interface ReceiptClassificationInput {
|
|
3
|
-
command: string;
|
|
4
|
-
terminal: TerminalObservation;
|
|
5
|
-
}
|
|
6
|
-
export interface ReceiptClassifierOptions {
|
|
7
|
-
treeSitterWasmPath?: string;
|
|
8
|
-
bashWasmPath?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ReceiptClassifier {
|
|
11
|
-
classify(input: unknown): Promise<ReceiptClassification>;
|
|
12
|
-
classifyOperation?(input: unknown): Promise<ReceiptClassification>;
|
|
13
|
-
close(): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export type ReceiptOperationTool = 'edit' | 'write' | 'apply-patch' | 'apply_patch' | 'bash' | 'git' | 'gh' | 'bun' | 'npm';
|
|
16
|
-
export type PullRequestObservationState = 'open' | 'closed' | 'merged';
|
|
17
|
-
export type CheckObservationState = 'completed-success' | 'completed-failure' | 'pending';
|
|
18
|
-
export type ReviewObservationDecision = 'approved' | 'changes-requested' | 'commented' | 'pending';
|
|
19
|
-
export interface ReceiptOperationContext extends ReceiptContext {
|
|
20
|
-
resourceRevisionIdentity?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ReceiptOperationAfter extends ReceiptObservationAfter {
|
|
23
|
-
commitClosure?: boolean;
|
|
24
|
-
pullRequest?: {
|
|
25
|
-
identity: string;
|
|
26
|
-
state: PullRequestObservationState;
|
|
27
|
-
};
|
|
28
|
-
resourceRevisionIdentity?: string;
|
|
29
|
-
checkState?: CheckObservationState;
|
|
30
|
-
reviewDecision?: ReviewObservationDecision;
|
|
31
|
-
}
|
|
32
|
-
export interface ReceiptOperationObservation {
|
|
33
|
-
callId: string;
|
|
34
|
-
operation: ReceiptOperation;
|
|
35
|
-
tool: ReceiptOperationTool;
|
|
36
|
-
command?: string;
|
|
37
|
-
context: ReceiptOperationContext;
|
|
38
|
-
after?: ReceiptOperationAfter;
|
|
39
|
-
terminal: TerminalObservation;
|
|
40
|
-
}
|
|
41
|
-
export declare function parseReceiptOperationAfter(input: unknown): ReceiptOperationAfter | undefined;
|
|
42
|
-
export declare function parseReceiptOperationObservation(input: unknown): ReceiptOperationObservation | undefined;
|
|
43
|
-
export declare function createReceiptClassifier(options?: ReceiptClassifierOptions): ReceiptClassifier;
|
|
44
|
-
export type { ReceiptOperation };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import type { ReceiptDigestDomain, ReceiptReadbackFailureCategory, ReceiptReadbackProgression } from './receipt-readback.js';
|
|
2
|
-
export declare const RECEIPT_SCHEMA_VERSION: 2;
|
|
3
|
-
export declare const RECEIPT_PROTOCOL_VERSION: 2;
|
|
4
|
-
declare const LEGACY_RECEIPT_SCHEMA_VERSION: 1;
|
|
5
|
-
declare const LEGACY_RECEIPT_PROTOCOL_VERSION: 1;
|
|
6
|
-
export type ReceiptOperation = 'implementation' | 'verification' | 'commit' | 'push' | 'pr-creation' | 'check-readback' | 'review-readback';
|
|
7
|
-
export type ReceiptClassificationOutcome = 'accepted' | 'rejected' | 'unavailable';
|
|
8
|
-
export type ReceiptAttribution = 'runtime-verified' | 'unattributed';
|
|
9
|
-
export type ReceiptResult = 'success' | 'failure' | 'unknown';
|
|
10
|
-
export type ReceiptSideEffect = 'required' | 'not-required';
|
|
11
|
-
export type TerminalStatus = 'success' | 'failure' | 'cancelled' | 'running' | 'unknown';
|
|
12
|
-
export type TerminalOutput = 'empty' | 'non-empty' | 'unknown';
|
|
13
|
-
export type DigestDomain = ReceiptDigestDomain;
|
|
14
|
-
export type ReceiptReasonCode = 'already-consumed' | 'abandoned-observation' | 'ambiguous-attribution' | 'classification-rejected' | 'classification-unavailable' | 'call-context-conflict' | 'classifier-closed' | 'cross-registration-disputed' | 'capability-mismatch' | 'duplicate-finalization' | 'empty-result' | 'epoch-mismatch' | 'forbidden-field' | 'grammar-incompatible' | 'incomplete-envelope' | 'invalid-observation' | 'invalid-receipt' | 'invalid-terminal-result' | 'no-op-resource' | 'parser-asset-unavailable' | 'parser-failure' | 'prohibited-shell-shape' | 'successful-no-op' | 'terminal-failure' | 'terminal-cancelled' | 'terminal-running' | 'terminal-unknown' | 'unknown-envelope' | 'unknown-receipt' | 'unit-mismatch' | 'unchanged-worktree' | 'unchanged-worktree' | 'unsupported-command' | 'workspace-mismatch' | 'recognized-command';
|
|
15
|
-
export interface ReceiptClassification {
|
|
16
|
-
outcome: ReceiptClassificationOutcome;
|
|
17
|
-
category: ReceiptOperation | null;
|
|
18
|
-
attribution: ReceiptAttribution;
|
|
19
|
-
result: ReceiptResult;
|
|
20
|
-
sideEffect: ReceiptSideEffect;
|
|
21
|
-
reasonCode: ReceiptReasonCode;
|
|
22
|
-
}
|
|
23
|
-
export interface ReceiptContext {
|
|
24
|
-
epochId: string;
|
|
25
|
-
unitId: string;
|
|
26
|
-
workspaceIdentity: string;
|
|
27
|
-
repositoryIdentity?: string;
|
|
28
|
-
worktreeIdentity?: string;
|
|
29
|
-
operationTargetIdentity?: string;
|
|
30
|
-
resourceIdentity?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface ReceiptObservationAfter {
|
|
33
|
-
workspaceIdentity: string;
|
|
34
|
-
repositoryIdentity?: string;
|
|
35
|
-
worktreeIdentity?: string;
|
|
36
|
-
operationTargetIdentity?: string;
|
|
37
|
-
resourceIdentity?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface TerminalObservation {
|
|
40
|
-
status: TerminalStatus;
|
|
41
|
-
output: TerminalOutput;
|
|
42
|
-
noOp: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface ReceiptLedgerOptions {
|
|
45
|
-
registrationIdentity?: string;
|
|
46
|
-
capabilityFlags?: readonly string[];
|
|
47
|
-
sessionSalt?: Uint8Array;
|
|
48
|
-
}
|
|
49
|
-
export interface ReceiptLedgerMetadata {
|
|
50
|
-
schemaVersion: typeof RECEIPT_SCHEMA_VERSION;
|
|
51
|
-
protocolVersion: typeof RECEIPT_PROTOCOL_VERSION;
|
|
52
|
-
registrationDigest: string;
|
|
53
|
-
capabilityFlags: readonly string[];
|
|
54
|
-
}
|
|
55
|
-
export interface CanonicalReceiptFields {
|
|
56
|
-
receiptId: string;
|
|
57
|
-
registrationDigest: string;
|
|
58
|
-
callDigest: string;
|
|
59
|
-
epochDigest: string;
|
|
60
|
-
unitDigest: string;
|
|
61
|
-
workspaceDigest: string;
|
|
62
|
-
repositoryDigest?: string;
|
|
63
|
-
worktreeDigest?: string;
|
|
64
|
-
operationTargetIdentity?: string;
|
|
65
|
-
resourceDigest?: string;
|
|
66
|
-
operation: ReceiptOperation;
|
|
67
|
-
result: 'success';
|
|
68
|
-
source: 'runtime-verified';
|
|
69
|
-
consumption: 'available' | 'consumed';
|
|
70
|
-
timestamp: number;
|
|
71
|
-
}
|
|
72
|
-
export interface ReceiptEnvelope {
|
|
73
|
-
schemaVersion: typeof RECEIPT_SCHEMA_VERSION | typeof LEGACY_RECEIPT_SCHEMA_VERSION;
|
|
74
|
-
protocolVersion: typeof RECEIPT_PROTOCOL_VERSION | typeof LEGACY_RECEIPT_PROTOCOL_VERSION;
|
|
75
|
-
registrationDigest: string;
|
|
76
|
-
capabilityFlags: readonly string[];
|
|
77
|
-
compatibility: 'compatible';
|
|
78
|
-
canonical: CanonicalReceiptFields;
|
|
79
|
-
}
|
|
80
|
-
export type PrepareObservationResult = {
|
|
81
|
-
status: 'prepared';
|
|
82
|
-
preparationId: string;
|
|
83
|
-
} | {
|
|
84
|
-
status: 'duplicate' | 'rejected';
|
|
85
|
-
reasonCode: ReceiptReasonCode;
|
|
86
|
-
};
|
|
87
|
-
export type FinalizeObservationResult = {
|
|
88
|
-
status: 'finalized';
|
|
89
|
-
receipt: ReceiptEnvelope;
|
|
90
|
-
} | {
|
|
91
|
-
status: 'rejected';
|
|
92
|
-
reasonCode: ReceiptReasonCode;
|
|
93
|
-
};
|
|
94
|
-
export type AbandonObservationResult = {
|
|
95
|
-
status: 'abandoned';
|
|
96
|
-
} | {
|
|
97
|
-
status: 'rejected';
|
|
98
|
-
reasonCode: ReceiptReasonCode;
|
|
99
|
-
};
|
|
100
|
-
export type ConsumeReceiptResult = {
|
|
101
|
-
status: 'consumed';
|
|
102
|
-
receipt: ReceiptEnvelope;
|
|
103
|
-
} | {
|
|
104
|
-
status: 'rejected';
|
|
105
|
-
reasonCode: ReceiptReasonCode;
|
|
106
|
-
};
|
|
107
|
-
export type RecoverReceiptResult = {
|
|
108
|
-
status: 'recovered' | 'duplicate';
|
|
109
|
-
receipt: ReceiptEnvelope;
|
|
110
|
-
} | {
|
|
111
|
-
status: 'rejected';
|
|
112
|
-
category: ReceiptReadbackFailureCategory;
|
|
113
|
-
};
|
|
114
|
-
export type RecoverReadbackResult = {
|
|
115
|
-
status: 'recovered' | 'duplicate';
|
|
116
|
-
receipts: readonly ReceiptEnvelope[];
|
|
117
|
-
progression: ReceiptReadbackProgression;
|
|
118
|
-
} | {
|
|
119
|
-
status: 'rejected';
|
|
120
|
-
category: ReceiptReadbackFailureCategory;
|
|
121
|
-
};
|
|
122
|
-
export type EnvelopeValidationResult = {
|
|
123
|
-
compatibility: 'compatible';
|
|
124
|
-
envelope: ReceiptEnvelope;
|
|
125
|
-
} | {
|
|
126
|
-
compatibility: 'unavailable' | 'rejected';
|
|
127
|
-
reasonCode: ReceiptReasonCode;
|
|
128
|
-
};
|
|
129
|
-
export interface ReceiptLedger {
|
|
130
|
-
readonly metadata: ReceiptLedgerMetadata;
|
|
131
|
-
digestIdentity(domain: DigestDomain, identity: string): string;
|
|
132
|
-
prepareObservation(input: unknown): PrepareObservationResult;
|
|
133
|
-
finalizeObservation(input: unknown): FinalizeObservationResult;
|
|
134
|
-
abandonObservation(input: unknown): AbandonObservationResult;
|
|
135
|
-
consumeReceipt(receiptId: unknown, context: unknown): ConsumeReceiptResult;
|
|
136
|
-
recoverReceipt(input: unknown, operationTargetIdentity?: string): RecoverReceiptResult;
|
|
137
|
-
recoverReadback(input: readonly unknown[], operationTargetIdentity?: string): RecoverReadbackResult;
|
|
138
|
-
getProgressionState(): ReceiptReadbackProgression;
|
|
139
|
-
validateEnvelope(input: unknown): EnvelopeValidationResult;
|
|
140
|
-
getEnvelope(receiptId: unknown): ReceiptEnvelope | undefined;
|
|
141
|
-
listReceipts(): readonly ReceiptEnvelope[];
|
|
142
|
-
getSessionSalt(): Uint8Array;
|
|
143
|
-
}
|
|
144
|
-
export declare function isLocalOperation(operation: ReceiptOperation): operation is 'implementation' | 'verification' | 'commit';
|
|
145
|
-
export declare function createReceiptLedger(options?: ReceiptLedgerOptions): ReceiptLedger;
|
|
146
|
-
export {};
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import type { ReceiptEnvelope, ReceiptLedgerMetadata, ReceiptOperation } from './receipt-ledger.js';
|
|
2
|
-
export declare const RECEIPT_READBACK_SCHEMA_VERSION: 2;
|
|
3
|
-
export declare const RECEIPT_READBACK_PROTOCOL_VERSION: 2;
|
|
4
|
-
declare const LEGACY_RECEIPT_READBACK_SCHEMA_VERSION: 1;
|
|
5
|
-
type ReceiptReadbackVersion = typeof RECEIPT_READBACK_SCHEMA_VERSION | typeof LEGACY_RECEIPT_READBACK_SCHEMA_VERSION;
|
|
6
|
-
export type ReceiptDigestDomain = 'repository' | 'worktree' | 'resource' | 'workspace' | 'epoch' | 'unit' | 'call' | 'registration';
|
|
7
|
-
export type ReceiptProgressionStateName = 'started' | 'completed';
|
|
8
|
-
export type ReceiptEpochFamily = 'work' | 'shipping';
|
|
9
|
-
export interface ReceiptResourceScope {
|
|
10
|
-
readonly operation: ReceiptOperation;
|
|
11
|
-
readonly resourceIdentity: string;
|
|
12
|
-
}
|
|
13
|
-
export type ReceiptReadbackFailureCategory = 'malformed' | 'forbidden-field' | 'unknown-kind' | 'unknown-schema' | 'unknown-protocol' | 'unknown-capability' | 'integrity-mismatch' | 'missing-mint' | 'control-before-mint' | 'conflicting-marker' | 'out-of-order' | 'cross-registration' | 'capability-mismatch' | 'salt-mismatch' | 'receipt-mismatch' | 'progression-mismatch' | 'inconsistent-evidence' | 'missing-internal-id' | 'identity-digest-mismatch' | 'conflicting-seed' | 'missing-seed';
|
|
14
|
-
export interface ReceiptMintMarker {
|
|
15
|
-
readonly kind: 'mint';
|
|
16
|
-
readonly schemaVersion: ReceiptReadbackVersion;
|
|
17
|
-
readonly protocolVersion: ReceiptReadbackVersion;
|
|
18
|
-
readonly envelope: ReceiptEnvelope;
|
|
19
|
-
readonly sessionSalt: string;
|
|
20
|
-
readonly integrity: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ReceiptConsumeMarker {
|
|
23
|
-
readonly kind: 'control';
|
|
24
|
-
readonly schemaVersion: ReceiptReadbackVersion;
|
|
25
|
-
readonly protocolVersion: ReceiptReadbackVersion;
|
|
26
|
-
readonly registrationDigest: string;
|
|
27
|
-
readonly capabilityFlags: readonly string[];
|
|
28
|
-
readonly control: 'consume';
|
|
29
|
-
readonly receiptId: string;
|
|
30
|
-
readonly transitionDigest: string;
|
|
31
|
-
readonly timestamp: number;
|
|
32
|
-
readonly integrity: string;
|
|
33
|
-
}
|
|
34
|
-
export interface ReceiptEpochProgressionMarker {
|
|
35
|
-
readonly kind: 'control';
|
|
36
|
-
readonly schemaVersion: ReceiptReadbackVersion;
|
|
37
|
-
readonly protocolVersion: ReceiptReadbackVersion;
|
|
38
|
-
readonly registrationDigest: string;
|
|
39
|
-
readonly capabilityFlags: readonly string[];
|
|
40
|
-
readonly control: 'progression';
|
|
41
|
-
readonly target: 'epoch';
|
|
42
|
-
readonly epochId: string;
|
|
43
|
-
readonly epochDigest: string;
|
|
44
|
-
readonly family: ReceiptEpochFamily;
|
|
45
|
-
readonly state: ReceiptProgressionStateName;
|
|
46
|
-
readonly transitionDigest: string;
|
|
47
|
-
readonly timestamp: number;
|
|
48
|
-
readonly sessionSalt: string;
|
|
49
|
-
readonly integrity: string;
|
|
50
|
-
}
|
|
51
|
-
export interface ReceiptUnitProgressionMarker {
|
|
52
|
-
readonly kind: 'control';
|
|
53
|
-
readonly schemaVersion: ReceiptReadbackVersion;
|
|
54
|
-
readonly protocolVersion: ReceiptReadbackVersion;
|
|
55
|
-
readonly registrationDigest: string;
|
|
56
|
-
readonly capabilityFlags: readonly string[];
|
|
57
|
-
readonly control: 'progression';
|
|
58
|
-
readonly target: 'unit';
|
|
59
|
-
readonly epochId: string;
|
|
60
|
-
readonly epochDigest: string;
|
|
61
|
-
readonly unitId: string;
|
|
62
|
-
readonly unitDigest: string;
|
|
63
|
-
readonly family: ReceiptEpochFamily;
|
|
64
|
-
readonly requiredOperations: readonly ReceiptOperation[];
|
|
65
|
-
readonly resourceScopes: readonly ReceiptResourceScope[];
|
|
66
|
-
readonly pinnedOperationTargetIdentity?: string;
|
|
67
|
-
readonly state: ReceiptProgressionStateName;
|
|
68
|
-
readonly transitionDigest: string;
|
|
69
|
-
readonly timestamp: number;
|
|
70
|
-
readonly sessionSalt: string;
|
|
71
|
-
readonly integrity: string;
|
|
72
|
-
}
|
|
73
|
-
export type ReceiptProgressionMarker = ReceiptEpochProgressionMarker | ReceiptUnitProgressionMarker;
|
|
74
|
-
export type ReceiptControlMarker = ReceiptConsumeMarker | ReceiptProgressionMarker;
|
|
75
|
-
export type ReceiptMarker = ReceiptMintMarker | ReceiptControlMarker;
|
|
76
|
-
export type ReceiptProgressionMarkerInput = {
|
|
77
|
-
readonly target: 'epoch';
|
|
78
|
-
readonly state: ReceiptProgressionStateName;
|
|
79
|
-
readonly epochId: string;
|
|
80
|
-
readonly family: ReceiptEpochFamily;
|
|
81
|
-
readonly transitionDigest: string;
|
|
82
|
-
readonly timestamp?: number;
|
|
83
|
-
} | {
|
|
84
|
-
readonly target: 'unit';
|
|
85
|
-
readonly state: ReceiptProgressionStateName;
|
|
86
|
-
readonly epochId: string;
|
|
87
|
-
readonly unitId: string;
|
|
88
|
-
readonly family: ReceiptEpochFamily;
|
|
89
|
-
readonly requiredOperations: readonly ReceiptOperation[];
|
|
90
|
-
readonly resourceScopes: readonly ReceiptResourceScope[];
|
|
91
|
-
readonly pinnedOperationTargetIdentity?: string;
|
|
92
|
-
readonly transitionDigest: string;
|
|
93
|
-
readonly timestamp?: number;
|
|
94
|
-
};
|
|
95
|
-
export interface ReceiptProgressionProjectionSource {
|
|
96
|
-
readonly metadata: ReceiptLedgerMetadata | (() => ReceiptLedgerMetadata);
|
|
97
|
-
readonly getSessionSalt: () => Uint8Array;
|
|
98
|
-
readonly digestIdentity: (domain: ReceiptDigestDomain, identity: string) => string;
|
|
99
|
-
}
|
|
100
|
-
export interface ReceiptReadbackExpectation {
|
|
101
|
-
readonly registrationDigest: string;
|
|
102
|
-
readonly capabilityFlags: readonly string[];
|
|
103
|
-
readonly sessionSalt: Uint8Array;
|
|
104
|
-
readonly source?: 'runtime-verified';
|
|
105
|
-
/**
|
|
106
|
-
* When present, legacy v1 mint markers are rejected because they cannot
|
|
107
|
-
* authenticate a foreign/worktree target. Absence retains the narrow v1
|
|
108
|
-
* parent-target recovery shim; callers must validate that parent separately.
|
|
109
|
-
*/
|
|
110
|
-
readonly operationTargetIdentity?: string;
|
|
111
|
-
}
|
|
112
|
-
export type ReceiptEpochProgressionSnapshot = {
|
|
113
|
-
readonly target: 'epoch';
|
|
114
|
-
readonly state: ReceiptProgressionStateName;
|
|
115
|
-
readonly epochId: string;
|
|
116
|
-
readonly epochDigest: string;
|
|
117
|
-
readonly family: ReceiptEpochFamily;
|
|
118
|
-
readonly transitionDigest: string;
|
|
119
|
-
};
|
|
120
|
-
export type ReceiptUnitProgressionSnapshot = {
|
|
121
|
-
readonly target: 'unit';
|
|
122
|
-
readonly state: ReceiptProgressionStateName;
|
|
123
|
-
readonly epochId: string;
|
|
124
|
-
readonly epochDigest: string;
|
|
125
|
-
readonly unitId: string;
|
|
126
|
-
readonly unitDigest: string;
|
|
127
|
-
readonly family: ReceiptEpochFamily;
|
|
128
|
-
readonly requiredOperations: readonly ReceiptOperation[];
|
|
129
|
-
readonly resourceScopes: readonly ReceiptResourceScope[];
|
|
130
|
-
readonly pinnedOperationTargetIdentity?: string;
|
|
131
|
-
readonly transitionDigest: string;
|
|
132
|
-
};
|
|
133
|
-
export type ReceiptProgressionSnapshot = ReceiptEpochProgressionSnapshot | ReceiptUnitProgressionSnapshot;
|
|
134
|
-
export interface ReceiptReadbackProgression {
|
|
135
|
-
readonly epoch: ReceiptEpochProgressionSnapshot | null;
|
|
136
|
-
readonly unit: ReceiptUnitProgressionSnapshot | null;
|
|
137
|
-
}
|
|
138
|
-
export interface ReceiptReadbackState {
|
|
139
|
-
readonly registrationDigest: string;
|
|
140
|
-
readonly receipts: readonly ReceiptEnvelope[];
|
|
141
|
-
readonly progression: ReceiptReadbackProgression;
|
|
142
|
-
}
|
|
143
|
-
export type ReceiptMarkerValidation = {
|
|
144
|
-
readonly status: 'valid';
|
|
145
|
-
readonly marker: ReceiptMarker;
|
|
146
|
-
} | {
|
|
147
|
-
readonly status: 'rejected';
|
|
148
|
-
readonly category: ReceiptReadbackFailureCategory;
|
|
149
|
-
};
|
|
150
|
-
export type ReceiptReadbackResult = {
|
|
151
|
-
readonly status: 'reconstructed';
|
|
152
|
-
readonly state: ReceiptReadbackState;
|
|
153
|
-
} | {
|
|
154
|
-
readonly status: 'rejected';
|
|
155
|
-
readonly category: ReceiptReadbackFailureCategory;
|
|
156
|
-
};
|
|
157
|
-
export type ReceiptReadbackSeedResult = {
|
|
158
|
-
readonly status: 'empty';
|
|
159
|
-
} | {
|
|
160
|
-
readonly status: 'ready';
|
|
161
|
-
readonly sessionSalt: Uint8Array;
|
|
162
|
-
readonly registrationDigest: string;
|
|
163
|
-
readonly capabilityFlags: readonly string[];
|
|
164
|
-
} | {
|
|
165
|
-
readonly status: 'repair-required';
|
|
166
|
-
readonly category: ReceiptReadbackFailureCategory;
|
|
167
|
-
};
|
|
168
|
-
export declare function digestReceiptIdentity(domain: ReceiptDigestDomain, identity: string, sessionSalt: Uint8Array): string;
|
|
169
|
-
export declare function validateReceiptMarker(input: unknown): ReceiptMarkerValidation;
|
|
170
|
-
/**
|
|
171
|
-
* Filters a raw marker array, retaining only markers that belong to the given
|
|
172
|
-
* registrationDigest. Markers that cannot be parsed (malformed, unknown schema,
|
|
173
|
-
* etc.) are retained as-is so that downstream callers can fail-closed on them.
|
|
174
|
-
*
|
|
175
|
-
* Use this before extractReceiptReadbackSeed / foldReceiptReadback when the
|
|
176
|
-
* shared metadata array may contain markers from multiple concurrent
|
|
177
|
-
* registrations (e.g. dual-registration in a single OpenCode session).
|
|
178
|
-
*/
|
|
179
|
-
export declare function filterMarkersByRegistration(markers: readonly unknown[], ownRegistrationDigest: string): unknown[];
|
|
180
|
-
export declare function extractReceiptReadbackSeed(inputs: readonly unknown[]): ReceiptReadbackSeedResult;
|
|
181
|
-
export declare function projectReceiptMintMarker(receipt: unknown, sessionSalt: Uint8Array): ReceiptMintMarker | undefined;
|
|
182
|
-
export declare function projectReceiptConsumptionMarker(receipt: unknown, transitionDigest: string, timestamp?: number): ReceiptConsumeMarker | undefined;
|
|
183
|
-
export declare function projectReceiptProgressionMarker(source: ReceiptProgressionProjectionSource, input: ReceiptProgressionMarkerInput): ReceiptProgressionMarker | undefined;
|
|
184
|
-
export declare function foldReceiptReadback(inputs: readonly unknown[], expectation: ReceiptReadbackExpectation): ReceiptReadbackResult;
|
|
185
|
-
export declare function receiptReadbackExpectationFromMetadata(metadata: ReceiptLedgerMetadata, sessionSalt: Uint8Array, operationTargetIdentity?: string): ReceiptReadbackExpectation;
|
|
186
|
-
export {};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { type ReceiptClassifier } from './receipt-classifier.js';
|
|
2
|
-
import type { ReceiptLedger, ReceiptOperation } from './receipt-ledger.js';
|
|
3
|
-
import type { ReceiptResourceScope } from './receipt-readback.js';
|
|
4
|
-
export type WorkflowMode = 'protected' | 'disabled' | 'unavailable';
|
|
5
|
-
export type WorkflowState = 'protected' | 'waiting' | 'rejected' | 'disabled' | 'unavailable' | 'inactive';
|
|
6
|
-
export type RepairKind = 'fresh-readback' | 'rerun-operation' | 'question-attestation';
|
|
7
|
-
export type TransitionTarget = 'unit' | 'epoch';
|
|
8
|
-
export type EpochFamily = 'work' | 'shipping';
|
|
9
|
-
export type WorkflowReasonCode = 'abandoned-transition' | 'call-context-conflict' | 'cancelled-operation' | 'consumed-receipt' | 'declaration-superseded' | 'disabled' | 'epoch-completed' | 'epoch-mismatch' | 'failed-operation' | 'family-conflict' | 'finalization-failed' | 'foreign-registration' | 'forbidden-field' | 'guard-unavailable' | 'incompatible-receipt' | 'invalid-configuration' | 'invalid-control' | 'invalid-receipt' | 'invalid-transition' | 'missing-evidence' | 'no-supported-repair' | 'no-active-epoch' | 'no-active-unit' | 'no-op-operation' | 'operation-not-required' | 'operation-target-mismatch' | 'readback-timeout' | 'receipt-mismatch' | 'rejected-operation' | 'resource-mismatch' | 'running-operation' | 'snapshot-blocked' | 'stale-receipt' | 'transition-finalized' | 'transition-terminal' | 'transition-replayed' | 'unattributed-operation' | 'unit-active' | 'unit-completed' | 'unit-incomplete' | 'unit-mismatch' | 'unit-ready' | 'workspace-mismatch' | 'runtime-scope-conflict' | 'invalid-recovery' | 'recovery-conflict' | 'fork-copy-not-lineage';
|
|
10
|
-
export interface WorkflowGuardOptions {
|
|
11
|
-
ledger: ReceiptLedger;
|
|
12
|
-
classifier?: ReceiptClassifier;
|
|
13
|
-
workspaceIdentity: string;
|
|
14
|
-
repositoryIdentity?: string;
|
|
15
|
-
worktreeIdentity?: string;
|
|
16
|
-
supportedRepairs?: readonly RepairKind[];
|
|
17
|
-
questionEligibleOperations?: readonly ReceiptOperation[];
|
|
18
|
-
runtimeRequiredOperations?: readonly ReceiptOperation[];
|
|
19
|
-
runtimeResourceScopes?: Readonly<Record<string, string>>;
|
|
20
|
-
mode?: WorkflowMode;
|
|
21
|
-
maxReceiptAgeMs?: number;
|
|
22
|
-
clock?: () => number;
|
|
23
|
-
}
|
|
24
|
-
export interface RuntimeUnitPolicy {
|
|
25
|
-
requiredOperations?: readonly ReceiptOperation[];
|
|
26
|
-
resourceScopes?: Readonly<Record<string, string>>;
|
|
27
|
-
}
|
|
28
|
-
export interface EpochSnapshot {
|
|
29
|
-
epochId: string;
|
|
30
|
-
family: EpochFamily;
|
|
31
|
-
status: 'active' | 'completed';
|
|
32
|
-
}
|
|
33
|
-
export interface UnitSnapshot {
|
|
34
|
-
unitId: string;
|
|
35
|
-
status: 'active' | 'completed';
|
|
36
|
-
requiredOperations: readonly ReceiptOperation[];
|
|
37
|
-
requiredResourceOperations: readonly ReceiptOperation[];
|
|
38
|
-
resourceScopes: readonly ReceiptResourceScope[];
|
|
39
|
-
pinnedOperationTargetIdentity?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface CurrentOperationContext {
|
|
42
|
-
readonly workspaceIdentity: string;
|
|
43
|
-
readonly repositoryIdentity?: string;
|
|
44
|
-
readonly worktreeIdentity?: string;
|
|
45
|
-
}
|
|
46
|
-
export interface WorkflowStatus {
|
|
47
|
-
state: WorkflowState;
|
|
48
|
-
reasonCode: WorkflowReasonCode;
|
|
49
|
-
repair?: RepairKind;
|
|
50
|
-
statusKey: string;
|
|
51
|
-
epoch: EpochSnapshot | null;
|
|
52
|
-
unit: UnitSnapshot | null;
|
|
53
|
-
satisfiedOperations: readonly ReceiptOperation[];
|
|
54
|
-
missingOperations: readonly ReceiptOperation[];
|
|
55
|
-
}
|
|
56
|
-
export type ActivationResult = {
|
|
57
|
-
status: 'activated' | 'reused' | 'attached';
|
|
58
|
-
epoch: EpochSnapshot;
|
|
59
|
-
} | {
|
|
60
|
-
status: 'ignored';
|
|
61
|
-
reasonCode: WorkflowReasonCode;
|
|
62
|
-
} | {
|
|
63
|
-
status: 'rejected';
|
|
64
|
-
reasonCode: WorkflowReasonCode;
|
|
65
|
-
};
|
|
66
|
-
export type StartUnitResult = {
|
|
67
|
-
status: 'started';
|
|
68
|
-
unit: UnitSnapshot;
|
|
69
|
-
} | {
|
|
70
|
-
status: 'rejected';
|
|
71
|
-
reasonCode: WorkflowReasonCode;
|
|
72
|
-
};
|
|
73
|
-
export type EvidenceObservationResult = {
|
|
74
|
-
status: 'accepted';
|
|
75
|
-
operation: ReceiptOperation;
|
|
76
|
-
} | {
|
|
77
|
-
status: 'rejected';
|
|
78
|
-
reasonCode: WorkflowReasonCode;
|
|
79
|
-
} | {
|
|
80
|
-
status: 'unavailable';
|
|
81
|
-
reasonCode: WorkflowReasonCode;
|
|
82
|
-
};
|
|
83
|
-
export type ReadbackObservationResult = {
|
|
84
|
-
status: 'accepted';
|
|
85
|
-
changed: boolean;
|
|
86
|
-
} | {
|
|
87
|
-
status: 'rejected';
|
|
88
|
-
reasonCode: WorkflowReasonCode;
|
|
89
|
-
};
|
|
90
|
-
export type TransitionPrepareResult = {
|
|
91
|
-
status: 'allowed';
|
|
92
|
-
transitionId: string;
|
|
93
|
-
} | {
|
|
94
|
-
status: 'waiting' | 'rejected' | 'unavailable';
|
|
95
|
-
reasonCode: WorkflowReasonCode;
|
|
96
|
-
};
|
|
97
|
-
export type TransitionFinalizeResult = {
|
|
98
|
-
status: 'completed' | 'duplicate';
|
|
99
|
-
target: TransitionTarget;
|
|
100
|
-
transitionId: string;
|
|
101
|
-
} | {
|
|
102
|
-
status: 'waiting' | 'rejected' | 'unavailable';
|
|
103
|
-
reasonCode: WorkflowReasonCode;
|
|
104
|
-
};
|
|
105
|
-
export type AbandonTransitionResult = {
|
|
106
|
-
status: 'abandoned';
|
|
107
|
-
} | {
|
|
108
|
-
status: 'duplicate';
|
|
109
|
-
reasonCode: 'abandoned-transition';
|
|
110
|
-
} | {
|
|
111
|
-
status: 'rejected';
|
|
112
|
-
reasonCode: WorkflowReasonCode;
|
|
113
|
-
};
|
|
114
|
-
export type ControlResult = {
|
|
115
|
-
status: 'changed' | 'unchanged';
|
|
116
|
-
mode: WorkflowMode;
|
|
117
|
-
} | {
|
|
118
|
-
status: 'rejected';
|
|
119
|
-
reasonCode: WorkflowReasonCode;
|
|
120
|
-
};
|
|
121
|
-
export type WorkflowRecoveryResult = {
|
|
122
|
-
status: 'restored' | 'duplicate';
|
|
123
|
-
provenance: 'restart';
|
|
124
|
-
epoch: EpochSnapshot;
|
|
125
|
-
unit: UnitSnapshot | null;
|
|
126
|
-
} | {
|
|
127
|
-
status: 'rejected';
|
|
128
|
-
reasonCode: WorkflowReasonCode;
|
|
129
|
-
};
|
|
130
|
-
export interface WorkflowGuard {
|
|
131
|
-
activate(input: unknown): ActivationResult;
|
|
132
|
-
startUnit(input: unknown, policy?: RuntimeUnitPolicy): StartUnitResult;
|
|
133
|
-
observeReceipt(input: unknown): EvidenceObservationResult;
|
|
134
|
-
observeAttempt(input: unknown): EvidenceObservationResult;
|
|
135
|
-
observeOperation(input: unknown): Promise<EvidenceObservationResult>;
|
|
136
|
-
/**
|
|
137
|
-
* Internal recovery seam. Callers MUST validate host lineage, own
|
|
138
|
-
* registration/seed/readback, stable workspace, and current mutable
|
|
139
|
-
* revisions before using this classifier-bypassing path.
|
|
140
|
-
*/
|
|
141
|
-
observeTrustedRecoveredOperation(input: unknown): Promise<EvidenceObservationResult>;
|
|
142
|
-
observeReadback(input: unknown): ReadbackObservationResult;
|
|
143
|
-
currentOperationContext(): CurrentOperationContext;
|
|
144
|
-
/**
|
|
145
|
-
* Read-only: whether the active unit already has a resource baseline for
|
|
146
|
-
* `operation` (declared on the unit, seeded, or propagated from PR
|
|
147
|
-
* creation). False when there is no active unit.
|
|
148
|
-
*/
|
|
149
|
-
hasResourceBaseline(operation: ReceiptOperation): boolean;
|
|
150
|
-
status(): WorkflowStatus;
|
|
151
|
-
prepareTransition(input: unknown): TransitionPrepareResult;
|
|
152
|
-
finalizeTransition(input: unknown): TransitionFinalizeResult;
|
|
153
|
-
abandonTransition(input: unknown): AbandonTransitionResult;
|
|
154
|
-
restore(input: unknown): WorkflowRecoveryResult;
|
|
155
|
-
setMode(input: unknown): ControlResult;
|
|
156
|
-
}
|
|
157
|
-
export declare function createWorkflowGuard(options: WorkflowGuardOptions): WorkflowGuard;
|