@intutic/shared-types 1.0.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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/agentPool.d.ts +40 -0
  4. package/dist/agentPool.d.ts.map +1 -0
  5. package/dist/agentPool.js +3 -0
  6. package/dist/agentPool.js.map +1 -0
  7. package/dist/annotation.d.ts +150 -0
  8. package/dist/annotation.d.ts.map +1 -0
  9. package/dist/annotation.js +6 -0
  10. package/dist/annotation.js.map +1 -0
  11. package/dist/anomaly.d.ts +227 -0
  12. package/dist/anomaly.d.ts.map +1 -0
  13. package/dist/anomaly.js +35 -0
  14. package/dist/anomaly.js.map +1 -0
  15. package/dist/api-contracts.d.ts +176 -0
  16. package/dist/api-contracts.d.ts.map +1 -0
  17. package/dist/api-contracts.js +110 -0
  18. package/dist/api-contracts.js.map +1 -0
  19. package/dist/attenuation.d.ts +115 -0
  20. package/dist/attenuation.d.ts.map +1 -0
  21. package/dist/attenuation.js +26 -0
  22. package/dist/attenuation.js.map +1 -0
  23. package/dist/auth.d.ts +340 -0
  24. package/dist/auth.d.ts.map +1 -0
  25. package/dist/auth.js +87 -0
  26. package/dist/auth.js.map +1 -0
  27. package/dist/benchmark.d.ts +76 -0
  28. package/dist/benchmark.d.ts.map +1 -0
  29. package/dist/benchmark.js +8 -0
  30. package/dist/benchmark.js.map +1 -0
  31. package/dist/billing.d.ts +173 -0
  32. package/dist/billing.d.ts.map +1 -0
  33. package/dist/billing.js +28 -0
  34. package/dist/billing.js.map +1 -0
  35. package/dist/cdc.d.ts +73 -0
  36. package/dist/cdc.d.ts.map +1 -0
  37. package/dist/cdc.js +13 -0
  38. package/dist/cdc.js.map +1 -0
  39. package/dist/cfo.d.ts +66 -0
  40. package/dist/cfo.d.ts.map +1 -0
  41. package/dist/cfo.js +3 -0
  42. package/dist/cfo.js.map +1 -0
  43. package/dist/connectors.d.ts +23 -0
  44. package/dist/connectors.d.ts.map +1 -0
  45. package/dist/connectors.js +6 -0
  46. package/dist/connectors.js.map +1 -0
  47. package/dist/enums.d.ts +238 -0
  48. package/dist/enums.d.ts.map +1 -0
  49. package/dist/enums.js +243 -0
  50. package/dist/enums.js.map +1 -0
  51. package/dist/errors.d.ts +122 -0
  52. package/dist/errors.d.ts.map +1 -0
  53. package/dist/errors.js +135 -0
  54. package/dist/errors.js.map +1 -0
  55. package/dist/evaluator.d.ts +70 -0
  56. package/dist/evaluator.d.ts.map +1 -0
  57. package/dist/evaluator.js +8 -0
  58. package/dist/evaluator.js.map +1 -0
  59. package/dist/finops.d.ts +185 -0
  60. package/dist/finops.d.ts.map +1 -0
  61. package/dist/finops.js +14 -0
  62. package/dist/finops.js.map +1 -0
  63. package/dist/hindsight.d.ts +49 -0
  64. package/dist/hindsight.d.ts.map +1 -0
  65. package/dist/hindsight.js +3 -0
  66. package/dist/hindsight.js.map +1 -0
  67. package/dist/identity.d.ts +101 -0
  68. package/dist/identity.d.ts.map +1 -0
  69. package/dist/identity.js +29 -0
  70. package/dist/identity.js.map +1 -0
  71. package/dist/index.d.ts +40 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +120 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/intelligence.d.ts +325 -0
  76. package/dist/intelligence.d.ts.map +1 -0
  77. package/dist/intelligence.js +28 -0
  78. package/dist/intelligence.js.map +1 -0
  79. package/dist/marketplace.d.ts +76 -0
  80. package/dist/marketplace.d.ts.map +1 -0
  81. package/dist/marketplace.js +16 -0
  82. package/dist/marketplace.js.map +1 -0
  83. package/dist/notifications.d.ts +206 -0
  84. package/dist/notifications.d.ts.map +1 -0
  85. package/dist/notifications.js +6 -0
  86. package/dist/notifications.js.map +1 -0
  87. package/dist/observability.d.ts +45 -0
  88. package/dist/observability.d.ts.map +1 -0
  89. package/dist/observability.js +10 -0
  90. package/dist/observability.js.map +1 -0
  91. package/dist/policy.d.ts +104 -0
  92. package/dist/policy.d.ts.map +1 -0
  93. package/dist/policy.js +14 -0
  94. package/dist/policy.js.map +1 -0
  95. package/dist/prompt.d.ts +99 -0
  96. package/dist/prompt.d.ts.map +1 -0
  97. package/dist/prompt.js +3 -0
  98. package/dist/prompt.js.map +1 -0
  99. package/dist/session.d.ts +62 -0
  100. package/dist/session.d.ts.map +1 -0
  101. package/dist/session.js +14 -0
  102. package/dist/session.js.map +1 -0
  103. package/dist/sop.d.ts +387 -0
  104. package/dist/sop.d.ts.map +1 -0
  105. package/dist/sop.js +44 -0
  106. package/dist/sop.js.map +1 -0
  107. package/dist/sync.d.ts +374 -0
  108. package/dist/sync.d.ts.map +1 -0
  109. package/dist/sync.js +56 -0
  110. package/dist/sync.js.map +1 -0
  111. package/dist/taskManagement.d.ts +141 -0
  112. package/dist/taskManagement.d.ts.map +1 -0
  113. package/dist/taskManagement.js +14 -0
  114. package/dist/taskManagement.js.map +1 -0
  115. package/dist/trial.d.ts +34 -0
  116. package/dist/trial.d.ts.map +1 -0
  117. package/dist/trial.js +6 -0
  118. package/dist/trial.js.map +1 -0
  119. package/dist/usage.d.ts +34 -0
  120. package/dist/usage.d.ts.map +1 -0
  121. package/dist/usage.js +6 -0
  122. package/dist/usage.js.map +1 -0
  123. package/dist/warehouse.d.ts +49 -0
  124. package/dist/warehouse.d.ts.map +1 -0
  125. package/dist/warehouse.js +8 -0
  126. package/dist/warehouse.js.map +1 -0
  127. package/dist/workspaceSettings.d.ts +116 -0
  128. package/dist/workspaceSettings.d.ts.map +1 -0
  129. package/dist/workspaceSettings.js +50 -0
  130. package/dist/workspaceSettings.js.map +1 -0
  131. package/package.json +24 -0
