@milehimikey/em 1.11.0 → 1.13.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/skills/event-modeling/SKILL.md +4 -2
- package/.claude/skills/event-modeling-conform/SKILL.md +20 -9
- package/.claude/skills/event-modeling-conform/reference/conform.md +107 -10
- package/.claude/skills/event-modeling-design/SKILL.md +22 -6
- package/.claude/skills/event-modeling-discover/SKILL.md +1 -1
- package/.claude/skills/event-modeling-implement/SKILL.md +12 -6
- package/.claude/skills/event-modeling-implement/reference/implement.md +165 -18
- package/.claude/skills/event-modeling-review/SKILL.md +5 -1
- package/.claude/skills/event-modeling-shared/reference/em-dsl.md +57 -8
- package/.claude/skills/event-modeling-shared/reference/operating-principles.md +13 -3
- package/.claude/skills/event-modeling-shared/reference/slice-doc-schema.md +69 -0
- package/.claude/skills/event-modeling-shared/templates/conformance-report.md +8 -1
- package/.claude/skills/event-modeling-shared/templates/constitution.md +8 -1
- package/.claude/skills/event-modeling-shared/templates/state.md +3 -0
- package/README.md +1 -0
- package/dist/catalog/build.js +42 -1
- package/dist/catalog/build.js.map +1 -1
- package/dist/catalog/coverage.d.ts +15 -0
- package/dist/catalog/coverage.js +34 -0
- package/dist/catalog/coverage.js.map +1 -0
- package/dist/catalog/docJoin.d.ts +20 -2
- package/dist/catalog/docJoin.js +32 -4
- package/dist/catalog/docJoin.js.map +1 -1
- package/dist/catalog/docModelConsistencyValidate.js +1 -1
- package/dist/catalog/docModelConsistencyValidate.js.map +1 -1
- package/dist/catalog/driftSignal.d.ts +11 -5
- package/dist/catalog/driftSignal.js +18 -4
- package/dist/catalog/driftSignal.js.map +1 -1
- package/dist/catalog/modelVersionValidate.d.ts +9 -0
- package/dist/catalog/modelVersionValidate.js +38 -0
- package/dist/catalog/modelVersionValidate.js.map +1 -0
- package/dist/catalog/noteBindingValidate.js +18 -0
- package/dist/catalog/noteBindingValidate.js.map +1 -1
- package/dist/catalog/orphanedSliceDocValidate.d.ts +8 -1
- package/dist/catalog/orphanedSliceDocValidate.js +33 -6
- package/dist/catalog/orphanedSliceDocValidate.js.map +1 -1
- package/dist/catalog/pages.d.ts +16 -1
- package/dist/catalog/pages.js +16 -4
- package/dist/catalog/pages.js.map +1 -1
- package/dist/catalog/sliceDoc.d.ts +12 -0
- package/dist/catalog/sliceDoc.js +15 -0
- package/dist/catalog/sliceDoc.js.map +1 -1
- package/dist/catalog/sliceReadyValidate.d.ts +12 -1
- package/dist/catalog/sliceReadyValidate.js +4 -4
- package/dist/catalog/sliceReadyValidate.js.map +1 -1
- package/dist/cli/agentsMd.js +9 -3
- package/dist/cli/agentsMd.js.map +1 -1
- package/dist/cli/ciInit.js +20 -0
- package/dist/cli/ciInit.js.map +1 -1
- package/dist/cli/conformScope.d.ts +1 -0
- package/dist/cli/conformScope.js +13 -4
- package/dist/cli/conformScope.js.map +1 -1
- package/dist/cli/conformSupersede.d.ts +24 -2
- package/dist/cli/conformSupersede.js +44 -3
- package/dist/cli/conformSupersede.js.map +1 -1
- package/dist/cli/coverage.d.ts +34 -9
- package/dist/cli/coverage.js +61 -24
- package/dist/cli/coverage.js.map +1 -1
- package/dist/cli/findings.d.ts +134 -0
- package/dist/cli/findings.js +355 -0
- package/dist/cli/findings.js.map +1 -0
- package/dist/cli/markImplemented.js +12 -1
- package/dist/cli/markImplemented.js.map +1 -1
- package/dist/cli/metrics.d.ts +93 -0
- package/dist/cli/metrics.js +331 -0
- package/dist/cli/metrics.js.map +1 -0
- package/dist/cli/modelVersion.d.ts +139 -0
- package/dist/cli/modelVersion.js +256 -0
- package/dist/cli/modelVersion.js.map +1 -0
- package/dist/cli/ratify.js +17 -1
- package/dist/cli/ratify.js.map +1 -1
- package/dist/cli/reratify.d.ts +17 -0
- package/dist/cli/reratify.js +37 -2
- package/dist/cli/reratify.js.map +1 -1
- package/dist/cli/review.js +12 -1
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/skillCheck.js +2 -2
- package/dist/cli/skillCheck.js.map +1 -1
- package/dist/cli/sliceConform.d.ts +50 -0
- package/dist/cli/sliceConform.js +206 -0
- package/dist/cli/sliceConform.js.map +1 -0
- package/dist/cli/sliceIndex.d.ts +2 -0
- package/dist/cli/sliceIndex.js +24 -7
- package/dist/cli/sliceIndex.js.map +1 -1
- package/dist/cli/sliceLink.js +16 -0
- package/dist/cli/sliceLink.js.map +1 -1
- package/dist/cli/sliceNew.d.ts +12 -0
- package/dist/cli/sliceNew.js +23 -0
- package/dist/cli/sliceNew.js.map +1 -1
- package/dist/cli/sliceStubAll.d.ts +76 -0
- package/dist/cli/sliceStubAll.js +189 -0
- package/dist/cli/sliceStubAll.js.map +1 -0
- package/dist/cli/stateFile.d.ts +63 -7
- package/dist/cli/stateFile.js +179 -18
- package/dist/cli/stateFile.js.map +1 -1
- package/dist/cli/status.d.ts +90 -1
- package/dist/cli/status.js +151 -16
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/upgrade.d.ts +122 -0
- package/dist/cli/upgrade.js +476 -0
- package/dist/cli/upgrade.js.map +1 -0
- package/dist/cli.js +586 -66
- package/dist/cli.js.map +1 -1
- package/dist/emit/coverageJson.d.ts +2 -2
- package/dist/emit/coverageJson.js +6 -2
- package/dist/emit/coverageJson.js.map +1 -1
- package/dist/emit/freshnessJson.d.ts +1 -1
- package/dist/emit/freshnessJson.js +3 -1
- package/dist/emit/freshnessJson.js.map +1 -1
- package/dist/emit/json.d.ts +34 -1
- package/dist/emit/json.js +84 -2
- package/dist/emit/json.js.map +1 -1
- package/dist/emit/metricsJson.d.ts +7 -0
- package/dist/emit/metricsJson.js +27 -0
- package/dist/emit/metricsJson.js.map +1 -0
- package/dist/emit/statusJson.d.ts +1 -1
- package/dist/emit/statusJson.js +22 -1
- package/dist/emit/statusJson.js.map +1 -1
- package/dist/emit/upgradeJson.d.ts +5 -0
- package/dist/emit/upgradeJson.js +26 -0
- package/dist/emit/upgradeJson.js.map +1 -0
- package/dist/emit/validateJson.d.ts +10 -5
- package/dist/emit/validateJson.js +22 -8
- package/dist/emit/validateJson.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +151 -22
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/continuation.d.ts +23 -0
- package/dist/model/continuation.js +49 -0
- package/dist/model/continuation.js.map +1 -0
- package/dist/model/queryIndex.js +1 -1
- package/dist/model/queryIndex.js.map +1 -1
- package/dist/model/rules.d.ts +13 -0
- package/dist/model/rules.js +18 -0
- package/dist/model/rules.js.map +1 -1
- package/dist/model/sliceDocIndex.d.ts +12 -5
- package/dist/model/sliceDocIndex.js +18 -7
- package/dist/model/sliceDocIndex.js.map +1 -1
- package/dist/model/validate.d.ts +20 -0
- package/dist/model/validate.js +94 -45
- package/dist/model/validate.js.map +1 -1
- package/dist/render/sliceStatus.d.ts +3 -3
- package/dist/render/sliceStatus.js +27 -29
- package/dist/render/sliceStatus.js.map +1 -1
- package/dist/templates.d.ts +3 -3
- package/dist/templates.js +15 -2
- package/dist/templates.js.map +1 -1
- package/dist/util/localDate.d.ts +2 -0
- package/dist/util/localDate.js +17 -0
- package/dist/util/localDate.js.map +1 -0
- package/dist/util/semver.d.ts +19 -0
- package/dist/util/semver.js +54 -0
- package/dist/util/semver.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { NormalizedModel } from "../model/model.js";
|
|
2
|
+
import { RefsResult } from "../model/refs.js";
|
|
3
|
+
import { GitRunner } from "./diff-inputs.js";
|
|
4
|
+
export declare const UPGRADE_MIN_SUPPORTED_VERSION = "1.6.0";
|
|
5
|
+
export interface UpgradeContext {
|
|
6
|
+
modelFile: string;
|
|
7
|
+
baseDir: string;
|
|
8
|
+
repoRoot: string;
|
|
9
|
+
installedVersion: string;
|
|
10
|
+
packagedSkillsRoot: string;
|
|
11
|
+
model: NormalizedModel;
|
|
12
|
+
refs: RefsResult;
|
|
13
|
+
}
|
|
14
|
+
export interface StepDetection {
|
|
15
|
+
applicable: boolean;
|
|
16
|
+
reason: string;
|
|
17
|
+
/** True when this step's condition was found but can't be applied mechanically — surfaces as
|
|
18
|
+
* a human-list item instead (currently only `constitution`, when `.specify/` already owns the
|
|
19
|
+
* slot). `applicable` is always false alongside `human: true` — the two are never both true. */
|
|
20
|
+
human?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type StepApplyOutcome = {
|
|
23
|
+
ok: true;
|
|
24
|
+
changedFiles: string[];
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
export type UpgradeStepId = "skill-bundle" | "reaction-shape" | "state-file" | "ci-block" | "constitution";
|
|
30
|
+
export interface UpgradeStepDef {
|
|
31
|
+
id: UpgradeStepId;
|
|
32
|
+
/** The em release that introduced the feature this step brings a repo up to date with —
|
|
33
|
+
* informational only (printed alongside the step's own reason), sourced from the actual
|
|
34
|
+
* release that shipped it, never guessed. */
|
|
35
|
+
sinceVersion: string;
|
|
36
|
+
detect(ctx: UpgradeContext): StepDetection;
|
|
37
|
+
apply(ctx: UpgradeContext): StepApplyOutcome;
|
|
38
|
+
}
|
|
39
|
+
export declare const UPGRADE_STEPS: readonly UpgradeStepDef[];
|
|
40
|
+
export type HumanItemId = "no-model-version" | "continuation-has-own-doc" | "ready-to-implement-no-ratifiedby" | "coverage-scope-default" | "unratified-constitution" | "predates-1.6";
|
|
41
|
+
export interface HumanItem {
|
|
42
|
+
id: HumanItemId;
|
|
43
|
+
reason: string;
|
|
44
|
+
}
|
|
45
|
+
export declare function detectHumanItems(ctx: UpgradeContext): HumanItem[];
|
|
46
|
+
export interface FromVersion {
|
|
47
|
+
version: string;
|
|
48
|
+
inferred: boolean;
|
|
49
|
+
basis: string;
|
|
50
|
+
}
|
|
51
|
+
/** `Em version:` if recorded; else a best-effort inference from artifacts already on disk, with
|
|
52
|
+
* the basis always stated so the output never claims false precision. Never throws — a repo
|
|
53
|
+
* with no evidence at all reads as "unknown", same sentinel the bullet itself uses. */
|
|
54
|
+
export declare function resolveFromVersion(ctx: UpgradeContext, recorded: string | null): FromVersion;
|
|
55
|
+
export declare function resolveRepoRoot(anchorDir: string, runGit?: GitRunner): {
|
|
56
|
+
ok: true;
|
|
57
|
+
repoRoot: string;
|
|
58
|
+
} | {
|
|
59
|
+
ok: false;
|
|
60
|
+
message: string;
|
|
61
|
+
};
|
|
62
|
+
export declare function isWorkingTreeClean(repoRoot: string, runGit?: GitRunner): boolean;
|
|
63
|
+
/** `true` when `git commit` in `repoRoot` would actually succeed identity-wise — `git config
|
|
64
|
+
* user.name`/`user.email` (the merged local+global+system view, same one `git commit` itself
|
|
65
|
+
* consults) both resolve to something non-empty. Checked once, up front, alongside the
|
|
66
|
+
* dirty-tree refusal: failing here with a clear, single message beats discovering it deep into
|
|
67
|
+
* step 1's own `git commit` with a confusing passthrough error, and it's a real gap to check —
|
|
68
|
+
* a CI runner (unlike a developer's own machine) routinely has no git identity configured at
|
|
69
|
+
* all. */
|
|
70
|
+
export declare function hasGitIdentity(repoRoot: string, runGit?: GitRunner): boolean;
|
|
71
|
+
export interface StepReport {
|
|
72
|
+
id: UpgradeStepId;
|
|
73
|
+
sinceVersion: string;
|
|
74
|
+
applicable: boolean;
|
|
75
|
+
human: boolean;
|
|
76
|
+
reason: string;
|
|
77
|
+
}
|
|
78
|
+
export interface UpgradeReport {
|
|
79
|
+
from: FromVersion;
|
|
80
|
+
to: string;
|
|
81
|
+
steps: StepReport[];
|
|
82
|
+
human: HumanItem[];
|
|
83
|
+
stateFileError: string | null;
|
|
84
|
+
}
|
|
85
|
+
/** Dry-run: detect every step and every human item, apply nothing. Shared by `--json`, plain
|
|
86
|
+
* text output, `--check`, and the first phase of `--apply`. */
|
|
87
|
+
export declare function detectUpgrade(ctx: UpgradeContext): UpgradeReport;
|
|
88
|
+
export interface ApplyStepResult {
|
|
89
|
+
id: UpgradeStepId;
|
|
90
|
+
applied: boolean;
|
|
91
|
+
changedFiles: string[];
|
|
92
|
+
commit: string | null;
|
|
93
|
+
}
|
|
94
|
+
export type ApplyUpgradeResult = {
|
|
95
|
+
ok: true;
|
|
96
|
+
report: UpgradeReport;
|
|
97
|
+
applied: ApplyStepResult[];
|
|
98
|
+
emVersionCommit: string | null;
|
|
99
|
+
} | {
|
|
100
|
+
ok: false;
|
|
101
|
+
message: string;
|
|
102
|
+
report: UpgradeReport;
|
|
103
|
+
applied: ApplyStepResult[];
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* `--apply`: detect, then apply every applicable mechanical step in fixed order, one commit
|
|
107
|
+
* each (`em upgrade: <step-id> (<from> → <to>)`), stopping at the first failure with every
|
|
108
|
+
* prior commit intact and the failed step's own partial writes discarded. On full success,
|
|
109
|
+
* writes `Em version: <to>` as one final commit — always, even when every step above was a
|
|
110
|
+
* no-op, UNLESS the bullet already reads `<to>` (idempotent second run makes zero commits).
|
|
111
|
+
* Refuses outright on a dirty starting working tree.
|
|
112
|
+
*/
|
|
113
|
+
export declare function applyUpgrade(ctx: UpgradeContext, runGit?: GitRunner): ApplyUpgradeResult;
|
|
114
|
+
/** `--check` (what CI runs): exit-worthiness only — no writes. Hard incompatibilities are the
|
|
115
|
+
* ONLY thing that makes this fail: an unparseable/missing state file, or a `predates-1.6` human
|
|
116
|
+
* item (an old reaction shape `em migrate` itself refuses to touch). Every other human item —
|
|
117
|
+
* including the ordinary "some steps are applicable" case — is advisory, same as running
|
|
118
|
+
* `em upgrade` without `--apply` at all. */
|
|
119
|
+
export declare function checkUpgrade(ctx: UpgradeContext): {
|
|
120
|
+
ok: boolean;
|
|
121
|
+
report: UpgradeReport;
|
|
122
|
+
};
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// `em upgrade` (MIL-219): bring a model repo authored under an older em (1.6 forward) up to the
|
|
3
|
+
// installed version. Nothing here is new machinery — every mechanical step DELEGATES to an
|
|
4
|
+
// existing command's own plan/apply (`em skill sync`, `em migrate`, `em ci init`) or an existing
|
|
5
|
+
// stateFile.ts primitive; this module is the orchestration: fixed step order, detect-then-apply,
|
|
6
|
+
// one git commit per applied step, and the human list of things no command can safely decide by
|
|
7
|
+
// itself.
|
|
8
|
+
//
|
|
9
|
+
// Two disjoint lists, always both computed together (dry-run, `--apply`, and `--check` alike):
|
|
10
|
+
// - **steps** — mechanical, idempotent, each `{ id, sinceVersion, detect, apply }`. `detect`
|
|
11
|
+
// is pure-ish (reads fs, never writes); `apply` performs the actual write and is only ever
|
|
12
|
+
// called when `detect` said `applicable`. A step never partially writes on failure — the
|
|
13
|
+
// same "verify before write" discipline `em migrate` itself holds (migrateReactionShape.ts).
|
|
14
|
+
// - **human** — detect-only, by construction never applied by this command. One of these
|
|
15
|
+
// (`predates-1.6`) is also the one thing that makes `--check` exit 1 — see `checkUpgrade`.
|
|
16
|
+
//
|
|
17
|
+
// `UpgradeContext` batches everything a step/human-detector needs: the already-compiled model
|
|
18
|
+
// (steps never re-compile — the ONE exception, `reaction-shape`, re-reads `modelFile`'s raw text
|
|
19
|
+
// itself before applying, precisely because a prior step in the same run could have touched it,
|
|
20
|
+
// though in practice no other step ever does) plus the resolved repo root every skill-bundle/
|
|
21
|
+
// ci-block/constitution check needs. Requires the model directory to be inside a git
|
|
22
|
+
// repository — same requirement `em conform-scope` holds, for the same reason (there is no
|
|
23
|
+
// "changed since when" or "commit per step" without one).
|
|
24
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
import { realGit } from "./diff-inputs.js";
|
|
27
|
+
import { resolveSliceDocJoin } from "../catalog/docJoin.js";
|
|
28
|
+
import { validateOrphanedSliceDocs } from "../catalog/orphanedSliceDocValidate.js";
|
|
29
|
+
import { planMigration, verifyMigration } from "./migrateReactionShape.js";
|
|
30
|
+
import { planSkillSyncBundle, applySkillSyncBundle } from "./skillSync.js";
|
|
31
|
+
import { EM_ALL_SKILL_BUNDLE_DIRS, EM_SKILL_ANCHOR_DIR } from "./skillDirs.js";
|
|
32
|
+
import { ciWorkflowPath, conformWorkflowPath, buildCiWorkflowFile, buildConformWorkflowFile, ciManagedBody, conformManagedBody, planCiFile, applyCiFile, CI_WORKFLOW_MARKER, CONFORM_WORKFLOW_MARKER, } from "./ciInit.js";
|
|
33
|
+
import { findSpecifyRoot } from "./status.js";
|
|
34
|
+
import { scaffoldConstitution } from "../templates.js";
|
|
35
|
+
import { loadStateFile, parseState, setEmVersion, ensureOptionalBullets } from "./stateFile.js";
|
|
36
|
+
import { fieldLineRegex, normalizeFieldValue, locateFrontmatterInner } from "./frontmatterSurgery.js";
|
|
37
|
+
import { localIsoDate } from "../util/localDate.js";
|
|
38
|
+
export const UPGRADE_MIN_SUPPORTED_VERSION = "1.6.0";
|
|
39
|
+
// ---- Step 1: skill-bundle — delegates to `em skill sync`'s own plan/apply. ----
|
|
40
|
+
function vendoredSkillsRootOf(repoRoot) {
|
|
41
|
+
return join(repoRoot, ".claude", "skills");
|
|
42
|
+
}
|
|
43
|
+
function detectSkillBundle(ctx) {
|
|
44
|
+
const vendoredRoot = vendoredSkillsRootOf(ctx.repoRoot);
|
|
45
|
+
if (!existsSync(join(vendoredRoot, EM_SKILL_ANCHOR_DIR))) {
|
|
46
|
+
return { applicable: false, reason: "no vendored skill bundle installed at .claude/skills/ — run `em skill install` first if you want one" };
|
|
47
|
+
}
|
|
48
|
+
const bundlePlan = planSkillSyncBundle(ctx.packagedSkillsRoot, vendoredRoot, EM_ALL_SKILL_BUNDLE_DIRS);
|
|
49
|
+
const totalChanges = bundlePlan.reduce((n, { plan }) => n + plan.changes.length, 0);
|
|
50
|
+
if (totalChanges === 0)
|
|
51
|
+
return { applicable: false, reason: "vendored skill bundle already matches the installed em" };
|
|
52
|
+
return { applicable: true, reason: `vendored skill bundle differs from the installed em in ${totalChanges} file(s)` };
|
|
53
|
+
}
|
|
54
|
+
function applySkillBundle(ctx) {
|
|
55
|
+
const vendoredRoot = vendoredSkillsRootOf(ctx.repoRoot);
|
|
56
|
+
const bundlePlan = planSkillSyncBundle(ctx.packagedSkillsRoot, vendoredRoot, EM_ALL_SKILL_BUNDLE_DIRS);
|
|
57
|
+
const totalChanges = bundlePlan.reduce((n, { plan }) => n + plan.changes.length, 0);
|
|
58
|
+
if (totalChanges === 0)
|
|
59
|
+
return { ok: false, message: "nothing to sync" };
|
|
60
|
+
applySkillSyncBundle(bundlePlan, ctx.packagedSkillsRoot, vendoredRoot);
|
|
61
|
+
const changedFiles = bundlePlan.flatMap(({ dirName, plan }) => plan.changes.map((c) => join(".claude", "skills", dirName, c.relPath)));
|
|
62
|
+
return { ok: true, changedFiles };
|
|
63
|
+
}
|
|
64
|
+
// ---- Step 2: reaction-shape — delegates to `em migrate`'s own plan/verify/apply. ----
|
|
65
|
+
function readMigrationPlan(ctx) {
|
|
66
|
+
const source = readFileSync(ctx.modelFile, "utf8");
|
|
67
|
+
try {
|
|
68
|
+
return planMigration(source);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null; // parse error — surfaced by the normal compile path before upgrade ever runs
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function detectReactionShape(ctx) {
|
|
75
|
+
const plan = readMigrationPlan(ctx);
|
|
76
|
+
if (!plan)
|
|
77
|
+
return { applicable: false, reason: "model file has a parse error — fix it before running em upgrade" };
|
|
78
|
+
if (plan.changes.length === 0)
|
|
79
|
+
return { applicable: false, reason: "no old two-slice Automation/Translation shape found" };
|
|
80
|
+
return { applicable: true, reason: `${plan.changes.length} old two-slice reaction site(s) found` };
|
|
81
|
+
}
|
|
82
|
+
function applyReactionShape(ctx) {
|
|
83
|
+
const source = readFileSync(ctx.modelFile, "utf8");
|
|
84
|
+
const plan = readMigrationPlan(ctx);
|
|
85
|
+
if (!plan || plan.changes.length === 0)
|
|
86
|
+
return { ok: false, message: "nothing to migrate" };
|
|
87
|
+
const verify = verifyMigration(source, plan.rewritten);
|
|
88
|
+
if (!verify.ok) {
|
|
89
|
+
return { ok: false, message: `the rewrite would introduce ${verify.newErrors.length} new error(s) — aborting, ${ctx.modelFile} left untouched` };
|
|
90
|
+
}
|
|
91
|
+
writeFileSync(ctx.modelFile, plan.rewritten);
|
|
92
|
+
return { ok: true, changedFiles: [ctx.modelFile] };
|
|
93
|
+
}
|
|
94
|
+
// ---- Step 3: state-file — ensure Model version:/Certified: are present (MIL-218 defaults). ----
|
|
95
|
+
// `Em version:` itself is deliberately NOT this step's job — `runUpgradeApply` always writes it
|
|
96
|
+
// as its own dedicated final commit, whether or not this step ran (module header).
|
|
97
|
+
function detectStateFile(ctx) {
|
|
98
|
+
const loaded = loadStateFile(ctx.baseDir);
|
|
99
|
+
if (!loaded.ok)
|
|
100
|
+
return { applicable: false, reason: loaded.message };
|
|
101
|
+
const patched = ensureOptionalBullets(loaded.text, "1970-01-01");
|
|
102
|
+
if (!patched.ok)
|
|
103
|
+
return { applicable: false, reason: patched.message };
|
|
104
|
+
if (patched.text === loaded.text)
|
|
105
|
+
return { applicable: false, reason: "Model version:/Certified: bullets already present" };
|
|
106
|
+
return { applicable: true, reason: "state file is missing Model version:/Certified: bullet(s)" };
|
|
107
|
+
}
|
|
108
|
+
function applyStateFile(ctx) {
|
|
109
|
+
const loaded = loadStateFile(ctx.baseDir);
|
|
110
|
+
if (!loaded.ok)
|
|
111
|
+
return { ok: false, message: loaded.message };
|
|
112
|
+
const today = localIsoDate();
|
|
113
|
+
const patched = ensureOptionalBullets(loaded.text, today);
|
|
114
|
+
if (!patched.ok)
|
|
115
|
+
return { ok: false, message: patched.message };
|
|
116
|
+
if (patched.text === loaded.text)
|
|
117
|
+
return { ok: false, message: "nothing to change" };
|
|
118
|
+
writeFileSync(loaded.path, patched.text);
|
|
119
|
+
return { ok: true, changedFiles: [loaded.path] };
|
|
120
|
+
}
|
|
121
|
+
// ---- Step 4: ci-block — refreshes both generated workflow files via `em ci init`'s own
|
|
122
|
+
// plan/apply, reusing whatever <model>/--tests arguments the existing em-ci.yml was already
|
|
123
|
+
// generated with (extracted from its own coverage step — never guessed, never re-prompted).
|
|
124
|
+
// Only touches a file that already carries the GENERATED markers; never creates one from
|
|
125
|
+
// scratch (module header / ticket: "never creates a workflow the repo didn't ask for"). ----
|
|
126
|
+
// Not anchored on a literal "em coverage" — the generated line pins an exact version
|
|
127
|
+
// (`npx @milehimikey/em@1.9.0 coverage "..."`, ciInit.ts's own `em` template variable), so
|
|
128
|
+
// "em" and "coverage" are never adjacent in the real file.
|
|
129
|
+
const CI_INIT_ARGS_RE = /\bcoverage "([^"]*)" --tests "([^"]*)" --strict\b/;
|
|
130
|
+
function extractCiInitArgs(emCiContent) {
|
|
131
|
+
const m = CI_INIT_ARGS_RE.exec(emCiContent);
|
|
132
|
+
return m ? { model: m[1], testsDir: m[2] } : null;
|
|
133
|
+
}
|
|
134
|
+
function ciBlockPlans(ctx) {
|
|
135
|
+
const ciPath = ciWorkflowPath(ctx.repoRoot);
|
|
136
|
+
const conformPath = conformWorkflowPath(ctx.repoRoot);
|
|
137
|
+
if (!existsSync(ciPath))
|
|
138
|
+
return { ciPath, ciStale: false, conformPath, conformStale: false, args: null };
|
|
139
|
+
const args = extractCiInitArgs(readFileSync(ciPath, "utf8"));
|
|
140
|
+
if (!args)
|
|
141
|
+
return { ciPath, ciStale: false, conformPath, conformStale: false, args: null };
|
|
142
|
+
const ciStatus = planCiFile(ciPath, buildCiWorkflowFile(args.model, args.testsDir, ctx.installedVersion), ciManagedBody(args.model, args.testsDir, ctx.installedVersion), CI_WORKFLOW_MARKER, false);
|
|
143
|
+
const ciStale = ciStatus.kind === "stale";
|
|
144
|
+
let conformStale = false;
|
|
145
|
+
if (existsSync(conformPath)) {
|
|
146
|
+
const conformStatus = planCiFile(conformPath, buildConformWorkflowFile(args.model, ctx.installedVersion), conformManagedBody(args.model, ctx.installedVersion), CONFORM_WORKFLOW_MARKER, false);
|
|
147
|
+
conformStale = conformStatus.kind === "stale";
|
|
148
|
+
}
|
|
149
|
+
return { ciPath, ciStale, conformPath, conformStale, args };
|
|
150
|
+
}
|
|
151
|
+
function detectCiBlock(ctx) {
|
|
152
|
+
const { ciPath, ciStale, conformStale, args } = ciBlockPlans(ctx);
|
|
153
|
+
if (!existsSync(ciPath))
|
|
154
|
+
return { applicable: false, reason: "no .github/workflows/em-ci.yml — em upgrade never creates one" };
|
|
155
|
+
if (!args)
|
|
156
|
+
return { applicable: false, reason: "can't determine the <model>/--tests arguments em-ci.yml was generated with — run `em ci init <model>` by hand if it needs refreshing" };
|
|
157
|
+
if (!ciStale && !conformStale)
|
|
158
|
+
return { applicable: false, reason: "generated CI block(s) already match the installed em" };
|
|
159
|
+
return { applicable: true, reason: "generated CI block(s) are stale" };
|
|
160
|
+
}
|
|
161
|
+
function applyCiBlock(ctx) {
|
|
162
|
+
const { ciPath, ciStale, conformPath, conformStale, args } = ciBlockPlans(ctx);
|
|
163
|
+
if (!args || (!ciStale && !conformStale))
|
|
164
|
+
return { ok: false, message: "nothing to refresh" };
|
|
165
|
+
const changedFiles = [];
|
|
166
|
+
if (ciStale) {
|
|
167
|
+
const status = planCiFile(ciPath, buildCiWorkflowFile(args.model, args.testsDir, ctx.installedVersion), ciManagedBody(args.model, args.testsDir, ctx.installedVersion), CI_WORKFLOW_MARKER, false);
|
|
168
|
+
applyCiFile(ciPath, status);
|
|
169
|
+
changedFiles.push(ciPath);
|
|
170
|
+
}
|
|
171
|
+
if (conformStale) {
|
|
172
|
+
const status = planCiFile(conformPath, buildConformWorkflowFile(args.model, ctx.installedVersion), conformManagedBody(args.model, ctx.installedVersion), CONFORM_WORKFLOW_MARKER, false);
|
|
173
|
+
applyCiFile(conformPath, status);
|
|
174
|
+
changedFiles.push(conformPath);
|
|
175
|
+
}
|
|
176
|
+
return { ok: true, changedFiles };
|
|
177
|
+
}
|
|
178
|
+
// ---- Step 5: constitution — scaffold a draft when absent and no .specify/ owns the slot. ----
|
|
179
|
+
function detectConstitution(ctx) {
|
|
180
|
+
const path = join(ctx.baseDir, "constitution.md");
|
|
181
|
+
if (existsSync(path))
|
|
182
|
+
return { applicable: false, reason: "constitution.md already exists" };
|
|
183
|
+
const specifyRoot = findSpecifyRoot(ctx.baseDir);
|
|
184
|
+
if (specifyRoot) {
|
|
185
|
+
return {
|
|
186
|
+
applicable: false,
|
|
187
|
+
human: true,
|
|
188
|
+
reason: `no constitution.md, but ${join(specifyRoot, ".specify")} exists — spec-kit owns the constitution slot (.specify/memory/constitution.md); decide by hand whether it needs writing`,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
return { applicable: true, reason: "no constitution.md and no .specify/ — em upgrade will scaffold a draft" };
|
|
192
|
+
}
|
|
193
|
+
function applyConstitution(ctx) {
|
|
194
|
+
const path = join(ctx.baseDir, "constitution.md");
|
|
195
|
+
if (existsSync(path))
|
|
196
|
+
return { ok: false, message: "constitution.md already exists" };
|
|
197
|
+
if (findSpecifyRoot(ctx.baseDir))
|
|
198
|
+
return { ok: false, message: ".specify/ exists — not scaffolding a second constitution" };
|
|
199
|
+
writeFileSync(path, scaffoldConstitution(ctx.model.name));
|
|
200
|
+
return { ok: true, changedFiles: [path] };
|
|
201
|
+
}
|
|
202
|
+
export const UPGRADE_STEPS = [
|
|
203
|
+
{ id: "skill-bundle", sinceVersion: "1.7.0", detect: detectSkillBundle, apply: applySkillBundle },
|
|
204
|
+
{ id: "reaction-shape", sinceVersion: "1.8.0", detect: detectReactionShape, apply: applyReactionShape },
|
|
205
|
+
{ id: "state-file", sinceVersion: "1.13.0", detect: detectStateFile, apply: applyStateFile },
|
|
206
|
+
{ id: "ci-block", sinceVersion: "1.9.0", detect: detectCiBlock, apply: applyCiBlock },
|
|
207
|
+
{ id: "constitution", sinceVersion: "1.11.0", detect: detectConstitution, apply: applyConstitution },
|
|
208
|
+
];
|
|
209
|
+
function elementRefOf(ctx) {
|
|
210
|
+
return (id) => ctx.refs.refById.get(id);
|
|
211
|
+
}
|
|
212
|
+
/** Every non-continuation slice's doc join — computed once, shared by every human detector below
|
|
213
|
+
* that needs a doc's `status`/`ratifiedBy` (mirrors `modelVersion.ts`'s `computeSlicesVector`
|
|
214
|
+
* exclusion of continuation slices, MIL-208: a continuation's own join already resolves to its
|
|
215
|
+
* originating slice's doc, so counting it again here would double-count). */
|
|
216
|
+
function nonContinuationDocs(ctx) {
|
|
217
|
+
const results = [];
|
|
218
|
+
ctx.model.slices.forEach((slice, i) => {
|
|
219
|
+
const key = ctx.refs.sliceKeys[i];
|
|
220
|
+
const { doc, continuationOf } = resolveSliceDocJoin(ctx.model, ctx.refs, slice, key, ctx.baseDir, elementRefOf(ctx));
|
|
221
|
+
if (continuationOf !== null)
|
|
222
|
+
return;
|
|
223
|
+
results.push({ key, status: doc.status, ratifiedBy: doc.ratifiedBy });
|
|
224
|
+
});
|
|
225
|
+
return results;
|
|
226
|
+
}
|
|
227
|
+
function detectNoModelVersion(ctx) {
|
|
228
|
+
const loaded = loadStateFile(ctx.baseDir);
|
|
229
|
+
if (!loaded.ok)
|
|
230
|
+
return null;
|
|
231
|
+
const parsed = parseState(loaded.text);
|
|
232
|
+
if (!parsed.ok || parsed.state.modelVersion !== null)
|
|
233
|
+
return null;
|
|
234
|
+
const hasImplemented = nonContinuationDocs(ctx).some((d) => d.status === "implemented");
|
|
235
|
+
if (!hasImplemented)
|
|
236
|
+
return null;
|
|
237
|
+
return {
|
|
238
|
+
id: "no-model-version",
|
|
239
|
+
reason: "Model version: none, but at least one slice is implemented — run `em model version bump --by <name>` to start tracking design versions",
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function detectContinuationHasOwnDoc(ctx) {
|
|
243
|
+
const diags = validateOrphanedSliceDocs(ctx.model, ctx.refs, ctx.baseDir);
|
|
244
|
+
const count = diags.filter((d) => d.code === "continuation-has-own-doc").length;
|
|
245
|
+
if (count === 0)
|
|
246
|
+
return null;
|
|
247
|
+
return {
|
|
248
|
+
id: "continuation-has-own-doc",
|
|
249
|
+
reason: `${count} continuation slice(s) still carry their own doc file instead of sharing their originating slice's — see \`em validate\`'s continuation-has-own-doc warning(s)`,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function detectReadyNoRatifiedBy(ctx) {
|
|
253
|
+
const keys = nonContinuationDocs(ctx)
|
|
254
|
+
.filter((d) => d.status === "ready-to-implement" && !d.ratifiedBy)
|
|
255
|
+
.map((d) => d.key)
|
|
256
|
+
.sort();
|
|
257
|
+
if (keys.length === 0)
|
|
258
|
+
return null;
|
|
259
|
+
return {
|
|
260
|
+
id: "ready-to-implement-no-ratifiedby",
|
|
261
|
+
reason: `${keys.length} ready-to-implement doc(s) with no ratifiedBy: ${keys.join(", ")} — run \`em slice ratify --by <name>\` on each`,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function detectCoverageScopeDefault(ctx) {
|
|
265
|
+
const ciPath = ciWorkflowPath(ctx.repoRoot);
|
|
266
|
+
if (!existsSync(ciPath))
|
|
267
|
+
return null;
|
|
268
|
+
const content = readFileSync(ciPath, "utf8");
|
|
269
|
+
if (!/\bcoverage\b[^\n]*--strict\b/.test(content))
|
|
270
|
+
return null;
|
|
271
|
+
const anyImplemented = nonContinuationDocs(ctx).some((d) => d.status === "implemented");
|
|
272
|
+
if (anyImplemented)
|
|
273
|
+
return null;
|
|
274
|
+
return {
|
|
275
|
+
id: "coverage-scope-default",
|
|
276
|
+
reason: "em-ci.yml runs `em coverage --strict`, but no slice doc is status: implemented yet (MIL-207 scopes --strict to implemented docs only) — the gate is trivially green until the first slice is marked implemented",
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function detectUnratifiedConstitution(ctx) {
|
|
280
|
+
const specifyRoot = findSpecifyRoot(ctx.baseDir);
|
|
281
|
+
const path = specifyRoot ? join(specifyRoot, ".specify", "memory", "constitution.md") : join(ctx.baseDir, "constitution.md");
|
|
282
|
+
if (!existsSync(path))
|
|
283
|
+
return null;
|
|
284
|
+
const content = readFileSync(path, "utf8");
|
|
285
|
+
const inner = locateFrontmatterInner(content);
|
|
286
|
+
if (!inner)
|
|
287
|
+
return null;
|
|
288
|
+
const innerText = content.slice(inner.innerStart, inner.innerEnd);
|
|
289
|
+
const m = fieldLineRegex("ratifiedBy").exec(innerText);
|
|
290
|
+
const value = m ? normalizeFieldValue(m[2]) : null;
|
|
291
|
+
if (value !== null)
|
|
292
|
+
return null;
|
|
293
|
+
return { id: "unratified-constitution", reason: `${path} has no ratifiedBy: — it's still a draft` };
|
|
294
|
+
}
|
|
295
|
+
function detectPredates16(ctx) {
|
|
296
|
+
const plan = readMigrationPlan(ctx);
|
|
297
|
+
if (!plan || plan.refusals.length === 0)
|
|
298
|
+
return null;
|
|
299
|
+
return {
|
|
300
|
+
id: "predates-1.6",
|
|
301
|
+
reason: `${plan.refusals.length} old-shape reaction site(s) can't be auto-migrated — run \`em migrate\` by hand, resolve the refusal(s), then re-run \`em upgrade\``,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
const HUMAN_DETECTORS = [
|
|
305
|
+
detectNoModelVersion,
|
|
306
|
+
detectContinuationHasOwnDoc,
|
|
307
|
+
detectReadyNoRatifiedBy,
|
|
308
|
+
detectCoverageScopeDefault,
|
|
309
|
+
detectUnratifiedConstitution,
|
|
310
|
+
detectPredates16,
|
|
311
|
+
];
|
|
312
|
+
export function detectHumanItems(ctx) {
|
|
313
|
+
return HUMAN_DETECTORS.map((d) => d(ctx)).filter((x) => x !== null);
|
|
314
|
+
}
|
|
315
|
+
const EM_VERSION_STAMP_RE = /^em-version:\s*(.+)$/m;
|
|
316
|
+
/** `Em version:` if recorded; else a best-effort inference from artifacts already on disk, with
|
|
317
|
+
* the basis always stated so the output never claims false precision. Never throws — a repo
|
|
318
|
+
* with no evidence at all reads as "unknown", same sentinel the bullet itself uses. */
|
|
319
|
+
export function resolveFromVersion(ctx, recorded) {
|
|
320
|
+
if (recorded !== null)
|
|
321
|
+
return { version: recorded, inferred: false, basis: "recorded `Em version:` bullet" };
|
|
322
|
+
const reactionPlan = readMigrationPlan(ctx);
|
|
323
|
+
if (reactionPlan && (reactionPlan.changes.length > 0 || reactionPlan.refusals.length > 0)) {
|
|
324
|
+
return { version: UPGRADE_MIN_SUPPORTED_VERSION, inferred: true, basis: "old two-slice Automation/Translation reaction shape (pre-1.7.1) found in the model" };
|
|
325
|
+
}
|
|
326
|
+
const skillMdPath = join(vendoredSkillsRootOf(ctx.repoRoot), EM_SKILL_ANCHOR_DIR, "SKILL.md");
|
|
327
|
+
if (existsSync(skillMdPath)) {
|
|
328
|
+
const m = EM_VERSION_STAMP_RE.exec(readFileSync(skillMdPath, "utf8"));
|
|
329
|
+
if (m)
|
|
330
|
+
return { version: m[1].trim(), inferred: true, basis: "vendored skill bundle's em-version: stamp" };
|
|
331
|
+
}
|
|
332
|
+
const loaded = loadStateFile(ctx.baseDir);
|
|
333
|
+
if (loaded.ok) {
|
|
334
|
+
const hasMil218Bullets = /^-\s+\*\*Model version:\*\*/m.test(loaded.text) || /^-\s+\*\*Certified:\*\*/m.test(loaded.text);
|
|
335
|
+
if (hasMil218Bullets)
|
|
336
|
+
return { version: "1.13.0", inferred: true, basis: "state file already carries Model version:/Certified: bullets (MIL-218)" };
|
|
337
|
+
}
|
|
338
|
+
return { version: "unknown", inferred: true, basis: "no version evidence found (no Em version: bullet, no skill stamp, no MIL-218 bullets, no old reaction shape)" };
|
|
339
|
+
}
|
|
340
|
+
// ---- git plumbing for `--apply` ----
|
|
341
|
+
export function resolveRepoRoot(anchorDir, runGit = realGit) {
|
|
342
|
+
const r = runGit(["-C", anchorDir, "rev-parse", "--show-toplevel"]);
|
|
343
|
+
if (r.status !== 0)
|
|
344
|
+
return { ok: false, message: `em upgrade: ${anchorDir} is not inside a git repository — em upgrade --apply needs one commit per step` };
|
|
345
|
+
return { ok: true, repoRoot: r.stdout.trim() };
|
|
346
|
+
}
|
|
347
|
+
export function isWorkingTreeClean(repoRoot, runGit = realGit) {
|
|
348
|
+
const r = runGit(["-C", repoRoot, "status", "--porcelain"]);
|
|
349
|
+
return r.status === 0 && r.stdout.trim().length === 0;
|
|
350
|
+
}
|
|
351
|
+
/** `true` when `git commit` in `repoRoot` would actually succeed identity-wise — `git config
|
|
352
|
+
* user.name`/`user.email` (the merged local+global+system view, same one `git commit` itself
|
|
353
|
+
* consults) both resolve to something non-empty. Checked once, up front, alongside the
|
|
354
|
+
* dirty-tree refusal: failing here with a clear, single message beats discovering it deep into
|
|
355
|
+
* step 1's own `git commit` with a confusing passthrough error, and it's a real gap to check —
|
|
356
|
+
* a CI runner (unlike a developer's own machine) routinely has no git identity configured at
|
|
357
|
+
* all. */
|
|
358
|
+
export function hasGitIdentity(repoRoot, runGit = realGit) {
|
|
359
|
+
const name = runGit(["-C", repoRoot, "config", "user.name"]);
|
|
360
|
+
const email = runGit(["-C", repoRoot, "config", "user.email"]);
|
|
361
|
+
return name.status === 0 && name.stdout.trim().length > 0 && email.status === 0 && email.stdout.trim().length > 0;
|
|
362
|
+
}
|
|
363
|
+
function gitCommitAll(repoRoot, message, runGit) {
|
|
364
|
+
const add = runGit(["-C", repoRoot, "add", "-A"]);
|
|
365
|
+
if (add.status !== 0)
|
|
366
|
+
return { ok: false, message: `git add failed: ${(add.stderr || "").trim() || "unknown error"}` };
|
|
367
|
+
const commit = runGit(["-C", repoRoot, "commit", "-m", message]);
|
|
368
|
+
if (commit.status !== 0)
|
|
369
|
+
return { ok: false, message: `git commit failed: ${(commit.stderr || "").trim() || "unknown error"}` };
|
|
370
|
+
return { ok: true };
|
|
371
|
+
}
|
|
372
|
+
/** Discards every uncommitted change in `repoRoot` — tracked and untracked alike. Only ever
|
|
373
|
+
* called right after a step's `apply` reports failure, to restore the "clean before the next
|
|
374
|
+
* step" invariant `isWorkingTreeClean`'s pre-flight check depends on; safe precisely because
|
|
375
|
+
* that pre-flight check already proved the tree was clean before this run started, so anything
|
|
376
|
+
* dirty now was written by the step that just failed. */
|
|
377
|
+
function gitDiscardAll(repoRoot, runGit) {
|
|
378
|
+
runGit(["-C", repoRoot, "checkout", "--", "."]);
|
|
379
|
+
runGit(["-C", repoRoot, "clean", "-fd", "."]);
|
|
380
|
+
}
|
|
381
|
+
/** Dry-run: detect every step and every human item, apply nothing. Shared by `--json`, plain
|
|
382
|
+
* text output, `--check`, and the first phase of `--apply`. */
|
|
383
|
+
export function detectUpgrade(ctx) {
|
|
384
|
+
const loaded = loadStateFile(ctx.baseDir);
|
|
385
|
+
let recorded = null;
|
|
386
|
+
let stateFileError = null;
|
|
387
|
+
if (!loaded.ok) {
|
|
388
|
+
stateFileError = loaded.message;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
const parsed = parseState(loaded.text);
|
|
392
|
+
if (!parsed.ok)
|
|
393
|
+
stateFileError = parsed.message;
|
|
394
|
+
else
|
|
395
|
+
recorded = parsed.state.emVersion;
|
|
396
|
+
}
|
|
397
|
+
const from = resolveFromVersion(ctx, recorded);
|
|
398
|
+
const steps = UPGRADE_STEPS.map((s) => {
|
|
399
|
+
const d = s.detect(ctx);
|
|
400
|
+
return { id: s.id, sinceVersion: s.sinceVersion, applicable: d.applicable, human: d.human === true, reason: d.reason };
|
|
401
|
+
});
|
|
402
|
+
const human = detectHumanItems(ctx);
|
|
403
|
+
return { from, to: ctx.installedVersion, steps, human, stateFileError };
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* `--apply`: detect, then apply every applicable mechanical step in fixed order, one commit
|
|
407
|
+
* each (`em upgrade: <step-id> (<from> → <to>)`), stopping at the first failure with every
|
|
408
|
+
* prior commit intact and the failed step's own partial writes discarded. On full success,
|
|
409
|
+
* writes `Em version: <to>` as one final commit — always, even when every step above was a
|
|
410
|
+
* no-op, UNLESS the bullet already reads `<to>` (idempotent second run makes zero commits).
|
|
411
|
+
* Refuses outright on a dirty starting working tree.
|
|
412
|
+
*/
|
|
413
|
+
export function applyUpgrade(ctx, runGit = realGit) {
|
|
414
|
+
const report = detectUpgrade(ctx);
|
|
415
|
+
if (report.stateFileError) {
|
|
416
|
+
return { ok: false, message: `em upgrade: unparseable state file — ${report.stateFileError}`, report, applied: [] };
|
|
417
|
+
}
|
|
418
|
+
if (!isWorkingTreeClean(ctx.repoRoot, runGit)) {
|
|
419
|
+
return { ok: false, message: "em upgrade --apply: working tree is not clean — commit or stash first", report, applied: [] };
|
|
420
|
+
}
|
|
421
|
+
if (!hasGitIdentity(ctx.repoRoot, runGit)) {
|
|
422
|
+
return {
|
|
423
|
+
ok: false,
|
|
424
|
+
message: "em upgrade --apply: no git identity configured — run `git config user.name <name>` and " +
|
|
425
|
+
"`git config user.email <email>` first (add --global to set it once for every repo)",
|
|
426
|
+
report,
|
|
427
|
+
applied: [],
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
const applied = [];
|
|
431
|
+
for (const step of UPGRADE_STEPS) {
|
|
432
|
+
const detection = step.detect(ctx);
|
|
433
|
+
if (!detection.applicable) {
|
|
434
|
+
applied.push({ id: step.id, applied: false, changedFiles: [], commit: null });
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
const result = step.apply(ctx);
|
|
438
|
+
if (!result.ok) {
|
|
439
|
+
gitDiscardAll(ctx.repoRoot, runGit);
|
|
440
|
+
return { ok: false, message: `em upgrade: step "${step.id}" failed — ${result.message}`, report, applied };
|
|
441
|
+
}
|
|
442
|
+
const message = `em upgrade: ${step.id} (${report.from.version} → ${report.to})`;
|
|
443
|
+
const commitResult = gitCommitAll(ctx.repoRoot, message, runGit);
|
|
444
|
+
if (!commitResult.ok) {
|
|
445
|
+
return { ok: false, message: `em upgrade: step "${step.id}" applied but failed to commit — ${commitResult.message}`, report, applied };
|
|
446
|
+
}
|
|
447
|
+
applied.push({ id: step.id, applied: true, changedFiles: result.changedFiles, commit: message });
|
|
448
|
+
}
|
|
449
|
+
const loaded = loadStateFile(ctx.baseDir);
|
|
450
|
+
let emVersionCommit = null;
|
|
451
|
+
if (loaded.ok) {
|
|
452
|
+
const today = localIsoDate();
|
|
453
|
+
const stamped = setEmVersion(loaded.text, ctx.installedVersion, today);
|
|
454
|
+
if (stamped.ok && stamped.text !== loaded.text) {
|
|
455
|
+
writeFileSync(loaded.path, stamped.text);
|
|
456
|
+
const message = `em upgrade: em-version (${report.from.version} → ${report.to})`;
|
|
457
|
+
const commitResult = gitCommitAll(ctx.repoRoot, message, runGit);
|
|
458
|
+
if (!commitResult.ok) {
|
|
459
|
+
return { ok: false, message: `em upgrade: writing Em version: failed to commit — ${commitResult.message}`, report, applied };
|
|
460
|
+
}
|
|
461
|
+
emVersionCommit = message;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return { ok: true, report, applied, emVersionCommit };
|
|
465
|
+
}
|
|
466
|
+
/** `--check` (what CI runs): exit-worthiness only — no writes. Hard incompatibilities are the
|
|
467
|
+
* ONLY thing that makes this fail: an unparseable/missing state file, or a `predates-1.6` human
|
|
468
|
+
* item (an old reaction shape `em migrate` itself refuses to touch). Every other human item —
|
|
469
|
+
* including the ordinary "some steps are applicable" case — is advisory, same as running
|
|
470
|
+
* `em upgrade` without `--apply` at all. */
|
|
471
|
+
export function checkUpgrade(ctx) {
|
|
472
|
+
const report = detectUpgrade(ctx);
|
|
473
|
+
const hardIncompatibility = report.stateFileError !== null || report.human.some((h) => h.id === "predates-1.6");
|
|
474
|
+
return { ok: !hardIncompatibility, report };
|
|
475
|
+
}
|
|
476
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/cli/upgrade.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,gGAAgG;AAChG,2FAA2F;AAC3F,iGAAiG;AACjG,iGAAiG;AACjG,gGAAgG;AAChG,UAAU;AACV,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,8FAA8F;AAC9F,4FAA4F;AAC5F,gGAAgG;AAChG,0FAA0F;AAC1F,8FAA8F;AAC9F,EAAE;AACF,8FAA8F;AAC9F,iGAAiG;AACjG,gGAAgG;AAChG,8FAA8F;AAC9F,qFAAqF;AACrF,2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