codex-orchestrator 0.1.47 → 0.1.49
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 +42 -0
- package/dist/src/config/schema.d.ts +5 -1
- package/dist/src/config/schema.d.ts.map +1 -1
- package/dist/src/config/schema.js +16 -0
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/github/gh-issue-adapter.d.ts +3 -1
- package/dist/src/github/gh-issue-adapter.d.ts.map +1 -1
- package/dist/src/github/gh-issue-adapter.js +44 -6
- package/dist/src/github/gh-issue-adapter.js.map +1 -1
- package/dist/src/github/gh-pull-request-adapter.d.ts +3 -1
- package/dist/src/github/gh-pull-request-adapter.d.ts.map +1 -1
- package/dist/src/github/gh-pull-request-adapter.js +74 -0
- package/dist/src/github/gh-pull-request-adapter.js.map +1 -1
- package/dist/src/github/issues.d.ts +4 -0
- package/dist/src/github/issues.d.ts.map +1 -1
- package/dist/src/github/issues.js +6 -0
- package/dist/src/github/issues.js.map +1 -1
- package/dist/src/github/pull-requests.d.ts +9 -0
- package/dist/src/github/pull-requests.d.ts.map +1 -1
- package/dist/src/github/pull-requests.js +13 -0
- package/dist/src/github/pull-requests.js.map +1 -1
- package/dist/src/runner/command-utils.d.ts.map +1 -1
- package/dist/src/runner/command-utils.js +1 -0
- package/dist/src/runner/command-utils.js.map +1 -1
- package/dist/src/runner/local-execution-session.d.ts.map +1 -1
- package/dist/src/runner/local-execution-session.js +5 -2
- package/dist/src/runner/local-execution-session.js.map +1 -1
- package/dist/src/runner/mission-activation.d.ts +29 -0
- package/dist/src/runner/mission-activation.d.ts.map +1 -0
- package/dist/src/runner/mission-activation.js +54 -0
- package/dist/src/runner/mission-activation.js.map +1 -0
- package/dist/src/runner/mission-agent-broker.d.ts +53 -0
- package/dist/src/runner/mission-agent-broker.d.ts.map +1 -0
- package/dist/src/runner/mission-agent-broker.js +182 -0
- package/dist/src/runner/mission-agent-broker.js.map +1 -0
- package/dist/src/runner/mission-cancellation.d.ts +77 -0
- package/dist/src/runner/mission-cancellation.d.ts.map +1 -0
- package/dist/src/runner/mission-cancellation.js +180 -0
- package/dist/src/runner/mission-cancellation.js.map +1 -0
- package/dist/src/runner/mission-canonical-path.d.ts +34 -0
- package/dist/src/runner/mission-canonical-path.d.ts.map +1 -0
- package/dist/src/runner/mission-canonical-path.js +121 -0
- package/dist/src/runner/mission-canonical-path.js.map +1 -0
- package/dist/src/runner/mission-capability-kernel.d.ts +34 -0
- package/dist/src/runner/mission-capability-kernel.d.ts.map +1 -0
- package/dist/src/runner/mission-capability-kernel.js +158 -0
- package/dist/src/runner/mission-capability-kernel.js.map +1 -0
- package/dist/src/runner/mission-check-policy.d.ts +17 -0
- package/dist/src/runner/mission-check-policy.d.ts.map +1 -0
- package/dist/src/runner/mission-check-policy.js +31 -0
- package/dist/src/runner/mission-check-policy.js.map +1 -0
- package/dist/src/runner/mission-coordinator-lock.d.ts +16 -0
- package/dist/src/runner/mission-coordinator-lock.d.ts.map +1 -0
- package/dist/src/runner/mission-coordinator-lock.js +170 -0
- package/dist/src/runner/mission-coordinator-lock.js.map +1 -0
- package/dist/src/runner/mission-deployment.d.ts +21 -0
- package/dist/src/runner/mission-deployment.d.ts.map +1 -0
- package/dist/src/runner/mission-deployment.js +108 -0
- package/dist/src/runner/mission-deployment.js.map +1 -0
- package/dist/src/runner/mission-evaluation.d.ts +61 -0
- package/dist/src/runner/mission-evaluation.d.ts.map +1 -0
- package/dist/src/runner/mission-evaluation.js +183 -0
- package/dist/src/runner/mission-evaluation.js.map +1 -0
- package/dist/src/runner/mission-executor-probe.d.ts +10 -0
- package/dist/src/runner/mission-executor-probe.d.ts.map +1 -0
- package/dist/src/runner/mission-executor-probe.js +180 -0
- package/dist/src/runner/mission-executor-probe.js.map +1 -0
- package/dist/src/runner/mission-git-contracts.d.ts +75 -0
- package/dist/src/runner/mission-git-contracts.d.ts.map +1 -0
- package/dist/src/runner/mission-git-contracts.js +201 -0
- package/dist/src/runner/mission-git-contracts.js.map +1 -0
- package/dist/src/runner/mission-git-runtime-owner-ref.d.ts +13 -0
- package/dist/src/runner/mission-git-runtime-owner-ref.d.ts.map +1 -0
- package/dist/src/runner/mission-git-runtime-owner-ref.js +111 -0
- package/dist/src/runner/mission-git-runtime-owner-ref.js.map +1 -0
- package/dist/src/runner/mission-git-transaction.d.ts +97 -0
- package/dist/src/runner/mission-git-transaction.d.ts.map +1 -0
- package/dist/src/runner/mission-git-transaction.js +1009 -0
- package/dist/src/runner/mission-git-transaction.js.map +1 -0
- package/dist/src/runner/mission-identifiers.d.ts +31 -0
- package/dist/src/runner/mission-identifiers.d.ts.map +1 -0
- package/dist/src/runner/mission-identifiers.js +75 -0
- package/dist/src/runner/mission-identifiers.js.map +1 -0
- package/dist/src/runner/mission-input-snapshot.d.ts +21 -0
- package/dist/src/runner/mission-input-snapshot.d.ts.map +1 -0
- package/dist/src/runner/mission-input-snapshot.js +63 -0
- package/dist/src/runner/mission-input-snapshot.js.map +1 -0
- package/dist/src/runner/mission-ownership.d.ts +38 -0
- package/dist/src/runner/mission-ownership.d.ts.map +1 -0
- package/dist/src/runner/mission-ownership.js +88 -0
- package/dist/src/runner/mission-ownership.js.map +1 -0
- package/dist/src/runner/mission-patch-audit.d.ts +21 -0
- package/dist/src/runner/mission-patch-audit.d.ts.map +1 -0
- package/dist/src/runner/mission-patch-audit.js +186 -0
- package/dist/src/runner/mission-patch-audit.js.map +1 -0
- package/dist/src/runner/mission-path-language.d.ts +6 -0
- package/dist/src/runner/mission-path-language.d.ts.map +1 -0
- package/dist/src/runner/mission-path-language.js +106 -0
- package/dist/src/runner/mission-path-language.js.map +1 -0
- package/dist/src/runner/mission-permit-authority.d.ts +26 -0
- package/dist/src/runner/mission-permit-authority.d.ts.map +1 -0
- package/dist/src/runner/mission-permit-authority.js +145 -0
- package/dist/src/runner/mission-permit-authority.js.map +1 -0
- package/dist/src/runner/mission-plan-parent-coordinator.d.ts +87 -0
- package/dist/src/runner/mission-plan-parent-coordinator.d.ts.map +1 -0
- package/dist/src/runner/mission-plan-parent-coordinator.js +441 -0
- package/dist/src/runner/mission-plan-parent-coordinator.js.map +1 -0
- package/dist/src/runner/mission-plan-parent.d.ts +156 -0
- package/dist/src/runner/mission-plan-parent.d.ts.map +1 -0
- package/dist/src/runner/mission-plan-parent.js +589 -0
- package/dist/src/runner/mission-plan-parent.js.map +1 -0
- package/dist/src/runner/mission-process-executor.d.ts +25 -0
- package/dist/src/runner/mission-process-executor.d.ts.map +1 -0
- package/dist/src/runner/mission-process-executor.js +182 -0
- package/dist/src/runner/mission-process-executor.js.map +1 -0
- package/dist/src/runner/mission-publication-git.d.ts +21 -0
- package/dist/src/runner/mission-publication-git.d.ts.map +1 -0
- package/dist/src/runner/mission-publication-git.js +61 -0
- package/dist/src/runner/mission-publication-git.js.map +1 -0
- package/dist/src/runner/mission-publication.d.ts +192 -0
- package/dist/src/runner/mission-publication.d.ts.map +1 -0
- package/dist/src/runner/mission-publication.js +1001 -0
- package/dist/src/runner/mission-publication.js.map +1 -0
- package/dist/src/runner/mission-quarantine-patch-executor.d.ts +29 -0
- package/dist/src/runner/mission-quarantine-patch-executor.d.ts.map +1 -0
- package/dist/src/runner/mission-quarantine-patch-executor.js +121 -0
- package/dist/src/runner/mission-quarantine-patch-executor.js.map +1 -0
- package/dist/src/runner/mission-repository-executor.d.ts +54 -0
- package/dist/src/runner/mission-repository-executor.d.ts.map +1 -0
- package/dist/src/runner/mission-repository-executor.js +192 -0
- package/dist/src/runner/mission-repository-executor.js.map +1 -0
- package/dist/src/runner/mission-repository-observer.d.ts +8 -0
- package/dist/src/runner/mission-repository-observer.d.ts.map +1 -0
- package/dist/src/runner/mission-repository-observer.js +24 -0
- package/dist/src/runner/mission-repository-observer.js.map +1 -0
- package/dist/src/runner/mission-reservations.d.ts +15 -0
- package/dist/src/runner/mission-reservations.d.ts.map +1 -0
- package/dist/src/runner/mission-reservations.js +116 -0
- package/dist/src/runner/mission-reservations.js.map +1 -0
- package/dist/src/runner/mission-resolution-loop.d.ts +172 -0
- package/dist/src/runner/mission-resolution-loop.d.ts.map +1 -0
- package/dist/src/runner/mission-resolution-loop.js +318 -0
- package/dist/src/runner/mission-resolution-loop.js.map +1 -0
- package/dist/src/runner/mission-runtime-owner.d.ts +36 -0
- package/dist/src/runner/mission-runtime-owner.d.ts.map +1 -0
- package/dist/src/runner/mission-runtime-owner.js +174 -0
- package/dist/src/runner/mission-runtime-owner.js.map +1 -0
- package/dist/src/runner/mission-safe-executor.d.ts +96 -0
- package/dist/src/runner/mission-safe-executor.d.ts.map +1 -0
- package/dist/src/runner/mission-safe-executor.js +288 -0
- package/dist/src/runner/mission-safe-executor.js.map +1 -0
- package/dist/src/runner/mission-sandbox.d.ts +16 -0
- package/dist/src/runner/mission-sandbox.d.ts.map +1 -0
- package/dist/src/runner/mission-sandbox.js +91 -0
- package/dist/src/runner/mission-sandbox.js.map +1 -0
- package/dist/src/runner/mission-scheduler.d.ts +57 -0
- package/dist/src/runner/mission-scheduler.d.ts.map +1 -0
- package/dist/src/runner/mission-scheduler.js +205 -0
- package/dist/src/runner/mission-scheduler.js.map +1 -0
- package/dist/src/runner/mission-scope-expansion.d.ts +47 -0
- package/dist/src/runner/mission-scope-expansion.d.ts.map +1 -0
- package/dist/src/runner/mission-scope-expansion.js +147 -0
- package/dist/src/runner/mission-scope-expansion.js.map +1 -0
- package/dist/src/runner/mission-state-machine.d.ts +118 -0
- package/dist/src/runner/mission-state-machine.d.ts.map +1 -0
- package/dist/src/runner/mission-state-machine.js +316 -0
- package/dist/src/runner/mission-state-machine.js.map +1 -0
- package/dist/src/runner/mission-state-store.d.ts +70 -0
- package/dist/src/runner/mission-state-store.d.ts.map +1 -0
- package/dist/src/runner/mission-state-store.js +916 -0
- package/dist/src/runner/mission-state-store.js.map +1 -0
- package/dist/src/runner/rework-policy.d.ts +2 -1
- package/dist/src/runner/rework-policy.d.ts.map +1 -1
- package/dist/src/runner/rework-policy.js +3 -0
- package/dist/src/runner/rework-policy.js.map +1 -1
- package/dist/src/setup/project-config.d.ts.map +1 -1
- package/dist/src/setup/project-config.js +5 -0
- package/dist/src/setup/project-config.js.map +1 -1
- package/docs/deep-dive.md +25 -16
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { MissionDeploymentRecord } from './mission-deployment.js';
|
|
2
|
+
export interface RuntimeOwnerRecord {
|
|
3
|
+
version: 1;
|
|
4
|
+
repository: string;
|
|
5
|
+
deploymentId: string;
|
|
6
|
+
githubAppInstallationId: string;
|
|
7
|
+
credentialGeneration: string;
|
|
8
|
+
compatibilityEpoch: number;
|
|
9
|
+
deploymentRecordHash: string;
|
|
10
|
+
approvedByCommit: string;
|
|
11
|
+
fencingEpoch: number;
|
|
12
|
+
}
|
|
13
|
+
export interface RuntimeOwnerObservation {
|
|
14
|
+
sha: string;
|
|
15
|
+
record: RuntimeOwnerRecord;
|
|
16
|
+
}
|
|
17
|
+
export interface RuntimeOwnerRefAdapter {
|
|
18
|
+
read(): Promise<RuntimeOwnerObservation | undefined>;
|
|
19
|
+
compareAndSwap(expectedSha: string | undefined, record: RuntimeOwnerRecord): Promise<RuntimeOwnerObservation>;
|
|
20
|
+
}
|
|
21
|
+
export declare function canonicalRuntimeOwnerRecord(record: RuntimeOwnerRecord): string;
|
|
22
|
+
export declare function parseRuntimeOwnerRecord(content: string): RuntimeOwnerRecord;
|
|
23
|
+
export declare function assertRuntimeOwnerRecord(value: unknown): asserts value is RuntimeOwnerRecord;
|
|
24
|
+
export declare class RuntimeOwnerConflictError extends Error {
|
|
25
|
+
constructor(message: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class MissionRuntimeOwnership {
|
|
28
|
+
private readonly adapter;
|
|
29
|
+
constructor(adapter: RuntimeOwnerRefAdapter);
|
|
30
|
+
acquireInitial(deployment: MissionDeploymentRecord): Promise<RuntimeOwnerObservation>;
|
|
31
|
+
transfer(deployment: MissionDeploymentRecord, githubServerTime: string): Promise<RuntimeOwnerObservation>;
|
|
32
|
+
assertMutationFence(deployment: MissionDeploymentRecord, expectedFencingEpoch: number): Promise<RuntimeOwnerObservation>;
|
|
33
|
+
runFencedMutation<T>(deployment: MissionDeploymentRecord, expectedFencingEpoch: number, mutation: (fence: RuntimeOwnerObservation) => Promise<T>): Promise<T>;
|
|
34
|
+
}
|
|
35
|
+
export declare function ownerRecord(deployment: MissionDeploymentRecord, fencingEpoch: number): RuntimeOwnerRecord;
|
|
36
|
+
//# sourceMappingURL=mission-runtime-owner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mission-runtime-owner.d.ts","sourceRoot":"","sources":["../../../src/runner/mission-runtime-owner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAGvE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,IAAI,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;IACrD,cAAc,CACZ,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACrC;AAcD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAG9E;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAY3E;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,kBAAkB,CAwC5F;AAED,qBAAa,yBAA0B,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAInC;AAED,qBAAa,uBAAuB;IACf,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,sBAAsB;IAEtD,cAAc,CAAC,UAAU,EAAE,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAQrF,QAAQ,CACnB,UAAU,EAAE,uBAAuB,EACnC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,uBAAuB,CAAC;IA+BtB,mBAAmB,CAC9B,UAAU,EAAE,uBAAuB,EACnC,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,uBAAuB,CAAC;IA8BtB,iBAAiB,CAAC,CAAC,EAC9B,UAAU,EAAE,uBAAuB,EACnC,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,CAAC,CAAC,GACvD,OAAO,CAAC,CAAC,CAAC;CAId;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,uBAAuB,EACnC,YAAY,EAAE,MAAM,GACnB,kBAAkB,CAepB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { missionDeploymentRecordHash } from './mission-deployment.js';
|
|
2
|
+
const runtimeOwnerFields = [
|
|
3
|
+
'version',
|
|
4
|
+
'repository',
|
|
5
|
+
'deploymentId',
|
|
6
|
+
'githubAppInstallationId',
|
|
7
|
+
'credentialGeneration',
|
|
8
|
+
'compatibilityEpoch',
|
|
9
|
+
'deploymentRecordHash',
|
|
10
|
+
'approvedByCommit',
|
|
11
|
+
'fencingEpoch',
|
|
12
|
+
];
|
|
13
|
+
export function canonicalRuntimeOwnerRecord(record) {
|
|
14
|
+
assertRuntimeOwnerRecord(record);
|
|
15
|
+
return JSON.stringify(Object.fromEntries(runtimeOwnerFields.map((field) => [field, record[field]])));
|
|
16
|
+
}
|
|
17
|
+
export function parseRuntimeOwnerRecord(content) {
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = JSON.parse(content);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
throw new Error('Invalid Mission runtime owner record: expected JSON.');
|
|
24
|
+
}
|
|
25
|
+
assertRuntimeOwnerRecord(parsed);
|
|
26
|
+
if (content !== canonicalRuntimeOwnerRecord(parsed)) {
|
|
27
|
+
throw new Error('Invalid Mission runtime owner record: expected canonical JSON.');
|
|
28
|
+
}
|
|
29
|
+
return parsed;
|
|
30
|
+
}
|
|
31
|
+
export function assertRuntimeOwnerRecord(value) {
|
|
32
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
33
|
+
throw new Error('Invalid Mission runtime owner record: root must be an object.');
|
|
34
|
+
}
|
|
35
|
+
const record = value;
|
|
36
|
+
const allowed = new Set(runtimeOwnerFields);
|
|
37
|
+
for (const key of Object.keys(record)) {
|
|
38
|
+
if (!allowed.has(key)) {
|
|
39
|
+
throw new Error(`Invalid Mission runtime owner record: unexpected field ${key}.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (Object.keys(record).length !== runtimeOwnerFields.length
|
|
43
|
+
|| runtimeOwnerFields.some((field) => !(field in record))) {
|
|
44
|
+
throw new Error('Invalid Mission runtime owner record: exact fields are required.');
|
|
45
|
+
}
|
|
46
|
+
if (record.version !== 1) {
|
|
47
|
+
throw new Error('Invalid Mission runtime owner record: version must be 1.');
|
|
48
|
+
}
|
|
49
|
+
for (const field of [
|
|
50
|
+
'repository',
|
|
51
|
+
'deploymentId',
|
|
52
|
+
'githubAppInstallationId',
|
|
53
|
+
'credentialGeneration',
|
|
54
|
+
]) {
|
|
55
|
+
if (typeof record[field] !== 'string' || record[field].trim().length === 0) {
|
|
56
|
+
throw new Error(`Invalid Mission runtime owner record: ${field} must be non-empty.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (!Number.isSafeInteger(record.compatibilityEpoch) || record.compatibilityEpoch <= 0
|
|
60
|
+
|| !Number.isSafeInteger(record.fencingEpoch) || record.fencingEpoch <= 0) {
|
|
61
|
+
throw new Error('Invalid Mission runtime owner record: epochs must be positive integers.');
|
|
62
|
+
}
|
|
63
|
+
if (typeof record.deploymentRecordHash !== 'string'
|
|
64
|
+
|| !/^sha256:[a-f0-9]{64}$/u.test(record.deploymentRecordHash)) {
|
|
65
|
+
throw new Error('Invalid Mission runtime owner record: deploymentRecordHash must be SHA-256.');
|
|
66
|
+
}
|
|
67
|
+
if (typeof record.approvedByCommit !== 'string'
|
|
68
|
+
|| !/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/u.test(record.approvedByCommit)) {
|
|
69
|
+
throw new Error('Invalid Mission runtime owner record: approvedByCommit must be a Git object ID.');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export class RuntimeOwnerConflictError extends Error {
|
|
73
|
+
constructor(message) {
|
|
74
|
+
super(`Mission runtime owner conflict: ${message}`);
|
|
75
|
+
this.name = 'RuntimeOwnerConflictError';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export class MissionRuntimeOwnership {
|
|
79
|
+
adapter;
|
|
80
|
+
constructor(adapter) {
|
|
81
|
+
this.adapter = adapter;
|
|
82
|
+
}
|
|
83
|
+
async acquireInitial(deployment) {
|
|
84
|
+
const observed = await this.adapter.read();
|
|
85
|
+
if (observed) {
|
|
86
|
+
throw new RuntimeOwnerConflictError(`already owned by ${observed.record.deploymentId}`);
|
|
87
|
+
}
|
|
88
|
+
return this.adapter.compareAndSwap(undefined, ownerRecord(deployment, 1));
|
|
89
|
+
}
|
|
90
|
+
async transfer(deployment, githubServerTime) {
|
|
91
|
+
const observed = await this.adapter.read();
|
|
92
|
+
if (!observed) {
|
|
93
|
+
throw new RuntimeOwnerConflictError('cannot transfer an absent owner; use initial acquisition');
|
|
94
|
+
}
|
|
95
|
+
if (deployment.repository !== observed.record.repository) {
|
|
96
|
+
throw new RuntimeOwnerConflictError('repository does not match current owner');
|
|
97
|
+
}
|
|
98
|
+
if (deployment.deploymentId === observed.record.deploymentId) {
|
|
99
|
+
throw new RuntimeOwnerConflictError('transfer requires a different deployment ID');
|
|
100
|
+
}
|
|
101
|
+
const now = exactTimestamp(githubServerTime, 'GitHub server time');
|
|
102
|
+
const notBefore = exactTimestamp(deployment.takeoverNotBefore, 'takeoverNotBefore');
|
|
103
|
+
if (now < notBefore) {
|
|
104
|
+
throw new RuntimeOwnerConflictError(`takeoverNotBefore is ${deployment.takeoverNotBefore}`);
|
|
105
|
+
}
|
|
106
|
+
if (exactTimestamp(deployment.priorCredentialRevokedAt, 'priorCredentialRevokedAt') > now) {
|
|
107
|
+
throw new RuntimeOwnerConflictError('prior credential revocation is not yet observed');
|
|
108
|
+
}
|
|
109
|
+
if (deployment.credentialGeneration === observed.record.credentialGeneration) {
|
|
110
|
+
throw new RuntimeOwnerConflictError('transfer requires a new credential generation');
|
|
111
|
+
}
|
|
112
|
+
if (deployment.compatibilityEpoch < observed.record.compatibilityEpoch) {
|
|
113
|
+
throw new RuntimeOwnerConflictError('compatibility epoch cannot move backward');
|
|
114
|
+
}
|
|
115
|
+
return this.adapter.compareAndSwap(observed.sha, ownerRecord(deployment, observed.record.fencingEpoch + 1));
|
|
116
|
+
}
|
|
117
|
+
async assertMutationFence(deployment, expectedFencingEpoch) {
|
|
118
|
+
if (!Number.isSafeInteger(expectedFencingEpoch) || expectedFencingEpoch <= 0) {
|
|
119
|
+
throw new RuntimeOwnerConflictError('fencing epoch must be a positive integer');
|
|
120
|
+
}
|
|
121
|
+
const observed = await this.adapter.read();
|
|
122
|
+
if (!observed) {
|
|
123
|
+
throw new RuntimeOwnerConflictError('owner ref is absent');
|
|
124
|
+
}
|
|
125
|
+
const expected = ownerRecord(deployment, expectedFencingEpoch);
|
|
126
|
+
if (observed.record.credentialGeneration !== expected.credentialGeneration) {
|
|
127
|
+
throw new RuntimeOwnerConflictError('credential generation does not match current owner');
|
|
128
|
+
}
|
|
129
|
+
for (const field of [
|
|
130
|
+
'repository',
|
|
131
|
+
'deploymentId',
|
|
132
|
+
'githubAppInstallationId',
|
|
133
|
+
'compatibilityEpoch',
|
|
134
|
+
'deploymentRecordHash',
|
|
135
|
+
'approvedByCommit',
|
|
136
|
+
]) {
|
|
137
|
+
if (observed.record[field] !== expected[field]) {
|
|
138
|
+
throw new RuntimeOwnerConflictError(`${field} does not match the protected deployment record`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (observed.record.fencingEpoch !== expectedFencingEpoch) {
|
|
142
|
+
throw new RuntimeOwnerConflictError('fencing epoch does not match current owner');
|
|
143
|
+
}
|
|
144
|
+
return observed;
|
|
145
|
+
}
|
|
146
|
+
async runFencedMutation(deployment, expectedFencingEpoch, mutation) {
|
|
147
|
+
const fence = await this.assertMutationFence(deployment, expectedFencingEpoch);
|
|
148
|
+
return mutation(fence);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export function ownerRecord(deployment, fencingEpoch) {
|
|
152
|
+
if (!Number.isSafeInteger(fencingEpoch) || fencingEpoch <= 0) {
|
|
153
|
+
throw new Error('Mission runtime owner fencingEpoch must be a positive integer.');
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
version: 1,
|
|
157
|
+
repository: deployment.repository,
|
|
158
|
+
deploymentId: deployment.deploymentId,
|
|
159
|
+
githubAppInstallationId: deployment.githubAppInstallationId,
|
|
160
|
+
credentialGeneration: deployment.credentialGeneration,
|
|
161
|
+
compatibilityEpoch: deployment.compatibilityEpoch,
|
|
162
|
+
deploymentRecordHash: missionDeploymentRecordHash(deployment),
|
|
163
|
+
approvedByCommit: deployment.approvedByCommit,
|
|
164
|
+
fencingEpoch,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function exactTimestamp(value, field) {
|
|
168
|
+
const parsed = Date.parse(value);
|
|
169
|
+
if (!Number.isFinite(parsed) || new Date(parsed).toISOString() !== value) {
|
|
170
|
+
throw new RuntimeOwnerConflictError(`${field} is not an exact UTC ISO timestamp`);
|
|
171
|
+
}
|
|
172
|
+
return parsed;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=mission-runtime-owner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mission-runtime-owner.js","sourceRoot":"","sources":["../../../src/runner/mission-runtime-owner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AA2BtE,MAAM,kBAAkB,GAA4C;IAClE,SAAS;IACT,YAAY;IACZ,cAAc;IACd,yBAAyB;IACzB,sBAAsB;IACtB,oBAAoB;IACpB,sBAAsB;IACtB,kBAAkB;IAClB,cAAc;CACf,CAAC;AAEF,MAAM,UAAU,2BAA2B,CAAC,MAA0B;IACpE,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvG,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,OAAO,KAAK,2BAA2B,CAAC,MAAM,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,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AAyB,CAAC,GAAG,KAAK,oCAAoC,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type MissionExecutorProbeResult } from './mission-executor-probe.js';
|
|
2
|
+
import { type MissionProcessInput, type MissionProcessResult } from './mission-process-executor.js';
|
|
3
|
+
import type { MissionSandboxBackend } from './mission-capability-kernel.js';
|
|
4
|
+
export declare const missionSafeExecutorKinds: readonly ["completion-report-repair", "review-evidence-repair", "acceptance-proof-repair", "configured-check"];
|
|
5
|
+
export type MissionSafeExecutorKind = (typeof missionSafeExecutorKinds)[number];
|
|
6
|
+
export interface MissionSafeExecutorDescriptor {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: MissionSafeExecutorKind;
|
|
9
|
+
executable: string;
|
|
10
|
+
args: string[];
|
|
11
|
+
readPaths: string[];
|
|
12
|
+
writePaths: string[];
|
|
13
|
+
network: 'deny';
|
|
14
|
+
idempotency: 'repeat-safe' | 'reconcile';
|
|
15
|
+
}
|
|
16
|
+
export interface MissionSafeExecutorPermit extends MissionSafeExecutorDescriptor {
|
|
17
|
+
missionId: string;
|
|
18
|
+
actionKey: string;
|
|
19
|
+
executorId: string;
|
|
20
|
+
grantedPaths: string[];
|
|
21
|
+
inputSnapshot: string;
|
|
22
|
+
fencingEpoch: number;
|
|
23
|
+
expiresAt: string;
|
|
24
|
+
descriptorFingerprint: string;
|
|
25
|
+
}
|
|
26
|
+
export interface MissionSafeExecutorAuthorizationRequest {
|
|
27
|
+
missionId: string;
|
|
28
|
+
actionKey: string;
|
|
29
|
+
executorId: string;
|
|
30
|
+
grantedPaths: string[];
|
|
31
|
+
inputSnapshot: string;
|
|
32
|
+
fencingEpoch: number;
|
|
33
|
+
expiresAt: string;
|
|
34
|
+
}
|
|
35
|
+
export type MissionSafeExecutorClassification = {
|
|
36
|
+
kind: 'safe-executor';
|
|
37
|
+
descriptor: MissionSafeExecutorDescriptor;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'external-input-required';
|
|
40
|
+
reason: 'legacy-shell-executor-unavailable-in-mission-mode';
|
|
41
|
+
migration: 'register an exact argv Mission safe executor';
|
|
42
|
+
};
|
|
43
|
+
export interface MissionSafeExecutorOptions {
|
|
44
|
+
backend: MissionSandboxBackend;
|
|
45
|
+
workspaceRoot: string;
|
|
46
|
+
quarantineRoot: string;
|
|
47
|
+
deniedReadPaths: string[];
|
|
48
|
+
sourceEnv: NodeJS.ProcessEnv;
|
|
49
|
+
allowedEnvKeys: string[];
|
|
50
|
+
timeoutMs: number;
|
|
51
|
+
capabilityProof: MissionExecutorProbeResult;
|
|
52
|
+
}
|
|
53
|
+
export interface MissionSafeExecutorReceipt {
|
|
54
|
+
version: 1;
|
|
55
|
+
missionId: string;
|
|
56
|
+
actionKey: string;
|
|
57
|
+
executorId: string;
|
|
58
|
+
descriptorFingerprint: string;
|
|
59
|
+
exitCode: number;
|
|
60
|
+
termination: MissionProcessResult['termination'];
|
|
61
|
+
stdoutSha256: string;
|
|
62
|
+
stderrSha256: string;
|
|
63
|
+
outputs: Array<{
|
|
64
|
+
path: string;
|
|
65
|
+
size: number;
|
|
66
|
+
sha256: string;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
export interface MissionSafeExecutorResult {
|
|
70
|
+
process: MissionProcessResult;
|
|
71
|
+
receipt: MissionSafeExecutorReceipt;
|
|
72
|
+
}
|
|
73
|
+
export interface MissionSafeExecutorDependencies {
|
|
74
|
+
runProcess?: (input: MissionProcessInput) => Promise<MissionProcessResult>;
|
|
75
|
+
now?: () => Date;
|
|
76
|
+
}
|
|
77
|
+
export declare class MissionSafeExecutorRegistry {
|
|
78
|
+
private readonly descriptors;
|
|
79
|
+
constructor(descriptors: MissionSafeExecutorDescriptor[]);
|
|
80
|
+
authorize(request: MissionSafeExecutorAuthorizationRequest): MissionSafeExecutorPermit;
|
|
81
|
+
classify(input: string | {
|
|
82
|
+
executorId: string;
|
|
83
|
+
}): MissionSafeExecutorClassification;
|
|
84
|
+
kinds(): MissionSafeExecutorKind[];
|
|
85
|
+
validatePermit(permit: MissionSafeExecutorPermit, now: Date): MissionSafeExecutorPermit;
|
|
86
|
+
}
|
|
87
|
+
export declare class MissionSafeExecutor {
|
|
88
|
+
private readonly registry;
|
|
89
|
+
private readonly options;
|
|
90
|
+
private readonly runProcess;
|
|
91
|
+
private readonly now;
|
|
92
|
+
constructor(registry: MissionSafeExecutorRegistry, options: MissionSafeExecutorOptions, dependencies?: MissionSafeExecutorDependencies);
|
|
93
|
+
execute(permit: MissionSafeExecutorPermit): Promise<MissionSafeExecutorResult>;
|
|
94
|
+
}
|
|
95
|
+
export declare function missionSafeExecutorPermitFingerprint(permit: MissionSafeExecutorPermit): string;
|
|
96
|
+
//# sourceMappingURL=mission-safe-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mission-safe-executor.d.ts","sourceRoot":"","sources":["../../../src/runner/mission-safe-executor.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,eAAO,MAAM,wBAAwB,gHAK3B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB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E,+BAAoC;IAavC,OAAO,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;CA4C5F;AAED,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAY9F"}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { lstat, readdir } from 'node:fs/promises';
|
|
3
|
+
import { basename, isAbsolute, join } from 'node:path';
|
|
4
|
+
import { globMatches, normalizePath, uniqueSortedPaths } from '../path-policy.js';
|
|
5
|
+
import { inspectCanonicalFile } from './mission-canonical-path.js';
|
|
6
|
+
import { missionExecutorRequiredChecks, } from './mission-executor-probe.js';
|
|
7
|
+
import { assertMissionPathPattern, missionDefaultDeniedRepositoryPaths, missionPathPatternsOverlap, scopePatternContainedBy, } from './mission-path-language.js';
|
|
8
|
+
import { runMissionProcess, } from './mission-process-executor.js';
|
|
9
|
+
import { buildMissionSandboxInvocation } from './mission-sandbox.js';
|
|
10
|
+
export const missionSafeExecutorKinds = [
|
|
11
|
+
'completion-report-repair',
|
|
12
|
+
'review-evidence-repair',
|
|
13
|
+
'acceptance-proof-repair',
|
|
14
|
+
'configured-check',
|
|
15
|
+
];
|
|
16
|
+
export class MissionSafeExecutorRegistry {
|
|
17
|
+
descriptors = new Map();
|
|
18
|
+
constructor(descriptors) {
|
|
19
|
+
for (const input of descriptors) {
|
|
20
|
+
const descriptor = normalizeDescriptor(input);
|
|
21
|
+
if (this.descriptors.has(descriptor.id)) {
|
|
22
|
+
throw new Error(`Mission safe executor id is duplicated: ${descriptor.id}.`);
|
|
23
|
+
}
|
|
24
|
+
this.descriptors.set(descriptor.id, descriptor);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
authorize(request) {
|
|
28
|
+
requireText(request.missionId, 'missionId');
|
|
29
|
+
requireText(request.actionKey, 'actionKey');
|
|
30
|
+
requireText(request.inputSnapshot, 'inputSnapshot');
|
|
31
|
+
if (!Number.isSafeInteger(request.fencingEpoch) || request.fencingEpoch <= 0) {
|
|
32
|
+
throw new Error('Mission safe executor fencingEpoch must be a positive integer.');
|
|
33
|
+
}
|
|
34
|
+
if (!Number.isFinite(Date.parse(request.expiresAt))) {
|
|
35
|
+
throw new Error('Mission safe executor expiresAt must be an ISO timestamp.');
|
|
36
|
+
}
|
|
37
|
+
const descriptor = this.descriptors.get(request.executorId);
|
|
38
|
+
if (!descriptor) {
|
|
39
|
+
throw new Error(`Mission safe executor is not registered: ${request.executorId}.`);
|
|
40
|
+
}
|
|
41
|
+
const grantedPaths = uniqueSortedPaths(request.grantedPaths);
|
|
42
|
+
if (grantedPaths.length === 0) {
|
|
43
|
+
throw new Error('Mission safe executor granted scope must not be empty.');
|
|
44
|
+
}
|
|
45
|
+
for (const path of descriptor.readPaths) {
|
|
46
|
+
if (!grantedPaths.some((grant) => scopePatternContainedBy(path, grant))) {
|
|
47
|
+
throw new Error(`Mission safe executor path is outside granted scope: ${path}.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
...structuredClone(descriptor),
|
|
52
|
+
missionId: request.missionId,
|
|
53
|
+
actionKey: request.actionKey,
|
|
54
|
+
executorId: descriptor.id,
|
|
55
|
+
grantedPaths,
|
|
56
|
+
inputSnapshot: request.inputSnapshot,
|
|
57
|
+
fencingEpoch: request.fencingEpoch,
|
|
58
|
+
expiresAt: request.expiresAt,
|
|
59
|
+
descriptorFingerprint: descriptorFingerprint(descriptor),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
classify(input) {
|
|
63
|
+
if (typeof input === 'string') {
|
|
64
|
+
return {
|
|
65
|
+
kind: 'external-input-required',
|
|
66
|
+
reason: 'legacy-shell-executor-unavailable-in-mission-mode',
|
|
67
|
+
migration: 'register an exact argv Mission safe executor',
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const descriptor = this.descriptors.get(input.executorId);
|
|
71
|
+
if (!descriptor) {
|
|
72
|
+
throw new Error(`Mission safe executor is not registered: ${input.executorId}.`);
|
|
73
|
+
}
|
|
74
|
+
return { kind: 'safe-executor', descriptor: structuredClone(descriptor) };
|
|
75
|
+
}
|
|
76
|
+
kinds() {
|
|
77
|
+
return Array.from(new Set([...this.descriptors.values()].map((descriptor) => descriptor.kind))).sort();
|
|
78
|
+
}
|
|
79
|
+
validatePermit(permit, now) {
|
|
80
|
+
const receivedDescriptor = normalizeDescriptor(permit);
|
|
81
|
+
const registered = this.descriptors.get(permit.executorId);
|
|
82
|
+
if (!registered
|
|
83
|
+
|| descriptorFingerprint(receivedDescriptor) !== permit.descriptorFingerprint
|
|
84
|
+
|| descriptorFingerprint(registered) !== permit.descriptorFingerprint) {
|
|
85
|
+
throw new Error('Mission safe executor permit descriptor was modified or unregistered.');
|
|
86
|
+
}
|
|
87
|
+
if (Date.parse(permit.expiresAt) <= now.getTime()) {
|
|
88
|
+
throw new Error('Mission safe executor permit has expired.');
|
|
89
|
+
}
|
|
90
|
+
const authorized = this.authorize({
|
|
91
|
+
missionId: permit.missionId,
|
|
92
|
+
actionKey: permit.actionKey,
|
|
93
|
+
executorId: permit.executorId,
|
|
94
|
+
grantedPaths: permit.grantedPaths,
|
|
95
|
+
inputSnapshot: permit.inputSnapshot,
|
|
96
|
+
fencingEpoch: permit.fencingEpoch,
|
|
97
|
+
expiresAt: permit.expiresAt,
|
|
98
|
+
});
|
|
99
|
+
if (missionSafeExecutorPermitFingerprint(authorized)
|
|
100
|
+
!== missionSafeExecutorPermitFingerprint(permit)) {
|
|
101
|
+
throw new Error('Mission safe executor permit identity was modified.');
|
|
102
|
+
}
|
|
103
|
+
return authorized;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export class MissionSafeExecutor {
|
|
107
|
+
registry;
|
|
108
|
+
options;
|
|
109
|
+
runProcess;
|
|
110
|
+
now;
|
|
111
|
+
constructor(registry, options, dependencies = {}) {
|
|
112
|
+
this.registry = registry;
|
|
113
|
+
this.options = options;
|
|
114
|
+
const checks = new Set(options.capabilityProof.checks);
|
|
115
|
+
if (!options.capabilityProof.supported
|
|
116
|
+
|| options.capabilityProof.backend !== options.backend
|
|
117
|
+
|| options.capabilityProof.failures.length > 0
|
|
118
|
+
|| missionExecutorRequiredChecks.some((check) => !checks.has(check))) {
|
|
119
|
+
throw new Error('Mission safe executor requires a successful active capability proof.');
|
|
120
|
+
}
|
|
121
|
+
this.runProcess = dependencies.runProcess ?? runMissionProcess;
|
|
122
|
+
this.now = dependencies.now ?? (() => new Date());
|
|
123
|
+
}
|
|
124
|
+
async execute(permit) {
|
|
125
|
+
const authorized = this.registry.validatePermit(permit, this.now());
|
|
126
|
+
const existingOutputs = await inspectQuarantineOutputs(this.options.quarantineRoot);
|
|
127
|
+
if (existingOutputs.length > 0) {
|
|
128
|
+
throw new Error('Mission safe executor requires a fresh empty quarantine.');
|
|
129
|
+
}
|
|
130
|
+
const invocation = buildMissionSandboxInvocation({
|
|
131
|
+
backend: this.options.backend,
|
|
132
|
+
workspaceRoot: this.options.workspaceRoot,
|
|
133
|
+
quarantineRoot: this.options.quarantineRoot,
|
|
134
|
+
mode: authorized.writePaths.length > 0 ? 'quarantine-write' : 'read-only',
|
|
135
|
+
command: authorized.executable,
|
|
136
|
+
args: authorized.args,
|
|
137
|
+
deniedReadPaths: this.options.deniedReadPaths,
|
|
138
|
+
});
|
|
139
|
+
const process = await this.runProcess({
|
|
140
|
+
...invocation,
|
|
141
|
+
cwd: this.options.workspaceRoot,
|
|
142
|
+
timeoutMs: this.options.timeoutMs,
|
|
143
|
+
sourceEnv: this.options.sourceEnv,
|
|
144
|
+
allowedEnvKeys: this.options.allowedEnvKeys,
|
|
145
|
+
});
|
|
146
|
+
const outputs = await inspectQuarantineOutputs(this.options.quarantineRoot);
|
|
147
|
+
const undeclared = outputs.filter((output) => !authorized.writePaths.some((pattern) => globMatches(pattern, output.path)));
|
|
148
|
+
if (undeclared.length > 0) {
|
|
149
|
+
throw new Error(`Mission safe executor produced undeclared quarantine output: ${undeclared[0].path}.`);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
process,
|
|
153
|
+
receipt: {
|
|
154
|
+
version: 1,
|
|
155
|
+
missionId: authorized.missionId,
|
|
156
|
+
actionKey: authorized.actionKey,
|
|
157
|
+
executorId: authorized.executorId,
|
|
158
|
+
descriptorFingerprint: authorized.descriptorFingerprint,
|
|
159
|
+
exitCode: process.exitCode,
|
|
160
|
+
termination: process.termination,
|
|
161
|
+
stdoutSha256: hash(process.stdout),
|
|
162
|
+
stderrSha256: hash(process.stderr),
|
|
163
|
+
outputs,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
export function missionSafeExecutorPermitFingerprint(permit) {
|
|
169
|
+
return hash(JSON.stringify([
|
|
170
|
+
'mission-safe-executor-permit-v1',
|
|
171
|
+
permit.missionId,
|
|
172
|
+
permit.actionKey,
|
|
173
|
+
permit.executorId,
|
|
174
|
+
permit.descriptorFingerprint,
|
|
175
|
+
permit.grantedPaths,
|
|
176
|
+
permit.inputSnapshot,
|
|
177
|
+
permit.fencingEpoch,
|
|
178
|
+
permit.expiresAt,
|
|
179
|
+
]));
|
|
180
|
+
}
|
|
181
|
+
function normalizeDescriptor(input) {
|
|
182
|
+
const id = requireText(input.id, 'id');
|
|
183
|
+
if (!missionSafeExecutorKinds.includes(input.kind)) {
|
|
184
|
+
throw new Error(`Mission safe executor kind is invalid: ${String(input.kind)}.`);
|
|
185
|
+
}
|
|
186
|
+
if (!isAbsolute(input.executable)) {
|
|
187
|
+
throw new Error('Mission safe executor executable must be absolute.');
|
|
188
|
+
}
|
|
189
|
+
if (['sh', 'bash', 'zsh', 'fish', 'dash', 'env'].includes(basename(input.executable))) {
|
|
190
|
+
throw new Error('Mission safe executor forbids shell executables.');
|
|
191
|
+
}
|
|
192
|
+
if (input.args.some((arg) => arg.includes('\0') || /\$\(|`|\|\||&&|[<>;]/u.test(arg))) {
|
|
193
|
+
throw new Error('Mission safe executor arguments contain shell-control syntax.');
|
|
194
|
+
}
|
|
195
|
+
if (input.network !== 'deny') {
|
|
196
|
+
throw new Error('Mission safe executor network must be denied.');
|
|
197
|
+
}
|
|
198
|
+
if (input.idempotency !== 'repeat-safe' && input.idempotency !== 'reconcile') {
|
|
199
|
+
throw new Error('Mission safe executor idempotency is invalid.');
|
|
200
|
+
}
|
|
201
|
+
const readPaths = uniqueSortedPaths(input.readPaths);
|
|
202
|
+
const writePaths = uniqueSortedPaths(input.writePaths);
|
|
203
|
+
if (readPaths.length === 0) {
|
|
204
|
+
throw new Error('Mission safe executor requires finite read scope.');
|
|
205
|
+
}
|
|
206
|
+
for (const path of [...readPaths, ...writePaths]) {
|
|
207
|
+
assertMissionPathPattern(path, 'Mission safe executor path');
|
|
208
|
+
if (missionDefaultDeniedRepositoryPaths.some((denied) => missionPathPatternsOverlap(path, denied))) {
|
|
209
|
+
throw new Error(`Mission safe executor path overlaps a denied repository path: ${path}.`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
id,
|
|
214
|
+
kind: input.kind,
|
|
215
|
+
executable: input.executable,
|
|
216
|
+
args: [...input.args],
|
|
217
|
+
readPaths,
|
|
218
|
+
writePaths,
|
|
219
|
+
network: 'deny',
|
|
220
|
+
idempotency: input.idempotency,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function descriptorFingerprint(descriptor) {
|
|
224
|
+
return hash(JSON.stringify([
|
|
225
|
+
'mission-safe-executor-descriptor-v1',
|
|
226
|
+
descriptor.id,
|
|
227
|
+
descriptor.kind,
|
|
228
|
+
descriptor.executable,
|
|
229
|
+
descriptor.args,
|
|
230
|
+
descriptor.readPaths,
|
|
231
|
+
descriptor.writePaths,
|
|
232
|
+
descriptor.network,
|
|
233
|
+
descriptor.idempotency,
|
|
234
|
+
]));
|
|
235
|
+
}
|
|
236
|
+
function hash(value) {
|
|
237
|
+
return `sha256:${createHash('sha256').update(value).digest('hex')}`;
|
|
238
|
+
}
|
|
239
|
+
async function inspectQuarantineOutputs(root) {
|
|
240
|
+
const paths = [];
|
|
241
|
+
await walk('');
|
|
242
|
+
const outputs = [];
|
|
243
|
+
for (const path of paths.sort()) {
|
|
244
|
+
const inspected = await inspectCanonicalFile({
|
|
245
|
+
root,
|
|
246
|
+
path,
|
|
247
|
+
deniedPaths: [],
|
|
248
|
+
missing: 'reject',
|
|
249
|
+
});
|
|
250
|
+
if (!inspected)
|
|
251
|
+
throw new Error(`Mission safe executor quarantine output disappeared: ${path}.`);
|
|
252
|
+
outputs.push({
|
|
253
|
+
path,
|
|
254
|
+
size: inspected.identity.size,
|
|
255
|
+
sha256: `sha256:${inspected.identity.sha256}`,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
return outputs;
|
|
259
|
+
async function walk(relativeDirectory) {
|
|
260
|
+
const directory = relativeDirectory ? join(root, relativeDirectory) : root;
|
|
261
|
+
const entries = await readdir(directory);
|
|
262
|
+
for (const entry of entries) {
|
|
263
|
+
const relativePath = normalizePath(relativeDirectory
|
|
264
|
+
? `${relativeDirectory}/${entry}` : entry);
|
|
265
|
+
const info = await lstat(join(root, relativePath));
|
|
266
|
+
if (info.isSymbolicLink()) {
|
|
267
|
+
throw new Error(`Mission safe executor refuses symbolic quarantine output: ${relativePath}.`);
|
|
268
|
+
}
|
|
269
|
+
if (info.isDirectory()) {
|
|
270
|
+
await walk(relativePath);
|
|
271
|
+
}
|
|
272
|
+
else if (info.isFile()) {
|
|
273
|
+
paths.push(relativePath);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
throw new Error(`Mission safe executor refuses non-regular quarantine output: ${relativePath}.`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function requireText(value, field) {
|
|
282
|
+
const normalized = value.trim();
|
|
283
|
+
if (normalized.length === 0) {
|
|
284
|
+
throw new Error(`Mission safe executor ${field} must be non-empty.`);
|
|
285
|
+
}
|
|
286
|
+
return normalized;
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=mission-safe-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mission-safe-executor.js","sourceRoot":"","sources":["../../../src/runner/mission-safe-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACL,6BAA6B,GAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,mCAAmC,EACnC,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iBAAiB,GAGlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAGrE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,0BAA0B;IAC1B,wBAAwB;IACxB,yBAAyB;IACzB,kBAAkB;CACV,CAAC;AAkFX,MAAM,OAAO,2BAA2B;IACrB,WAAW,GAAG,IAAI,GAAG,EAAyC,CAAC;IAEhF,YAAmB,WAA4C;QAC7D,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;YAChC,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;YAC9C,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAI,KAAK,CAAC,2CAA2C,UAAU,CAAC,EAAE,GAAG,CAAC,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+
import type { MissionSandboxBackend } from './mission-capability-kernel.js';
|
|
2
|
+
export interface MissionSandboxInput {
|
|
3
|
+
backend: MissionSandboxBackend;
|
|
4
|
+
workspaceRoot: string;
|
|
5
|
+
quarantineRoot: string;
|
|
6
|
+
mode: 'read-only' | 'quarantine-write';
|
|
7
|
+
command: string;
|
|
8
|
+
args: string[];
|
|
9
|
+
deniedReadPaths?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface MissionSandboxInvocation {
|
|
12
|
+
file: string;
|
|
13
|
+
args: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function buildMissionSandboxInvocation(input: MissionSandboxInput): MissionSandboxInvocation;
|
|
16
|
+
//# sourceMappingURL=mission-sandbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mission-sandbox.d.ts","sourceRoot":"","sources":["../../../src/runner/mission-sandbox.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,WAAW,GAAG,kBAAkB,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,mBAAmB,GAAG,wBAAwB,CAuDlG"}
|