@lucern/contracts 0.1.0 → 0.1.2-alpha.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 (128) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/README.md +3 -0
  3. package/dist/agents/v1.d.ts +2 -0
  4. package/dist/agents/v1.js +3 -0
  5. package/dist/agents/v1.js.map +1 -0
  6. package/dist/api-enums.contract.d.ts +30 -29
  7. package/dist/api-enums.contract.js +145 -133
  8. package/dist/api-enums.contract.js.map +1 -1
  9. package/dist/auth-context.contract.d.ts +2 -0
  10. package/dist/auth-context.contract.js +48 -0
  11. package/dist/auth-context.contract.js.map +1 -0
  12. package/dist/auth-session.contract.d.ts +2 -54
  13. package/dist/auth-session.contract.js +41 -43
  14. package/dist/auth-session.contract.js.map +1 -1
  15. package/dist/auth.contract.d.ts +92 -0
  16. package/dist/auth.contract.js +48 -0
  17. package/dist/auth.contract.js.map +1 -0
  18. package/dist/beliefs/v1.d.ts +2 -0
  19. package/dist/beliefs/v1.js +3 -0
  20. package/dist/beliefs/v1.js.map +1 -0
  21. package/dist/context-pack.contract.d.ts +55 -54
  22. package/dist/context-pack.contract.js +88 -160
  23. package/dist/context-pack.contract.js.map +1 -1
  24. package/dist/convex-admin.contract.d.ts +7 -0
  25. package/dist/convex-admin.contract.js +3 -0
  26. package/dist/convex-admin.contract.js.map +1 -0
  27. package/dist/events-types.contract.d.ts +1 -0
  28. package/dist/events-types.contract.js +136 -0
  29. package/dist/events-types.contract.js.map +1 -0
  30. package/dist/events.contract.d.ts +178 -0
  31. package/dist/events.contract.js +136 -0
  32. package/dist/events.contract.js.map +1 -0
  33. package/dist/evidence/v1.d.ts +2 -0
  34. package/dist/evidence/v1.js +3 -0
  35. package/dist/evidence/v1.js.map +1 -0
  36. package/dist/gateway.contract.d.ts +17 -12
  37. package/dist/gateway.contract.js +11 -11
  38. package/dist/gateway.contract.js.map +1 -1
  39. package/dist/graph/v1.d.ts +2 -0
  40. package/dist/graph/v1.js +3 -0
  41. package/dist/graph/v1.js.map +1 -0
  42. package/dist/ids.contract.d.ts +9 -0
  43. package/dist/ids.contract.js +29 -0
  44. package/dist/ids.contract.js.map +1 -0
  45. package/dist/index.d.ts +15 -22
  46. package/dist/index.js +5525 -21
  47. package/dist/index.js.map +1 -1
  48. package/dist/lens-filter.contract.d.ts +10 -9
  49. package/dist/lens-filter.contract.js +59 -84
  50. package/dist/lens-filter.contract.js.map +1 -1
  51. package/dist/lens-workflow.contract.d.ts +23 -21
  52. package/dist/lens-workflow.contract.js +116 -48
  53. package/dist/lens-workflow.contract.js.map +1 -1
  54. package/dist/mcp-tools.contract-D8kXcP6d.d.ts +254 -0
  55. package/dist/mcp-tools.contract.d.ts +1 -152
  56. package/dist/mcp-tools.contract.js +2984 -3280
  57. package/dist/mcp-tools.contract.js.map +1 -1
  58. package/dist/ontologies/v1.d.ts +2 -0
  59. package/dist/ontologies/v1.js +3 -0
  60. package/dist/ontologies/v1.js.map +1 -0
  61. package/dist/ontology-matching.contract.d.ts +1 -0
  62. package/dist/ontology-matching.contract.js +346 -0
  63. package/dist/ontology-matching.contract.js.map +1 -0
  64. package/dist/prompt.contract.d.ts +5 -4
  65. package/dist/prompt.contract.js +10 -23
  66. package/dist/prompt.contract.js.map +1 -1
  67. package/dist/questions/v1.d.ts +2 -0
  68. package/dist/questions/v1.js +3 -0
  69. package/dist/questions/v1.js.map +1 -0
  70. package/dist/sdk-methods.contract.d.ts +51 -45
  71. package/dist/sdk-methods.contract.js +2 -16
  72. package/dist/sdk-methods.contract.js.map +1 -1
  73. package/dist/sdk-tools.contract-BnV0hKLp.d.ts +150 -0
  74. package/dist/sdk-tools.contract.d.ts +2 -93
  75. package/dist/sdk-tools.contract.js +4220 -1397
  76. package/dist/sdk-tools.contract.js.map +1 -1
  77. package/dist/text-matching.contract.d.ts +55 -0
  78. package/dist/text-matching.contract.js +246 -0
  79. package/dist/text-matching.contract.js.map +1 -0
  80. package/dist/topic-scope.contract.d.ts +1 -0
  81. package/dist/topic-scope.contract.js +54 -0
  82. package/dist/topic-scope.contract.js.map +1 -0
  83. package/dist/topics/v1.d.ts +2 -0
  84. package/dist/topics/v1.js +3 -0
  85. package/dist/topics/v1.js.map +1 -0
  86. package/dist/v1/agents/v1.d.ts +2 -0
  87. package/dist/v1/agents/v1.js +3 -0
  88. package/dist/v1/agents/v1.js.map +1 -0
  89. package/dist/v1/beliefs/v1.d.ts +2 -0
  90. package/dist/v1/beliefs/v1.js +3 -0
  91. package/dist/v1/beliefs/v1.js.map +1 -0
  92. package/dist/v1/evidence/v1.d.ts +2 -0
  93. package/dist/v1/evidence/v1.js +3 -0
  94. package/dist/v1/evidence/v1.js.map +1 -0
  95. package/dist/v1/graph/v1.d.ts +2 -0
  96. package/dist/v1/graph/v1.js +3 -0
  97. package/dist/v1/graph/v1.js.map +1 -0
  98. package/dist/v1/ontologies/v1.d.ts +78 -0
  99. package/dist/v1/ontologies/v1.js +346 -0
  100. package/dist/v1/ontologies/v1.js.map +1 -0
  101. package/dist/v1/questions/v1.d.ts +2 -0
  102. package/dist/v1/questions/v1.js +3 -0
  103. package/dist/v1/questions/v1.js.map +1 -0
  104. package/dist/v1/topics/v1.d.ts +21 -0
  105. package/dist/v1/topics/v1.js +54 -0
  106. package/dist/v1/topics/v1.js.map +1 -0
  107. package/dist/v1/worktrees/v1.d.ts +2 -0
  108. package/dist/v1/worktrees/v1.js +3 -0
  109. package/dist/v1/worktrees/v1.js.map +1 -0
  110. package/dist/workflow-runtime.contract.d.ts +46 -45
  111. package/dist/workflow-runtime.contract.js +228 -241
  112. package/dist/workflow-runtime.contract.js.map +1 -1
  113. package/dist/worktrees/v1.d.ts +2 -0
  114. package/dist/worktrees/v1.js +3 -0
  115. package/dist/worktrees/v1.js.map +1 -0
  116. package/package.json +19 -13
  117. package/dist/api-enums.contract.d.ts.map +0 -1
  118. package/dist/auth-session.contract.d.ts.map +0 -1
  119. package/dist/context-pack.contract.d.ts.map +0 -1
  120. package/dist/gateway.contract.d.ts.map +0 -1
  121. package/dist/index.d.ts.map +0 -1
  122. package/dist/lens-filter.contract.d.ts.map +0 -1
  123. package/dist/lens-workflow.contract.d.ts.map +0 -1
  124. package/dist/mcp-tools.contract.d.ts.map +0 -1
  125. package/dist/prompt.contract.d.ts.map +0 -1
  126. package/dist/sdk-methods.contract.d.ts.map +0 -1
  127. package/dist/sdk-tools.contract.d.ts.map +0 -1
  128. package/dist/workflow-runtime.contract.d.ts.map +0 -1
