@fro.bot/systematic 3.23.0 → 3.24.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.
@@ -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;