package/dist/sop.d.ts ADDED
@@ -0,0 +1,387 @@
1
+ /**
2
+ * SOP (Standard Operating Procedure) registry types.
3
+ *
4
+ * These types correspond to the `sop_registry` table and the
5
+ * SOP proof tree structures used by the SSL (Self-Supervised Learning)
6
+ * synthesis pipeline.
7
+ *
8
+ * HLD §3.4 (SOP Registry), LLD 01-data-architecture §3.1, LLD #6
9
+ *
10
+ * @module
11
+ */
12
+ import type { ChangeClassification, ComplexityTier, RiskLevel, SopLifecycleState } from './enums.js';
13
+ /**
14
+ * A Standard Operating Procedure in the registry.
15
+ *
16
+ * SOPs are the governance documents that define expected agent behavior.
17
+ * They are versioned, classified by risk/complexity, and follow a
18
+ * lifecycle from hypothesis through validation to deprecation.
19
+ *
20
+ * LLD §3.1 — sop_registry table
21
+ */
22
+ export interface Sop {
23
+ /** Unique SOP identifier — `newId('sp')`. */
24
+ sopId: string;
25
+ /** Workspace this SOP belongs to — FK to `workspaces`. */
26
+ workspaceId: string;
27
+ /** Human-readable title of the SOP. */
28
+ title: string;
29
+ /** Semantic version string (e.g., '1.0.0'). */
30
+ version: string;
31
+ /** Full markdown content of the SOP document. CONFIDENTIAL. */
32
+ markdownContent: string;
33
+ /** Risk severity tier assigned to this SOP. */
34
+ riskTier: RiskLevel;
35
+ /** Task complexity tier for routing. */
36
+ complexityTier: ComplexityTier;
37
+ /** Whether this SOP version is currently active. */
38
+ isActive: boolean;
39
+ /** Current lifecycle state. */
40
+ lifecycleState: SopLifecycleState;
41
+ /** Optional when it was created. */
42
+ createdAt?: string;
43
+ /** Optional when it was updated. */
44
+ updatedAt?: string;
45
+ /** Optional SHA-256 hash of markdown content. */
46
+ contentHash?: string;
47
+ /** Optional SOP IDs this SOP depends on. */
48
+ dependencies?: string[];
49
+ /** Optional author/creator who registered the SOP. */
50
+ createdBy?: string;
51
+ /** Optional connector credentials ID. */
52
+ connectorId?: string;
53
+ /** Optional external source identifier. */
54
+ externalId?: string;
55
+ /** Version counter for optimistic locking. */
56
+ versionCounter?: number;
57
+ }
58
+ /**
59
+ * A proof tree produced by the SSL bottom-up synthesis pipeline.
60
+ *
61
+ * Proof trees capture the formal verification structure of an SOP,
62
+ * including the synthesis score (Family B metric) that measures
63
+ * how well the SOP has been validated against real-world execution traces.
64
+ *
65
+ * HLD §3.4 — SSL Skill Graph, Family B synthesis metrics
66
+ */
67
+ export interface SopProofTree {
68
+ /** Unique tree identifier — `newId('pt')`. */
69
+ treeId: string;
70
+ /** SOP this proof tree belongs to — FK to `sop_registry`. */
71
+ sopId: string;
72
+ /** Monotonically increasing version number. */
73
+ version: number;
74
+ /** The proof tree structure (JSON). */
75
+ treeJson: Record<string, unknown>;
76
+ /** Bottom-up synthesis score (0.0–1.0). */
77
+ synthesisScore: number;
78
+ }
79
+ /**
80
+ * Audit record for a SOP lifecycle state transition.
81
+ *
82
+ * Every transition through the 7-state FSM is logged in the
83
+ * `sop_lifecycle_transitions` table for governance auditability.
84
+ *
85
+ * @see HLD §3.4 — SOP Lifecycle FSM
86
+ */
87
+ export interface SopLifecycleTransition {
88
+ /** Unique transition identifier — `newId('lt')`. */
89
+ transitionId: string;
90
+ /** SOP that transitioned — FK to `sop_registry`. */
91
+ sopId: string;
92
+ /** Workspace scope — FK to `workspaces`. */
93
+ workspaceId: string;
94
+ /** State before the transition. */
95
+ fromState: SopLifecycleState;
96
+ /** State after the transition. */
97
+ toState: SopLifecycleState;
98
+ /** How the change affects the prior version (anti-gaming gate). */
99
+ changeClassification?: ChangeClassification;
100
+ /** User or system actor who triggered the transition. */
101
+ actorId: string;
102
+ /** Explanation for the transition (required for WEAKEN). */
103
+ rationale?: string;
104
+ /** Anti-gaming gate evaluation result. */
105
+ antiGamingResult?: {
106
+ gatePassed: boolean;
107
+ classificationConfidence: number;
108
+ reviewRequired: boolean;
109
+ };
110
+ /** When the transition occurred. */
111
+ createdAt: string;
112
+ }
113
+ /**
114
+ * Aggregated health metrics snapshot for a SOP.
115
+ *
116
+ * Computed by `sopHealthService.computeHealthMetrics()` and cached
117
+ * in Valkey at `v2:sop:health:{sop_id}` with a 5-minute TTL.
118
+ *
119
+ * @see HLD §3.4 — SOP Health Dashboard
120
+ */
121
+ export interface SopHealthMetrics {
122
+ /** SOP identifier. */
123
+ sopId: string;
124
+ /** Workspace identifier. */
125
+ workspaceId: string;
126
+ /** Last time this SOP was matched by an execution trace. */
127
+ lastMatchAt: string | null;
128
+ /** Last time this SOP was edited. */
129
+ lastEditAt: string | null;
130
+ /** Number of matches in the last 30 days. */
131
+ matchCount30d: number;
132
+ /** Average compliance score across recent traces (0.0–1.0). */
133
+ avgCompliance: number;
134
+ /** Number of behavioral drift events detected. */
135
+ driftEventCount: number;
136
+ /** Total accumulated cost in USD attributed to this SOP. */
137
+ totalCostUsd: number;
138
+ /** Whether this SOP is stale (no matches in SOP_STALENESS_DAYS). */
139
+ isStale: boolean;
140
+ }
141
+ /**
142
+ * A queued item in the Dream Cycle processing pipeline.
143
+ *
144
+ * Items originate from capability misses (LLD #5), decision mining
145
+ * entries, or drift signals. Phase 1: queue management only.
146
+ * Phase 3: LLM synthesis consumes the queue.
147
+ *
148
+ * @see HLD §3.4.6 — Dream Cycle
149
+ */
150
+ export interface DreamCycleQueueItem {
151
+ /** Unique queue item identifier — `newId('dq')`. */
152
+ queueItemId: string;
153
+ /** Workspace scope — FK to `workspaces`. */
154
+ workspaceId: string;
155
+ /** Origin of the queue item. */
156
+ sourceType: 'CAPABILITY_MISS' | 'DECISION_MINING' | 'DRIFT_SIGNAL';
157
+ /** Source entity ID (FK to originating table). */
158
+ sourceId: string;
159
+ /** Priority (lower = higher priority). Default: 100. */
160
+ priority: number;
161
+ /** Queue item status. */
162
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
163
+ /** Resulting SOP ID (populated on COMPLETED). */
164
+ resultSopId?: string;
165
+ /** Error message (populated on FAILED). */
166
+ errorMessage?: string;
167
+ /** When the item was enqueued. */
168
+ enqueuedAt: string;
169
+ /** When processing started. */
170
+ startedAt?: string;
171
+ /** When processing completed or failed. */
172
+ completedAt?: string;
173
+ }
174
+ /**
175
+ * Input for enqueuing a Dream Cycle item.
176
+ *
177
+ * @see HLD §3.4.6 — Dream Cycle
178
+ */
179
+ export interface DreamCycleEnqueueInput {
180
+ /** Workspace to enqueue in. */
181
+ workspaceId: string;
182
+ /** Origin of the queue item. */
183
+ sourceType: 'CAPABILITY_MISS' | 'DECISION_MINING' | 'DRIFT_SIGNAL';
184
+ /** Source entity ID. */
185
+ sourceId: string;
186
+ /** Priority override. Default: 100. */
187
+ priority?: number;
188
+ }
189
+ /**
190
+ * Result of a Gödel completeness probe evaluation.
191
+ *
192
+ * Evaluates a SOP against the 13-category quality rubric (HLD §3.7).
193
+ * Distinct from the 12-category runtime anomaly taxonomy (LLD #5).
194
+ *
195
+ * @see HLD §3.7 — Gödel Completeness Probe
196
+ */
197
+ export interface GodelProbeResult {
198
+ /** Unique result identifier — `newId('gp')`. */
199
+ resultId: string;
200
+ /** SOP that was evaluated. */
201
+ sopId: string;
202
+ /** Workspace scope. */
203
+ workspaceId: string;
204
+ /** Weighted aggregate score (0.0–1.0). */
205
+ aggregateScore: number;
206
+ /** Per-category scores (13 categories). */
207
+ categoryScores: Record<string, number>;
208
+ /** Probe version used for evaluation. */
209
+ probeVersion: string;
210
+ /** When the evaluation was performed. */
211
+ evaluatedAt: string;
212
+ }
213
+ /**
214
+ * Partial content update for forking a new SOP version.
215
+ *
216
+ * @see HLD §3.4.8 — Version chain
217
+ */
218
+ export interface SopContentUpdate {
219
+ /** Updated title. */
220
+ title?: string;
221
+ /** Updated markdown content. */
222
+ markdownContent?: string;
223
+ /** Updated risk tier. */
224
+ riskTier?: RiskLevel;
225
+ /** Updated complexity tier. */
226
+ complexityTier?: ComplexityTier;
227
+ }
228
+ /**
229
+ * Result of a lifecycle state transition attempt.
230
+ */
231
+ export interface SopLifecycleTransitionResult {
232
+ /** Whether the transition succeeded. */
233
+ success: boolean;
234
+ /** SOP that was (or was not) transitioned. */
235
+ sopId: string;
236
+ /** State before the transition. */
237
+ fromState: SopLifecycleState;
238
+ /** Requested target state. */
239
+ toState: SopLifecycleState;
240
+ /** Reason for failure (undefined on success). */
241
+ reason?: string;
242
+ }
243
+ /**
244
+ * The 10 valid lifecycle transitions in the 7-state FSM.
245
+ *
246
+ * @see HLD §3.4 — SOP Lifecycle
247
+ */
248
+ export declare const VALID_SOP_TRANSITIONS: ReadonlyArray<{
249
+ from: SopLifecycleState;
250
+ to: SopLifecycleState;
251
+ description: string;
252
+ }>;
253
+ /**
254
+ * Maps lifecycle state to enforcement mode.
255
+ */
256
+ export declare const ENFORCEMENT_BY_STATE: Record<SopLifecycleState, 'NONE' | 'SHADOW' | 'ACTIVE'>;
257
+ /** Edge types in the SOP dependency graph. */
258
+ export type SopEdgeType = 'DEPENDS_ON' | 'DERIVES_FROM' | 'VALIDATES';
259
+ /** An edge in the SOP dependency graph. */
260
+ export interface SopGraphEdge {
261
+ fromId: string;
262
+ toId: string;
263
+ edgeType: SopEdgeType;
264
+ metadata?: Record<string, unknown>;
265
+ }
266
+ /** Preview of cascade invalidation impact (read-only). */
267
+ export interface CascadeImpactResult {
268
+ rootSopId: string;
269
+ affectedSopIds: string[];
270
+ affectedCount: number;
271
+ depth: number;
272
+ }
273
+ /** Result of an executed cascade invalidation. */
274
+ export interface CascadeInvalidationResult {
275
+ rootSopId: string;
276
+ invalidatedSopIds: string[];
277
+ invalidatedCount: number;
278
+ depth: number;
279
+ }
280
+ /** Result of anti-gaming analysis on a SOP change. */
281
+ export interface AntiGamingResult {
282
+ changeClassification: ChangeClassification;
283
+ requiresElevatedApproval: boolean;
284
+ impactSummary: string;
285
+ }
286
+ /** Deviation types during plan execution. */
287
+ export type DeviationType = 'TOOL_SUBSTITUTION' | 'STEP_SKIP' | 'STEP_REORDER' | 'EXTRA_STEP' | 'PARAMETER_DRIFT';
288
+ /** A single deviation from a stored plan. */
289
+ export interface PlanDeviation {
290
+ stepIndex: number;
291
+ deviationType: DeviationType;
292
+ expectedTool?: string;
293
+ actualTool?: string;
294
+ details?: string;
295
+ }
296
+ /** Adherence score for a stored plan. */
297
+ export interface PlanAdherenceScore {
298
+ planId: string;
299
+ totalSteps: number;
300
+ completedSteps: number;
301
+ deviationCount: number;
302
+ adherencePercent: number;
303
+ }
304
+ /** A stored plan artifact. */
305
+ export interface StoredPlan {
306
+ planId: string;
307
+ workspaceId: string;
308
+ sopId: string | null;
309
+ createdBy: string;
310
+ approvedBy: string | null;
311
+ approvalTimestamp: string | null;
312
+ harnessType: string;
313
+ lifecycleState: string;
314
+ steps: Record<string, unknown>[];
315
+ executionOutcome: string | null;
316
+ deviationLog: PlanDeviation[];
317
+ approvalRationale: string | null;
318
+ }
319
+ /** Recommendation types from decision mining analysis. */
320
+ export type DecisionRecommendation = 'THRESHOLD_RELAXATION' | 'AUTO_KILL_UPGRADE' | 'SOP_REFINEMENT' | 'NO_ACTION';
321
+ /** Aggregated decision mining analysis. */
322
+ export interface DecisionMiningAnalysis {
323
+ sopId: string | null;
324
+ totalDecisions: number;
325
+ approvedRate: number;
326
+ rejectedRate: number;
327
+ recommendation: DecisionRecommendation;
328
+ }
329
+ /** Gate result from Gödel scoring. */
330
+ export type GodelGateResult = 'BLOCKED' | 'PENDING_REVIEW' | 'GENERATED';
331
+ /** Score result from the 13-category Gödel rubric. */
332
+ export interface GodelScore {
333
+ totalScore: number;
334
+ categories: Record<string, number>;
335
+ gateResult: GodelGateResult;
336
+ }
337
+ /** Diff between two proof tree versions. */
338
+ export interface ProofTreeDiff {
339
+ fromVersion: number;
340
+ toVersion: number;
341
+ addedNodes: string[];
342
+ removedNodes: string[];
343
+ modifiedNodes: string[];
344
+ }
345
+ /** Summary row of an SOP for lists in the UI. */
346
+ export interface SopSummary {
347
+ sopId: string;
348
+ title: string;
349
+ version: string;
350
+ lifecycleState: SopLifecycleState | string;
351
+ riskTier: RiskLevel | string;
352
+ complexityTier: ComplexityTier | string;
353
+ contentHash?: string;
354
+ isActive?: boolean;
355
+ createdAt?: string;
356
+ updatedAt?: string;
357
+ }
358
+ /** Paginated result from SOP listing. */
359
+ export interface SopListResult {
360
+ items: SopSummary[];
361
+ total: number;
362
+ page: number;
363
+ limit: number;
364
+ }
365
+ /** Filters for SOP query. */
366
+ export interface SopFilters {
367
+ page?: number;
368
+ limit?: number;
369
+ lifecycle_state?: string;
370
+ risk_tier?: string;
371
+ all_versions?: boolean;
372
+ }
373
+ export interface DecisionEntry {
374
+ entry_id: string;
375
+ session_id: string;
376
+ workspace_id: string;
377
+ original_tool_call: string;
378
+ hijacked_tool_call: string;
379
+ rationale: string;
380
+ status: 'PENDING_REVIEW' | 'APPROVED' | 'REJECTED' | 'PROMOTED' | string;
381
+ created_at: string | null;
382
+ }
383
+ export interface DecisionListResult {
384
+ items: DecisionEntry[];
385
+ total: number;
386
+ }
387
+ //# sourceMappingURL=sop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sop.d.ts","sourceRoot":"","sources":["../src/sop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,YAAY,CAAA;AAInB;;;;;;;;GAQG;AACH,MAAM,WAAW,GAAG;IAClB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IAEb,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAA;IAEnB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IAEb,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAA;IAEf,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAA;IAEvB,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAA;IAEnB,wCAAwC;IACxC,cAAc,EAAE,cAAc,CAAA;IAE9B,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAA;IAEjB,+BAA+B;IAC/B,cAAc,EAAE,iBAAiB,CAAA;IAEjC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IAEvB,sDAAsD;IACtD,SAAS,CAAC,EAA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GAAG,UAAU,GAAG,MAAM,CAAA;IACxE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;CACd"}
package/dist/sop.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * SOP (Standard Operating Procedure) registry types.
4
+ *
5
+ * These types correspond to the `sop_registry` table and the
6
+ * SOP proof tree structures used by the SSL (Self-Supervised Learning)
7
+ * synthesis pipeline.
8
+ *
9
+ * HLD §3.4 (SOP Registry), LLD 01-data-architecture §3.1, LLD #6
10
+ *
11
+ * @module
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.ENFORCEMENT_BY_STATE = exports.VALID_SOP_TRANSITIONS = void 0;
15
+ /**
16
+ * The 10 valid lifecycle transitions in the 7-state FSM.
17
+ *
18
+ * @see HLD §3.4 — SOP Lifecycle
19
+ */
20
+ exports.VALID_SOP_TRANSITIONS = [
21
+ { from: 'DRAFT', to: 'PENDING_REVIEW', description: 'Submit for review' },
22
+ { from: 'PENDING_REVIEW', to: 'GENERATED', description: 'Gödel score passes threshold' },
23
+ { from: 'PENDING_REVIEW', to: 'DRAFT', description: 'Return to draft for edits' },
24
+ { from: 'GENERATED', to: 'HYPOTHESIZED', description: 'Deploy in shadow mode' },
25
+ { from: 'HYPOTHESIZED', to: 'REFINED', description: 'Refine based on shadow results' },
26
+ { from: 'HYPOTHESIZED', to: 'INVALIDATED', description: 'Hypothesis disproved' },
27
+ { from: 'REFINED', to: 'VALIDATED', description: 'Promote to active enforcement' },
28
+ { from: 'REFINED', to: 'INVALIDATED', description: 'Refinement failed' },
29
+ { from: 'VALIDATED', to: 'INVALIDATED', description: 'Invalidated by cascade or manual' },
30
+ { from: 'VALIDATED', to: 'PENDING_REVIEW', description: 'Cascade invalidation triggers re-review' },
31
+ ];
32
+ /**
33
+ * Maps lifecycle state to enforcement mode.
34
+ */
35
+ exports.ENFORCEMENT_BY_STATE = {
36
+ DRAFT: 'NONE',
37
+ PENDING_REVIEW: 'NONE',
38
+ GENERATED: 'NONE',
39
+ HYPOTHESIZED: 'SHADOW',
40
+ REFINED: 'SHADOW',
41
+ VALIDATED: 'ACTIVE',
42
+ INVALIDATED: 'NONE',
43
+ };
44
+ //# sourceMappingURL=sop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sop.js","sourceRoot":"","sources":["../src/sop.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAmUH;;;;GAIG;AACU,QAAA,qBAAqB,GAA2F;IAC3H,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,EAAE;IACzE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,8BAA8B,EAAE;IACxF,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACjF,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,uBAAuB,EAAE;IAC/E,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,gCAAgC,EAAE;IACtF,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,sBAAsB,EAAE;IAChF,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,+BAA+B,EAAE;IAClF,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE;IACxE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,kCAAkC,EAAE;IACzF,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,E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