@contractspec/lib.execution-lanes 0.1.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/README.md +27 -0
- package/dist/adapters/in-process.d.ts +4 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/queue.d.ts +7 -0
- package/dist/adapters/subagent.d.ts +10 -0
- package/dist/adapters/tmux.d.ts +10 -0
- package/dist/adapters/types.d.ts +16 -0
- package/dist/adapters/workflow-engine.d.ts +10 -0
- package/dist/defaults/defaults.test.d.ts +1 -0
- package/dist/defaults/index.d.ts +3 -0
- package/dist/defaults/index.js +2 -0
- package/dist/defaults/lanes.d.ts +2 -0
- package/dist/defaults/roles.d.ts +2 -0
- package/dist/defaults/transitions.d.ts +2 -0
- package/dist/evidence/bundle.d.ts +13 -0
- package/dist/evidence/bundle.test.d.ts +1 -0
- package/dist/evidence/gate.d.ts +10 -0
- package/dist/evidence/gate.test.d.ts +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +4 -0
- package/dist/interop/commands.d.ts +18 -0
- package/dist/interop/commands.test.d.ts +1 -0
- package/dist/interop/index.d.ts +1 -0
- package/dist/interop/index.js +2 -0
- package/dist/lanes/clarify/clarify.d.ts +11 -0
- package/dist/lanes/clarify/clarify.test.d.ts +1 -0
- package/dist/lanes/complete/completion-loop-authority.test.d.ts +1 -0
- package/dist/lanes/complete/completion-loop-failures.test.d.ts +1 -0
- package/dist/lanes/complete/completion-loop-progress.d.ts +7 -0
- package/dist/lanes/complete/completion-loop-shared.d.ts +24 -0
- package/dist/lanes/complete/completion-loop-terminal.d.ts +12 -0
- package/dist/lanes/complete/completion-loop.d.ts +31 -0
- package/dist/lanes/complete/completion-loop.test.d.ts +1 -0
- package/dist/lanes/complete/failure-class.d.ts +7 -0
- package/dist/lanes/plan/consensus-authority.d.ts +10 -0
- package/dist/lanes/plan/consensus-authority.test.d.ts +1 -0
- package/dist/lanes/plan/consensus.d.ts +54 -0
- package/dist/lanes/plan/consensus.test.d.ts +1 -0
- package/dist/lanes/team/finalize.d.ts +4 -0
- package/dist/lanes/team/team-run-authority.test.d.ts +1 -0
- package/dist/lanes/team/team-run-control.d.ts +4 -0
- package/dist/lanes/team/team-run-control.test.d.ts +1 -0
- package/dist/lanes/team/team-run-core.d.ts +19 -0
- package/dist/lanes/team/team-run-lifecycle.d.ts +7 -0
- package/dist/lanes/team/team-run-operations.d.ts +10 -0
- package/dist/lanes/team/team-run-scope.test.d.ts +1 -0
- package/dist/lanes/team/team-run-shared.d.ts +23 -0
- package/dist/lanes/team/team-run.d.ts +48 -0
- package/dist/lanes/team/team-run.test.d.ts +1 -0
- package/dist/lanes/team/worker-launch.d.ts +3 -0
- package/dist/node/defaults/index.js +1 -0
- package/dist/node/index.js +3 -0
- package/dist/node/interop/index.js +1 -0
- package/dist/node/types/index.js +1 -0
- package/dist/package-exports.test.d.ts +1 -0
- package/dist/registry/execution-lane-registry.d.ts +9 -0
- package/dist/registry/role-profile-registry.d.ts +10 -0
- package/dist/registry/verification-policy-registry.d.ts +10 -0
- package/dist/runtime/authority-hooks.d.ts +14 -0
- package/dist/runtime/in-memory-store.d.ts +34 -0
- package/dist/runtime/lane-runtime-authority.test.d.ts +1 -0
- package/dist/runtime/lane-runtime-options.d.ts +11 -0
- package/dist/runtime/lane-runtime-terminal.d.ts +5 -0
- package/dist/runtime/lane-runtime.d.ts +20 -0
- package/dist/runtime/lane-runtime.test.d.ts +1 -0
- package/dist/runtime/persistence-bundle.d.ts +2 -0
- package/dist/runtime/persistence-bundle.test.d.ts +1 -0
- package/dist/runtime/persistence-files-codec.d.ts +6 -0
- package/dist/runtime/persistence-files.d.ts +4 -0
- package/dist/runtime/persistence-files.test.d.ts +1 -0
- package/dist/runtime/readiness.d.ts +16 -0
- package/dist/runtime/role-guard.d.ts +12 -0
- package/dist/runtime/role-guard.test.d.ts +1 -0
- package/dist/runtime/selector.d.ts +12 -0
- package/dist/runtime/selector.test.d.ts +1 -0
- package/dist/runtime/state-sync.d.ts +5 -0
- package/dist/runtime/status-views.d.ts +5 -0
- package/dist/runtime/store.d.ts +22 -0
- package/dist/types/completion.d.ts +60 -0
- package/dist/types/core.d.ts +19 -0
- package/dist/types/evidence.d.ts +64 -0
- package/dist/types/failures.d.ts +8 -0
- package/dist/types/failures.test.d.ts +1 -0
- package/dist/types/identifiers.d.ts +12 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +2 -0
- package/dist/types/lanes.d.ts +65 -0
- package/dist/types/plan.d.ts +46 -0
- package/dist/types/roles.d.ts +24 -0
- package/dist/types/runtime.d.ts +123 -0
- package/dist/types/team.d.ts +128 -0
- package/dist/utils/deep-clone.d.ts +1 -0
- package/dist/utils/id.d.ts +1 -0
- package/dist/validation/clarification-artifact.d.ts +4 -0
- package/dist/validation/completion-loop-spec.d.ts +4 -0
- package/dist/validation/contracts.test.d.ts +1 -0
- package/dist/validation/issues.d.ts +6 -0
- package/dist/validation/lane-spec.d.ts +3 -0
- package/dist/validation/plan-pack.d.ts +3 -0
- package/dist/validation/role-profile.d.ts +3 -0
- package/dist/validation/team-run-spec.d.ts +4 -0
- package/dist/validation/verification-policy.d.ts +5 -0
- package/package.json +105 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { RoleWriteScope } from './roles';
|
|
2
|
+
export type TeamTaskStatus = 'pending' | 'ready' | 'leased' | 'running' | 'blocked' | 'completed' | 'failed' | 'cancelled';
|
|
3
|
+
export type TeamWorkerStatus = 'idle' | 'running' | 'paused' | 'offline' | 'failed' | 'completed';
|
|
4
|
+
export type TeamCleanupStatus = 'not_requested' | 'in_progress' | 'completed' | 'partial' | 'failed';
|
|
5
|
+
export interface TeamWorkerSpec {
|
|
6
|
+
workerId: string;
|
|
7
|
+
roleProfile: string;
|
|
8
|
+
concurrencyClass: 'single' | 'parallel';
|
|
9
|
+
worktreeMode?: 'shared' | 'isolated';
|
|
10
|
+
}
|
|
11
|
+
export interface TeamBacklogTaskSpec {
|
|
12
|
+
taskId: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
roleHint?: string;
|
|
16
|
+
dependencies?: string[];
|
|
17
|
+
writePaths?: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface TeamWorkerLaunchSpec {
|
|
20
|
+
runId: string;
|
|
21
|
+
workerId: string;
|
|
22
|
+
roleKey: string;
|
|
23
|
+
writeScope: RoleWriteScope;
|
|
24
|
+
worktreeMode?: TeamWorkerSpec['worktreeMode'];
|
|
25
|
+
writePaths?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface TeamRunSpec {
|
|
28
|
+
id: string;
|
|
29
|
+
sourcePlanPackId?: string;
|
|
30
|
+
objective: string;
|
|
31
|
+
backendKey?: string;
|
|
32
|
+
workers: TeamWorkerSpec[];
|
|
33
|
+
backlog: TeamBacklogTaskSpec[];
|
|
34
|
+
coordination: {
|
|
35
|
+
mailbox: boolean;
|
|
36
|
+
taskLeasing: boolean;
|
|
37
|
+
heartbeats: boolean;
|
|
38
|
+
rebalancing: boolean;
|
|
39
|
+
};
|
|
40
|
+
verificationLane: {
|
|
41
|
+
required: boolean;
|
|
42
|
+
ownerRole: string;
|
|
43
|
+
};
|
|
44
|
+
shutdownPolicy: {
|
|
45
|
+
requireTerminalTasks: boolean;
|
|
46
|
+
requireEvidenceGate: boolean;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface TeamLeaseRecord {
|
|
50
|
+
workerId: string;
|
|
51
|
+
leasedAt: string;
|
|
52
|
+
expiresAt: string;
|
|
53
|
+
renewCount: number;
|
|
54
|
+
}
|
|
55
|
+
export interface TeamHeartbeatRecord {
|
|
56
|
+
id: string;
|
|
57
|
+
workerId: string;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
currentTaskId?: string;
|
|
60
|
+
health: 'healthy' | 'stale' | 'offline' | 'failed';
|
|
61
|
+
progressSummary?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface TeamTaskRecord {
|
|
64
|
+
taskId: string;
|
|
65
|
+
title: string;
|
|
66
|
+
description: string;
|
|
67
|
+
roleHint?: string;
|
|
68
|
+
dependencies: string[];
|
|
69
|
+
writePaths?: string[];
|
|
70
|
+
status: TeamTaskStatus;
|
|
71
|
+
claimedBy?: string;
|
|
72
|
+
evidenceBundleIds: string[];
|
|
73
|
+
retryHistory: string[];
|
|
74
|
+
lease?: TeamLeaseRecord;
|
|
75
|
+
}
|
|
76
|
+
export interface TeamWorkerState {
|
|
77
|
+
workerId: string;
|
|
78
|
+
roleProfile: string;
|
|
79
|
+
status: TeamWorkerStatus;
|
|
80
|
+
currentTaskId?: string;
|
|
81
|
+
lastHeartbeatAt?: string;
|
|
82
|
+
progressSummary?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface TeamMailboxMessage {
|
|
85
|
+
id: string;
|
|
86
|
+
from: string;
|
|
87
|
+
to: string;
|
|
88
|
+
scope: 'leader-worker' | 'worker-leader' | 'worker-worker' | 'system';
|
|
89
|
+
createdAt: string;
|
|
90
|
+
body: string;
|
|
91
|
+
}
|
|
92
|
+
export interface TeamCleanupState {
|
|
93
|
+
status: TeamCleanupStatus;
|
|
94
|
+
requestedAt?: string;
|
|
95
|
+
completedAt?: string;
|
|
96
|
+
reason?: string;
|
|
97
|
+
failures: Array<{
|
|
98
|
+
workerId: string;
|
|
99
|
+
message: string;
|
|
100
|
+
}>;
|
|
101
|
+
}
|
|
102
|
+
export interface TeamRunState {
|
|
103
|
+
runId: string;
|
|
104
|
+
spec: TeamRunSpec;
|
|
105
|
+
status: 'initialized' | 'running' | 'paused' | 'completed' | 'completed_with_followup_recommended' | 'blocked' | 'failed' | 'aborted';
|
|
106
|
+
tasks: TeamTaskRecord[];
|
|
107
|
+
workers: TeamWorkerState[];
|
|
108
|
+
mailbox: TeamMailboxMessage[];
|
|
109
|
+
heartbeatLog: TeamHeartbeatRecord[];
|
|
110
|
+
cleanup: TeamCleanupState;
|
|
111
|
+
evidenceBundleIds: string[];
|
|
112
|
+
createdAt: string;
|
|
113
|
+
updatedAt: string;
|
|
114
|
+
terminalReason?: string;
|
|
115
|
+
terminalStateArtifactId?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface TeamCompletionSnapshot {
|
|
118
|
+
runId: string;
|
|
119
|
+
status: TeamRunState['status'];
|
|
120
|
+
completedAt: string;
|
|
121
|
+
evidenceBundleIds: string[];
|
|
122
|
+
cleanupStatus: TeamCleanupStatus;
|
|
123
|
+
taskStatuses: Array<{
|
|
124
|
+
taskId: string;
|
|
125
|
+
status: TeamTaskStatus;
|
|
126
|
+
}>;
|
|
127
|
+
followupRecommendation?: string;
|
|
128
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deepClone<T>(value: T): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createId(prefix: string): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ClarificationArtifact } from '../types';
|
|
2
|
+
import { type ExecutionLanesValidationIssue } from './issues';
|
|
3
|
+
export declare function validateClarificationArtifact(artifact: ClarificationArtifact): ExecutionLanesValidationIssue[];
|
|
4
|
+
export declare function assertValidClarificationArtifact(artifact: ClarificationArtifact): ClarificationArtifact;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CompletionLoopSpec } from '../types';
|
|
2
|
+
import { type ExecutionLanesValidationIssue } from './issues';
|
|
3
|
+
export declare function validateCompletionLoopSpec(spec: CompletionLoopSpec): ExecutionLanesValidationIssue[];
|
|
4
|
+
export declare function assertValidCompletionLoopSpec(spec: CompletionLoopSpec): CompletionLoopSpec;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ExecutionLanesValidationIssue {
|
|
2
|
+
path: string;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function pushIssue(issues: ExecutionLanesValidationIssue[], path: string, message: string): void;
|
|
6
|
+
export declare function assertValid(issues: ExecutionLanesValidationIssue[], message: string): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TeamRunSpec } from '../types';
|
|
2
|
+
import { type ExecutionLanesValidationIssue } from './issues';
|
|
3
|
+
export declare function validateTeamRunSpec(spec: TeamRunSpec): ExecutionLanesValidationIssue[];
|
|
4
|
+
export declare function assertValidTeamRunSpec(spec: TeamRunSpec): TeamRunSpec;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VerificationPolicy, VerificationPolicySource } from '../types';
|
|
2
|
+
import { type ExecutionLanesValidationIssue } from './issues';
|
|
3
|
+
export declare function validateVerificationPolicy(policy: VerificationPolicy): ExecutionLanesValidationIssue[];
|
|
4
|
+
export declare function validateVerificationPolicySource(policy: VerificationPolicySource): ExecutionLanesValidationIssue[];
|
|
5
|
+
export declare function assertValidVerificationPolicy(policy: VerificationPolicy): VerificationPolicy;
|
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@contractspec/lib.execution-lanes",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Execution lanes orchestration contracts and runtime for ContractSpec.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"contractspec",
|
|
7
|
+
"execution",
|
|
8
|
+
"lanes",
|
|
9
|
+
"orchestration",
|
|
10
|
+
"typescript"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
20
|
+
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
21
|
+
"build": "bun run build:bundle && bun run build:types",
|
|
22
|
+
"build:bundle": "contractspec-bun-build transpile",
|
|
23
|
+
"build:types": "contractspec-bun-build types",
|
|
24
|
+
"dev": "contractspec-bun-build dev",
|
|
25
|
+
"clean": "rimraf dist .turbo",
|
|
26
|
+
"lint": "bun lint:fix",
|
|
27
|
+
"lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
|
|
28
|
+
"lint:check": "node ../../../scripts/biome.cjs check .",
|
|
29
|
+
"test": "bun test",
|
|
30
|
+
"prebuild": "contractspec-bun-build prebuild",
|
|
31
|
+
"typecheck": "tsc --noEmit"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@contractspec/lib.contracts-spec": "5.2.0",
|
|
35
|
+
"@contractspec/lib.harness": "0.2.11"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@contractspec/tool.bun": "3.7.14",
|
|
39
|
+
"@contractspec/tool.typescript": "3.7.13",
|
|
40
|
+
"typescript": "^5.9.3"
|
|
41
|
+
},
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"bun": "./dist/index.js",
|
|
46
|
+
"node": "./dist/node/index.js",
|
|
47
|
+
"default": "./dist/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./defaults": {
|
|
50
|
+
"types": "./dist/defaults/index.d.ts",
|
|
51
|
+
"bun": "./dist/defaults/index.js",
|
|
52
|
+
"node": "./dist/node/defaults/index.js",
|
|
53
|
+
"default": "./dist/defaults/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./interop": {
|
|
56
|
+
"types": "./dist/interop/index.d.ts",
|
|
57
|
+
"bun": "./dist/interop/index.js",
|
|
58
|
+
"node": "./dist/node/interop/index.js",
|
|
59
|
+
"default": "./dist/interop/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./types": {
|
|
62
|
+
"types": "./dist/types/index.d.ts",
|
|
63
|
+
"bun": "./dist/types/index.js",
|
|
64
|
+
"node": "./dist/node/types/index.js",
|
|
65
|
+
"default": "./dist/types/index.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public",
|
|
70
|
+
"registry": "https://registry.npmjs.org/",
|
|
71
|
+
"exports": {
|
|
72
|
+
".": {
|
|
73
|
+
"types": "./dist/index.d.ts",
|
|
74
|
+
"bun": "./dist/index.js",
|
|
75
|
+
"node": "./dist/node/index.js",
|
|
76
|
+
"default": "./dist/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./defaults": {
|
|
79
|
+
"types": "./dist/defaults/index.d.ts",
|
|
80
|
+
"bun": "./dist/defaults/index.js",
|
|
81
|
+
"node": "./dist/node/defaults/index.js",
|
|
82
|
+
"default": "./dist/defaults/index.js"
|
|
83
|
+
},
|
|
84
|
+
"./interop": {
|
|
85
|
+
"types": "./dist/interop/index.d.ts",
|
|
86
|
+
"bun": "./dist/interop/index.js",
|
|
87
|
+
"node": "./dist/node/interop/index.js",
|
|
88
|
+
"default": "./dist/interop/index.js"
|
|
89
|
+
},
|
|
90
|
+
"./types": {
|
|
91
|
+
"types": "./dist/types/index.d.ts",
|
|
92
|
+
"bun": "./dist/types/index.js",
|
|
93
|
+
"node": "./dist/node/types/index.js",
|
|
94
|
+
"default": "./dist/types/index.js"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"license": "MIT",
|
|
99
|
+
"repository": {
|
|
100
|
+
"type": "git",
|
|
101
|
+
"url": "https://github.com/lssm-tech/contractspec.git",
|
|
102
|
+
"directory": "packages/libs/execution-lanes"
|
|
103
|
+
},
|
|
104
|
+
"homepage": "https://contractspec.io"
|
|
105
|
+
}
|