@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.
- package/CHANGELOG.md +3 -0
- package/README.md +3 -0
- package/dist/agents/v1.d.ts +2 -0
- package/dist/agents/v1.js +3 -0
- package/dist/agents/v1.js.map +1 -0
- package/dist/api-enums.contract.d.ts +30 -29
- package/dist/api-enums.contract.js +145 -133
- package/dist/api-enums.contract.js.map +1 -1
- package/dist/auth-context.contract.d.ts +2 -0
- package/dist/auth-context.contract.js +48 -0
- package/dist/auth-context.contract.js.map +1 -0
- package/dist/auth-session.contract.d.ts +2 -54
- package/dist/auth-session.contract.js +41 -43
- package/dist/auth-session.contract.js.map +1 -1
- package/dist/auth.contract.d.ts +92 -0
- package/dist/auth.contract.js +48 -0
- package/dist/auth.contract.js.map +1 -0
- package/dist/beliefs/v1.d.ts +2 -0
- package/dist/beliefs/v1.js +3 -0
- package/dist/beliefs/v1.js.map +1 -0
- package/dist/context-pack.contract.d.ts +55 -54
- package/dist/context-pack.contract.js +88 -160
- package/dist/context-pack.contract.js.map +1 -1
- package/dist/convex-admin.contract.d.ts +7 -0
- package/dist/convex-admin.contract.js +3 -0
- package/dist/convex-admin.contract.js.map +1 -0
- package/dist/events-types.contract.d.ts +1 -0
- package/dist/events-types.contract.js +136 -0
- package/dist/events-types.contract.js.map +1 -0
- package/dist/events.contract.d.ts +178 -0
- package/dist/events.contract.js +136 -0
- package/dist/events.contract.js.map +1 -0
- package/dist/evidence/v1.d.ts +2 -0
- package/dist/evidence/v1.js +3 -0
- package/dist/evidence/v1.js.map +1 -0
- package/dist/gateway.contract.d.ts +17 -12
- package/dist/gateway.contract.js +11 -11
- package/dist/gateway.contract.js.map +1 -1
- package/dist/graph/v1.d.ts +2 -0
- package/dist/graph/v1.js +3 -0
- package/dist/graph/v1.js.map +1 -0
- package/dist/ids.contract.d.ts +9 -0
- package/dist/ids.contract.js +29 -0
- package/dist/ids.contract.js.map +1 -0
- package/dist/index.d.ts +15 -22
- package/dist/index.js +5525 -21
- package/dist/index.js.map +1 -1
- package/dist/lens-filter.contract.d.ts +10 -9
- package/dist/lens-filter.contract.js +59 -84
- package/dist/lens-filter.contract.js.map +1 -1
- package/dist/lens-workflow.contract.d.ts +23 -21
- package/dist/lens-workflow.contract.js +116 -48
- package/dist/lens-workflow.contract.js.map +1 -1
- package/dist/mcp-tools.contract-D8kXcP6d.d.ts +254 -0
- package/dist/mcp-tools.contract.d.ts +1 -152
- package/dist/mcp-tools.contract.js +2984 -3280
- package/dist/mcp-tools.contract.js.map +1 -1
- package/dist/ontologies/v1.d.ts +2 -0
- package/dist/ontologies/v1.js +3 -0
- package/dist/ontologies/v1.js.map +1 -0
- package/dist/ontology-matching.contract.d.ts +1 -0
- package/dist/ontology-matching.contract.js +346 -0
- package/dist/ontology-matching.contract.js.map +1 -0
- package/dist/prompt.contract.d.ts +5 -4
- package/dist/prompt.contract.js +10 -23
- package/dist/prompt.contract.js.map +1 -1
- package/dist/questions/v1.d.ts +2 -0
- package/dist/questions/v1.js +3 -0
- package/dist/questions/v1.js.map +1 -0
- package/dist/sdk-methods.contract.d.ts +51 -45
- package/dist/sdk-methods.contract.js +2 -16
- package/dist/sdk-methods.contract.js.map +1 -1
- package/dist/sdk-tools.contract-BnV0hKLp.d.ts +150 -0
- package/dist/sdk-tools.contract.d.ts +2 -93
- package/dist/sdk-tools.contract.js +4220 -1397
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/text-matching.contract.d.ts +55 -0
- package/dist/text-matching.contract.js +246 -0
- package/dist/text-matching.contract.js.map +1 -0
- package/dist/topic-scope.contract.d.ts +1 -0
- package/dist/topic-scope.contract.js +54 -0
- package/dist/topic-scope.contract.js.map +1 -0
- package/dist/topics/v1.d.ts +2 -0
- package/dist/topics/v1.js +3 -0
- package/dist/topics/v1.js.map +1 -0
- package/dist/v1/agents/v1.d.ts +2 -0
- package/dist/v1/agents/v1.js +3 -0
- package/dist/v1/agents/v1.js.map +1 -0
- package/dist/v1/beliefs/v1.d.ts +2 -0
- package/dist/v1/beliefs/v1.js +3 -0
- package/dist/v1/beliefs/v1.js.map +1 -0
- package/dist/v1/evidence/v1.d.ts +2 -0
- package/dist/v1/evidence/v1.js +3 -0
- package/dist/v1/evidence/v1.js.map +1 -0
- package/dist/v1/graph/v1.d.ts +2 -0
- package/dist/v1/graph/v1.js +3 -0
- package/dist/v1/graph/v1.js.map +1 -0
- package/dist/v1/ontologies/v1.d.ts +78 -0
- package/dist/v1/ontologies/v1.js +346 -0
- package/dist/v1/ontologies/v1.js.map +1 -0
- package/dist/v1/questions/v1.d.ts +2 -0
- package/dist/v1/questions/v1.js +3 -0
- package/dist/v1/questions/v1.js.map +1 -0
- package/dist/v1/topics/v1.d.ts +21 -0
- package/dist/v1/topics/v1.js +54 -0
- package/dist/v1/topics/v1.js.map +1 -0
- package/dist/v1/worktrees/v1.d.ts +2 -0
- package/dist/v1/worktrees/v1.js +3 -0
- package/dist/v1/worktrees/v1.js.map +1 -0
- package/dist/workflow-runtime.contract.d.ts +46 -45
- package/dist/workflow-runtime.contract.js +228 -241
- package/dist/workflow-runtime.contract.js.map +1 -1
- package/dist/worktrees/v1.d.ts +2 -0
- package/dist/worktrees/v1.js +3 -0
- package/dist/worktrees/v1.js.map +1 -0
- package/package.json +19 -13
- package/dist/api-enums.contract.d.ts.map +0 -1
- package/dist/auth-session.contract.d.ts.map +0 -1
- package/dist/context-pack.contract.d.ts.map +0 -1
- package/dist/gateway.contract.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lens-filter.contract.d.ts.map +0 -1
- package/dist/lens-workflow.contract.d.ts.map +0 -1
- package/dist/mcp-tools.contract.d.ts.map +0 -1
- package/dist/prompt.contract.d.ts.map +0 -1
- package/dist/sdk-methods.contract.d.ts.map +0 -1
- package/dist/sdk-tools.contract.d.ts.map +0 -1
- 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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
56
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
77
|
+
type ResearchMemoOutput = WorkflowOutputBase & {
|
|
78
78
|
kind: "research_memo";
|
|
79
79
|
claims: string[];
|
|
80
80
|
evidenceRefs?: string[];
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
type StrategyArtifactOutput = WorkflowOutputBase & {
|
|
83
83
|
kind: "strategy_artifact";
|
|
84
84
|
recommendations: string[];
|
|
85
85
|
decisionWindow?: string;
|
|
86
86
|
};
|
|
87
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
+
type StructuredPayloadOutput = WorkflowOutputBase & {
|
|
102
102
|
kind: "structured_payload";
|
|
103
103
|
payload: Record<string, unknown>;
|
|
104
104
|
};
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
var WORKFLOW_APPROVAL_MODES = [
|
|
9
|
+
"none",
|
|
10
|
+
"audit_only",
|
|
11
|
+
"human_required",
|
|
12
|
+
"auto_approve"
|
|
29
13
|
];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
var WORKFLOW_RUN_STATUSES = [
|
|
46
|
+
"queued",
|
|
47
|
+
"running",
|
|
48
|
+
"awaiting_approval",
|
|
49
|
+
"completed",
|
|
50
|
+
"failed",
|
|
51
|
+
"cancelled"
|
|
68
52
|
];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
var WORKFLOW_TRIGGER_KINDS = [
|
|
54
|
+
"manual",
|
|
55
|
+
"schedule",
|
|
56
|
+
"hook"
|
|
73
57
|
];
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
var WORKFLOW_PROOF_ARTIFACT_KINDS = [
|
|
59
|
+
"report",
|
|
60
|
+
"brief",
|
|
61
|
+
"artifact",
|
|
62
|
+
"dashboard",
|
|
63
|
+
"test_evidence"
|
|
80
64
|
];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
65
|
+
var WORKFLOW_STAFFING_HINTS = [
|
|
66
|
+
"solo",
|
|
67
|
+
"backend+tests",
|
|
68
|
+
"fullstack",
|
|
69
|
+
"mcp+tests"
|
|
86
70
|
];
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
71
|
+
var WORKFLOW_AUTO_FIX_MODES = [
|
|
72
|
+
"disabled",
|
|
73
|
+
"dry_run",
|
|
74
|
+
"safe",
|
|
75
|
+
"aggressive"
|
|
92
76
|
];
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
var DEFAULT_WORKFLOW_AUTO_FIX_POLICY = {
|
|
85
|
+
mode: "disabled",
|
|
86
|
+
permittedMutationTiers: ["read_only"],
|
|
87
|
+
requireAuditTrail: true
|
|
104
88
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|