@milehimikey/em 1.13.1 → 1.14.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/.claude/agents/em-critic.md +26 -0
- package/.claude/agents/em-implementer.md +34 -0
- package/.claude/agents/em-reviewer.md +31 -0
- package/.claude/agents/em-validator.md +27 -0
- package/.claude/skills/event-modeling/SKILL.md +50 -11
- package/.claude/skills/event-modeling-conform/SKILL.md +1 -1
- package/.claude/skills/event-modeling-design/SKILL.md +126 -18
- package/.claude/skills/event-modeling-discover/SKILL.md +1 -1
- package/.claude/skills/event-modeling-engagement/SKILL.md +192 -0
- package/.claude/skills/event-modeling-engagement/reference/engagement.md +143 -0
- package/.claude/skills/event-modeling-implement/SKILL.md +1 -1
- package/.claude/skills/event-modeling-implement/reference/implement.md +38 -11
- package/.claude/skills/event-modeling-review/SKILL.md +1 -1
- package/.claude/skills/event-modeling-shared/reference/em-dsl.md +274 -189
- package/.claude/skills/event-modeling-shared/reference/operating-principles.md +61 -0
- package/.claude/skills/event-modeling-shared/reference/slice-doc-schema.md +108 -5
- package/.claude/skills/event-modeling-shared/templates/constitution.md +18 -1
- package/.claude/skills/event-modeling-shared/templates/slice.md +64 -39
- package/.claude/skills/event-modeling-shared/templates/state.md +5 -1
- package/.claude-plugin/marketplace.json +14 -0
- package/README.md +25 -11
- package/dist/catalog/apiFirst.d.ts +28 -0
- package/dist/catalog/apiFirst.js +49 -0
- package/dist/catalog/apiFirst.js.map +1 -0
- package/dist/catalog/docJoin.d.ts +13 -0
- package/dist/catalog/docJoin.js +11 -0
- package/dist/catalog/docJoin.js.map +1 -1
- package/dist/catalog/docModelConsistencyValidate.js +44 -4
- package/dist/catalog/docModelConsistencyValidate.js.map +1 -1
- package/dist/catalog/invariantsValidate.d.ts +4 -0
- package/dist/catalog/invariantsValidate.js +102 -0
- package/dist/catalog/invariantsValidate.js.map +1 -0
- package/dist/catalog/scenarios.d.ts +15 -0
- package/dist/catalog/scenarios.js +97 -0
- package/dist/catalog/scenarios.js.map +1 -0
- package/dist/catalog/sliceDoc.d.ts +8 -0
- package/dist/catalog/sliceDoc.js +9 -0
- package/dist/catalog/sliceDoc.js.map +1 -1
- package/dist/catalog/sliceReadyValidate.d.ts +31 -4
- package/dist/catalog/sliceReadyValidate.js +66 -8
- package/dist/catalog/sliceReadyValidate.js.map +1 -1
- package/dist/catalog/sliceSections.d.ts +55 -0
- package/dist/catalog/sliceSections.js +317 -0
- package/dist/catalog/sliceSections.js.map +1 -0
- package/dist/cli/agentsMd.js +7 -1
- package/dist/cli/agentsMd.js.map +1 -1
- package/dist/cli/api.d.ts +90 -0
- package/dist/cli/api.js +318 -0
- package/dist/cli/api.js.map +1 -0
- package/dist/cli/ciInit.d.ts +82 -21
- package/dist/cli/ciInit.js +468 -64
- package/dist/cli/ciInit.js.map +1 -1
- package/dist/cli/conformScope.d.ts +28 -0
- package/dist/cli/conformScope.js +67 -0
- package/dist/cli/conformScope.js.map +1 -1
- package/dist/cli/coverage.d.ts +9 -0
- package/dist/cli/coverage.js +60 -8
- package/dist/cli/coverage.js.map +1 -1
- package/dist/cli/engagement.d.ts +210 -0
- package/dist/cli/engagement.js +444 -0
- package/dist/cli/engagement.js.map +1 -0
- package/dist/cli/engagementFile.d.ts +86 -0
- package/dist/cli/engagementFile.js +255 -0
- package/dist/cli/engagementFile.js.map +1 -0
- package/dist/cli/metrics.d.ts +10 -0
- package/dist/cli/metrics.js +49 -1
- package/dist/cli/metrics.js.map +1 -1
- package/dist/cli/pluginPin.d.ts +55 -0
- package/dist/cli/pluginPin.js +188 -0
- package/dist/cli/pluginPin.js.map +1 -0
- package/dist/cli/ratify.d.ts +27 -2
- package/dist/cli/ratify.js +112 -13
- package/dist/cli/ratify.js.map +1 -1
- package/dist/cli/reratify.d.ts +3 -2
- package/dist/cli/reratify.js +36 -14
- package/dist/cli/reratify.js.map +1 -1
- package/dist/cli/scopeInputs.d.ts +48 -0
- package/dist/cli/scopeInputs.js +176 -0
- package/dist/cli/scopeInputs.js.map +1 -0
- package/dist/cli/skillCheck.d.ts +15 -1
- package/dist/cli/skillCheck.js +22 -1
- package/dist/cli/skillCheck.js.map +1 -1
- package/dist/cli/skillDirs.d.ts +5 -0
- package/dist/cli/skillDirs.js +13 -1
- package/dist/cli/skillDirs.js.map +1 -1
- package/dist/cli/skillSync.d.ts +4 -0
- package/dist/cli/skillSync.js +23 -0
- package/dist/cli/skillSync.js.map +1 -1
- package/dist/cli/sliceNew.d.ts +11 -7
- package/dist/cli/sliceNew.js +91 -18
- package/dist/cli/sliceNew.js.map +1 -1
- package/dist/cli/sliceSync.d.ts +50 -0
- package/dist/cli/sliceSync.js +170 -0
- package/dist/cli/sliceSync.js.map +1 -0
- package/dist/cli/status.d.ts +24 -1
- package/dist/cli/status.js +20 -1
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/systemInputs.d.ts +53 -10
- package/dist/cli/systemInputs.js +186 -11
- package/dist/cli/systemInputs.js.map +1 -1
- package/dist/cli/upgrade.d.ts +16 -3
- package/dist/cli/upgrade.js +366 -30
- package/dist/cli/upgrade.js.map +1 -1
- package/dist/cli/usageLog.d.ts +4 -2
- package/dist/cli/usageLog.js +4 -2
- package/dist/cli/usageLog.js.map +1 -1
- package/dist/cli.js +554 -94
- package/dist/cli.js.map +1 -1
- package/dist/emit/api.d.ts +29 -0
- package/dist/emit/api.js +220 -0
- package/dist/emit/api.js.map +1 -0
- package/dist/emit/apiCheckJson.d.ts +3 -0
- package/dist/emit/apiCheckJson.js +21 -0
- package/dist/emit/apiCheckJson.js.map +1 -0
- package/dist/emit/codeownersJson.d.ts +3 -0
- package/dist/emit/codeownersJson.js +19 -0
- package/dist/emit/codeownersJson.js.map +1 -0
- package/dist/emit/diffJson.d.ts +1 -1
- package/dist/emit/diffJson.js +8 -1
- package/dist/emit/diffJson.js.map +1 -1
- package/dist/emit/engagementJson.d.ts +8 -0
- package/dist/emit/engagementJson.js +46 -0
- package/dist/emit/engagementJson.js.map +1 -0
- package/dist/emit/glossaryJson.d.ts +1 -1
- package/dist/emit/glossaryJson.js +4 -1
- package/dist/emit/glossaryJson.js.map +1 -1
- package/dist/emit/json.d.ts +17 -1
- package/dist/emit/json.js +30 -1
- package/dist/emit/json.js.map +1 -1
- package/dist/emit/metricsJson.d.ts +1 -1
- package/dist/emit/metricsJson.js +4 -1
- package/dist/emit/metricsJson.js.map +1 -1
- package/dist/emit/queryJson.d.ts +1 -1
- package/dist/emit/queryJson.js +7 -1
- package/dist/emit/queryJson.js.map +1 -1
- package/dist/emit/scopeJson.d.ts +12 -0
- package/dist/emit/scopeJson.js +26 -0
- package/dist/emit/scopeJson.js.map +1 -0
- package/dist/emit/skillCheckJson.d.ts +3 -2
- package/dist/emit/skillCheckJson.js +10 -2
- package/dist/emit/skillCheckJson.js.map +1 -1
- package/dist/emit/statusJson.d.ts +1 -1
- package/dist/emit/statusJson.js +15 -1
- package/dist/emit/statusJson.js.map +1 -1
- package/dist/emit/systemJson.d.ts +15 -8
- package/dist/emit/systemJson.js +28 -13
- package/dist/emit/systemJson.js.map +1 -1
- package/dist/emit/validateJson.d.ts +3 -3
- package/dist/emit/validateJson.js +10 -4
- package/dist/emit/validateJson.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +163 -31
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/diff.d.ts +4 -1
- package/dist/model/diff.js +44 -8
- package/dist/model/diff.js.map +1 -1
- package/dist/model/glossary.d.ts +2 -0
- package/dist/model/glossary.js +1 -0
- package/dist/model/glossary.js.map +1 -1
- package/dist/model/model.d.ts +55 -2
- package/dist/model/model.js +57 -0
- package/dist/model/model.js.map +1 -1
- package/dist/model/qualifiedRef.d.ts +18 -0
- package/dist/model/qualifiedRef.js +26 -0
- package/dist/model/qualifiedRef.js.map +1 -1
- package/dist/model/queryIndex.d.ts +9 -1
- package/dist/model/queryIndex.js +18 -2
- package/dist/model/queryIndex.js.map +1 -1
- package/dist/model/rules.d.ts +143 -2
- package/dist/model/rules.js +162 -3
- package/dist/model/rules.js.map +1 -1
- package/dist/model/validate.d.ts +40 -0
- package/dist/model/validate.js +147 -1
- package/dist/model/validate.js.map +1 -1
- package/dist/parser/ast.d.ts +31 -3
- package/dist/parser/parser.js +148 -14
- package/dist/parser/parser.js.map +1 -1
- package/dist/query/format.js +1 -1
- package/dist/query/format.js.map +1 -1
- package/dist/query/verbs.d.ts +6 -0
- package/dist/query/verbs.js +6 -2
- package/dist/query/verbs.js.map +1 -1
- package/dist/system/adaptation.d.ts +14 -0
- package/dist/system/adaptation.js +49 -0
- package/dist/system/adaptation.js.map +1 -0
- package/dist/system/codeowners.d.ts +77 -0
- package/dist/system/codeowners.js +242 -0
- package/dist/system/codeowners.js.map +1 -0
- package/dist/system/manifest.d.ts +10 -5
- package/dist/system/manifest.js +54 -26
- package/dist/system/manifest.js.map +1 -1
- package/dist/system/migrateManifest.d.ts +28 -0
- package/dist/system/migrateManifest.js +155 -0
- package/dist/system/migrateManifest.js.map +1 -0
- package/dist/system/scope.d.ts +46 -0
- package/dist/system/scope.js +132 -0
- package/dist/system/scope.js.map +1 -0
- package/dist/system/verify.d.ts +50 -13
- package/dist/system/verify.js +179 -58
- package/dist/system/verify.js.map +1 -1
- package/dist/templates.d.ts +2 -2
- package/dist/templates.js +23 -2
- package/dist/templates.js.map +1 -1
- package/package.json +5 -2
- package/plugin/.claude-plugin/plugin.json +18 -0
- package/plugin/agents/em-critic.md +27 -0
- package/plugin/agents/em-implementer.md +35 -0
- package/plugin/agents/em-reviewer.md +32 -0
- package/plugin/agents/em-validator.md +28 -0
- package/plugin/shared/reference/em-dsl.md +866 -0
- package/plugin/shared/reference/methodology.md +329 -0
- package/plugin/shared/reference/operating-principles.md +222 -0
- package/plugin/shared/reference/slice-doc-schema.md +566 -0
- package/plugin/shared/templates/conformance-report.md +85 -0
- package/plugin/shared/templates/constitution.md +136 -0
- package/plugin/shared/templates/model-readme.md +46 -0
- package/plugin/shared/templates/slice.md +251 -0
- package/plugin/shared/templates/state.md +77 -0
- package/plugin/skills/conform/SKILL.md +93 -0
- package/plugin/skills/conform/reference/conform.md +428 -0
- package/plugin/skills/design/SKILL.md +297 -0
- package/plugin/skills/discover/SKILL.md +90 -0
- package/plugin/skills/discover/reference/extract.md +147 -0
- package/plugin/skills/engagement/SKILL.md +193 -0
- package/plugin/skills/engagement/reference/engagement.md +144 -0
- package/plugin/skills/event-modeling/SKILL.md +132 -0
- package/plugin/skills/implement/SKILL.md +61 -0
- package/plugin/skills/implement/reference/implement.md +439 -0
- package/plugin/skills/review/SKILL.md +74 -0
- package/dist/emit/typespec.d.ts +0 -26
- package/dist/emit/typespec.js +0 -356
- package/dist/emit/typespec.js.map +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// The em Claude Code plugin's pin check (MIL-231, R14). Pure: reads a repo's `.claude/settings.json`
|
|
3
|
+
// (then `.claude/settings.local.json`) and the machine-level marketplace registry, and reports
|
|
4
|
+
// findings. No process.exit, no console, and nothing reads the real `~/.claude/plugins` unless the
|
|
5
|
+
// caller passes it - the CLI resolves the directory (EM_CLAUDE_PLUGINS_DIR, default
|
|
6
|
+
// ~/.claude/plugins), tests pass a fixture.
|
|
7
|
+
//
|
|
8
|
+
// Why two parts. A marketplace registration is per user and keyed by marketplace NAME: two repos
|
|
9
|
+
// pinning different refs under one name silently collide (MIL-229 spike). The marketplace name
|
|
10
|
+
// therefore carries the exact version (`em-1-14-0`), and the check compares the repo's declaration
|
|
11
|
+
// (settings) AND the machine's registration (known_marketplaces.json) against the installed em.
|
|
12
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
13
|
+
import { homedir } from "node:os";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
export const PLUGIN_NAME = "em";
|
|
16
|
+
export const PLUGIN_REPO = "milehimikey/em";
|
|
17
|
+
/** A marketplace key that makes a repo "declare the plugin": `em-<major>-<minor>-<patch>`. */
|
|
18
|
+
export const PLUGIN_MARKETPLACE_RE = /^em-\d+-\d+-\d+$/;
|
|
19
|
+
/** `1.14.0` -> `em-1-14-0` (the marketplace name the release stamps into .claude-plugin/marketplace.json). */
|
|
20
|
+
export function pluginMarketplaceName(version) {
|
|
21
|
+
return `em-${version.replace(/\./g, "-")}`;
|
|
22
|
+
}
|
|
23
|
+
/** The two commands that register and enable the plugin pinned to `version` (both are required, in
|
|
24
|
+
* this order: `plugin install` alone fails with "Plugin not found in marketplace"). */
|
|
25
|
+
export function pluginInstallCommands(version) {
|
|
26
|
+
return [
|
|
27
|
+
`claude plugin marketplace add ${PLUGIN_REPO}@v${version} --scope project`,
|
|
28
|
+
`claude plugin install ${PLUGIN_NAME}@${pluginMarketplaceName(version)} --scope project`,
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
/** The `.claude/settings.json` entries that pin the plugin to `version` (MIL-232, R14). Pure. */
|
|
32
|
+
export function pluginSettingsEntries(version) {
|
|
33
|
+
const name = pluginMarketplaceName(version);
|
|
34
|
+
return {
|
|
35
|
+
name,
|
|
36
|
+
marketplace: { source: { source: "github", repo: PLUGIN_REPO, ref: `v${version}` } },
|
|
37
|
+
enabledKey: `${PLUGIN_NAME}@${name}`,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Merge the plugin pin for `version` into the text of a `.claude/settings.json` (`null` = file
|
|
42
|
+
* absent). Unknown keys and key order are preserved; output is 2-space JSON with a trailing newline.
|
|
43
|
+
* Returns `null` when the existing text is not a JSON object (the caller must not clobber it).
|
|
44
|
+
*/
|
|
45
|
+
export function mergePluginSettings(existing, version) {
|
|
46
|
+
let settings = {};
|
|
47
|
+
if (existing !== null) {
|
|
48
|
+
try {
|
|
49
|
+
const v = JSON.parse(existing);
|
|
50
|
+
if (v === null || typeof v !== "object" || Array.isArray(v))
|
|
51
|
+
return null;
|
|
52
|
+
settings = v;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const e = pluginSettingsEntries(version);
|
|
59
|
+
const markets = { ...(obj(settings.extraKnownMarketplaces) ?? {}), [e.name]: e.marketplace };
|
|
60
|
+
const enabled = { ...(obj(settings.enabledPlugins) ?? {}), [e.enabledKey]: true };
|
|
61
|
+
const out = { ...settings, extraKnownMarketplaces: markets, enabledPlugins: enabled };
|
|
62
|
+
return JSON.stringify(out, null, 2) + "\n";
|
|
63
|
+
}
|
|
64
|
+
function readJson(path) {
|
|
65
|
+
try {
|
|
66
|
+
const v = JSON.parse(readFileSync(path, "utf8"));
|
|
67
|
+
return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function obj(v) {
|
|
74
|
+
return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A repo "declares the plugin" iff `.claude/settings.json` (then `.claude/settings.local.json`) has
|
|
78
|
+
* an `extraKnownMarketplaces` key matching `^em-\d+-\d+-\d+$` whose `source` is the github repo
|
|
79
|
+
* `milehimikey/em`. When several keys match (a stale pin left beside the current one), the one named
|
|
80
|
+
* `preferName` wins, else the first in key order.
|
|
81
|
+
*/
|
|
82
|
+
export function detectPlugin(repoRoot, preferName) {
|
|
83
|
+
const files = [join(repoRoot, ".claude", "settings.json"), join(repoRoot, ".claude", "settings.local.json")]
|
|
84
|
+
.map(readJson)
|
|
85
|
+
.filter((j) => j !== null);
|
|
86
|
+
for (const settings of files) {
|
|
87
|
+
const markets = obj(settings.extraKnownMarketplaces);
|
|
88
|
+
if (!markets)
|
|
89
|
+
continue;
|
|
90
|
+
const names = Object.keys(markets)
|
|
91
|
+
.filter((k) => {
|
|
92
|
+
const src = obj(obj(markets[k])?.source);
|
|
93
|
+
return PLUGIN_MARKETPLACE_RE.test(k) && src?.source === "github" && src.repo === PLUGIN_REPO;
|
|
94
|
+
})
|
|
95
|
+
.sort();
|
|
96
|
+
if (names.length === 0)
|
|
97
|
+
continue;
|
|
98
|
+
const name = preferName && names.includes(preferName) ? preferName : names[0];
|
|
99
|
+
const ref = obj(obj(markets[name])?.source)?.ref;
|
|
100
|
+
let enabled = false;
|
|
101
|
+
for (const f of files) {
|
|
102
|
+
const v = obj(f.enabledPlugins)?.[`${PLUGIN_NAME}@${name}`];
|
|
103
|
+
if (v !== undefined)
|
|
104
|
+
enabled = v === true;
|
|
105
|
+
}
|
|
106
|
+
return { declared: true, name, ref: typeof ref === "string" ? ref : null, enabled };
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
/** The machine-level plugins directory: EM_CLAUDE_PLUGINS_DIR, else ~/.claude/plugins. */
|
|
111
|
+
export function claudePluginsDir(env = process.env) {
|
|
112
|
+
return env.EM_CLAUDE_PLUGINS_DIR ? env.EM_CLAUDE_PLUGINS_DIR : join(homedir(), ".claude", "plugins");
|
|
113
|
+
}
|
|
114
|
+
/** The `source.ref` the machine registry holds for `name`, `undefined` when there is no entry (or no
|
|
115
|
+
* readable registry), `null` when the entry carries no ref. */
|
|
116
|
+
function registeredRef(pluginsDir, name) {
|
|
117
|
+
const file = join(pluginsDir, "known_marketplaces.json");
|
|
118
|
+
if (!existsSync(file))
|
|
119
|
+
return undefined;
|
|
120
|
+
const entry = obj(readJson(file)?.[name]);
|
|
121
|
+
if (!entry)
|
|
122
|
+
return undefined;
|
|
123
|
+
const ref = obj(entry.source)?.ref;
|
|
124
|
+
return typeof ref === "string" ? ref : null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Check the plugin declaration in `repoRoot` against `installedVersion` (em --version) and the
|
|
128
|
+
* machine registry in `pluginsDir`. `null` when the repo does not declare the plugin.
|
|
129
|
+
*/
|
|
130
|
+
export function checkPlugin(repoRoot, installedVersion, pluginsDir) {
|
|
131
|
+
const expectedName = pluginMarketplaceName(installedVersion);
|
|
132
|
+
const expectedRef = `v${installedVersion}`;
|
|
133
|
+
const plugin = detectPlugin(repoRoot, expectedName);
|
|
134
|
+
if (!plugin)
|
|
135
|
+
return null;
|
|
136
|
+
const commands = pluginInstallCommands(installedVersion);
|
|
137
|
+
const findings = [];
|
|
138
|
+
const pinOk = plugin.name === expectedName && plugin.ref === expectedRef;
|
|
139
|
+
if (!pinOk) {
|
|
140
|
+
findings.push({
|
|
141
|
+
code: "plugin-pin-mismatch",
|
|
142
|
+
message: `em plugin pin mismatch: .claude/settings.json pins ${plugin.name} at ref ${plugin.ref ?? "(none)"}, ` +
|
|
143
|
+
`but installed em is ${installedVersion} (expected marketplace ${expectedName} at ref ${expectedRef}) - ` +
|
|
144
|
+
`update extraKnownMarketplaces and enabledPlugins to the installed version, then run the install commands`,
|
|
145
|
+
pluginName: plugin.name,
|
|
146
|
+
pluginRef: plugin.ref,
|
|
147
|
+
installedVersion,
|
|
148
|
+
installCommands: commands,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
if (!plugin.enabled) {
|
|
152
|
+
findings.push({
|
|
153
|
+
code: "plugin-not-enabled",
|
|
154
|
+
message: `em plugin is not enabled: enabledPlugins["${PLUGIN_NAME}@${plugin.name}"] is not true in .claude/settings.json`,
|
|
155
|
+
pluginName: plugin.name,
|
|
156
|
+
pluginRef: plugin.ref,
|
|
157
|
+
installedVersion,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// The machine registration is only meaningful against a correct pin; a wrong pin is the one root
|
|
161
|
+
// cause, reported once.
|
|
162
|
+
if (pinOk) {
|
|
163
|
+
const reg = registeredRef(pluginsDir, plugin.name);
|
|
164
|
+
if (reg === undefined) {
|
|
165
|
+
findings.push({
|
|
166
|
+
code: "plugin-not-installed-locally",
|
|
167
|
+
message: `em plugin ${plugin.name} is not registered on this machine (no entry in ${join(pluginsDir, "known_marketplaces.json")}) - run:\n ${commands.join("\n ")}`,
|
|
168
|
+
pluginName: plugin.name,
|
|
169
|
+
pluginRef: null,
|
|
170
|
+
installedVersion,
|
|
171
|
+
installCommands: commands,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
else if (reg !== expectedRef) {
|
|
175
|
+
findings.push({
|
|
176
|
+
code: "plugin-registered-at-different-ref",
|
|
177
|
+
message: `em plugin ${plugin.name} is registered on this machine at ${reg ?? "(no ref)"}, not ${expectedRef} - ` +
|
|
178
|
+
`the agent would run the wrong skills; run: claude plugin marketplace remove ${plugin.name}, then:\n ${commands.join("\n ")}`,
|
|
179
|
+
pluginName: plugin.name,
|
|
180
|
+
pluginRef: reg,
|
|
181
|
+
installedVersion,
|
|
182
|
+
installCommands: commands,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return { plugin, findings };
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=pluginPin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginPin.js","sourceRoot":"","sources":["../../src/cli/pluginPin.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,qGAAqG;AACrG,+FAA+F;AAC/F,mGAAmG;AACnG,oFAAoF;AACpF,4CAA4C;AAC5C,EAAE;AACF,iGAAiG;AACjG,+FAA+F;AAC/F,mGAAmG;AACnG,gGAAgG;AAEhG,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAC5C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,8GAA8G;AAC9G,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,OAAO,MAAM,OAAO,CA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U,EAAE,yBAAyB,CAAC,eAAe,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBACrK,UAAU,EAAE,MAAM,CAAC,IAAI;gBACvB,SAAS,EAAE,IAAI;gBACf,gBAAgB;gBAChB,eAAe,EAAE,QAAQ;aAC1B,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,oCAAoC;gBAC1C,OAAO,EACL,aAAa,MAAM,CAAC,IAAI,qCAAqC,GAAG,IAAI,UAAU,SAAS,WAAW,KAAK;oBACvG,+EAA+E,MAAM,CAAC,IAAI,cAAc,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBACjI,UAAU,EAAE,MAAM,CAAC,IAAI;gBACvB,SAAS,EAAE,GAAG;gBACd,gBAAgB;gBAChB,eAAe,EAAE,QAAQ;aAC1B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC"}
|
package/dist/cli/ratify.d.ts
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { NormalizedModel } from "../model/model.js";
|
|
2
2
|
import { RefsResult } from "../model/refs.js";
|
|
3
|
+
/** MIL-238: the ratifier's API-first statement about this version of a public-touching slice. */
|
|
4
|
+
export type MeaningConfirmation = {
|
|
5
|
+
kind: "meaning-unchanged";
|
|
6
|
+
} | {
|
|
7
|
+
kind: "contract-change";
|
|
8
|
+
why: string;
|
|
9
|
+
};
|
|
10
|
+
/** The two frontmatter keys a `MeaningConfirmation` is written to — cleared together on rewrite. */
|
|
11
|
+
export declare const MEANING_CONFIRMATION_KEYS: readonly ["meaningConfirmed", "contractChange"];
|
|
12
|
+
/** Turn the `--meaning-unchanged` / `--contract-change "<why>"` flags into a confirmation (or
|
|
13
|
+
* null when neither was passed). Refuses both at once, an empty reason, and a reason that can't
|
|
14
|
+
* be written as one quoted frontmatter value (control characters, double quotes). */
|
|
15
|
+
export declare function parseMeaningFlags(meaningUnchanged: boolean | undefined, contractChange: string | undefined): {
|
|
16
|
+
ok: true;
|
|
17
|
+
confirmation: MeaningConfirmation | null;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
/** The frontmatter line a confirmation is recorded as. */
|
|
23
|
+
export declare function meaningConfirmationLine(c: MeaningConfirmation): string;
|
|
24
|
+
/** The refusal for a public-touching slice ratified/reratified without a confirmation. */
|
|
25
|
+
export declare function meaningConfirmationRequiredMessage(sliceKey: string): string;
|
|
26
|
+
/** Remove every `meaningConfirmed:`/`contractChange:` line (whole line, EOL included). */
|
|
27
|
+
export declare function stripMeaningConfirmation(inner: string): string;
|
|
3
28
|
/** The status this command flips a slice doc to — the handoff gate
|
|
4
29
|
* (docs/process.md#the-slice-lifecycle-gates): contracts/invariants agreed, open questions
|
|
5
30
|
* resolved or deferred, ready for an implementing agent or engineer to pick up. */
|
|
@@ -51,7 +76,7 @@ export type ApplyRatifyResult = {
|
|
|
51
76
|
* that refusal message (and in the caller's skip notice); every other refusal here is about the
|
|
52
77
|
* doc's own text. No fs access — the caller reads/writes; see `runRatify` below.
|
|
53
78
|
*/
|
|
54
|
-
export declare function applyRatifyFrontmatter(raw: string, sliceKey: string, ratifiedBy: string, ratifiedOn: string, skipReview?: boolean): ApplyRatifyResult;
|
|
79
|
+
export declare function applyRatifyFrontmatter(raw: string, sliceKey: string, ratifiedBy: string, ratifiedOn: string, skipReview?: boolean, confirmation?: MeaningConfirmation | null): ApplyRatifyResult;
|
|
55
80
|
export type RunRatifyResult = {
|
|
56
81
|
ok: true;
|
|
57
82
|
path: string;
|
|
@@ -70,4 +95,4 @@ export type RunRatifyResult = {
|
|
|
70
95
|
* `--slice-ready`/`em export` use (MIL-121 cross-binding included), then reads/applies/writes
|
|
71
96
|
* it. `baseDir` is the `.em` file's directory, same convention every doc/note path in `em` uses.
|
|
72
97
|
*/
|
|
73
|
-
export declare function runRatify(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, ratifiedBy: string, ratifiedOn: string, skipReview?: boolean): RunRatifyResult;
|
|
98
|
+
export declare function runRatify(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, ratifiedBy: string, ratifiedOn: string, skipReview?: boolean, confirmation?: MeaningConfirmation | null): RunRatifyResult;
|
package/dist/cli/ratify.js
CHANGED
|
@@ -40,14 +40,79 @@
|
|
|
40
40
|
// reports any whose doc isn't `ready-to-implement`/`implemented` yet. Repeated-view instance
|
|
41
41
|
// hops (`view X again`) are never edges in `ModelIndex.out`/`.in` (queryIndex.ts's own design
|
|
42
42
|
// note), so they never surface here either — nothing extra to filter.
|
|
43
|
+
// MIL-238 — the API-first meaning confirmation: on a public-touching slice (one owning a `public`
|
|
44
|
+
// command/event/view, catalog/apiFirst.ts) ratification also asserts the contract is current and
|
|
45
|
+
// says whether this version changes what it MEANS to a consumer. `--meaning-unchanged` records
|
|
46
|
+
// `meaningConfirmed: true`; `--contract-change "<why>"` records `contractChange: "<why>"`; exactly
|
|
47
|
+
// one is required there, and either is accepted (and recorded, harmlessly) on any other slice.
|
|
48
|
+
// The line goes directly after `ratifiedOn:`, replacing any earlier confirmation line.
|
|
43
49
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
44
50
|
import { join } from "node:path";
|
|
45
51
|
import { continuationOf } from "../model/continuation.js";
|
|
46
52
|
import { resolveSliceDocJoin } from "../catalog/docJoin.js";
|
|
47
53
|
import { buildModelIndex } from "../model/queryIndex.js";
|
|
48
|
-
import { fieldLineRegex, locateFrontmatterInner, normalizeFieldValue } from "./frontmatterSurgery.js";
|
|
54
|
+
import { fieldLineRegex, fieldLineWithEolRegex, locateFrontmatterInner, normalizeFieldValue } from "./frontmatterSurgery.js";
|
|
49
55
|
import { REVIEWED_STATUS } from "./review.js";
|
|
50
56
|
import { isValidDateString } from "./stateFile.js";
|
|
57
|
+
import { isPublicTouchingSlice } from "../catalog/apiFirst.js";
|
|
58
|
+
/** The two frontmatter keys a `MeaningConfirmation` is written to — cleared together on rewrite. */
|
|
59
|
+
export const MEANING_CONFIRMATION_KEYS = ["meaningConfirmed", "contractChange"];
|
|
60
|
+
/** Turn the `--meaning-unchanged` / `--contract-change "<why>"` flags into a confirmation (or
|
|
61
|
+
* null when neither was passed). Refuses both at once, an empty reason, and a reason that can't
|
|
62
|
+
* be written as one quoted frontmatter value (control characters, double quotes). */
|
|
63
|
+
export function parseMeaningFlags(meaningUnchanged, contractChange) {
|
|
64
|
+
if (meaningUnchanged && contractChange !== undefined) {
|
|
65
|
+
return { ok: false, message: 'pass one of --meaning-unchanged or --contract-change "<why>", not both' };
|
|
66
|
+
}
|
|
67
|
+
if (meaningUnchanged)
|
|
68
|
+
return { ok: true, confirmation: { kind: "meaning-unchanged" } };
|
|
69
|
+
if (contractChange === undefined)
|
|
70
|
+
return { ok: true, confirmation: null };
|
|
71
|
+
const why = contractChange.trim();
|
|
72
|
+
if (!why)
|
|
73
|
+
return { ok: false, message: 'a contract-change reason is required (--contract-change "<why>")' };
|
|
74
|
+
if (/[\x00-\x1f\x7f]/.test(why)) {
|
|
75
|
+
return { ok: false, message: "contract-change reason must not contain control characters" };
|
|
76
|
+
}
|
|
77
|
+
if (why.includes('"')) {
|
|
78
|
+
return {
|
|
79
|
+
ok: false,
|
|
80
|
+
message: "contract-change reason must not contain double quotes — it is written as one quoted frontmatter value",
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return { ok: true, confirmation: { kind: "contract-change", why } };
|
|
84
|
+
}
|
|
85
|
+
/** The frontmatter line a confirmation is recorded as. */
|
|
86
|
+
export function meaningConfirmationLine(c) {
|
|
87
|
+
return c.kind === "meaning-unchanged" ? "meaningConfirmed: true" : `contractChange: "${c.why}"`;
|
|
88
|
+
}
|
|
89
|
+
/** The refusal for a public-touching slice ratified/reratified without a confirmation. */
|
|
90
|
+
export function meaningConfirmationRequiredMessage(sliceKey) {
|
|
91
|
+
return (`slice "${sliceKey}" touches the public surface — pass --meaning-unchanged, or ` +
|
|
92
|
+
`--contract-change "<why>" if a consumer must read this change differently`);
|
|
93
|
+
}
|
|
94
|
+
/** Remove every `meaningConfirmed:`/`contractChange:` line (whole line, EOL included). */
|
|
95
|
+
export function stripMeaningConfirmation(inner) {
|
|
96
|
+
let out = inner;
|
|
97
|
+
for (const key of MEANING_CONFIRMATION_KEYS) {
|
|
98
|
+
const re = fieldLineWithEolRegex(key);
|
|
99
|
+
while (re.test(out))
|
|
100
|
+
out = out.replace(re, "");
|
|
101
|
+
}
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
/** The confirmation currently recorded in a frontmatter `inner` block, or null. */
|
|
105
|
+
function recordedConfirmation(inner) {
|
|
106
|
+
const mc = fieldLineRegex("meaningConfirmed").exec(inner);
|
|
107
|
+
if (mc && normalizeFieldValue(mc[2])?.toLowerCase() === "true")
|
|
108
|
+
return { kind: "meaning-unchanged" };
|
|
109
|
+
const cc = fieldLineRegex("contractChange").exec(inner);
|
|
110
|
+
const why = cc ? normalizeFieldValue(cc[2]) : null;
|
|
111
|
+
return why !== null ? { kind: "contract-change", why } : null;
|
|
112
|
+
}
|
|
113
|
+
function sameConfirmation(a, b) {
|
|
114
|
+
return a.kind === b.kind && (a.kind === "meaning-unchanged" || a.why === b.why);
|
|
115
|
+
}
|
|
51
116
|
/** The status this command flips a slice doc to — the handoff gate
|
|
52
117
|
* (docs/process.md#the-slice-lifecycle-gates): contracts/invariants agreed, open questions
|
|
53
118
|
* resolved or deferred, ready for an implementing agent or engineer to pick up. */
|
|
@@ -113,7 +178,7 @@ export function upstreamUnratifiedSlices(model, refs, baseDir, sliceKey) {
|
|
|
113
178
|
* that refusal message (and in the caller's skip notice); every other refusal here is about the
|
|
114
179
|
* doc's own text. No fs access — the caller reads/writes; see `runRatify` below.
|
|
115
180
|
*/
|
|
116
|
-
export function applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, skipReview = false) {
|
|
181
|
+
export function applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, skipReview = false, confirmation = null) {
|
|
117
182
|
const trimmedBy = ratifiedBy.trim();
|
|
118
183
|
if (!trimmedBy)
|
|
119
184
|
return { ok: false, message: "a ratifier name is required (--by)" };
|
|
@@ -129,7 +194,11 @@ export function applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, sk
|
|
|
129
194
|
const range = locateFrontmatterInner(raw);
|
|
130
195
|
if (!range)
|
|
131
196
|
return { ok: false, message: "no frontmatter block found" };
|
|
132
|
-
const
|
|
197
|
+
const originalInner = raw.slice(range.innerStart, range.innerEnd);
|
|
198
|
+
const recorded = recordedConfirmation(originalInner);
|
|
199
|
+
// MIL-238: a new confirmation replaces any earlier one — strip it before locating the lines
|
|
200
|
+
// below, so the fresh line can be spliced in right after `ratifiedOn:`.
|
|
201
|
+
const inner = confirmation ? stripMeaningConfirmation(originalInner) : originalInner;
|
|
133
202
|
const statusMatch = fieldLineRegex("status").exec(inner);
|
|
134
203
|
if (!statusMatch)
|
|
135
204
|
return { ok: false, message: "no `status:` field found in frontmatter" };
|
|
@@ -140,13 +209,27 @@ export function applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, sk
|
|
|
140
209
|
const currentOn = onMatch ? normalizeFieldValue(onMatch[2]) : null;
|
|
141
210
|
if (currentStatus === RATIFIED_STATUS && currentBy !== null && currentOn !== null) {
|
|
142
211
|
if (currentBy === trimmedBy && currentOn === ratifiedOn) {
|
|
143
|
-
|
|
212
|
+
// MIL-238: same identity — a no-op unless this run adds a confirmation the doc lacks. A
|
|
213
|
+
// DIFFERENT recorded confirmation is provenance, refused like a different ratifier.
|
|
214
|
+
if (confirmation === null || (recorded !== null && sameConfirmation(recorded, confirmation))) {
|
|
215
|
+
return { ok: true, content: raw, changed: false, skippedReviewFrom: null }; // idempotent no-op
|
|
216
|
+
}
|
|
217
|
+
if (recorded !== null) {
|
|
218
|
+
return {
|
|
219
|
+
ok: false,
|
|
220
|
+
message: `already ratified by ${currentBy} on ${currentOn} with ${meaningConfirmationLine(recorded)} — ` +
|
|
221
|
+
`refusing to overwrite with ${meaningConfirmationLine(confirmation)}`,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
// else: fall through and record the confirmation alongside the unchanged sign-off.
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
return {
|
|
228
|
+
ok: false,
|
|
229
|
+
message: `already ratified by ${currentBy} on ${currentOn} — refusing to overwrite with ` +
|
|
230
|
+
`${trimmedBy} on ${ratifiedOn}`,
|
|
231
|
+
};
|
|
144
232
|
}
|
|
145
|
-
return {
|
|
146
|
-
ok: false,
|
|
147
|
-
message: `already ratified by ${currentBy} on ${currentOn} — refusing to overwrite with ` +
|
|
148
|
-
`${trimmedBy} on ${ratifiedOn}`,
|
|
149
|
-
};
|
|
150
233
|
}
|
|
151
234
|
// The review gate (MIL-201, D1). A doc that never passed through `status: reviewed` has not
|
|
152
235
|
// been through the first human gate, so ratifying it collapses two decisions into one — the
|
|
@@ -178,6 +261,11 @@ export function applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, sk
|
|
|
178
261
|
missingLines.push(`ratifiedBy: ${trimmedBy}`);
|
|
179
262
|
if (!onMatch)
|
|
180
263
|
missingLines.push(`ratifiedOn: ${ratifiedOn}`);
|
|
264
|
+
// MIL-238: the confirmation line goes directly after `ratifiedOn:` — at the end of the
|
|
265
|
+
// inserted block when `ratifiedOn:` is new, else appended to the existing line's edit below.
|
|
266
|
+
const confirmationText = confirmation ? meaningConfirmationLine(confirmation) : null;
|
|
267
|
+
if (confirmationText && !onMatch)
|
|
268
|
+
missingLines.push(confirmationText);
|
|
181
269
|
const newStatusText = `${statusMatch[1]}${RATIFIED_STATUS}`;
|
|
182
270
|
const statusNext = missingLines.length > 0 ? `${newStatusText}${eol}${missingLines.join(eol)}` : newStatusText;
|
|
183
271
|
// Apply from the highest index first so an earlier edit's index stays valid — same convention
|
|
@@ -189,8 +277,14 @@ export function applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, sk
|
|
|
189
277
|
];
|
|
190
278
|
if (byMatch)
|
|
191
279
|
edits.push({ index: byMatch.index, oldLen: byMatch[0].length, next: `${byMatch[1]}${trimmedBy}` });
|
|
192
|
-
if (onMatch)
|
|
193
|
-
|
|
280
|
+
if (onMatch) {
|
|
281
|
+
const onNext = `${onMatch[1]}${ratifiedOn}`;
|
|
282
|
+
edits.push({
|
|
283
|
+
index: onMatch.index,
|
|
284
|
+
oldLen: onMatch[0].length,
|
|
285
|
+
next: confirmationText ? `${onNext}${eol}${confirmationText}` : onNext,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
194
288
|
edits.sort((a, b) => b.index - a.index);
|
|
195
289
|
let updatedInner = inner;
|
|
196
290
|
for (const edit of edits) {
|
|
@@ -204,7 +298,7 @@ export function applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, sk
|
|
|
204
298
|
* `--slice-ready`/`em export` use (MIL-121 cross-binding included), then reads/applies/writes
|
|
205
299
|
* it. `baseDir` is the `.em` file's directory, same convention every doc/note path in `em` uses.
|
|
206
300
|
*/
|
|
207
|
-
export function runRatify(model, refs, baseDir, sliceKey, ratifiedBy, ratifiedOn, skipReview = false) {
|
|
301
|
+
export function runRatify(model, refs, baseDir, sliceKey, ratifiedBy, ratifiedOn, skipReview = false, confirmation = null) {
|
|
208
302
|
const sliceIndex = refs.sliceKeys.indexOf(sliceKey);
|
|
209
303
|
if (sliceIndex === -1) {
|
|
210
304
|
return { ok: false, message: `no slice with export key "${sliceKey}" in this model` };
|
|
@@ -243,10 +337,15 @@ export function runRatify(model, refs, baseDir, sliceKey, ratifiedBy, ratifiedOn
|
|
|
243
337
|
}
|
|
244
338
|
const absPath = join(baseDir, doc.path);
|
|
245
339
|
const raw = readFileSync(absPath, "utf8");
|
|
246
|
-
const result = applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, skipReview);
|
|
340
|
+
const result = applyRatifyFrontmatter(raw, sliceKey, ratifiedBy, ratifiedOn, skipReview, confirmation);
|
|
247
341
|
if (!result.ok) {
|
|
248
342
|
return { ok: false, message: `${doc.path}: ${result.message}` };
|
|
249
343
|
}
|
|
344
|
+
// MIL-238: the API-first gate — after the doc's own preconditions, before any write: a
|
|
345
|
+
// public-touching slice needs a meaning confirmation.
|
|
346
|
+
if (confirmation === null && isPublicTouchingSlice(model, refs, sliceKey)) {
|
|
347
|
+
return { ok: false, message: meaningConfirmationRequiredMessage(sliceKey) };
|
|
348
|
+
}
|
|
250
349
|
// MIL-198: computed once the gate above has passed, before the write — advisory only, so it
|
|
251
350
|
// runs the same whether the gate passed on its own merits or via --skip-review.
|
|
252
351
|
const upstreamWarnings = upstreamUnratifiedSlices(model, refs, baseDir, sliceKey);
|
package/dist/cli/ratify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ratify.js","sourceRoot":"","sources":["../../src/cli/ratify.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,0FAA0F;AAC1F,kFAAkF;AAClF,8FAA8F;AAC9F,8FAA8F;AAC9F,wFAAwF;AACxF,8FAA8F;AAC9F,6FAA6F;AAC7F,EAAE;AACF,gGAAgG;AAChG,+FAA+F;AAC/F,0FAA0F;AAC1F,gGAAgG;AAChG,yFAAyF;AACzF,EAAE;AACF,gGAAgG;AAChG,8FAA8F;AAC9F,8FAA8F;AAC9F,0FAA0F;AAC1F,gDAAgD;AAChD,EAAE;AACF,iGAAiG;AACjG,wFAAwF;AACxF,6FAA6F;AAC7F,iGAAiG;AACjG,0FAA0F;AAC1F,0FAA0F;AAC1F,2FAA2F;AAC3F,kGAAkG;AAClG,qFAAqF;AACrF,EAAE;AACF,iGAAiG;AACjG,6FAA6F;AAC7F,2FAA2F;AAC3F,+FAA+F;AAC/F,4FAA4F;AAC5F,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AAC;IACD,4FAA4F;IAC5F,gFAAgF;IAChF,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAClF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
package/dist/cli/reratify.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NormalizedModel } from "../model/model.js";
|
|
2
2
|
import { RefsResult } from "../model/refs.js";
|
|
3
|
+
import { MeaningConfirmation } from "./ratify.js";
|
|
3
4
|
export type ApplyReratifyResult = {
|
|
4
5
|
ok: true;
|
|
5
6
|
content: string;
|
|
@@ -20,7 +21,7 @@ export type ReratifyKind = "shipped" | "unshipped";
|
|
|
20
21
|
* see module header for why this precondition (not idempotent-no-op) is the right refusal
|
|
21
22
|
* shape here. No fs access — the caller reads/writes; see `runReratify` below.
|
|
22
23
|
*/
|
|
23
|
-
export declare function applyReratifyFrontmatter(raw: string): ApplyReratifyResult;
|
|
24
|
+
export declare function applyReratifyFrontmatter(raw: string, confirmation?: MeaningConfirmation | null): ApplyReratifyResult;
|
|
24
25
|
/** MIL-214: the certification-aware advisory `runReratify` computes about the version being
|
|
25
26
|
* superseded — never gates the bump, see module header. */
|
|
26
27
|
export interface ReratifyAdvisory {
|
|
@@ -53,4 +54,4 @@ export type RunReratifyResult = {
|
|
|
53
54
|
* writes it. `baseDir` is the `.em` file's directory, same convention every doc/note path in
|
|
54
55
|
* `em` uses.
|
|
55
56
|
*/
|
|
56
|
-
export declare function runReratify(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string): RunReratifyResult;
|
|
57
|
+
export declare function runReratify(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, confirmation?: MeaningConfirmation | null): RunReratifyResult;
|
package/dist/cli/reratify.js
CHANGED
|
@@ -57,12 +57,19 @@
|
|
|
57
57
|
// conform sweep ever ran — so this is advisory only, printed by the CLI layer, never gating the
|
|
58
58
|
// bump itself. MIL-258: the advisory is about superseding a SHIPPED version, so the unshipped
|
|
59
59
|
// path skips it entirely (`advisory: null`) — an unshipped version has no certification to lack.
|
|
60
|
+
//
|
|
61
|
+
// MIL-238: `meaningConfirmed:`/`contractChange:` describe the PRIOR version too, so they are
|
|
62
|
+
// cleared in the same sweep as the sign-off keys. On a public-touching slice the bump itself
|
|
63
|
+
// requires a fresh confirmation (`--meaning-unchanged` or `--contract-change "<why>"`), written
|
|
64
|
+
// directly after the new `version:` line; on any other slice either flag is accepted and recorded.
|
|
60
65
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
61
66
|
import { join } from "node:path";
|
|
62
67
|
import { continuationOf } from "../model/continuation.js";
|
|
63
68
|
import { resolveSliceDocJoin } from "../catalog/docJoin.js";
|
|
64
69
|
import { fieldLineRegex, fieldLineWithEolRegex, locateFrontmatterInner, normalizeFieldValue } from "./frontmatterSurgery.js";
|
|
65
70
|
import { listAllFindingsFiles, unruledFindingsInScope } from "./findings.js";
|
|
71
|
+
import { MEANING_CONFIRMATION_KEYS, meaningConfirmationLine, meaningConfirmationRequiredMessage, } from "./ratify.js";
|
|
72
|
+
import { isPublicTouchingSlice } from "../catalog/apiFirst.js";
|
|
66
73
|
/** The status a doc must already be in for `reratify` to apply — mirrors `RATIFIED_STATUS` in
|
|
67
74
|
* ratify.ts (the status this command flips TO), named separately since it's the precondition
|
|
68
75
|
* here, not the target. */
|
|
@@ -76,7 +83,7 @@ const TARGET_STATUS = "ready-to-implement";
|
|
|
76
83
|
* see module header for why this precondition (not idempotent-no-op) is the right refusal
|
|
77
84
|
* shape here. No fs access — the caller reads/writes; see `runReratify` below.
|
|
78
85
|
*/
|
|
79
|
-
export function applyReratifyFrontmatter(raw) {
|
|
86
|
+
export function applyReratifyFrontmatter(raw, confirmation = null) {
|
|
80
87
|
const range = locateFrontmatterInner(raw);
|
|
81
88
|
if (!range)
|
|
82
89
|
return { ok: false, message: "no frontmatter block found" };
|
|
@@ -122,27 +129,37 @@ export function applyReratifyFrontmatter(raw) {
|
|
|
122
129
|
};
|
|
123
130
|
}
|
|
124
131
|
const newVersion = currentVersion + 1;
|
|
132
|
+
// Clear stale ratifiedBy:/ratifiedOn:/reviewedBy:/reviewedOn: — see module header — and
|
|
133
|
+
// (MIL-238) the prior version's meaningConfirmed:/contractChange:. Done FIRST, on the original
|
|
134
|
+
// text, so the fresh confirmation line spliced in after `version:` below is never swept away.
|
|
135
|
+
// These keys are disjoint from `status:`/`version:` by construction (fieldLineRegex matches one
|
|
136
|
+
// key at a time), so the two lines are re-located on the cleared text unchanged.
|
|
137
|
+
let cleared = inner;
|
|
138
|
+
for (const key of ["ratifiedBy", "ratifiedOn", "reviewedBy", "reviewedOn", ...MEANING_CONFIRMATION_KEYS]) {
|
|
139
|
+
cleared = cleared.replace(fieldLineWithEolRegex(key), "");
|
|
140
|
+
}
|
|
141
|
+
const clearedStatus = fieldLineRegex("status").exec(cleared);
|
|
142
|
+
const clearedVersion = fieldLineRegex("version").exec(cleared);
|
|
143
|
+
const afterVersion = cleared.slice(clearedVersion.index + clearedVersion[0].length);
|
|
144
|
+
const eol = afterVersion.startsWith("\r\n") ? "\r\n" : "\n";
|
|
145
|
+
const versionNext = `${clearedVersion[1]}${newVersion}`;
|
|
125
146
|
// Apply from the highest index first so an earlier edit's index stays valid — same convention
|
|
126
147
|
// markImplemented.ts/ratify.ts use.
|
|
127
148
|
const edits = [
|
|
128
149
|
// MIL-258: the unshipped path is already at the target status — nothing to flip.
|
|
129
150
|
...(kind === "shipped"
|
|
130
|
-
? [{ index:
|
|
151
|
+
? [{ index: clearedStatus.index, oldLen: clearedStatus[0].length, next: `${clearedStatus[1]}${TARGET_STATUS}` }]
|
|
131
152
|
: []),
|
|
132
|
-
{
|
|
153
|
+
{
|
|
154
|
+
index: clearedVersion.index,
|
|
155
|
+
oldLen: clearedVersion[0].length,
|
|
156
|
+
next: confirmation ? `${versionNext}${eol}${meaningConfirmationLine(confirmation)}` : versionNext,
|
|
157
|
+
},
|
|
133
158
|
].sort((a, b) => b.index - a.index);
|
|
134
|
-
let updatedInner =
|
|
159
|
+
let updatedInner = cleared;
|
|
135
160
|
for (const edit of edits) {
|
|
136
161
|
updatedInner = updatedInner.slice(0, edit.index) + edit.next + updatedInner.slice(edit.index + edit.oldLen);
|
|
137
162
|
}
|
|
138
|
-
// Clear stale ratifiedBy:/ratifiedOn:/reviewedBy:/reviewedOn: — see module header. A plain
|
|
139
|
-
// `.replace()` (not index-spliced alongside the edits above) is safe here: these four keys are
|
|
140
|
-
// disjoint from `status:`/`version:` and from each other by construction (fieldLineRegex matches
|
|
141
|
-
// one key at a time), so removing them from the ALREADY-updated text can't disturb the edits
|
|
142
|
-
// just applied.
|
|
143
|
-
for (const key of ["ratifiedBy", "ratifiedOn", "reviewedBy", "reviewedOn"]) {
|
|
144
|
-
updatedInner = updatedInner.replace(fieldLineWithEolRegex(key), "");
|
|
145
|
-
}
|
|
146
163
|
const content = raw.slice(0, range.innerStart) + updatedInner + raw.slice(range.innerEnd);
|
|
147
164
|
return { ok: true, content, newVersion, kind };
|
|
148
165
|
}
|
|
@@ -164,7 +181,7 @@ export function reratifyAdvisory(baseDir, sliceKey, currentVersion, conformedVer
|
|
|
164
181
|
* writes it. `baseDir` is the `.em` file's directory, same convention every doc/note path in
|
|
165
182
|
* `em` uses.
|
|
166
183
|
*/
|
|
167
|
-
export function runReratify(model, refs, baseDir, sliceKey) {
|
|
184
|
+
export function runReratify(model, refs, baseDir, sliceKey, confirmation = null) {
|
|
168
185
|
const sliceIndex = refs.sliceKeys.indexOf(sliceKey);
|
|
169
186
|
if (sliceIndex === -1) {
|
|
170
187
|
return { ok: false, message: `no slice with export key "${sliceKey}" in this model` };
|
|
@@ -198,10 +215,15 @@ export function runReratify(model, refs, baseDir, sliceKey) {
|
|
|
198
215
|
}
|
|
199
216
|
const absPath = join(baseDir, doc.path);
|
|
200
217
|
const raw = readFileSync(absPath, "utf8");
|
|
201
|
-
const result = applyReratifyFrontmatter(raw);
|
|
218
|
+
const result = applyReratifyFrontmatter(raw, confirmation);
|
|
202
219
|
if (!result.ok) {
|
|
203
220
|
return { ok: false, message: `${doc.path}: ${result.message}` };
|
|
204
221
|
}
|
|
222
|
+
// MIL-238: the API-first gate — after the doc's own preconditions, before any write: a
|
|
223
|
+
// public-touching slice's new version needs a meaning confirmation.
|
|
224
|
+
if (confirmation === null && isPublicTouchingSlice(model, refs, sliceKey)) {
|
|
225
|
+
return { ok: false, message: meaningConfirmationRequiredMessage(sliceKey) };
|
|
226
|
+
}
|
|
205
227
|
// MIL-214: computed from the doc's PRE-BUMP version/certification (`doc` was resolved before
|
|
206
228
|
// the write below changes `version`) — "was the version we're about to supersede ever fully
|
|
207
229
|
// certified". MIL-258: only meaningful for a SHIPPED version; an unshipped one has no
|