@@ -15,58 +15,58 @@
15
15
  * - Reclassifying a mutation tier is BREAKING
16
16
  * - Changing canonical workflow IDs is BREAKING
17
17
  */
18
- export declare const WORKFLOW_RUNTIME_SCHEMA_VERSION: "1.0.0";
19
- export declare const WORKFLOW_MUTATION_TIERS: readonly ["read_only", "low_risk_write", "high_risk_write"];
20
- export type WorkflowMutationTier = (typeof WORKFLOW_MUTATION_TIERS)[number];
21
- export declare const WORKFLOW_APPROVAL_MODES: readonly ["none", "audit_only", "human_required", "auto_approve"];
22
- export type WorkflowApprovalMode = (typeof WORKFLOW_APPROVAL_MODES)[number];
23
- export declare const DEFAULT_TIER_APPROVAL_MODE: Readonly<Record<WorkflowMutationTier, WorkflowApprovalMode>>;
24
- export declare const WORKFLOW_ACTION_KINDS: readonly ["context_pack", "integrity_check", "lucern_tool", "report_compile", "brief_publish", "notification", "custom"];
25
- export type WorkflowActionKind = (typeof WORKFLOW_ACTION_KINDS)[number];
26
- export declare const WORKFLOW_HOOK_EVENTS: readonly ["schedule.tick", "worktree.activated", "worktree.completed", "question.created", "question.answered", "evidence.appended", "inbox.item_created"];
27
- export type WorkflowHookEvent = (typeof WORKFLOW_HOOK_EVENTS)[number];
28
- export declare const WORKFLOW_OUTPUT_KINDS: readonly ["engineering_brief", "research_memo", "strategy_artifact", "inbox_summary", "pipeline_brief", "structured_payload"];
29
- export type WorkflowOutputKind = (typeof WORKFLOW_OUTPUT_KINDS)[number];
30
- export declare const WORKFLOW_RUN_STATUSES: readonly ["queued", "running", "awaiting_approval", "completed", "failed", "cancelled"];
31
- export type WorkflowRunStatus = (typeof WORKFLOW_RUN_STATUSES)[number];
32
- export declare const WORKFLOW_TRIGGER_KINDS: readonly ["manual", "schedule", "hook"];
33
- export type WorkflowTriggerKind = (typeof WORKFLOW_TRIGGER_KINDS)[number];
34
- export declare const WORKFLOW_PROOF_ARTIFACT_KINDS: readonly ["report", "brief", "artifact", "dashboard", "test_evidence"];
35
- export type WorkflowProofArtifactKind = (typeof WORKFLOW_PROOF_ARTIFACT_KINDS)[number];
36
- export declare const WORKFLOW_STAFFING_HINTS: readonly ["solo", "backend+tests", "fullstack", "mcp+tests"];
37
- export type WorkflowStaffingHint = (typeof WORKFLOW_STAFFING_HINTS)[number];
38
- export declare const WORKFLOW_AUTO_FIX_MODES: readonly ["disabled", "dry_run", "safe", "aggressive"];
39
- export type WorkflowAutoFixMode = (typeof WORKFLOW_AUTO_FIX_MODES)[number];
40
- export declare const WORKFLOW_INTEGRITY_CHECKS: readonly ["null_dependency_refs", "superseded_blockers", "band_order_inconsistency", "sparse_shaping", "failed_completed_gate"];
41
- export type WorkflowIntegrityCheckId = (typeof WORKFLOW_INTEGRITY_CHECKS)[number];
42
- export type WorkflowProofArtifact = {
18
+ declare const WORKFLOW_RUNTIME_SCHEMA_VERSION: "1.0.0";
19
+ declare const WORKFLOW_MUTATION_TIERS: readonly ["read_only", "low_risk_write", "high_risk_write"];
20
+ type WorkflowMutationTier = (typeof WORKFLOW_MUTATION_TIERS)[number];
21
+ declare const WORKFLOW_APPROVAL_MODES: readonly ["none", "audit_only", "human_required", "auto_approve"];
22
+ type WorkflowApprovalMode = (typeof WORKFLOW_APPROVAL_MODES)[number];
23
+ declare const DEFAULT_TIER_APPROVAL_MODE: Readonly<Record<WorkflowMutationTier, WorkflowApprovalMode>>;
24
+ declare const WORKFLOW_ACTION_KINDS: readonly ["context_pack", "integrity_check", "lucern_tool", "report_compile", "brief_publish", "notification", "custom"];
25
+ type WorkflowActionKind = (typeof WORKFLOW_ACTION_KINDS)[number];
26
+ declare const WORKFLOW_HOOK_EVENTS: readonly ["schedule.tick", "worktree.activated", "worktree.completed", "question.created", "question.answered", "evidence.appended", "inbox.item_created"];
27
+ type WorkflowHookEvent = (typeof WORKFLOW_HOOK_EVENTS)[number];
28
+ declare const WORKFLOW_OUTPUT_KINDS: readonly ["engineering_brief", "research_memo", "strategy_artifact", "inbox_summary", "pipeline_brief", "structured_payload"];
29
+ type WorkflowOutputKind = (typeof WORKFLOW_OUTPUT_KINDS)[number];
30
+ declare const WORKFLOW_RUN_STATUSES: readonly ["queued", "running", "awaiting_approval", "completed", "failed", "cancelled"];
31
+ type WorkflowRunStatus = (typeof WORKFLOW_RUN_STATUSES)[number];
32
+ declare const WORKFLOW_TRIGGER_KINDS: readonly ["manual", "schedule", "hook"];
33
+ type WorkflowTriggerKind = (typeof WORKFLOW_TRIGGER_KINDS)[number];
34
+ declare const WORKFLOW_PROOF_ARTIFACT_KINDS: readonly ["report", "brief", "artifact", "dashboard", "test_evidence"];
35
+ type WorkflowProofArtifactKind = (typeof WORKFLOW_PROOF_ARTIFACT_KINDS)[number];
36
+ declare const WORKFLOW_STAFFING_HINTS: readonly ["solo", "backend+tests", "fullstack", "mcp+tests"];
37
+ type WorkflowStaffingHint = (typeof WORKFLOW_STAFFING_HINTS)[number];
38
+ declare const WORKFLOW_AUTO_FIX_MODES: readonly ["disabled", "dry_run", "safe", "aggressive"];
39
+ type WorkflowAutoFixMode = (typeof WORKFLOW_AUTO_FIX_MODES)[number];
40
+ declare const WORKFLOW_INTEGRITY_CHECKS: readonly ["null_dependency_refs", "superseded_blockers", "band_order_inconsistency", "sparse_shaping", "failed_completed_gate"];
41
+ type WorkflowIntegrityCheckId = (typeof WORKFLOW_INTEGRITY_CHECKS)[number];
42
+ type WorkflowProofArtifact = {
43
43
  kind: WorkflowProofArtifactKind;
44
44
  label: string;
45
45
  required?: boolean;
46
46
  sourceRef?: string;
47
47
  };
48
- export type WorkflowAutoFixPolicy = {
48
+ type WorkflowAutoFixPolicy = {
49
49
  mode: WorkflowAutoFixMode;
50
50
  maxActionsPerRun?: number;
51
51
  permittedMutationTiers?: WorkflowMutationTier[];
52
52
  requireAuditTrail?: boolean;
53
53
  escalationGate?: string;
54
54
  };
55
- export declare const DEFAULT_WORKFLOW_AUTO_FIX_POLICY: WorkflowAutoFixPolicy;
56
- export type WorkflowApprovalPolicy = {
55
+ declare const DEFAULT_WORKFLOW_AUTO_FIX_POLICY: WorkflowAutoFixPolicy;
56
+ type WorkflowApprovalPolicy = {
57
57
  mode: WorkflowApprovalMode;
58
58
  approvalGate?: string;
59
59
  autoApprovePolicyKey?: string;
60
60
  rationaleRequired?: boolean;
61
61
  };
62
- export type WorkflowOutputBase = {
62
+ type WorkflowOutputBase = {
63
63
  outputId: string;
64
64
  kind: WorkflowOutputKind;
65
65
  title: string;
66
66
  summary: string;
67
67
  generatedAt?: number;
68
68
  };
69
- export type EngineeringBriefOutput = WorkflowOutputBase & {
69
+ type EngineeringBriefOutput = WorkflowOutputBase & {
70
70
  kind: "engineering_brief";
71
71
  sections: Array<{
72
72
  heading: string;
@@ -74,23 +74,23 @@ export type EngineeringBriefOutput = WorkflowOutputBase & {
74
74
  }>;
75
75
  touchedPaths?: string[];
76
76
  };
77
- export type ResearchMemoOutput = WorkflowOutputBase & {
77
+ type ResearchMemoOutput = WorkflowOutputBase & {
78
78
  kind: "research_memo";
79
79
  claims: string[];
80
80
  evidenceRefs?: string[];
81
81
  };
82
- export type StrategyArtifactOutput = WorkflowOutputBase & {
82
+ type StrategyArtifactOutput = WorkflowOutputBase & {
83
83
  kind: "strategy_artifact";
84
84
  recommendations: string[];
85
85
  decisionWindow?: string;
86
86
  };
87
- export type InboxSummaryOutput = WorkflowOutputBase & {
87
+ type InboxSummaryOutput = WorkflowOutputBase & {
88
88
  kind: "inbox_summary";
89
89
  channel: "developer_portal" | "chat" | "ops";
90
90
  inboxTitle: string;
91
91
  inboxBody: string;
92
92
  };
93
- export type PipelineBriefOutput = WorkflowOutputBase & {
93
+ type PipelineBriefOutput = WorkflowOutputBase & {
94
94
  kind: "pipeline_brief";
95
95
  hingeWorktreeId?: string;
96
96
  groupedBlockers: Array<{
@@ -98,12 +98,12 @@ export type PipelineBriefOutput = WorkflowOutputBase & {
98
98
  blockedWorktreeIds: string[];
99
99
  }>;
100
100
  };
101
- export type StructuredPayloadOutput = WorkflowOutputBase & {
101
+ type StructuredPayloadOutput = WorkflowOutputBase & {
102
102
  kind: "structured_payload";
103
103
  payload: Record<string, unknown>;
104
104
  };
105
- export type WorkflowOutputContract = EngineeringBriefOutput | ResearchMemoOutput | StrategyArtifactOutput | InboxSummaryOutput | PipelineBriefOutput | StructuredPayloadOutput;
106
- export type WorkflowActionContract = {
105
+ type WorkflowOutputContract = EngineeringBriefOutput | ResearchMemoOutput | StrategyArtifactOutput | InboxSummaryOutput | PipelineBriefOutput | StructuredPayloadOutput;
106
+ type WorkflowActionContract = {
107
107
  actionId: string;
108
108
  kind: WorkflowActionKind;
109
109
  title: string;
@@ -114,14 +114,14 @@ export type WorkflowActionContract = {
114
114
  idempotent?: boolean;
115
115
  approval: WorkflowApprovalPolicy;
116
116
  };
117
- export type WorkflowHookContract = {
117
+ type WorkflowHookContract = {
118
118
  hookId: string;
119
119
  event: WorkflowHookEvent;
120
120
  description: string;
121
121
  condition?: string;
122
122
  actionIds: string[];
123
123
  };
124
- export type WorkflowTriggerContract = {
124
+ type WorkflowTriggerContract = {
125
125
  kind: "manual";
126
126
  description?: string;
127
127
  } | {
@@ -132,7 +132,7 @@ export type WorkflowTriggerContract = {
132
132
  kind: "hook";
133
133
  event: WorkflowHookEvent;
134
134
  };
135
- export type WorkflowDefinitionV1 = {
135
+ type WorkflowDefinitionV1 = {
136
136
  workflowId: string;
137
137
  version: typeof WORKFLOW_RUNTIME_SCHEMA_VERSION;
138
138
  title: string;
@@ -146,7 +146,7 @@ export type WorkflowDefinitionV1 = {
146
146
  outputs: readonly WorkflowOutputKind[];
147
147
  integrityChecks?: readonly WorkflowIntegrityCheckId[];
148
148
  };
149
- export type WorkflowRunReceiptV1 = {
149
+ type WorkflowRunReceiptV1 = {
150
150
  runId: string;
151
151
  workflowId: string;
152
152
  status: WorkflowRunStatus;
@@ -156,7 +156,8 @@ export type WorkflowRunReceiptV1 = {
156
156
  outputKinds: WorkflowOutputKind[];
157
157
  approvalsRequired?: number;
158
158
  };
159
- export declare const NIGHTLY_RECONCILIATION_WORKFLOW_ID: "workflow.pipeline_reconciliation.v1";
160
- export declare const MORNING_BRIEF_WORKFLOW_ID: "workflow.morning_brief.v1";
161
- export declare const CANONICAL_WORKFLOW_DEFINITIONS: readonly WorkflowDefinitionV1[];
162
- //# sourceMappingURL=workflow-runtime.contract.d.ts.map
159
+ declare const NIGHTLY_RECONCILIATION_WORKFLOW_ID: "workflow.pipeline_reconciliation.v1";
160
+ declare const MORNING_BRIEF_WORKFLOW_ID: "workflow.morning_brief.v1";
161
+ declare const CANONICAL_WORKFLOW_DEFINITIONS: readonly WorkflowDefinitionV1[];
162
+
163
+ export { CANONICAL_WORKFLOW_DEFINITIONS, DEFAULT_TIER_APPROVAL_MODE, DEFAULT_WORKFLOW_AUTO_FIX_POLICY, type EngineeringBriefOutput, type InboxSummaryOutput, MORNING_BRIEF_WORKFLOW_ID, NIGHTLY_RECONCILIATION_WORKFLOW_ID, type PipelineBriefOutput, type ResearchMemoOutput, type StrategyArtifactOutput, type StructuredPayloadOutput, WORKFLOW_ACTION_KINDS, WORKFLOW_APPROVAL_MODES, WORKFLOW_AUTO_FIX_MODES, WORKFLOW_HOOK_EVENTS, WORKFLOW_INTEGRITY_CHECKS, WORKFLOW_MUTATION_TIERS, WORKFLOW_OUTPUT_KINDS, WORKFLOW_PROOF_ARTIFACT_KINDS, WORKFLOW_RUNTIME_SCHEMA_VERSION, WORKFLOW_RUN_STATUSES, WORKFLOW_STAFFING_HINTS, WORKFLOW_TRIGGER_KINDS, type WorkflowActionContract, type WorkflowActionKind, type WorkflowApprovalMode, type WorkflowApprovalPolicy, type WorkflowAutoFixMode, type WorkflowAutoFixPolicy, type WorkflowDefinitionV1, type WorkflowHookContract, type WorkflowHookEvent, type WorkflowIntegrityCheckId, type WorkflowMutationTier, type WorkflowOutputBase, type WorkflowOutputContract, type WorkflowOutputKind, type WorkflowProofArtifact, type WorkflowProofArtifactKind, type WorkflowRunReceiptV1, type WorkflowRunStatus, type WorkflowStaffingHint, type WorkflowTriggerContract, type WorkflowTriggerKind };
@@ -1,258 +1,245 @@
1
- /**
2
- * Workflow Runtime Contract v1
3
- *
4
- * Canonical TypeScript contract for Lucern's graph-local workflow runtime.
5
- * WF-1 defines the typed substrate for:
6
- * - workflow definitions and run receipts
7
- * - action mutation tiering and approval expectations
8
- * - hooks over worktree/question/evidence/inbox events
9
- * - output unions for domain-specific artifacts
10
- * - deterministic integrity checks and operational metadata
11
- *
12
- * BREAKING CHANGE RULES:
13
- * - Adding optional fields is NON-breaking
14
- * - Removing fields or renaming enum values is BREAKING
15
- * - Reclassifying a mutation tier is BREAKING
16
- * - Changing canonical workflow IDs is BREAKING
17
- */
18
- export const WORKFLOW_RUNTIME_SCHEMA_VERSION = "1.0.0";
19
- export const WORKFLOW_MUTATION_TIERS = [
20
- "read_only",
21
- "low_risk_write",
22
- "high_risk_write",
1
+ // src/workflow-runtime.contract.ts
2
+ var WORKFLOW_RUNTIME_SCHEMA_VERSION = "1.0.0";
3
+ var WORKFLOW_MUTATION_TIERS = [
4
+ "read_only",
5
+ "low_risk_write",
6
+ "high_risk_write"
23
7
  ];
24
- export const WORKFLOW_APPROVAL_MODES = [
25
- "none",
26
- "audit_only",
27
- "human_required",
28
- "auto_approve",
8
+ var WORKFLOW_APPROVAL_MODES = [
9
+ "none",
10
+ "audit_only",
11
+ "human_required",
12
+ "auto_approve"
29
13
  ];
30
- export const DEFAULT_TIER_APPROVAL_MODE = {
31
- read_only: "none",
32
- low_risk_write: "audit_only",
33
- high_risk_write: "human_required",
14
+ var DEFAULT_TIER_APPROVAL_MODE = {
15
+ read_only: "none",
16
+ low_risk_write: "audit_only",
17
+ high_risk_write: "human_required"
34
18
  };
35
- export const WORKFLOW_ACTION_KINDS = [
36
- "context_pack",
37
- "integrity_check",
38
- "lucern_tool",
39
- "report_compile",
40
- "brief_publish",
41
- "notification",
42
- "custom",
19
+ var WORKFLOW_ACTION_KINDS = [
20
+ "context_pack",
21
+ "integrity_check",
22
+ "lucern_tool",
23
+ "report_compile",
24
+ "brief_publish",
25
+ "notification",
26
+ "custom"
43
27
  ];
44
- export const WORKFLOW_HOOK_EVENTS = [
45
- "schedule.tick",
46
- "worktree.activated",
47
- "worktree.completed",
48
- "question.created",
49
- "question.answered",
50
- "evidence.appended",
51
- "inbox.item_created",
28
+ var WORKFLOW_HOOK_EVENTS = [
29
+ "schedule.tick",
30
+ "worktree.activated",
31
+ "worktree.completed",
32
+ "question.created",
33
+ "question.answered",
34
+ "evidence.appended",
35
+ "inbox.item_created"
52
36
  ];
53
- export const WORKFLOW_OUTPUT_KINDS = [
54
- "engineering_brief",
55
- "research_memo",
56
- "strategy_artifact",
57
- "inbox_summary",
58
- "pipeline_brief",
59
- "structured_payload",
37
+ var WORKFLOW_OUTPUT_KINDS = [
38
+ "engineering_brief",
39
+ "research_memo",
40
+ "strategy_artifact",
41
+ "inbox_summary",
42
+ "pipeline_brief",
43
+ "structured_payload"
60
44
  ];
61
- export const WORKFLOW_RUN_STATUSES = [
62
- "queued",
63
- "running",
64
- "awaiting_approval",
65
- "completed",
66
- "failed",
67
- "cancelled",
45
+ var WORKFLOW_RUN_STATUSES = [
46
+ "queued",
47
+ "running",
48
+ "awaiting_approval",
49
+ "completed",
50
+ "failed",
51
+ "cancelled"
68
52
  ];
69
- export const WORKFLOW_TRIGGER_KINDS = [
70
- "manual",
71
- "schedule",
72
- "hook",
53
+ var WORKFLOW_TRIGGER_KINDS = [
54
+ "manual",
55
+ "schedule",
56
+ "hook"
73
57
  ];
74
- export const WORKFLOW_PROOF_ARTIFACT_KINDS = [
75
- "report",
76
- "brief",
77
- "artifact",
78
- "dashboard",
79
- "test_evidence",
58
+ var WORKFLOW_PROOF_ARTIFACT_KINDS = [
59
+ "report",
60
+ "brief",
61
+ "artifact",
62
+ "dashboard",
63
+ "test_evidence"
80
64
  ];
81
- export const WORKFLOW_STAFFING_HINTS = [
82
- "solo",
83
- "backend+tests",
84
- "fullstack",
85
- "mcp+tests",
65
+ var WORKFLOW_STAFFING_HINTS = [
66
+ "solo",
67
+ "backend+tests",
68
+ "fullstack",
69
+ "mcp+tests"
86
70
  ];
87
- export const WORKFLOW_AUTO_FIX_MODES = [
88
- "disabled",
89
- "dry_run",
90
- "safe",
91
- "aggressive",
71
+ var WORKFLOW_AUTO_FIX_MODES = [
72
+ "disabled",
73
+ "dry_run",
74
+ "safe",
75
+ "aggressive"
92
76
  ];
93
- export const WORKFLOW_INTEGRITY_CHECKS = [
94
- "null_dependency_refs",
95
- "superseded_blockers",
96
- "band_order_inconsistency",
97
- "sparse_shaping",
98
- "failed_completed_gate",
77
+ var WORKFLOW_INTEGRITY_CHECKS = [
78
+ "null_dependency_refs",
79
+ "superseded_blockers",
80
+ "band_order_inconsistency",
81
+ "sparse_shaping",
82
+ "failed_completed_gate"
99
83
  ];
100
- export const DEFAULT_WORKFLOW_AUTO_FIX_POLICY = {
101
- mode: "disabled",
102
- permittedMutationTiers: ["read_only"],
103
- requireAuditTrail: true,
84
+ var DEFAULT_WORKFLOW_AUTO_FIX_POLICY = {
85
+ mode: "disabled",
86
+ permittedMutationTiers: ["read_only"],
87
+ requireAuditTrail: true
104
88
  };
105
- export const NIGHTLY_RECONCILIATION_WORKFLOW_ID = "workflow.pipeline_reconciliation.v1";
106
- export const MORNING_BRIEF_WORKFLOW_ID = "workflow.morning_brief.v1";
107
- export const CANONICAL_WORKFLOW_DEFINITIONS = [
108
- {
109
- workflowId: NIGHTLY_RECONCILIATION_WORKFLOW_ID,
110
- version: WORKFLOW_RUNTIME_SCHEMA_VERSION,
111
- title: "Nightly Pipeline Reconciliation",
112
- description: "Runs deterministic integrity checks, compiles pipeline state, and emits an operator-facing reconciliation brief.",
113
- trigger: {
114
- kind: "schedule",
115
- cadence: "daily",
116
- timezone: "America/New_York",
117
- },
118
- staffingHint: "backend+tests",
119
- proofArtifacts: [
120
- {
121
- kind: "report",
122
- label: "Pipeline reconciliation report",
123
- required: true,
124
- },
125
- {
126
- kind: "test_evidence",
127
- label: "Integrity check receipt",
128
- required: true,
129
- },
130
- ],
131
- autoFixPolicy: {
132
- mode: "safe",
133
- maxActionsPerRun: 5,
134
- permittedMutationTiers: ["read_only", "low_risk_write"],
135
- requireAuditTrail: true,
136
- escalationGate: "gate:workflow-runtime-contract-live",
137
- },
138
- actions: [
139
- {
140
- actionId: "compile_context_pack",
141
- kind: "context_pack",
142
- title: "Compile pipeline context",
143
- description: "Build the ranked context needed for deterministic checks.",
144
- mutationTier: "read_only",
145
- produces: ["structured_payload"],
146
- idempotent: true,
147
- approval: { mode: "none" },
148
- },
149
- {
150
- actionId: "run_integrity_checks",
151
- kind: "integrity_check",
152
- title: "Run integrity checks",
153
- description: "Evaluate dependency references, blockers, execution bands, shaping coverage, and completed gates.",
154
- mutationTier: "read_only",
155
- produces: ["structured_payload"],
156
- idempotent: true,
157
- approval: { mode: "none" },
158
- },
159
- {
160
- actionId: "record_followup_questions",
161
- kind: "lucern_tool",
162
- title: "Record follow-up questions",
163
- description: "Create or reopen operator-facing questions for integrity failures that require human review.",
164
- mutationTier: "low_risk_write",
165
- toolName: "create_question",
166
- produces: ["pipeline_brief"],
167
- approval: { mode: "audit_only", rationaleRequired: true },
168
- },
169
- {
170
- actionId: "publish_reconciliation_brief",
171
- kind: "brief_publish",
172
- title: "Publish reconciliation brief",
173
- description: "Emit an inbox-routed brief summarizing the nightly pipeline state and grouped blockers.",
174
- mutationTier: "low_risk_write",
175
- produces: ["pipeline_brief", "inbox_summary"],
176
- approval: { mode: "audit_only" },
177
- },
178
- ],
179
- hooks: [
180
- {
181
- hookId: "nightly-schedule",
182
- event: "schedule.tick",
183
- description: "Run once per nightly cadence.",
184
- actionIds: [
185
- "compile_context_pack",
186
- "run_integrity_checks",
187
- "record_followup_questions",
188
- "publish_reconciliation_brief",
189
- ],
190
- },
191
- ],
192
- outputs: ["pipeline_brief", "inbox_summary", "structured_payload"],
193
- integrityChecks: WORKFLOW_INTEGRITY_CHECKS,
89
+ var NIGHTLY_RECONCILIATION_WORKFLOW_ID = "workflow.pipeline_reconciliation.v1";
90
+ var MORNING_BRIEF_WORKFLOW_ID = "workflow.morning_brief.v1";
91
+ var CANONICAL_WORKFLOW_DEFINITIONS = [
92
+ {
93
+ workflowId: NIGHTLY_RECONCILIATION_WORKFLOW_ID,
94
+ version: WORKFLOW_RUNTIME_SCHEMA_VERSION,
95
+ title: "Nightly Pipeline Reconciliation",
96
+ description: "Runs deterministic integrity checks, compiles pipeline state, and emits an operator-facing reconciliation brief.",
97
+ trigger: {
98
+ kind: "schedule",
99
+ cadence: "daily",
100
+ timezone: "America/New_York"
194
101
  },
195
- {
196
- workflowId: MORNING_BRIEF_WORKFLOW_ID,
197
- version: WORKFLOW_RUNTIME_SCHEMA_VERSION,
198
- title: "Morning Brief",
199
- description: "Compiles a developer-facing morning brief from graph state, overnight workflow outputs, and inbox routing preferences.",
200
- trigger: {
201
- kind: "schedule",
202
- cadence: "daily",
203
- timezone: "America/New_York",
204
- },
205
- staffingHint: "solo",
206
- proofArtifacts: [
207
- {
208
- kind: "brief",
209
- label: "Morning brief",
210
- required: true,
211
- },
212
- ],
213
- autoFixPolicy: {
214
- mode: "dry_run",
215
- maxActionsPerRun: 1,
216
- permittedMutationTiers: ["read_only", "low_risk_write"],
217
- requireAuditTrail: true,
218
- },
219
- actions: [
220
- {
221
- actionId: "compile_brief_inputs",
222
- kind: "context_pack",
223
- title: "Compile brief inputs",
224
- description: "Read graph state, worktree state, and overnight workflow receipts.",
225
- mutationTier: "read_only",
226
- produces: ["structured_payload"],
227
- idempotent: true,
228
- approval: { mode: "none" },
229
- },
230
- {
231
- actionId: "publish_morning_brief",
232
- kind: "brief_publish",
233
- title: "Publish morning brief",
234
- description: "Publish a typed inbox summary with prioritized worktree and question context.",
235
- mutationTier: "low_risk_write",
236
- produces: ["engineering_brief", "inbox_summary"],
237
- approval: { mode: "audit_only" },
238
- },
239
- ],
240
- hooks: [
241
- {
242
- hookId: "morning-schedule",
243
- event: "schedule.tick",
244
- description: "Run once per morning cadence.",
245
- actionIds: ["compile_brief_inputs", "publish_morning_brief"],
246
- },
247
- {
248
- hookId: "worktree-complete-refresh",
249
- event: "worktree.completed",
250
- description: "Refresh the queued morning brief inputs when worktree outcomes land overnight.",
251
- actionIds: ["compile_brief_inputs"],
252
- },
253
- ],
254
- outputs: ["engineering_brief", "inbox_summary", "structured_payload"],
255
- integrityChecks: ["sparse_shaping"],
102
+ staffingHint: "backend+tests",
103
+ proofArtifacts: [
104
+ {
105
+ kind: "report",
106
+ label: "Pipeline reconciliation report",
107
+ required: true
108
+ },
109
+ {
110
+ kind: "test_evidence",
111
+ label: "Integrity check receipt",
112
+ required: true
113
+ }
114
+ ],
115
+ autoFixPolicy: {
116
+ mode: "safe",
117
+ maxActionsPerRun: 5,
118
+ permittedMutationTiers: ["read_only", "low_risk_write"],
119
+ requireAuditTrail: true,
120
+ escalationGate: "gate:workflow-runtime-contract-live"
256
121
  },
122
+ actions: [
123
+ {
124
+ actionId: "compile_context_pack",
125
+ kind: "context_pack",
126
+ title: "Compile pipeline context",
127
+ description: "Build the ranked context needed for deterministic checks.",
128
+ mutationTier: "read_only",
129
+ produces: ["structured_payload"],
130
+ idempotent: true,
131
+ approval: { mode: "none" }
132
+ },
133
+ {
134
+ actionId: "run_integrity_checks",
135
+ kind: "integrity_check",
136
+ title: "Run integrity checks",
137
+ description: "Evaluate dependency references, blockers, execution bands, shaping coverage, and completed gates.",
138
+ mutationTier: "read_only",
139
+ produces: ["structured_payload"],
140
+ idempotent: true,
141
+ approval: { mode: "none" }
142
+ },
143
+ {
144
+ actionId: "record_followup_questions",
145
+ kind: "lucern_tool",
146
+ title: "Record follow-up questions",
147
+ description: "Create or reopen operator-facing questions for integrity failures that require human review.",
148
+ mutationTier: "low_risk_write",
149
+ toolName: "create_question",
150
+ produces: ["pipeline_brief"],
151
+ approval: { mode: "audit_only", rationaleRequired: true }
152
+ },
153
+ {
154
+ actionId: "publish_reconciliation_brief",
155
+ kind: "brief_publish",
156
+ title: "Publish reconciliation brief",
157
+ description: "Emit an inbox-routed brief summarizing the nightly pipeline state and grouped blockers.",
158
+ mutationTier: "low_risk_write",
159
+ produces: ["pipeline_brief", "inbox_summary"],
160
+ approval: { mode: "audit_only" }
161
+ }
162
+ ],
163
+ hooks: [
164
+ {
165
+ hookId: "nightly-schedule",
166
+ event: "schedule.tick",
167
+ description: "Run once per nightly cadence.",
168
+ actionIds: [
169
+ "compile_context_pack",
170
+ "run_integrity_checks",
171
+ "record_followup_questions",
172
+ "publish_reconciliation_brief"
173
+ ]
174
+ }
175
+ ],
176
+ outputs: ["pipeline_brief", "inbox_summary", "structured_payload"],
177
+ integrityChecks: WORKFLOW_INTEGRITY_CHECKS
178
+ },
179
+ {
180
+ workflowId: MORNING_BRIEF_WORKFLOW_ID,
181
+ version: WORKFLOW_RUNTIME_SCHEMA_VERSION,
182
+ title: "Morning Brief",
183
+ description: "Compiles a developer-facing morning brief from graph state, overnight workflow outputs, and inbox routing preferences.",
184
+ trigger: {
185
+ kind: "schedule",
186
+ cadence: "daily",
187
+ timezone: "America/New_York"
188
+ },
189
+ staffingHint: "solo",
190
+ proofArtifacts: [
191
+ {
192
+ kind: "brief",
193
+ label: "Morning brief",
194
+ required: true
195
+ }
196
+ ],
197
+ autoFixPolicy: {
198
+ mode: "dry_run",
199
+ maxActionsPerRun: 1,
200
+ permittedMutationTiers: ["read_only", "low_risk_write"],
201
+ requireAuditTrail: true
202
+ },
203
+ actions: [
204
+ {
205
+ actionId: "compile_brief_inputs",
206
+ kind: "context_pack",
207
+ title: "Compile brief inputs",
208
+ description: "Read graph state, worktree state, and overnight workflow receipts.",
209
+ mutationTier: "read_only",
210
+ produces: ["structured_payload"],
211
+ idempotent: true,
212
+ approval: { mode: "none" }
213
+ },
214
+ {
215
+ actionId: "publish_morning_brief",
216
+ kind: "brief_publish",
217
+ title: "Publish morning brief",
218
+ description: "Publish a typed inbox summary with prioritized worktree and question context.",
219
+ mutationTier: "low_risk_write",
220
+ produces: ["engineering_brief", "inbox_summary"],
221
+ approval: { mode: "audit_only" }
222
+ }
223
+ ],
224
+ hooks: [
225
+ {
226
+ hookId: "morning-schedule",
227
+ event: "schedule.tick",
228
+ description: "Run once per morning cadence.",
229
+ actionIds: ["compile_brief_inputs", "publish_morning_brief"]
230
+ },
231
+ {
232
+ hookId: "worktree-complete-refresh",
233
+ event: "worktree.completed",
234
+ description: "Refresh the queued morning brief inputs when worktree outcomes land overnight.",
235
+ actionIds: ["compile_brief_inputs"]
236
+ }
237
+ ],
238
+ outputs: ["engineering_brief", "inbox_summary", "structured_payload"],
239
+ integrityChecks: ["sparse_shaping"]
240
+ }
257
241
  ];
242
+
243
+ export { CANONICAL_WORKFLOW_DEFINITIONS, DEFAULT_TIER_APPROVAL_MODE, DEFAULT_WORKFLOW_AUTO_FIX_POLICY, MORNING_BRIEF_WORKFLOW_ID, NIGHTLY_RECONCILIATION_WORKFLOW_ID, WORKFLOW_ACTION_KINDS, WORKFLOW_APPROVAL_MODES, WORKFLOW_AUTO_FIX_MODES, WORKFLOW_HOOK_EVENTS, WORKFLOW_INTEGRITY_CHECKS, WORKFLOW_MUTATION_TIERS, WORKFLOW_OUTPUT_KINDS, WORKFLOW_PROOF_ARTIFACT_KINDS, WORKFLOW_RUNTIME_SCHEMA_VERSION, WORKFLOW_RUN_STATUSES, WORKFLOW_STAFFING_HINTS, WORKFLOW_TRIGGER_KINDS };
244
+ //# sourceMappingURL=workflow-runtime.contract.js.map
258
245
  //# sourceMappingURL=workflow-runtime.contract.js.map