@sdd-method/sdd-cli 1.41.0 → 1.43.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/README.md +4 -57
- package/dist/author-bin.d.ts +3 -0
- package/dist/author-bin.d.ts.map +1 -0
- package/dist/author-bin.js +8 -0
- package/dist/author-bin.js.map +1 -0
- package/dist/author-program.d.ts +8 -0
- package/dist/author-program.d.ts.map +1 -0
- package/dist/author-program.js +99 -0
- package/dist/author-program.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-harness.d.ts +11 -8
- package/dist/lib/agent-harness.d.ts.map +1 -1
- package/dist/lib/agent-harness.js +17 -8
- package/dist/lib/agent-harness.js.map +1 -1
- package/dist/lib/api-surface/index.js +2 -2
- package/dist/lib/api-surface/index.js.map +1 -1
- package/dist/lib/briefing/index.d.ts +1 -1
- package/dist/lib/briefing/index.d.ts.map +1 -1
- package/dist/lib/briefing/index.js +1 -1
- package/dist/lib/briefing/index.js.map +1 -1
- package/dist/lib/briefing/render.d.ts +18 -1
- package/dist/lib/briefing/render.d.ts.map +1 -1
- package/dist/lib/briefing/render.js +17 -8
- package/dist/lib/briefing/render.js.map +1 -1
- package/dist/lib/catalogue/aggregation-manifest-loader.js +4 -4
- package/dist/lib/catalogue/aggregation-manifest-loader.js.map +1 -1
- package/dist/lib/catalogue/cli-version.d.ts +1 -1
- package/dist/lib/catalogue/cli-version.d.ts.map +1 -1
- package/dist/lib/catalogue/cli-version.js +3 -3
- package/dist/lib/catalogue/cli-version.js.map +1 -1
- package/dist/lib/catalogue/freshness.d.ts +27 -0
- package/dist/lib/catalogue/freshness.d.ts.map +1 -0
- package/dist/lib/catalogue/freshness.js +70 -0
- package/dist/lib/catalogue/freshness.js.map +1 -0
- package/dist/lib/catalogue/graph-run.js +1 -1
- package/dist/lib/catalogue/graph-run.js.map +1 -1
- package/dist/lib/ci-binding/index.d.ts +63 -0
- package/dist/lib/ci-binding/index.d.ts.map +1 -0
- package/dist/lib/ci-binding/index.js +220 -0
- package/dist/lib/ci-binding/index.js.map +1 -0
- package/dist/lib/ci-binding/module.d.ts +36 -0
- package/dist/lib/ci-binding/module.d.ts.map +1 -0
- package/dist/lib/ci-binding/module.js +204 -0
- package/dist/lib/ci-binding/module.js.map +1 -0
- package/dist/lib/context-pull/index.d.ts +45 -0
- package/dist/lib/context-pull/index.d.ts.map +1 -0
- package/dist/lib/context-pull/index.js +191 -0
- package/dist/lib/context-pull/index.js.map +1 -0
- package/dist/lib/context-pull/resolve.d.ts +46 -0
- package/dist/lib/context-pull/resolve.d.ts.map +1 -0
- package/dist/lib/context-pull/resolve.js +70 -0
- package/dist/lib/context-pull/resolve.js.map +1 -0
- package/dist/lib/context-pull/retired-mcp-setup.d.ts +7 -0
- package/dist/lib/context-pull/retired-mcp-setup.d.ts.map +1 -0
- package/dist/lib/context-pull/retired-mcp-setup.js +7 -0
- package/dist/lib/context-pull/retired-mcp-setup.js.map +1 -0
- package/dist/lib/hooks-seed/entries.d.ts +15 -0
- package/dist/lib/hooks-seed/entries.d.ts.map +1 -1
- package/dist/lib/hooks-seed/entries.js +30 -1
- package/dist/lib/hooks-seed/entries.js.map +1 -1
- package/dist/lib/hooks-seed/index.d.ts +4 -9
- package/dist/lib/hooks-seed/index.d.ts.map +1 -1
- package/dist/lib/hooks-seed/index.js +4 -7
- package/dist/lib/hooks-seed/index.js.map +1 -1
- package/dist/lib/hooks-seed/merge.d.ts +7 -0
- package/dist/lib/hooks-seed/merge.d.ts.map +1 -1
- package/dist/lib/hooks-seed/merge.js +31 -0
- package/dist/lib/hooks-seed/merge.js.map +1 -1
- package/dist/lib/init/app.d.ts +0 -1
- package/dist/lib/init/app.d.ts.map +1 -1
- package/dist/lib/init/app.js +3 -7
- package/dist/lib/init/app.js.map +1 -1
- package/dist/lib/init/ci-workflow.d.ts +6 -8
- package/dist/lib/init/ci-workflow.d.ts.map +1 -1
- package/dist/lib/init/ci-workflow.js +57 -120
- package/dist/lib/init/ci-workflow.js.map +1 -1
- package/dist/lib/init/integration.d.ts +0 -1
- package/dist/lib/init/integration.d.ts.map +1 -1
- package/dist/lib/init/integration.js +3 -7
- package/dist/lib/init/integration.js.map +1 -1
- package/dist/lib/init/platform.d.ts +2 -10
- package/dist/lib/init/platform.d.ts.map +1 -1
- package/dist/lib/init/platform.js +12 -15
- package/dist/lib/init/platform.js.map +1 -1
- package/dist/lib/lock-file.d.ts +20 -0
- package/dist/lib/lock-file.d.ts.map +1 -1
- package/dist/lib/lock-file.js +25 -1
- package/dist/lib/lock-file.js.map +1 -1
- package/dist/lib/mcp/build-info.d.ts.map +1 -1
- package/dist/lib/mcp/build-info.js +3 -3
- package/dist/lib/mcp/build-info.js.map +1 -1
- package/dist/lib/pack/index.js +2 -2
- package/dist/lib/pack/index.js.map +1 -1
- package/dist/lib/pack/validate.js +2 -2
- package/dist/lib/pack/validate.js.map +1 -1
- package/dist/lib/package-version.d.ts +23 -0
- package/dist/lib/package-version.d.ts.map +1 -1
- package/dist/lib/package-version.js +47 -10
- package/dist/lib/package-version.js.map +1 -1
- package/dist/lib/plan/index.d.ts.map +1 -1
- package/dist/lib/plan/index.js +4 -4
- package/dist/lib/plan/index.js.map +1 -1
- package/dist/lib/plan/read-sdd.js +1 -1
- package/dist/lib/plan/render-template.d.ts +8 -0
- package/dist/lib/plan/render-template.d.ts.map +1 -1
- package/dist/lib/plan/render-template.js +27 -3
- package/dist/lib/plan/render-template.js.map +1 -1
- package/dist/lib/sdd-index/repo-config.d.ts +1 -1
- package/dist/lib/sdd-index/repo-config.js +1 -1
- package/dist/lib/sdd-reader.d.ts +35 -0
- package/dist/lib/sdd-reader.d.ts.map +1 -0
- package/dist/lib/sdd-reader.js +91 -0
- package/dist/lib/sdd-reader.js.map +1 -0
- package/dist/lib/sync/briefing-merge.d.ts +1 -1
- package/dist/lib/sync/briefing-merge.d.ts.map +1 -1
- package/dist/lib/sync/briefing-merge.js +50 -34
- package/dist/lib/sync/briefing-merge.js.map +1 -1
- package/dist/lib/sync/diff.js +1 -1
- package/dist/lib/sync/diff.js.map +1 -1
- package/dist/lib/sync/index.d.ts +16 -6
- package/dist/lib/sync/index.d.ts.map +1 -1
- package/dist/lib/sync/index.js +89 -116
- package/dist/lib/sync/index.js.map +1 -1
- package/dist/lib/sync/settings-merge.d.ts +26 -48
- package/dist/lib/sync/settings-merge.d.ts.map +1 -1
- package/dist/lib/sync/settings-merge.js +70 -162
- package/dist/lib/sync/settings-merge.js.map +1 -1
- package/dist/lib/validate/bundle-coherence.js +2 -2
- package/dist/lib/validate/bundle-coherence.js.map +1 -1
- package/dist/lib/validate/plan.d.ts +25 -0
- package/dist/lib/validate/plan.d.ts.map +1 -0
- package/dist/lib/validate/plan.js +54 -0
- package/dist/lib/validate/plan.js.map +1 -0
- package/dist/maintain-bin.d.ts +3 -0
- package/dist/maintain-bin.d.ts.map +1 -0
- package/dist/maintain-bin.js +8 -0
- package/dist/maintain-bin.js.map +1 -0
- package/dist/maintain-program.d.ts +8 -0
- package/dist/maintain-program.d.ts.map +1 -0
- package/dist/maintain-program.js +94 -0
- package/dist/maintain-program.js.map +1 -0
- package/dist/maintain-version.json +4 -0
- package/dist/verbs/catalogue-check.d.ts +10 -0
- package/dist/verbs/catalogue-check.d.ts.map +1 -0
- package/dist/verbs/catalogue-check.js +28 -0
- package/dist/verbs/catalogue-check.js.map +1 -0
- package/dist/verbs/catalogue-maintain.d.ts +6 -0
- package/dist/verbs/catalogue-maintain.d.ts.map +1 -0
- package/dist/verbs/catalogue-maintain.js +110 -0
- package/dist/verbs/catalogue-maintain.js.map +1 -0
- package/dist/verbs/catalogue.d.ts +5 -0
- package/dist/verbs/catalogue.d.ts.map +1 -1
- package/dist/verbs/catalogue.js +16 -80
- package/dist/verbs/catalogue.js.map +1 -1
- package/dist/verbs/context.d.ts +3 -0
- package/dist/verbs/context.d.ts.map +1 -0
- package/dist/verbs/context.js +39 -0
- package/dist/verbs/context.js.map +1 -0
- package/dist/verbs/pack-build.d.ts +3 -0
- package/dist/verbs/pack-build.d.ts.map +1 -0
- package/dist/verbs/pack-build.js +31 -0
- package/dist/verbs/pack-build.js.map +1 -0
- package/dist/verbs/pack.d.ts.map +1 -1
- package/dist/verbs/pack.js +2 -25
- package/dist/verbs/pack.js.map +1 -1
- package/dist/verbs/sync.d.ts.map +1 -1
- package/dist/verbs/sync.js +21 -0
- package/dist/verbs/sync.js.map +1 -1
- package/dist/verbs/validate.d.ts.map +1 -1
- package/dist/verbs/validate.js +26 -0
- package/dist/verbs/validate.js.map +1 -1
- package/dist/verify-program.d.ts +6 -1
- package/dist/verify-program.d.ts.map +1 -1
- package/dist/verify-program.js +12 -5
- package/dist/verify-program.js.map +1 -1
- package/dist/verify-version.json +2 -2
- package/package.json +6 -5
- package/scripts/author-acceptance.mjs +170 -0
- package/scripts/author-version.json +4 -0
- package/scripts/build-persona-package.mjs +309 -0
- package/scripts/copy-yaml-assets.mjs +4 -2
- package/scripts/dagger-parity.sh +74 -0
- package/scripts/maintain-acceptance.mjs +240 -0
- package/scripts/maintain-version.json +4 -0
- package/scripts/release-gate.mjs +9 -0
- package/scripts/verify-version.json +2 -2
- package/scripts/vitest-tmpdir.mjs +26 -0
- package/scripts/build-verify-package.mjs +0 -210
|
@@ -1,145 +1,99 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `.claude/settings.json` merge pass during `sdd-cli sync`.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* `.claude/settings.json` merge pass during `sdd-cli sync`. The method's hooks (see
|
|
3
|
+
* src/lib/hooks-seed/) are upserted when the repo runs the claude-code harness; every adopter
|
|
4
|
+
* entry and every other top-level key is preserved.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The method seeds no MCP server (M-ADR 0220 §4.5). Sync removes the `sdd-mcp` entry it seeded
|
|
7
|
+
* before, without --allow-overwrite, because an entry whose command is the method's own
|
|
8
|
+
* `sdd-cli mcp serve` is the method's output: the same rule by which sync retired its own
|
|
9
|
+
* SDD_REPO_PATH value. An adopter's other servers, and an `sdd-mcp` entry that runs anything
|
|
10
|
+
* else, are left alone.
|
|
9
11
|
*
|
|
10
|
-
* Conflict handling mirrors ADR 0114: if the adopter has
|
|
11
|
-
*
|
|
12
|
-
* `--allow-overwrite` is passed.
|
|
12
|
+
* Conflict handling mirrors ADR 0114: if the adopter has modified a method-owned hook, sync
|
|
13
|
+
* refuses unless `--allow-overwrite` is passed.
|
|
13
14
|
*/
|
|
14
15
|
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
15
16
|
import { dirname, join, resolve } from "node:path";
|
|
16
|
-
import {
|
|
17
|
-
import { buildMethodManagedHooks, detectHooksDrift, upsertMethodManagedHooks, } from "../hooks-seed/index.js";
|
|
17
|
+
import { buildMethodManagedHooks, detectHooksDrift, normaliseOwnHookRenders, upsertMethodManagedHooks, } from "../hooks-seed/index.js";
|
|
18
18
|
export const SETTINGS_REL_PATH = ".claude/settings.json";
|
|
19
|
+
/** The server id the method used to seed. */
|
|
20
|
+
export const RETIRED_SERVER_ID = "sdd-mcp";
|
|
21
|
+
/**
|
|
22
|
+
* Whether an `mcpServers` entry is one the method seeded: `sdd-cli mcp serve` and no other field,
|
|
23
|
+
* with no env or only an SDD_REPO_PATH that resolves to the repo itself (the value older syncs
|
|
24
|
+
* wrote for a platform repo). An SDD_REPO_PATH pointing anywhere else was the adopter's own
|
|
25
|
+
* configuration, as is any other change, and the entry stays.
|
|
26
|
+
*/
|
|
27
|
+
export function isOwnSddMcpEntry(entry, targetRepo) {
|
|
28
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
29
|
+
return false;
|
|
30
|
+
const e = entry;
|
|
31
|
+
if (Object.keys(e).some((k) => k !== "command" && k !== "args" && k !== "env"))
|
|
32
|
+
return false;
|
|
33
|
+
if (e["command"] !== "sdd-cli")
|
|
34
|
+
return false;
|
|
35
|
+
const args = e["args"];
|
|
36
|
+
if (!Array.isArray(args) || args.length !== 2 || args[0] !== "mcp" || args[1] !== "serve")
|
|
37
|
+
return false;
|
|
38
|
+
const env = e["env"];
|
|
39
|
+
if (env === undefined)
|
|
40
|
+
return true;
|
|
41
|
+
if (!env || typeof env !== "object" || Array.isArray(env))
|
|
42
|
+
return false;
|
|
43
|
+
const keys = Object.keys(env);
|
|
44
|
+
if (keys.length !== 1 || keys[0] !== "SDD_REPO_PATH")
|
|
45
|
+
return false;
|
|
46
|
+
const path = env["SDD_REPO_PATH"];
|
|
47
|
+
return typeof path === "string" && resolve(targetRepo, path) === resolve(targetRepo);
|
|
48
|
+
}
|
|
49
|
+
/** The settings with the method's own `sdd-mcp` entry removed, and which ids went. */
|
|
50
|
+
export function retireOwnMcpServers(settings, targetRepo) {
|
|
51
|
+
const servers = settings["mcpServers"];
|
|
52
|
+
if (!servers || typeof servers !== "object" || Array.isArray(servers))
|
|
53
|
+
return { settings, retired: [] };
|
|
54
|
+
const current = servers;
|
|
55
|
+
if (!(RETIRED_SERVER_ID in current) || !isOwnSddMcpEntry(current[RETIRED_SERVER_ID], targetRepo)) {
|
|
56
|
+
return { settings, retired: [] };
|
|
57
|
+
}
|
|
58
|
+
const { [RETIRED_SERVER_ID]: _retired, ...rest } = current;
|
|
59
|
+
const { mcpServers: _servers, ...others } = settings;
|
|
60
|
+
return {
|
|
61
|
+
settings: Object.keys(rest).length > 0 ? { ...others, mcpServers: rest } : others,
|
|
62
|
+
retired: [RETIRED_SERVER_ID],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
19
65
|
export async function syncMethodManagedSettings(opts) {
|
|
20
66
|
const absPath = join(opts.targetRepo, SETTINGS_REL_PATH);
|
|
67
|
+
const fileExisted = await fileExists(absPath);
|
|
21
68
|
const existing = await readSettings(absPath);
|
|
22
|
-
// No profile gets an SDD_REPO_PATH any more (ruled 2026-10-01). It was written for platform
|
|
23
|
-
// repos only because the resolver treated a marker-bearing repo as one candidate among its
|
|
24
|
-
// marker-bearing siblings (MULTIPLE_SDDS_FOUND in the reverse estate's layout). The resolver now
|
|
25
|
-
// lets a platform-product repo serve itself, so the env var, an absolute, machine-specific
|
|
26
|
-
// path in a COMMITTED file, is no longer needed. A value left by an older sync that points at
|
|
27
|
-
// the repo itself is this tool's own output and is removed (normaliseSddRepoPathForDrift); a
|
|
28
|
-
// value pointing anywhere else is the adopter's and is still drift. App/integration repos
|
|
29
|
-
// configure their sibling platform SDD as before.
|
|
30
|
-
const owned = buildMethodManagedServers({});
|
|
31
|
-
// Drift is detected against a PATH-NORMALISED view of the existing file,
|
|
32
|
-
// not the raw bytes. Reason, measured on a live estate: the F27 defect
|
|
33
|
-
// wrote the literal CLI argument (".") as SDD_REPO_PATH. Once the
|
|
34
|
-
// generator was fixed to emit the absolute form, a strict comparison
|
|
35
|
-
// classified the defect's own historical output as an ADOPTER
|
|
36
|
-
// modification and refused to correct it — while the only offered remedy,
|
|
37
|
-
// --allow-overwrite, is the flag that rewrites genuinely adopter-owned
|
|
38
|
-
// keys. A repair that requires the dangerous flag is not a repair. So: an
|
|
39
|
-
// existing SDD_REPO_PATH that RESOLVES (from the target repo) to the same
|
|
40
|
-
// absolute path as the generated value is the tool's own output in an
|
|
41
|
-
// older costume, and is treated as regenerable, never as drift. The raw
|
|
42
|
-
// `existing` still flows into the upsert below, so the merge rewrites the
|
|
43
|
-
// stale form to the canonical one — the sync self-heals instead of
|
|
44
|
-
// wedging. A path that resolves DIFFERENTLY is still drift.
|
|
45
|
-
const drifted = detectManagedDrift(normaliseSddRepoPathForDrift(existing, owned, opts.targetRepo), owned);
|
|
46
|
-
// Computed from the state as READ, before any upsert: which method-managed ids
|
|
47
|
-
// were absent from the file this run opened. Combined with `hadPreviousSync`
|
|
48
|
-
// that is a re-seed; without it, a first seeding. Deliberately not derived
|
|
49
|
-
// from the upsert's `added`, which cannot tell the two apart — that conflation
|
|
50
|
-
// IS the defect.
|
|
51
|
-
const absentOnRead = absentManagedIds(existing, owned);
|
|
52
|
-
const reseeded = opts.hadPreviousSync === true ? absentOnRead : [];
|
|
53
69
|
const hooksActive = opts.agentHarness === "claude-code";
|
|
54
70
|
const ownedHooks = hooksActive ? buildMethodManagedHooks() : undefined;
|
|
55
71
|
const hooksDrifted = hooksActive && ownedHooks
|
|
56
|
-
? detectHooksDrift(existing, ownedHooks)
|
|
72
|
+
? detectHooksDrift(normaliseOwnHookRenders(existing, ownedHooks), ownedHooks)
|
|
57
73
|
: [];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
drifted,
|
|
62
|
-
added: [],
|
|
63
|
-
// Reported even on the refusal path: the re-seed was OBSERVED when the
|
|
64
|
-
// file was read, and it stays true whether or not this run went on to
|
|
65
|
-
// write. Zeroing it here would make a refusal hide a second finding.
|
|
66
|
-
reseeded,
|
|
67
|
-
updated: [],
|
|
68
|
-
unchanged: [],
|
|
69
|
-
hooksChangedEvents: [],
|
|
70
|
-
hooksDrifted,
|
|
71
|
-
wroteFile: false,
|
|
72
|
-
refused: true,
|
|
73
|
-
};
|
|
74
|
+
const base = { path: SETTINGS_REL_PATH, hooksDrifted };
|
|
75
|
+
if (hooksDrifted.length > 0 && !opts.allowOverwrite) {
|
|
76
|
+
return { ...base, retiredServers: [], hooksChangedEvents: [], wroteFile: false, refused: true };
|
|
74
77
|
}
|
|
78
|
+
const retirement = retireOwnMcpServers(existing, opts.targetRepo);
|
|
75
79
|
if (opts.checkOnly) {
|
|
76
|
-
return {
|
|
77
|
-
path: SETTINGS_REL_PATH,
|
|
78
|
-
drifted,
|
|
79
|
-
added: [],
|
|
80
|
-
reseeded,
|
|
81
|
-
updated: [],
|
|
82
|
-
unchanged: [],
|
|
83
|
-
hooksChangedEvents: [],
|
|
84
|
-
hooksDrifted,
|
|
85
|
-
wroteFile: false,
|
|
86
|
-
refused: false,
|
|
87
|
-
};
|
|
80
|
+
return { ...base, retiredServers: retirement.retired, hooksChangedEvents: [], wroteFile: false, refused: false };
|
|
88
81
|
}
|
|
89
|
-
|
|
90
|
-
let nextSettings = mcpResult.settings;
|
|
82
|
+
let nextSettings = retirement.settings;
|
|
91
83
|
let hooksChangedEvents = [];
|
|
92
84
|
if (hooksActive && ownedHooks) {
|
|
93
85
|
const hooksResult = upsertMethodManagedHooks(nextSettings, ownedHooks);
|
|
94
86
|
nextSettings = hooksResult.settings;
|
|
95
87
|
hooksChangedEvents = [...hooksResult.changedEvents];
|
|
96
88
|
}
|
|
97
|
-
const changed =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
drifted,
|
|
102
|
-
added: mcpResult.added,
|
|
103
|
-
reseeded,
|
|
104
|
-
updated: mcpResult.updated,
|
|
105
|
-
unchanged: mcpResult.unchanged,
|
|
106
|
-
hooksChangedEvents: [],
|
|
107
|
-
hooksDrifted,
|
|
108
|
-
wroteFile: false,
|
|
109
|
-
refused: false,
|
|
110
|
-
};
|
|
89
|
+
const changed = retirement.retired.length > 0 || hooksChangedEvents.length > 0;
|
|
90
|
+
// Nothing to write: leave the file as it is, and never create one just to hold nothing.
|
|
91
|
+
if (!changed || (!fileExisted && Object.keys(nextSettings).length === 0)) {
|
|
92
|
+
return { ...base, retiredServers: [], hooksChangedEvents: [], wroteFile: false, refused: false };
|
|
111
93
|
}
|
|
112
94
|
await mkdir(dirname(absPath), { recursive: true });
|
|
113
95
|
await writeFile(absPath, JSON.stringify(nextSettings, null, 2) + "\n", "utf8");
|
|
114
|
-
return {
|
|
115
|
-
path: SETTINGS_REL_PATH,
|
|
116
|
-
drifted,
|
|
117
|
-
added: mcpResult.added,
|
|
118
|
-
reseeded,
|
|
119
|
-
updated: mcpResult.updated,
|
|
120
|
-
unchanged: mcpResult.unchanged,
|
|
121
|
-
hooksChangedEvents,
|
|
122
|
-
hooksDrifted,
|
|
123
|
-
wroteFile: true,
|
|
124
|
-
refused: false,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Method-managed ids absent from the settings file as read.
|
|
129
|
-
*
|
|
130
|
-
* A missing or malformed `mcpServers` map counts every managed id as absent —
|
|
131
|
-
* `readSettings` already collapses an unparseable file to `{}`, and a file whose
|
|
132
|
-
* managed block was destroyed rather than edited is exactly the re-seed case
|
|
133
|
-
* this exists to name.
|
|
134
|
-
*/
|
|
135
|
-
function absentManagedIds(existing, owned) {
|
|
136
|
-
const servers = existing["mcpServers"];
|
|
137
|
-
const present = servers && typeof servers === "object" && !Array.isArray(servers)
|
|
138
|
-
? servers
|
|
139
|
-
: {};
|
|
140
|
-
return Object.keys(owned)
|
|
141
|
-
.filter((id) => !(id in present))
|
|
142
|
-
.sort();
|
|
96
|
+
return { ...base, retiredServers: retirement.retired, hooksChangedEvents, wroteFile: true, refused: false };
|
|
143
97
|
}
|
|
144
98
|
async function readSettings(absPath) {
|
|
145
99
|
if (!(await fileExists(absPath)))
|
|
@@ -167,50 +121,4 @@ async function fileExists(path) {
|
|
|
167
121
|
return false;
|
|
168
122
|
}
|
|
169
123
|
}
|
|
170
|
-
/**
|
|
171
|
-
* A view of `existing` for drift detection ONLY: where a method-managed
|
|
172
|
-
* entry's `env.SDD_REPO_PATH` resolves (from the target repo) to the same
|
|
173
|
-
* absolute path as the generated value, substitute the generated form.
|
|
174
|
-
*
|
|
175
|
-
* This makes "the tool's own older output" (the F27 relative-path defect,
|
|
176
|
-
* or a lexically different spelling of the same location) compare as
|
|
177
|
-
* pristine, so the merge proceeds and REWRITES it — while a path that
|
|
178
|
-
* resolves somewhere else entirely remains drift and still refuses.
|
|
179
|
-
* Never used for the write: the raw `existing` flows into the upsert, so
|
|
180
|
-
* the correction actually lands on disk.
|
|
181
|
-
*/
|
|
182
|
-
function normaliseSddRepoPathForDrift(existing, owned, targetRepo) {
|
|
183
|
-
const servers = existing["mcpServers"];
|
|
184
|
-
if (!servers || typeof servers !== "object" || Array.isArray(servers)) {
|
|
185
|
-
return existing;
|
|
186
|
-
}
|
|
187
|
-
const current = servers;
|
|
188
|
-
const out = {};
|
|
189
|
-
let touched = false;
|
|
190
|
-
for (const [id, entry] of Object.entries(current)) {
|
|
191
|
-
const existingPath = entry?.env?.["SDD_REPO_PATH"];
|
|
192
|
-
const ownedPath = owned[id]?.env?.["SDD_REPO_PATH"];
|
|
193
|
-
if (typeof existingPath === "string" &&
|
|
194
|
-
ownedPath === undefined &&
|
|
195
|
-
resolve(targetRepo, existingPath) === resolve(targetRepo)) {
|
|
196
|
-
// The retired platform SDD_REPO_PATH, pointing at the repo itself: regenerable, so the
|
|
197
|
-
// drift view drops it and the write (which replaces the entry whole) removes it.
|
|
198
|
-
const { SDD_REPO_PATH: _dropped, ...rest } = entry.env ?? {};
|
|
199
|
-
const { env: _env, ...bare } = entry;
|
|
200
|
-
out[id] = Object.keys(rest).length > 0 ? { ...bare, env: rest } : bare;
|
|
201
|
-
touched = true;
|
|
202
|
-
}
|
|
203
|
-
else if (typeof existingPath === "string" &&
|
|
204
|
-
typeof ownedPath === "string" &&
|
|
205
|
-
existingPath !== ownedPath &&
|
|
206
|
-
resolve(targetRepo, existingPath) === resolve(ownedPath)) {
|
|
207
|
-
out[id] = { ...entry, env: { ...entry.env, SDD_REPO_PATH: ownedPath } };
|
|
208
|
-
touched = true;
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
out[id] = entry;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return touched ? { ...existing, mcpServers: out } : existing;
|
|
215
|
-
}
|
|
216
124
|
//# sourceMappingURL=settings-merge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-merge.js","sourceRoot":"","sources":["../../../src/lib/sync/settings-merge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"settings-merge.js","sourceRoot":"","sources":["../../../src/lib/sync/settings-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC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C,OAAO,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAC5C,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;QAC1C,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACnE,OAAO,MAAiC,CAAC;QAC3C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,gFAAgF;IAClF,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// read 0 (the scores-coverage precedent, M-ADR 0205 §4.5).
|
|
12
12
|
import { readLockFile, findForwardBase } from "../lock-file.js";
|
|
13
13
|
import { loadSddManifest, } from "../catalogue/manifest-loader.js";
|
|
14
|
-
import {
|
|
14
|
+
import { getSddCliVersion } from "../package-version.js";
|
|
15
15
|
/**
|
|
16
16
|
* Manifest profile → the forward base that profile expects. Profiles with no
|
|
17
17
|
* entry (support-repo, organisation-profile) carry no expectation — silence,
|
|
@@ -37,7 +37,7 @@ export async function checkBundleCoherence(targetRepo) {
|
|
|
37
37
|
let profile;
|
|
38
38
|
try {
|
|
39
39
|
const manifest = await loadSddManifest(targetRepo, {
|
|
40
|
-
cliVersion:
|
|
40
|
+
cliVersion: getSddCliVersion(),
|
|
41
41
|
});
|
|
42
42
|
profile = manifest.profile;
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-coherence.js","sourceRoot":"","sources":["../../../src/lib/validate/bundle-coherence.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,4EAA4E;AAC5E,uEAAuE;AACvE,yEAAyE;AACzE,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,2DAA2D;AAC3D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,eAAe,GAEhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bundle-coherence.js","sourceRoot":"","sources":["../../../src/lib/validate/bundle-coherence.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,4EAA4E;AAC5E,uEAAuE;AACvE,yEAAyE;AACzE,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,2DAA2D;AAC3D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,eAAe,GAEhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,qBAAqB,GAA6C;IACtE,kBAAkB,EAAE,mBAAmB;IACvC,qBAAqB,EAAE,cAAc;IACrC,qBAAqB,EAAE,sBAAsB;CAC9C,CAAC;AAWF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,UAAkB;IAElB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,WAAW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;QAC9G,sDAAsD;QACtD,+CAA+C,CAClD,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The method-managed validation job, as DATA (bead sdm-dd6.2; Dagger ruling sdm-s48, 2026-10-15).
|
|
3
|
+
*
|
|
4
|
+
* One ordered plan per profile: every default validator, the platform's script-only checks, then the
|
|
5
|
+
* advisory catalogue freshness check. Every executor renders or runs THIS: the GitHub workflow
|
|
6
|
+
* generator (ci-workflow.ts) and the Dagger module (via `sdd-verify validate --list`). The job list
|
|
7
|
+
* drifted once when CI kept a hand copy of the suite (2026-10-01: three validators never reached CI),
|
|
8
|
+
* so no executor may keep its own list.
|
|
9
|
+
*/
|
|
10
|
+
import type { Profile } from "../repo-kind.js";
|
|
11
|
+
export type PlanTool = "sdd-verify" | "sdd-maintain" | "bash";
|
|
12
|
+
export interface PlanStep {
|
|
13
|
+
/** Stable id: the validator name, or a fixed id for script and freshness steps. */
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly title: string;
|
|
16
|
+
readonly tool: PlanTool;
|
|
17
|
+
/** argv after the tool, run from the SDD root. */
|
|
18
|
+
readonly args: readonly string[];
|
|
19
|
+
/** Advisory steps report but never fail the job (Tom's ruling on the freshness step). */
|
|
20
|
+
readonly advisory: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function methodValidationPlan(profile: Profile): readonly PlanStep[];
|
|
23
|
+
/** The shell form of a step, as a CI host's `run:` line writes it. */
|
|
24
|
+
export declare function stepCommand(step: PlanStep): string;
|
|
25
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/lib/validate/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,QAAQ;IACvB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAoBD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,QAAQ,EAAE,CAwB1E;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAElD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The method-managed validation job, as DATA (bead sdm-dd6.2; Dagger ruling sdm-s48, 2026-10-15).
|
|
3
|
+
*
|
|
4
|
+
* One ordered plan per profile: every default validator, the platform's script-only checks, then the
|
|
5
|
+
* advisory catalogue freshness check. Every executor renders or runs THIS: the GitHub workflow
|
|
6
|
+
* generator (ci-workflow.ts) and the Dagger module (via `sdd-verify validate --list`). The job list
|
|
7
|
+
* drifted once when CI kept a hand copy of the suite (2026-10-01: three validators never reached CI),
|
|
8
|
+
* so no executor may keep its own list.
|
|
9
|
+
*/
|
|
10
|
+
import { validatorsForProfile } from "./dispatch.js";
|
|
11
|
+
/** Titles kept from the hand-kept list, so step names stay readable. */
|
|
12
|
+
const TITLES = {
|
|
13
|
+
"adr-structure": "Validate ADR metadata",
|
|
14
|
+
"spec-lifecycle": "Validate spec lifecycle",
|
|
15
|
+
"no-bare-adr": "Reject bare ADR references",
|
|
16
|
+
traceability: "Validate traceability",
|
|
17
|
+
"runway-classification": "Validate runway classification",
|
|
18
|
+
"corpus-consistency": "Validate corpus consistency",
|
|
19
|
+
config: "Validate configuration",
|
|
20
|
+
"app-docs": "Validate app documentation",
|
|
21
|
+
"integration-docs": "Validate integration documentation",
|
|
22
|
+
"yaml-parse": "Validate that tracked YAML parses",
|
|
23
|
+
"gate-readiness": "Validate gate readiness",
|
|
24
|
+
"bundle-coherence": "Report bundle coherence",
|
|
25
|
+
// CI has no platform checkout, so this step runs the app-only checks; the met gate needs the platform beside it.
|
|
26
|
+
"app-dependencies": "Validate app dependencies (app-only checks; no platform checkout in CI)",
|
|
27
|
+
};
|
|
28
|
+
export function methodValidationPlan(profile) {
|
|
29
|
+
const steps = validatorsForProfile(profile)
|
|
30
|
+
.filter((v) => v.optional !== true)
|
|
31
|
+
.map((v) => ({
|
|
32
|
+
id: v.name,
|
|
33
|
+
title: TITLES[v.name] ?? `Validate ${v.name}`,
|
|
34
|
+
tool: "sdd-verify",
|
|
35
|
+
args: ["validate", "--target-repo", ".", "--validator", v.name],
|
|
36
|
+
advisory: false,
|
|
37
|
+
}));
|
|
38
|
+
if (profile === "platform") {
|
|
39
|
+
steps.push({ id: "cascade-completeness", title: "Validate cascade completeness", tool: "bash", args: ["orchestration/scripts/validate-cascade-completeness.sh", "all"], advisory: false }, { id: "architecture-alignment", title: "Validate architecture alignment", tool: "bash", args: ["orchestration/scripts/validate-architecture-alignment.sh"], advisory: false });
|
|
40
|
+
}
|
|
41
|
+
steps.push({
|
|
42
|
+
id: "catalogue-freshness",
|
|
43
|
+
title: "Check catalogues reproduce from the specs (advisory)",
|
|
44
|
+
tool: "sdd-maintain",
|
|
45
|
+
args: ["catalogue", "build", "--check", "--sdd-path", "."],
|
|
46
|
+
advisory: true,
|
|
47
|
+
});
|
|
48
|
+
return steps;
|
|
49
|
+
}
|
|
50
|
+
/** The shell form of a step, as a CI host's `run:` line writes it. */
|
|
51
|
+
export function stepCommand(step) {
|
|
52
|
+
return [step.tool, ...step.args].join(" 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C3B,KAAK,CAAC,IAAI,CACR,EAAE,EAAE,EAAE,sBAAsB,EAAE,KAAK,EAAE,+BAA+B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,wDAAwD,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAC9K,EAAE,EAAE,EAAE,wBAAwB,EAAE,KAAK,EAAE,iCAAiC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,0DAA0D,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAC9K,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC;QACT,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,sDAAsD;QAC7D,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,CAAC;QAC1D,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,IAAc;IACxC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintain-bin.d.ts","sourceRoot":"","sources":["../src/maintain-bin.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runMaintain } from "./maintain-program.js";
|
|
3
|
+
runMaintain(process.argv.slice(2)).catch((err) => {
|
|
4
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
5
|
+
process.stderr.write(`sdd-maintain: ${message}\n`);
|
|
6
|
+
process.exit(1);
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=maintain-bin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintain-bin.js","sourceRoot":"","sources":["../src/maintain-bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACxD,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,OAAO,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
/** The verbs maintain adds to verify, as `<verb>` or `<verb> <subcommand>`. Asserted by test. */
|
|
3
|
+
export declare const MAINTAIN_ONLY_SURFACE: ReadonlyArray<string>;
|
|
4
|
+
/** The full surface: verify's, plus maintain's own. */
|
|
5
|
+
export declare const MAINTAIN_SURFACE: ReadonlyArray<string>;
|
|
6
|
+
export declare function runMaintain(argv: readonly string[]): Promise<void>;
|
|
7
|
+
export declare function buildMaintainProgram(): Command;
|
|
8
|
+
//# sourceMappingURL=maintain-program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintain-program.d.ts","sourceRoot":"","sources":["../src/maintain-program.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAC;AAapD,iGAAiG;AACjG,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAWvD,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAiD,CAAC;AAMrG,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBxE;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAoC9C"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Fourth entrypoint: the MAINTAIN surface — M-ADR 0218.
|
|
2
|
+
//
|
|
3
|
+
// A binary that brings an SDD current and rebuilds its derived model, and cannot change
|
|
4
|
+
// what the SDD says. It is to unattended sync waves what sdd-verify is to CI.
|
|
5
|
+
//
|
|
6
|
+
// A verb is here when everything it writes is DERIVED or METHOD-MANAGED, deterministically
|
|
7
|
+
// (M-ADR 0218 §4.2–4.3): the method payload, lock, CI block and briefing (`sync`,
|
|
8
|
+
// `generate-briefing`), the derived model (`catalogue build | aggregate | graph | diff`), an
|
|
9
|
+
// output the caller names (`pack build`, `render screen`), and a code repository's briefing
|
|
10
|
+
// (`context pull`). Plus the whole verify surface, because the personas nest.
|
|
11
|
+
//
|
|
12
|
+
// ⚠ As with sdd-verify, the boundary is ABSENCE, not a menu: the package ships only the import
|
|
13
|
+
// closure of maintain-bin.js, so authoring verbs (init, scaffold, plan, conformance,
|
|
14
|
+
// contracts, api-surface, snapshot, metamodel, migration-map) are not present to be reached.
|
|
15
|
+
// That is why every registration below imports a per-subcommand registrar, never a barrel.
|
|
16
|
+
// Unclassified verbs default to AUTHOR (M-ADR 0218 §4.2) and stay out until classified.
|
|
17
|
+
import { Command, CommanderError } from "commander";
|
|
18
|
+
import { getPackageVersion } from "./lib/package-version.js";
|
|
19
|
+
import { registerVerifySurface, rejectOutsideSurface, VERIFY_SURFACE } from "./verify-program.js";
|
|
20
|
+
import { registerCatalogueAggregate, registerCatalogueBuild, registerCatalogueDiff, registerCatalogueGraph } from "./verbs/catalogue-maintain.js";
|
|
21
|
+
import { registerCatalogueCheck } from "./verbs/catalogue-check.js";
|
|
22
|
+
import { registerContext } from "./verbs/context.js";
|
|
23
|
+
import { registerGenerateBriefing } from "./verbs/generate-briefing.js";
|
|
24
|
+
import { registerPackBuild } from "./verbs/pack-build.js";
|
|
25
|
+
import { registerRender } from "./verbs/render.js";
|
|
26
|
+
import { registerSync } from "./verbs/sync.js";
|
|
27
|
+
const SPEC_URL = "https://github.com/tomfosteruk/sdd-method/blob/main/docs/method/cli/sdd-cli-specification.md";
|
|
28
|
+
/** The verbs maintain adds to verify, as `<verb>` or `<verb> <subcommand>`. Asserted by test. */
|
|
29
|
+
export const MAINTAIN_ONLY_SURFACE = [
|
|
30
|
+
"sync",
|
|
31
|
+
"generate-briefing",
|
|
32
|
+
"context pull",
|
|
33
|
+
"catalogue build",
|
|
34
|
+
"catalogue check",
|
|
35
|
+
"catalogue aggregate",
|
|
36
|
+
"catalogue graph",
|
|
37
|
+
"catalogue diff",
|
|
38
|
+
"pack build",
|
|
39
|
+
"render screen",
|
|
40
|
+
];
|
|
41
|
+
/** The full surface: verify's, plus maintain's own. */
|
|
42
|
+
export const MAINTAIN_SURFACE = [...VERIFY_SURFACE, ...MAINTAIN_ONLY_SURFACE];
|
|
43
|
+
const OUTSIDE = "is not part of sdd-maintain, which can bring a repository current and rebuild its derived model but cannot author specification content. " +
|
|
44
|
+
"Authoring verbs are in @sdd-method/sdd-cli.";
|
|
45
|
+
export async function runMaintain(argv) {
|
|
46
|
+
const program = buildMaintainProgram();
|
|
47
|
+
if (argv.length === 0) {
|
|
48
|
+
program.outputHelp();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
rejectOutsideSurface(program, argv, OUTSIDE);
|
|
52
|
+
try {
|
|
53
|
+
await program.parseAsync([...argv], { from: "user" });
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if (err instanceof CommanderError) {
|
|
57
|
+
if (err.code === "commander.help" || err.code === "commander.helpDisplayed" || err.code === "commander.version") {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
throw err;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export function buildMaintainProgram() {
|
|
65
|
+
const program = new Command();
|
|
66
|
+
program
|
|
67
|
+
.name("sdd-maintain")
|
|
68
|
+
.description("Bring an SDD repository current and rebuild its derived model — sync, briefing, catalogue build and aggregate, pack build, context pull — plus every read-only verify verb. Cannot author specification content.")
|
|
69
|
+
.version(getPackageVersion(), "-v, --version")
|
|
70
|
+
.addHelpText("after", `\nSpec: ${SPEC_URL}\nAuthoring verbs (scaffold, plan, conformance, …) are in @sdd-method/author-cli; init is in @sdd-method/sdd-cli.`)
|
|
71
|
+
.exitOverride()
|
|
72
|
+
.configureOutput({
|
|
73
|
+
writeOut: (str) => process.stdout.write(str),
|
|
74
|
+
writeErr: (str) => process.stderr.write(str),
|
|
75
|
+
});
|
|
76
|
+
// The verify surface first, from verify's own registration: the nesting is structural.
|
|
77
|
+
registerVerifySurface(program);
|
|
78
|
+
registerSync(program);
|
|
79
|
+
registerGenerateBriefing(program);
|
|
80
|
+
registerContext(program);
|
|
81
|
+
registerRender(program);
|
|
82
|
+
const catalogue = program.commands.find((c) => c.name() === "catalogue");
|
|
83
|
+
catalogue.description("Build, aggregate, validate and query per-SDD catalogues (ADR 0134) — the derived model");
|
|
84
|
+
registerCatalogueBuild(catalogue);
|
|
85
|
+
registerCatalogueCheck(catalogue);
|
|
86
|
+
registerCatalogueAggregate(catalogue);
|
|
87
|
+
registerCatalogueGraph(catalogue);
|
|
88
|
+
registerCatalogueDiff(catalogue);
|
|
89
|
+
const pack = program.commands.find((c) => c.name() === "pack");
|
|
90
|
+
pack.description("Build and validate adopter-shipped context-pack bundles (ADR 0151)");
|
|
91
|
+
registerPackBuild(pack);
|
|
92
|
+
return program;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=maintain-program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintain-program.js","sourceRoot":"","sources":["../src/maintain-program.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,wFAAwF;AACxF,8EAA8E;AAC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IACtB,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAClC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,cAAc,CAAC,OAAO,CAAC,CAAC;IAExB,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,WAAW,CAAE,CAAC;IAC1E,SAAS,CAAC,WAAW,CAAC,wFAAwF,CAAC,CAAC;IAChH,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAClC,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAClC,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACtC,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAClC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,MAAM,CAAE,CAAC;IAChE,IAAI,CAAC,WAAW,CAAC,oEAAoE,CAAC,CAAC;IACvF,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAExB,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* `catalogue check` (M-ADR 0220 §4.2, ruling 3): whether the committed catalogues are what the
|
|
4
|
+
* committed specifications build to. It builds into temporary space and writes nothing to the
|
|
5
|
+
* repository: `catalogue build --check` under its own name, so the author's surface holds no verb
|
|
6
|
+
* that writes the model. Its own registrar, so an artefact can carry it without the build,
|
|
7
|
+
* aggregate and graph registrations in catalogue-maintain.ts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerCatalogueCheck(catalogue: Command): void;
|
|
10
|
+
//# sourceMappingURL=catalogue-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue-check.d.ts","sourceRoot":"","sources":["../../src/verbs/catalogue-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAyB/D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { checkCataloguesFresh } from "../lib/catalogue/freshness.js";
|
|
3
|
+
/**
|
|
4
|
+
* `catalogue check` (M-ADR 0220 §4.2, ruling 3): whether the committed catalogues are what the
|
|
5
|
+
* committed specifications build to. It builds into temporary space and writes nothing to the
|
|
6
|
+
* repository: `catalogue build --check` under its own name, so the author's surface holds no verb
|
|
7
|
+
* that writes the model. Its own registrar, so an artefact can carry it without the build,
|
|
8
|
+
* aggregate and graph registrations in catalogue-maintain.ts.
|
|
9
|
+
*/
|
|
10
|
+
export function registerCatalogueCheck(catalogue) {
|
|
11
|
+
catalogue
|
|
12
|
+
.command("check")
|
|
13
|
+
.description("Report whether the committed catalogues/ are what the committed specifications build to; builds in a temporary directory and writes nothing (exit 1 lists every stale file)")
|
|
14
|
+
.option("--sdd-path <path>", "Path to the SDD repo root (defaults to cwd)")
|
|
15
|
+
.option("--strict", "Treat build findings as failures")
|
|
16
|
+
.option("--snapshot-store <dir>", "Snapshot store root the binding's snapshot_area is relative to (default: $SDD_SNAPSHOT_STORE; M-ADR 0214)")
|
|
17
|
+
.action(async (opts) => {
|
|
18
|
+
const snapshotStore = opts.snapshotStore ?? process.env.SDD_SNAPSHOT_STORE;
|
|
19
|
+
const r = await checkCataloguesFresh(resolve(opts.sddPath ?? process.cwd()), {
|
|
20
|
+
label: "catalogue check",
|
|
21
|
+
...(opts.strict !== undefined ? { strict: opts.strict } : {}),
|
|
22
|
+
...(snapshotStore !== undefined ? { snapshotStore } : {}),
|
|
23
|
+
}, (s) => process.stdout.write(s));
|
|
24
|
+
if (r.exitCode !== 0)
|
|
25
|
+
process.exit(r.exitCode);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=catalogue-check.js.map
|