@warpgogol/forge 9.7.1 → 10.1.0
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/AGENTS.md +50 -27
- package/CHANGELOG.md +39 -0
- package/bin/cli.js +0 -0
- package/dist/os/codebase/handlers/codebase-measure-symbols.d.ts.map +1 -1
- package/dist/os/codebase/handlers/codebase-measure-symbols.js +35 -4
- package/dist/os/codebase/handlers/codebase-measure-symbols.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +1 -69
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +2 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/determinism-check.d.ts.map +1 -1
- package/dist/os/core/handlers/determinism-check.js +2 -3
- package/dist/os/core/handlers/determinism-check.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +2 -4
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/flow/handlers/flow-peers.js +1 -1
- package/dist/os/flow/handlers/flow-peers.js.map +1 -1
- package/dist/os/{mission → flow}/open-missions.d.ts +1 -2
- package/dist/os/flow/open-missions.d.ts.map +1 -0
- package/dist/os/flow/open-missions.js +37 -0
- package/dist/os/flow/open-missions.js.map +1 -0
- package/dist/os/flow/preflight.js +1 -1
- package/dist/os/flow/preflight.js.map +1 -1
- package/dist/os/rfc/probe-batch.d.ts.map +1 -1
- package/dist/os/rfc/probe-batch.js +13 -6
- package/dist/os/rfc/probe-batch.js.map +1 -1
- package/dist/src/command-modules.d.ts.map +1 -1
- package/dist/src/command-modules.js +0 -2
- package/dist/src/command-modules.js.map +1 -1
- package/dist/src/contract/core-nodes.d.ts +8 -0
- package/dist/src/contract/core-nodes.d.ts.map +1 -0
- package/dist/src/contract/core-nodes.js +101 -0
- package/dist/src/contract/core-nodes.js.map +1 -0
- package/dist/src/contract/evaluator.d.ts +48 -0
- package/dist/src/contract/evaluator.d.ts.map +1 -0
- package/dist/src/contract/evaluator.js +158 -0
- package/dist/src/contract/evaluator.js.map +1 -0
- package/dist/src/contract/evidence-store.d.ts +17 -0
- package/dist/src/contract/evidence-store.d.ts.map +1 -0
- package/dist/src/contract/evidence-store.js +113 -0
- package/dist/src/contract/evidence-store.js.map +1 -0
- package/dist/src/contract/executors/zero-deps.d.ts +3 -0
- package/dist/src/contract/executors/zero-deps.d.ts.map +1 -0
- package/dist/src/contract/executors/zero-deps.js +88 -0
- package/dist/src/contract/executors/zero-deps.js.map +1 -0
- package/dist/src/contract/fingerprint.d.ts +34 -0
- package/dist/src/contract/fingerprint.d.ts.map +1 -0
- package/dist/src/contract/fingerprint.js +153 -0
- package/dist/src/contract/fingerprint.js.map +1 -0
- package/dist/src/contract/graph.d.ts +23 -0
- package/dist/src/contract/graph.d.ts.map +1 -0
- package/dist/src/contract/graph.js +158 -0
- package/dist/src/contract/graph.js.map +1 -0
- package/dist/src/contract/migration-map.d.ts +51 -0
- package/dist/src/contract/migration-map.d.ts.map +1 -0
- package/dist/src/contract/migration-map.js +130 -0
- package/dist/src/contract/migration-map.js.map +1 -0
- package/dist/src/contract/types.d.ts +108 -0
- package/dist/src/contract/types.d.ts.map +1 -0
- package/dist/src/contract/types.js +23 -0
- package/dist/src/contract/types.js.map +1 -0
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/integration/drain.d.ts +31 -0
- package/dist/src/integration/drain.d.ts.map +1 -0
- package/dist/src/integration/drain.js +195 -0
- package/dist/src/integration/drain.js.map +1 -0
- package/dist/src/integration/enqueue.d.ts +30 -0
- package/dist/src/integration/enqueue.d.ts.map +1 -0
- package/dist/src/integration/enqueue.js +64 -0
- package/dist/src/integration/enqueue.js.map +1 -0
- package/dist/src/integration/gitops.d.ts +33 -0
- package/dist/src/integration/gitops.d.ts.map +1 -0
- package/dist/src/integration/gitops.js +128 -0
- package/dist/src/integration/gitops.js.map +1 -0
- package/dist/src/integration/lease.d.ts +16 -0
- package/dist/src/integration/lease.d.ts.map +1 -0
- package/dist/src/integration/lease.js +140 -0
- package/dist/src/integration/lease.js.map +1 -0
- package/dist/src/integration/materialize.d.ts +7 -0
- package/dist/src/integration/materialize.d.ts.map +1 -0
- package/dist/src/integration/materialize.js +34 -0
- package/dist/src/integration/materialize.js.map +1 -0
- package/dist/src/integration/store.d.ts +21 -0
- package/dist/src/integration/store.d.ts.map +1 -0
- package/dist/src/integration/store.js +131 -0
- package/dist/src/integration/store.js.map +1 -0
- package/dist/src/integration/types.d.ts +71 -0
- package/dist/src/integration/types.d.ts.map +1 -0
- package/dist/src/integration/types.js +18 -0
- package/dist/src/integration/types.js.map +1 -0
- package/dist/src/onboarding/doctor.d.ts +0 -5
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +6 -79
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/npm-token-check.d.ts +1 -1
- package/dist/src/onboarding/npm-token-check.d.ts.map +1 -1
- package/dist/src/onboarding/npm-token-check.js +2 -2
- package/dist/src/onboarding/npm-token-check.js.map +1 -1
- package/dist/src/sdk/context.d.ts +13 -0
- package/dist/src/sdk/context.d.ts.map +1 -0
- package/dist/src/sdk/context.js +128 -0
- package/dist/src/sdk/context.js.map +1 -0
- package/dist/src/sdk/loader.d.ts +25 -0
- package/dist/src/sdk/loader.d.ts.map +1 -0
- package/dist/src/sdk/loader.js +155 -0
- package/dist/src/sdk/loader.js.map +1 -0
- package/dist/src/sdk/scan.d.ts +16 -0
- package/dist/src/sdk/scan.d.ts.map +1 -0
- package/dist/src/sdk/scan.js +126 -0
- package/dist/src/sdk/scan.js.map +1 -0
- package/dist/src/sdk/skills-gen.d.ts +27 -0
- package/dist/src/sdk/skills-gen.d.ts.map +1 -0
- package/dist/src/sdk/skills-gen.js +87 -0
- package/dist/src/sdk/skills-gen.js.map +1 -0
- package/dist/src/sdk/types.d.ts +124 -0
- package/dist/src/sdk/types.d.ts.map +1 -0
- package/dist/src/sdk/types.js +34 -0
- package/dist/src/sdk/types.js.map +1 -0
- package/dist/src/utils/hash.d.ts +1 -0
- package/dist/src/utils/hash.d.ts.map +1 -1
- package/dist/src/utils/hash.js +4 -0
- package/dist/src/utils/hash.js.map +1 -1
- package/dist/{os/mission → src/utils}/lockfile.d.ts +1 -18
- package/dist/src/utils/lockfile.d.ts.map +1 -0
- package/dist/src/utils/lockfile.js +70 -0
- package/dist/src/utils/lockfile.js.map +1 -0
- package/os/codebase/handlers/codebase-measure-symbols.ts +32 -4
- package/os/core/core.module.ts +3 -76
- package/os/core/handlers/assets-helpers.ts +2 -4
- package/os/core/handlers/determinism-check.ts +2 -3
- package/os/core/handlers/lifecycle-handlers.test.ts +529 -0
- package/os/core/handlers/release-prepare.ts +2 -4
- package/os/correctness/gate/trust-boundary-cx18.test.ts +1 -1
- package/os/flow/handlers/flow-peers.ts +1 -1
- package/os/flow/open-missions.ts +45 -0
- package/os/flow/preflight.ts +1 -1
- package/os/flow/tests/release-lines.test.ts +136 -0
- package/os/flow/tests/state-roots.test.ts +1 -48
- package/os/rfc/handlers/validate-corpus.test.ts +149 -0
- package/os/rfc/probe-batch.test.ts +253 -0
- package/os/rfc/probe-batch.ts +13 -6
- package/os/rfc/verifier/rfc-1391/ac10-operating-model-policy.acceptance.test.ts +63 -0
- package/package.json +177 -506
- package/src/command-modules.ts +0 -2
- package/src/contract/core-nodes.ts +111 -0
- package/src/contract/evaluator.ts +207 -0
- package/src/contract/evidence-store.ts +119 -0
- package/src/contract/executors/zero-deps.ts +92 -0
- package/src/contract/fingerprint.ts +176 -0
- package/src/contract/graph.ts +181 -0
- package/src/contract/migration-map.ts +174 -0
- package/src/contract/types.ts +125 -0
- package/src/index.ts +0 -2
- package/src/integration/drain.ts +271 -0
- package/src/integration/enqueue.ts +92 -0
- package/src/integration/gitops.ts +174 -0
- package/src/integration/lease.ts +144 -0
- package/src/integration/materialize.ts +40 -0
- package/src/integration/store.ts +153 -0
- package/src/integration/types.ts +79 -0
- package/src/onboarding/doctor.ts +9 -96
- package/src/onboarding/npm-token-check.ts +3 -3
- package/src/sdk/context.ts +135 -0
- package/src/sdk/loader.ts +170 -0
- package/src/sdk/scan.ts +132 -0
- package/src/sdk/skills-gen.ts +104 -0
- package/src/sdk/types.ts +135 -0
- package/src/tests/pkg-health-self-scan.test.ts +29 -0
- package/src/tests/rfc-evidence-sync.test.ts +369 -0
- package/src/tests/skill-agents-sync.test.ts +192 -0
- package/src/utils/hash.ts +5 -0
- package/src/utils/lockfile.ts +78 -0
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts +0 -25
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +0 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +0 -208
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +0 -1
- package/dist/os/mission/handlers/archive.d.ts +0 -4
- package/dist/os/mission/handlers/archive.d.ts.map +0 -1
- package/dist/os/mission/handlers/archive.js +0 -583
- package/dist/os/mission/handlers/archive.js.map +0 -1
- package/dist/os/mission/importer-block.d.ts +0 -19
- package/dist/os/mission/importer-block.d.ts.map +0 -1
- package/dist/os/mission/importer-block.js +0 -124
- package/dist/os/mission/importer-block.js.map +0 -1
- package/dist/os/mission/index.d.ts +0 -2
- package/dist/os/mission/index.d.ts.map +0 -1
- package/dist/os/mission/index.js +0 -15
- package/dist/os/mission/index.js.map +0 -1
- package/dist/os/mission/lockfile.d.ts.map +0 -1
- package/dist/os/mission/lockfile.js +0 -138
- package/dist/os/mission/lockfile.js.map +0 -1
- package/dist/os/mission/mission.module.d.ts +0 -3
- package/dist/os/mission/mission.module.d.ts.map +0 -1
- package/dist/os/mission/mission.module.js +0 -63
- package/dist/os/mission/mission.module.js.map +0 -1
- package/dist/os/mission/open-missions.d.ts.map +0 -1
- package/dist/os/mission/open-missions.js +0 -42
- package/dist/os/mission/open-missions.js.map +0 -1
- package/dist/os/mission/types.d.ts +0 -23
- package/dist/os/mission/types.d.ts.map +0 -1
- package/dist/os/mission/types.js +0 -19
- package/dist/os/mission/types.js.map +0 -1
- package/dist/os/werkstatt/handlers/lock.d.ts +0 -10
- package/dist/os/werkstatt/handlers/lock.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/lock.js +0 -153
- package/dist/os/werkstatt/handlers/lock.js.map +0 -1
- package/dist/os/werkstatt/handlers/schema.d.ts +0 -33
- package/dist/os/werkstatt/handlers/schema.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/schema.js +0 -42
- package/dist/os/werkstatt/handlers/schema.js.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts +0 -15
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +0 -171
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.d.ts +0 -18
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.js +0 -51
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.js.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts +0 -11
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +0 -86
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +0 -1
- package/dist/os/werkstatt/handlers/workspace-deps.d.ts +0 -12
- package/dist/os/werkstatt/handlers/workspace-deps.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/workspace-deps.js +0 -42
- package/dist/os/werkstatt/handlers/workspace-deps.js.map +0 -1
- package/dist/os/werkstatt/index.d.ts +0 -7
- package/dist/os/werkstatt/index.d.ts.map +0 -1
- package/dist/os/werkstatt/index.js +0 -18
- package/dist/os/werkstatt/index.js.map +0 -1
- package/dist/os/werkstatt/werkstatt.module.d.ts +0 -3
- package/dist/os/werkstatt/werkstatt.module.d.ts.map +0 -1
- package/dist/os/werkstatt/werkstatt.module.js +0 -91
- package/dist/os/werkstatt/werkstatt.module.js.map +0 -1
- package/os/core/handlers/forge-autonomy-validate.ts +0 -276
- package/os/correctness/gate/trust-boundary-cx19.test.ts +0 -514
- package/os/mission/handlers/archive.test.ts +0 -764
- package/os/mission/handlers/archive.ts +0 -711
- package/os/mission/handlers/ship-inflight-degraded.test.ts +0 -105
- package/os/mission/importer-block.ts +0 -119
- package/os/mission/index.ts +0 -15
- package/os/mission/lockfile.ts +0 -152
- package/os/mission/mission.module.ts +0 -68
- package/os/mission/open-missions.ts +0 -50
- package/os/mission/types.ts +0 -42
- package/os/werkstatt/handlers/lock.ts +0 -168
- package/os/werkstatt/handlers/schema.ts +0 -47
- package/os/werkstatt/handlers/werkstatt-lock-recover.ts +0 -206
- package/os/werkstatt/handlers/werkstatt-lock-status.ts +0 -82
- package/os/werkstatt/handlers/werkstatt-operation-validate.ts +0 -112
- package/os/werkstatt/handlers/workspace-deps.ts +0 -56
- package/os/werkstatt/index.ts +0 -39
- package/os/werkstatt/werkstatt.module.ts +0 -95
- package/src/tests/doctor-autonomy.test.ts +0 -246
- package/src/tests/forge-autonomy-validate.test.ts +0 -159
- package/src/tests/werkstatt-lock.test.ts +0 -357
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>Text-splice primitives for a single importer subtree inside
|
|
4
|
-
pnpm-lock.yaml (RFC-1544). A mission workpiece registers as the importer key
|
|
5
|
-
`missions/<id>/workpiece:` at the fixed two-space indent under `importers:`;
|
|
6
|
-
both consumers — flow.integrate's foreign-open-mission restore and
|
|
7
|
-
mission.archive's bookkeeping prune — must move exactly that key's block and
|
|
8
|
-
nothing else, so a whole-file checkout or a YAML round-trip (which rewrites
|
|
9
|
-
unrelated formatting) is never the mechanism.</purpose>
|
|
10
|
-
<non-goals>
|
|
11
|
-
<item>No YAML semantics — block boundaries are indent arithmetic on the pnpm-lock layout, not a parse.</item>
|
|
12
|
-
<item>No git/file I/O — pure string transforms; callers own reads and writes.</item>
|
|
13
|
-
</non-goals>
|
|
14
|
-
</MODULE_CONTRACT>
|
|
15
|
-
<CHANGE_SUMMARY>
|
|
16
|
-
<item>RFC-1544: importer-block extract/insert/remove text splices shared by flow.integrate restore and mission.archive prune</item>
|
|
17
|
-
<item>RFC-1544: attribute mission lockfile churn to owning checkout and auto-resolve foreign importer diffs (RFC-1544)</item>
|
|
18
|
-
</CHANGE_SUMMARY>
|
|
19
|
-
*/
|
|
20
|
-
const IMPORTER_INDENT = 2;
|
|
21
|
-
function indentOf(line) {
|
|
22
|
-
return line.length - line.trimStart().length;
|
|
23
|
-
}
|
|
24
|
-
/** Locate ` <key>:` at the importer indent — exact key, no prefix bleed. */
|
|
25
|
-
function importerKeyIndex(lines, key) {
|
|
26
|
-
const wanted = `${" ".repeat(IMPORTER_INDENT)}${key}:`;
|
|
27
|
-
return lines.findIndex((l) => l.trimEnd() === wanted);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The importer block lines for `key` inside lockfile `text`: the key line
|
|
31
|
-
* plus every deeper-indented member, trailing blanks excluded. Null when the
|
|
32
|
-
* key is absent.
|
|
33
|
-
*/
|
|
34
|
-
export function extractImporterBlock(text, key) {
|
|
35
|
-
const lines = text.split("\n");
|
|
36
|
-
const start = importerKeyIndex(lines, key);
|
|
37
|
-
if (start === -1)
|
|
38
|
-
return null;
|
|
39
|
-
let end = start + 1;
|
|
40
|
-
while (end < lines.length) {
|
|
41
|
-
const l = lines[end];
|
|
42
|
-
if (l.trim().length === 0) {
|
|
43
|
-
end += 1;
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
if (indentOf(l) <= IMPORTER_INDENT)
|
|
47
|
-
break;
|
|
48
|
-
end += 1;
|
|
49
|
-
}
|
|
50
|
-
while (end > start + 1 && lines[end - 1].trim().length === 0)
|
|
51
|
-
end -= 1;
|
|
52
|
-
return lines.slice(start, end);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* `text` without `key`'s importer block — the block plus its separating
|
|
56
|
-
* blank line(s), so removal leaves the surrounding layout intact. Returns
|
|
57
|
-
* the input unchanged when the key is absent.
|
|
58
|
-
*/
|
|
59
|
-
export function removeImporterBlock(text, key) {
|
|
60
|
-
const lines = text.split("\n");
|
|
61
|
-
const start = importerKeyIndex(lines, key);
|
|
62
|
-
if (start === -1)
|
|
63
|
-
return text;
|
|
64
|
-
let end = start + 1;
|
|
65
|
-
while (end < lines.length) {
|
|
66
|
-
const l = lines[end];
|
|
67
|
-
if (l.trim().length === 0) {
|
|
68
|
-
end += 1;
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
if (indentOf(l) <= IMPORTER_INDENT)
|
|
72
|
-
break;
|
|
73
|
-
end += 1;
|
|
74
|
-
}
|
|
75
|
-
// Also absorb the blank separator BEFORE the block when one exists —
|
|
76
|
-
// pnpm separates importer stanzas with a single blank line.
|
|
77
|
-
let s = start;
|
|
78
|
-
if (s > 0 && lines[s - 1].trim().length === 0)
|
|
79
|
-
s -= 1;
|
|
80
|
-
const out = [...lines.slice(0, s), ...lines.slice(end)];
|
|
81
|
-
// Collapse a doubled blank left at the seam when both sides kept one.
|
|
82
|
-
return out.join("\n").replace(/\n{3,}/g, "\n\n");
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* `text` with `block` inserted under `importers:` at pnpm's alphabetical
|
|
86
|
-
* position — before the first importer key sorting after `key`, else at the
|
|
87
|
-
* end of the importers section. Null when no `importers:` section exists.
|
|
88
|
-
*/
|
|
89
|
-
export function insertImporterBlock(text, key, block) {
|
|
90
|
-
const lines = text.split("\n");
|
|
91
|
-
const importersIdx = lines.findIndex((l) => l.trimEnd() === "importers:");
|
|
92
|
-
if (importersIdx === -1)
|
|
93
|
-
return null;
|
|
94
|
-
// Section end: first non-blank line with indent < 2 (or EOF).
|
|
95
|
-
let sectionEnd = lines.length;
|
|
96
|
-
for (let i = importersIdx + 1; i < lines.length; i += 1) {
|
|
97
|
-
const l = lines[i];
|
|
98
|
-
if (l.trim().length === 0)
|
|
99
|
-
continue;
|
|
100
|
-
if (indentOf(l) < IMPORTER_INDENT) {
|
|
101
|
-
sectionEnd = i;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// First importer key sorting after ours — mid-section insert.
|
|
106
|
-
for (let i = importersIdx + 1; i < sectionEnd; i += 1) {
|
|
107
|
-
const l = lines[i];
|
|
108
|
-
if (l.trim().length === 0 || indentOf(l) !== IMPORTER_INDENT)
|
|
109
|
-
continue;
|
|
110
|
-
const other = l.trim().replace(/:$/, "");
|
|
111
|
-
if (other > key) {
|
|
112
|
-
return [...lines.slice(0, i), ...block, "", ...lines.slice(i)].join("\n");
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
// End-of-section insert: splice before the trailing blank run when one
|
|
116
|
-
// exists (it already separates the last block from the next section).
|
|
117
|
-
let at = sectionEnd;
|
|
118
|
-
while (at > importersIdx + 1 && lines[at - 1].trim().length === 0)
|
|
119
|
-
at -= 1;
|
|
120
|
-
const hadTrailingBlanks = at < sectionEnd;
|
|
121
|
-
const payload = ["", ...block, ...(hadTrailingBlanks ? [] : [""])];
|
|
122
|
-
return [...lines.slice(0, at), ...payload, ...lines.slice(at)].join("\n");
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=importer-block.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importer-block.js","sourceRoot":"","sources":["../../../os/mission/importer-block.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;EAkBE;AAEF,MAAM,eAAe,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AAE,GAAG,KAAK,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,uEAAuE;IACvE,sEAAsE;IACtE,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,OAAO,EAAE,GAAG,YAAY,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,EAAE,IAAI,CAAC,CAAC;IAC3E,MAAM,iBAAiB,GAAG,EAAE,GAAG,UAAU,CAAC;IAC1C,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../os/mission/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/os/mission/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>Mission module index — re-export createForgeMissionModule for the forge kernel registry.</purpose>
|
|
4
|
-
<non-goals>
|
|
5
|
-
<item>Do not implement mission logic here — the module registration lives in mission.module.ts.</item>
|
|
6
|
-
</non-goals>
|
|
7
|
-
</MODULE_CONTRACT>
|
|
8
|
-
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-1097: sweep — packages/forge + services clean
|
|
10
|
-
|
|
11
|
-
Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
|
|
12
|
-
</CHANGE_SUMMARY>
|
|
13
|
-
*/
|
|
14
|
-
export { createForgeMissionModule } from "./mission.module.js";
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../os/mission/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAEF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile.d.ts","sourceRoot":"","sources":["../../../os/mission/lockfile.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAW/E;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CA6B/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAAE,EACpB,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC,GAC1C,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAmChD"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
4
|
-
Tracked lockfile restoration — after a mission lifecycle step runs `pnpm install`
|
|
5
|
-
for dependency pruning, the local install may rewrite `pnpm-lock.yaml`. That churn
|
|
6
|
-
is local mission state and must never land in tracked artifacts: this helper
|
|
7
|
-
restores the file committed at HEAD so the worktree returns clean.
|
|
8
|
-
</purpose>
|
|
9
|
-
<non-goals>
|
|
10
|
-
<item>Does not commit, stage, or delete the lockfile — only restores tracked bytes.</item>
|
|
11
|
-
<item>Does not synthesize a lockfile when HEAD carries none — returns false and changes nothing.</item>
|
|
12
|
-
</non-goals>
|
|
13
|
-
</MODULE_CONTRACT>
|
|
14
|
-
<CHANGE_SUMMARY>
|
|
15
|
-
<item>RFC-1505: steps 3-5 — tracked lockfile restore, no side-effect commits</item>
|
|
16
|
-
<item>RFC-1505: review r1 — durable projections and lockfile restore hardening</item>
|
|
17
|
-
<item>RFC-1505: review r2 — clone-only sternsystem enumeration and mission-gated lockfile net</item>
|
|
18
|
-
<item>RFC-1544: attribute mission lockfile churn to owning checkout and auto-resolve foreign importer diffs (RFC-1544)</item>
|
|
19
|
-
<item>RFC-1616: close r19 counterexamples CX-166 through CX-171</item>
|
|
20
|
-
<history>RFC-1505</history>
|
|
21
|
-
</CHANGE_SUMMARY>
|
|
22
|
-
*/
|
|
23
|
-
import path from "node:path";
|
|
24
|
-
import { execFileSync } from "../../src/utils/sync-fs.js";
|
|
25
|
-
import { closeEvidenceIndex, evidenceAnchoredGit, evidenceRepoPreflight, verifierGit, } from "../../src/utils/verifier-git.js";
|
|
26
|
-
import { extractImporterBlock, removeImporterBlock } from "./importer-block.js";
|
|
27
|
-
const LOCKFILE_NAME = "pnpm-lock.yaml";
|
|
28
|
-
/**
|
|
29
|
-
* Restore `pnpm-lock.yaml` to the bytes committed at HEAD.
|
|
30
|
-
*
|
|
31
|
-
* Runs `git show HEAD:pnpm-lock.yaml` in `root`. On exit 0 the stdout is written
|
|
32
|
-
* back over `root/pnpm-lock.yaml` and the call returns `true`. On a non-zero
|
|
33
|
-
* exit (no such file at HEAD, not a git repository) it returns `false` and
|
|
34
|
-
* changes nothing. Spawn failures (missing git binary) propagate.
|
|
35
|
-
* `root` is the repository root — git resolves `HEAD:pnpm-lock.yaml` against
|
|
36
|
-
* the enclosing repo's top level, so passing a nested directory of a larger
|
|
37
|
-
* repo would restore that repo's root lockfile instead.
|
|
38
|
-
*/
|
|
39
|
-
export async function restoreTrackedLockfile(root, io) {
|
|
40
|
-
// The committed-bytes read goes through the judged channel — the
|
|
41
|
-
// ambient exec layer inherits `process.env`, so a session `GIT_DIR`
|
|
42
|
-
// would serve `HEAD:` from a foreign object store and this "restore"
|
|
43
|
-
// would write forged bytes into the real worktree (CX-164). A refused
|
|
44
|
-
// read restores nothing and reports false.
|
|
45
|
-
const res = await verifierGit(root, ["show", `HEAD:${LOCKFILE_NAME}`]);
|
|
46
|
-
if (res.exitCode !== 0)
|
|
47
|
-
return false;
|
|
48
|
-
await io.writeFile(path.join(root, LOCKFILE_NAME), res.stdout);
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Sync-world adapter for `io.exec` — wraps `execFileSync` so handlers that still
|
|
53
|
-
* run on `execSync`/`execFileSync` (e.g. mission.archive) can call
|
|
54
|
-
* `restoreTrackedLockfile` without duplicating its logic. A non-zero exit maps
|
|
55
|
-
* to `exitCode`; a spawn failure (missing binary) keeps throwing.
|
|
56
|
-
*/
|
|
57
|
-
export function execFileSyncAdapter() {
|
|
58
|
-
return {
|
|
59
|
-
exec(command, args, opts) {
|
|
60
|
-
try {
|
|
61
|
-
const stdout = execFileSync(command, args, {
|
|
62
|
-
cwd: opts?.cwd,
|
|
63
|
-
encoding: "utf-8",
|
|
64
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
65
|
-
timeout: opts?.timeoutMs,
|
|
66
|
-
// Real pnpm-lock.yaml files exceed the 1 MiB default many times over —
|
|
67
|
-
// an ENOBUFS kill carries status null and would rethrow below.
|
|
68
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
69
|
-
});
|
|
70
|
-
return Promise.resolve({ exitCode: 0, stdout, stderr: "" });
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
const e = err;
|
|
74
|
-
if (e.status === undefined || e.status === null)
|
|
75
|
-
throw err;
|
|
76
|
-
return Promise.resolve({
|
|
77
|
-
exitCode: e.status,
|
|
78
|
-
stdout: e.stdout?.toString() ?? "",
|
|
79
|
-
stderr: e.stderr?.toString() ?? "",
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* RFC-1544 AC-5: drop the listed missions' `missions/<id>/workpiece`
|
|
87
|
-
* importer subtrees from the tracked `pnpm-lock.yaml` and stage the result
|
|
88
|
-
* for the archive bookkeeping commit. The written bytes are HEAD-minus-
|
|
89
|
-
* importers — the post-archive `pnpm install` may churn unrelated lockfile
|
|
90
|
-
* state, and only the importer removal is legitimate tracked change, so
|
|
91
|
-
* everything else is discarded exactly like `restoreTrackedLockfile` did.
|
|
92
|
-
*
|
|
93
|
-
* Returns `pruned` = mission ids whose importer block was actually removed;
|
|
94
|
-
* `staged` = whether `pnpm-lock.yaml` reached the index. When no listed
|
|
95
|
-
* importer exists at HEAD the tracked file is restored instead (the old
|
|
96
|
-
* churn-discard behavior) and `staged` stays false.
|
|
97
|
-
*/
|
|
98
|
-
export async function pruneMissionImportersFromLockfile(root, missionIds, io) {
|
|
99
|
-
// One preflight anchors the whole read→write→stage sequence: a `.git`
|
|
100
|
-
// indirection swap landing between the judged `show` and the `add`
|
|
101
|
-
// re-points the staging target into a foreign index, and a fresh
|
|
102
|
-
// preflight would happily attest THAT repo — the anchored fingerprint
|
|
103
|
-
// is re-proved immediately before the mutation and any drift refuses
|
|
104
|
-
// (CX-169). The `show` read itself runs on the same anchored surface.
|
|
105
|
-
const preflight = await evidenceRepoPreflight(root);
|
|
106
|
-
if (preflight === null)
|
|
107
|
-
return { pruned: [], staged: false };
|
|
108
|
-
try {
|
|
109
|
-
// Judged channel for the committed-bytes read — same CX-164
|
|
110
|
-
// redirect: ambient `GIT_DIR` would serve the foreign repo's
|
|
111
|
-
// lockfile bytes.
|
|
112
|
-
const head = await verifierGit(root, ["show", `HEAD:${LOCKFILE_NAME}`], { preflight });
|
|
113
|
-
if (head.exitCode !== 0)
|
|
114
|
-
return { pruned: [], staged: false };
|
|
115
|
-
let next = head.stdout;
|
|
116
|
-
const pruned = [];
|
|
117
|
-
for (const missionId of missionIds) {
|
|
118
|
-
const key = `missions/${missionId}/workpiece`;
|
|
119
|
-
if (extractImporterBlock(next, key) === null)
|
|
120
|
-
continue;
|
|
121
|
-
next = removeImporterBlock(next, key);
|
|
122
|
-
pruned.push(missionId);
|
|
123
|
-
}
|
|
124
|
-
const target = path.join(root, LOCKFILE_NAME);
|
|
125
|
-
if (pruned.length === 0) {
|
|
126
|
-
// Nothing legitimately prunes — keep the discard-churn restore.
|
|
127
|
-
await io.writeFile(target, head.stdout);
|
|
128
|
-
return { pruned, staged: false };
|
|
129
|
-
}
|
|
130
|
-
await io.writeFile(target, next);
|
|
131
|
-
const add = await evidenceAnchoredGit(root, ["add", "--", LOCKFILE_NAME], { preflight });
|
|
132
|
-
return { pruned, staged: add.exitCode === 0 };
|
|
133
|
-
}
|
|
134
|
-
finally {
|
|
135
|
-
closeEvidenceIndex(preflight);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
//# sourceMappingURL=lockfile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile.js","sourceRoot":"","sources":["../../../os/mission/lockfile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAA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"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>Register the mission archive command with the forge kernel registry.</purpose>
|
|
4
|
-
<non-goals>
|
|
5
|
-
<item>Do not implement handler logic here — delegate to handlers/archive.ts.</item>
|
|
6
|
-
</non-goals>
|
|
7
|
-
</MODULE_CONTRACT>
|
|
8
|
-
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-0573: initial forgeMissionModule registering mission.archive command.</item>
|
|
10
|
-
<item>RFC-0982: add --clean-orphans flag for trashing orphaned remnant directories.</item>
|
|
11
|
-
<item>RFC-1397: declare internal --ship-op flag — ship's own opId marker for the terminal archive step exemption.</item>
|
|
12
|
-
<item>RFC-1505: review r2 — clone-only sternsystem enumeration and mission-gated lockfile net</item>
|
|
13
|
-
</CHANGE_SUMMARY>
|
|
14
|
-
*/
|
|
15
|
-
export async function createForgeMissionModule() {
|
|
16
|
-
const { runMissionArchive } = await import("./handlers/archive.js");
|
|
17
|
-
return {
|
|
18
|
-
name: "forge-mission",
|
|
19
|
-
version: "0.1.0",
|
|
20
|
-
runtime: "autonomous",
|
|
21
|
-
declarations: [],
|
|
22
|
-
commands: [
|
|
23
|
-
{
|
|
24
|
-
name: "mission.archive",
|
|
25
|
-
description: "Move terminal-state mission directories (state: closed or aborted in " +
|
|
26
|
-
"mission.yaml) into missions/archive/<state>/<missionId>/ subdirectories. " +
|
|
27
|
-
"Bidirectional: moves open missions found in archive subdirectories back " +
|
|
28
|
-
"to missions/. Use --dry-run to preview. Use --status to filter to a " +
|
|
29
|
-
"single terminal status (closed, aborted). " +
|
|
30
|
-
"Prefer the docs.archive umbrella command unless you need to archive only missions.",
|
|
31
|
-
scope: "workspace",
|
|
32
|
-
mutatesState: true,
|
|
33
|
-
writes: ["missions/*", "missions/archive/**", "pnpm-lock.yaml"],
|
|
34
|
-
generates: [],
|
|
35
|
-
reads: ["missions/**"],
|
|
36
|
-
cacheable: false,
|
|
37
|
-
flags: {
|
|
38
|
-
"dry-run": {
|
|
39
|
-
kind: "boolean",
|
|
40
|
-
description: "Preview what would be moved without touching the filesystem.",
|
|
41
|
-
},
|
|
42
|
-
status: {
|
|
43
|
-
kind: "string",
|
|
44
|
-
description: "Filter to a single terminal status (closed, aborted).",
|
|
45
|
-
},
|
|
46
|
-
"clean-orphans": {
|
|
47
|
-
kind: "boolean",
|
|
48
|
-
description: "Trash orphaned directories (no mission.yaml, only cache files) instead of archiving them.",
|
|
49
|
-
},
|
|
50
|
-
"ship-op": {
|
|
51
|
-
kind: "string",
|
|
52
|
-
description: "Internal marker (RFC-1397): the leitstand.ship opId allowed to archive its own mission. " +
|
|
53
|
-
"Set only by ship's terminal mission-archive step — agents MUST NOT pass it by hand; " +
|
|
54
|
-
"a foreign opId self-inflicts an archive skip.",
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
execute: runMissionArchive,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
pipelines: [],
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=mission.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mission.module.js","sourceRoot":"","sources":["../../../os/mission/mission.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;EAaE;AAIF,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAC5C,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IACpE,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,YAAY;QACrB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EACT,uEAAuE;oBACvE,2EAA2E;oBAC3E,0EAA0E;oBAC1E,sEAAsE;oBACtE,4CAA4C;oBAC5C,oFAAoF;gBACtF,KAAK,EAAE,WAAW;gBAClB,YAAY,EAAE,IAAI;gBAClB,MAAM,EAAE,CAAC,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,CAAC;gBAC/D,SAAS,EAAE,EAAE;gBACb,KAAK,EAAE,CAAC,aAAa,CAAC;gBACtB,SAAS,EAAE,KAAK;gBAChB,KAAK,EAAE;oBACL,SAAS,EAAE;wBACT,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,8DAA8D;qBAC5E;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,uDAAuD;qBACrE;oBACD,eAAe,EAAE;wBACf,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,2FAA2F;qBAC9F;oBACD,SAAS,EAAE;wBACT,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,0FAA0F;4BAC1F,sFAAsF;4BACtF,+CAA+C;qBAClD;iBACF;gBACD,OAAO,EAAE,iBAAiB;aAC3B;SACF;QACD,SAAS,EAAE,EAAE;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-missions.d.ts","sourceRoot":"","sources":["../../../os/mission/open-missions.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>Open-mission scan for forge's flow gates (RFC-1537) — a forge-local
|
|
4
|
-
port of werkstatt.worktree.gate's openMissionsIn semantics: glob the
|
|
5
|
-
missions/<id>/mission.yaml manifests under a checkout, count `state: "open"`,
|
|
6
|
-
and treat an unreadable manifest as open (a corrupt live mission must never
|
|
7
|
-
silently pass — DNA-106). Forge cannot import the site plugin
|
|
8
|
-
(FORGE-AUTONOMY-01), so parity is pinned by the contract the preflight mission
|
|
9
|
-
check consumes.</purpose>
|
|
10
|
-
<non-goals>
|
|
11
|
-
<item>Read-only — never mutates mission state; mission lifecycle lives in mission.* commands.</item>
|
|
12
|
-
</non-goals>
|
|
13
|
-
</MODULE_CONTRACT>
|
|
14
|
-
<CHANGE_SUMMARY>
|
|
15
|
-
<item>RFC-1537: open-mission scan shared by the integrate preflight's cheap-first check and the importer-materialize dirt class</item>
|
|
16
|
-
<item>RFC-1537: classify regenerable worktree dirt and journal integrate refusals cheapest-first</item>
|
|
17
|
-
</CHANGE_SUMMARY>
|
|
18
|
-
*/
|
|
19
|
-
import { basename, dirname, join } from "node:path";
|
|
20
|
-
import { parse as yamlParse } from "yaml";
|
|
21
|
-
/**
|
|
22
|
-
* Mission ids whose `missions/<id>/mission.yaml` declares `state: "open"`.
|
|
23
|
-
* An unreadable manifest counts as open — same closed-shape semantics as the
|
|
24
|
-
* site plugin's worktree gate. Sorted for deterministic output.
|
|
25
|
-
*/
|
|
26
|
-
export async function openMissionsIn(worktree, io) {
|
|
27
|
-
const manifests = await io.glob("missions/*/mission.yaml", { cwd: worktree });
|
|
28
|
-
const open = [];
|
|
29
|
-
for (const rel of manifests) {
|
|
30
|
-
try {
|
|
31
|
-
const parsed = yamlParse(await io.readFile(join(worktree, rel)));
|
|
32
|
-
if (parsed?.state === "open") {
|
|
33
|
-
open.push(basename(dirname(rel)));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
open.push(basename(dirname(rel)));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return open.sort();
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=open-missions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-missions.js","sourceRoot":"","sources":["../../../os/mission/open-missions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAI1C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAAgB,EAChB,EAAe;IAEf,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9E,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAEvD,CAAC;YACT,IAAI,MAAM,EAAE,KAAK,KAAK,MAAM,EAAE,CAAC;gBAC7B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare const MISSIONS_DIR = "missions";
|
|
2
|
-
export declare const ARCHIVE_DIR_NAME = "archive";
|
|
3
|
-
export declare const MISSION_TERMINAL_STATUSES: readonly ["closed", "aborted"];
|
|
4
|
-
export interface MissionArchiveMove {
|
|
5
|
-
missionId: string;
|
|
6
|
-
state: string;
|
|
7
|
-
from: string;
|
|
8
|
-
to: string;
|
|
9
|
-
direction: "into-archive" | "out-of-archive" | "trashed-orphan";
|
|
10
|
-
}
|
|
11
|
-
export interface MissionArchiveSkip {
|
|
12
|
-
missionId: string;
|
|
13
|
-
dir: string;
|
|
14
|
-
reason: string;
|
|
15
|
-
}
|
|
16
|
-
export interface MissionArchiveResult {
|
|
17
|
-
command: "mission.archive";
|
|
18
|
-
status: "ok";
|
|
19
|
-
moved: MissionArchiveMove[];
|
|
20
|
-
skipped: MissionArchiveSkip[];
|
|
21
|
-
dryRun: boolean;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../os/mission/types.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,yBAAyB,gCAAiC,CAAC;AAExE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;CACjE;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,IAAI,CAAC;IACb,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;CACjB"}
|
package/dist/os/mission/types.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
4
|
-
Type definitions for the mission archive domain — mission directory discovery,
|
|
5
|
-
manifest state extraction, and archive result shapes.
|
|
6
|
-
</purpose>
|
|
7
|
-
<non-goals>
|
|
8
|
-
<item>Do not define archive handler logic here — that lives in handlers/archive.ts.</item>
|
|
9
|
-
</non-goals>
|
|
10
|
-
</MODULE_CONTRACT>
|
|
11
|
-
<CHANGE_SUMMARY>
|
|
12
|
-
<item>RFC-0573: initial mission archive types.</item>
|
|
13
|
-
<item>RFC-0982: add "trashed-orphan" to MissionArchiveMove.direction.</item>
|
|
14
|
-
</CHANGE_SUMMARY>
|
|
15
|
-
*/
|
|
16
|
-
export const MISSIONS_DIR = "missions";
|
|
17
|
-
export const ARCHIVE_DIR_NAME = "archive";
|
|
18
|
-
export const MISSION_TERMINAL_STATUSES = ["closed", "aborted"];
|
|
19
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../os/mission/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAE1C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type WerkstattLock } from "./schema.ts";
|
|
2
|
-
export declare function isLockStale(lock: WerkstattLock, now?: Date): boolean;
|
|
3
|
-
export declare function acquireLock(workspaceRoot: string, scope: string, operationId: string, command: string, owner: string, timeoutSeconds?: number): Promise<WerkstattLock>;
|
|
4
|
-
export declare function releaseLock(workspaceRoot: string, scope: string): Promise<void>;
|
|
5
|
-
export declare function heartbeatLock(workspaceRoot: string, scope: string): Promise<void>;
|
|
6
|
-
export declare function readAllLocks(workspaceRoot: string): Promise<Array<WerkstattLock & {
|
|
7
|
-
stale: boolean;
|
|
8
|
-
}>>;
|
|
9
|
-
export declare function removeStaleLock(workspaceRoot: string, scope: string): Promise<boolean>;
|
|
10
|
-
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../../os/werkstatt/handlers/lock.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAuBtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,CAIhF;AAED,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,cAAc,GAAE,MAAgC,GAC/C,OAAO,CAAC,aAAa,CAAC,CAgDxB;AAED,wBAAsB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBrF;AAED,wBAAsB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvF;AAED,wBAAsB,YAAY,CAChC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,CAmBpD;AAED,wBAAsB,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ5F"}
|