@mmnto/cli 1.53.4 → 1.53.6
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/dist/commands/doctor-parity.d.ts +59 -36
- package/dist/commands/doctor-parity.d.ts.map +1 -1
- package/dist/commands/doctor-parity.js +377 -57
- package/dist/commands/doctor-parity.js.map +1 -1
- package/dist/commands/doctor-parity.test.js +320 -6
- package/dist/commands/doctor-parity.test.js.map +1 -1
- package/dist/commands/init-templates.d.ts +8 -0
- package/dist/commands/init-templates.d.ts.map +1 -1
- package/dist/commands/init-templates.js +8 -0
- package/dist/commands/init-templates.js.map +1 -1
- package/dist/commands/install-hooks.d.ts +14 -3
- package/dist/commands/install-hooks.d.ts.map +1 -1
- package/dist/commands/install-hooks.js +22 -11
- package/dist/commands/install-hooks.js.map +1 -1
- package/dist/commands/install-hooks.test.js +27 -0
- package/dist/commands/install-hooks.test.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,51 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parity-drift sensor for `totem doctor --parity` (mmnto-ai/totem-strategy#448).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
4
|
+
* Detection is wired across all three tractability classes (mmnto-ai/totem#2073):
|
|
5
|
+
* - **version-pinned** (PR-1, mmnto-ai/totem#2069): each deps contract whose id
|
|
6
|
+
* resolves an `@mmnto/*` package name runs through the core
|
|
7
|
+
* `detectVersionPinnedContract` engine (pin-currency verdict, local-only floor).
|
|
8
|
+
* - **mechanical content-equality** (mmnto-ai/totem#2073): three artifact shapes,
|
|
9
|
+
* all local-read-only against the running `@mmnto/cli`'s OWN in-process template:
|
|
10
|
+
* · **skills** (`claude-skills`): managed-block equality of
|
|
11
|
+
* `.claude/skills/<name>/SKILL.md` via `detectMechanicalContract`.
|
|
12
|
+
* · **git-hooks**: per-repo REGENERATED whole-file/region equality of the four
|
|
13
|
+
* `.git/hooks/*` (package-manager + tier parameterized) via
|
|
14
|
+
* `detectGeneratedArtifactContract` — catches stale-version drift (#1854).
|
|
15
|
+
* · **session-start-orientation**: STATIC whole-file equality of the
|
|
16
|
+
* `.claude/hooks/SessionStart.cjs` + `.gemini/hooks/SessionStart.js` templates,
|
|
17
|
+
* also via `detectGeneratedArtifactContract` (no parameterization).
|
|
18
|
+
* - **manual-attestation** (mmnto-ai/totem#2080): the no-mechanical-sensor class —
|
|
19
|
+
* `detectManualAttestationContract` surfaces the doctrine-currency row / vendor-SDK
|
|
20
|
+
* pin as `info` (or honest-absent `skip`), NEVER pass/warn/fail (the "never fails"
|
|
21
|
+
* contract; structurally cannot gate under `--strict`).
|
|
15
22
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `--strict`. The detector carries that promotion eligibility back via
|
|
20
|
-
* `blockingDriftIds` so the command can gate without re-loading the manifest.
|
|
23
|
+
* The remaining contracts — the file-value-equality bot-configs (`cr-profile` etc.)
|
|
24
|
+
* and the structural-presence dimensions — keep the `skip` "not yet implemented" stub;
|
|
25
|
+
* their detection is a follow-on.
|
|
21
26
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* The parity sensor owns its OWN render + result type (`ParityLine`) carrying a
|
|
28
|
+
* WIDER status vocabulary (pass/warn/fail/info/unknown/skip) than the shared
|
|
29
|
+
* `CheckStatus`, so the verdict-state split (#2073 req #1) never ripples
|
|
30
|
+
* `CheckStatus` across the unrelated doctor checks.
|
|
31
|
+
*
|
|
32
|
+
* Sensor-not-gate: the detectors return `skip`/`warn`/`pass`/`info`/`unknown` —
|
|
33
|
+
* never `fail`. The `--strict` exit-code decision lives at the CLI edge: a
|
|
34
|
+
* `warn` from a `blocking: true` contract is promoted to `fail` (non-zero) ONLY
|
|
35
|
+
* under `--strict`. `info`/`unknown` are never gated. Honest-absent (Tenet 14):
|
|
36
|
+
* unconfigured → exactly one `skip` line; configured-but-missing / unparseable /
|
|
37
|
+
* unsupported-schema → `warn`, never a crash. Dynamic-import `@mmnto/totem` to
|
|
38
|
+
* keep core off the CLI cold-start graph, matching the other doctor checks.
|
|
39
|
+
*/
|
|
40
|
+
import type { ParityContractVerdict } from '@mmnto/totem';
|
|
41
|
+
/**
|
|
42
|
+
* A parity output line — the per-contract verdict plus its display name. Carries
|
|
43
|
+
* the WIDER `ParityContractVerdict` status vocabulary (pass/warn/fail/info/
|
|
44
|
+
* unknown/skip) rather than the shared `CheckStatus`, so the sensor honors the
|
|
45
|
+
* verdict-state split (#2073 req #1) without rippling `CheckStatus` across the
|
|
46
|
+
* other doctor checks. The parity command owns its own renderer.
|
|
27
47
|
*/
|
|
28
|
-
|
|
48
|
+
export interface ParityLine extends ParityContractVerdict {
|
|
49
|
+
name: string;
|
|
50
|
+
}
|
|
29
51
|
/**
|
|
30
|
-
* Result of a parity check: the rendered `
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* flag (which `DiagnosticResult` does not carry).
|
|
52
|
+
* Result of a parity check: the rendered `ParityLine`s plus the set of contract
|
|
53
|
+
* ids that produced a drift `warn` AND are `blocking: true`. The command
|
|
54
|
+
* promotes exactly these to `fail` under `--strict` — carrying the ids here
|
|
55
|
+
* avoids re-loading the manifest at the CLI edge to recover the `blocking` flag.
|
|
35
56
|
*/
|
|
36
57
|
export interface ParityCheckResult {
|
|
37
|
-
results:
|
|
58
|
+
results: ParityLine[];
|
|
38
59
|
/** Contract ids whose `warn` is `--strict`-promotable (blocking + drift). */
|
|
39
60
|
blockingDriftIds: string[];
|
|
40
61
|
}
|
|
41
62
|
/**
|
|
42
|
-
* Resolve, parse, and report the parity manifest as `
|
|
63
|
+
* Resolve, parse, and report the parity manifest as `ParityLine`s.
|
|
43
64
|
*
|
|
44
65
|
* Returns `{ results, blockingDriftIds }`: `results[0]` is always the section
|
|
45
|
-
* summary line; in the `ok` path it is followed by one line per contract
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* `
|
|
66
|
+
* summary line; in the `ok` path it is followed by one line per contract (or
|
|
67
|
+
* per artifact, for multi-artifact mechanical contracts) — a pin-currency
|
|
68
|
+
* verdict for the deps version-pinned contracts, a content-equality verdict for
|
|
69
|
+
* the mechanical skills contracts, and a `skip` stub for everything else. All
|
|
70
|
+
* non-`ok` paths return a single summary entry and an empty `blockingDriftIds`.
|
|
49
71
|
*
|
|
50
72
|
* @param cwd The directory to resolve config + manifest against (config/repo root).
|
|
51
73
|
*/
|
|
@@ -58,15 +80,16 @@ export interface ParityCliOptions {
|
|
|
58
80
|
* Sensor-not-gate is the default: a drift `warn` reports and exits 0. Under
|
|
59
81
|
* `--strict`, a `warn` from a `blocking: true` contract (its id carried in
|
|
60
82
|
* `checkParity`'s `blockingDriftIds`) is rendered as `FAIL` and promoted to a
|
|
61
|
-
* non-zero exit. Non-blocking drift stays a `warn` even under `--strict
|
|
62
|
-
*
|
|
83
|
+
* non-zero exit. Non-blocking drift stays a `warn` even under `--strict`, and
|
|
84
|
+
* `info` (attested fork) / `unknown` (unprovable) NEVER promote — the
|
|
85
|
+
* contract's `blocking` flag on a `warn`, not the flag alone, gates the exit.
|
|
63
86
|
*/
|
|
64
87
|
strict?: boolean;
|
|
65
88
|
/** Test seam — production callers omit and the command uses `process.cwd()`. */
|
|
66
89
|
cwdForTest?: string;
|
|
67
90
|
}
|
|
68
91
|
/**
|
|
69
|
-
* CLI entry — runs `checkParity`, renders each `
|
|
92
|
+
* CLI entry — runs `checkParity`, renders each `ParityLine`, and throws a
|
|
70
93
|
* `TotemError` when a blocking contract drifted under `--strict` so the
|
|
71
94
|
* top-level `handleError` produces the non-zero exit code (no direct
|
|
72
95
|
* `process.exit` per AGENTS.md).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-parity.d.ts","sourceRoot":"","sources":["../../src/commands/doctor-parity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"doctor-parity.d.ts","sourceRoot":"","sources":["../../src/commands/doctor-parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAIH,OAAO,KAAK,EAAuC,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAQ/F;;;;;;GAMG;AACH,MAAM,WAAW,UAAW,SAAQ,qBAAqB;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,6EAA6E;IAC7E,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AA6ND;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAkTzE;AAoDD,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkF1F"}
|