@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.
@@ -1,51 +1,73 @@
1
1
  /**
2
2
  * Parity-drift sensor for `totem doctor --parity` (mmnto-ai/totem-strategy#448).
3
3
  *
4
- * PR-1 (mmnto-ai/totem#2069): resolve the consumer-configured
5
- * `orient.parityManifest` config-path parse + Zod-validate the strategy-owned
6
- * `parity-manifest.yaml` emit `DiagnosticResult`s. The FIRST detection slice
7
- * is wired here: each `version-pinned` contract whose id resolves a deps package
8
- * name (`mmnto-cli-version`, `mmnto-totem-version`, `mmnto-mcp-version`,
9
- * `mmnto-pack-rust-architecture-version`) runs through the core
10
- * `detectVersionPinnedContract` engine (pin-currency verdict, local-only floor).
11
- * ALL other contracts — mechanical, manual-attestation, and the version-pinned
12
- * DOCTRINE pins (`governance-doctrine` / `agent-memory-doctrine`, which derive
13
- * no deps package name) — keep the `skip` info stub (their drift detection is a
14
- * follow-on).
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
- * Sensor-not-gate: the core detector returns `skip`/`warn`/`pass` only — never
17
- * `fail`. The `--strict` exit-code decision lives at the CLI edge: a `warn` from
18
- * a `blocking: true` contract is promoted to `fail` (non-zero) ONLY under
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
- * Honest-absent (Tenet 14): unconfigured exactly one `skip` line; never an
23
- * error. Configured-but-missing / unparseable / unsupported-schema `warn`,
24
- * never a crash (mirrors the `findStaleRules` best-effort fallback idiom in
25
- * doctor.ts). Dynamic-import `@mmnto/totem` to keep core off the CLI cold-start
26
- * graph, matching the other doctor checks.
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
- import type { DiagnosticResult } from './doctor.js';
48
+ export interface ParityLine extends ParityContractVerdict {
49
+ name: string;
50
+ }
29
51
  /**
30
- * Result of a parity check: the rendered `DiagnosticResult` lines plus the set
31
- * of contract ids that produced a drift `warn` AND are `blocking: true`. The
32
- * command promotes exactly these to `fail` under `--strict` — carrying the ids
33
- * here avoids re-loading the manifest at the CLI edge to recover the `blocking`
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: DiagnosticResult[];
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 `DiagnosticResult`s.
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 — a
46
- * pin-currency verdict for the deps version-pinned contracts, a `skip` stub for
47
- * everything else. All non-`ok` paths return a single summary entry and an empty
48
- * `blockingDriftIds`.
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` — the
62
- * contract's `blocking` flag, not the flag alone, gates the exit code.
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 `DiagnosticResult`, and throws a
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;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,6EAA6E;IAC7E,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwHzE;AA6CD,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;O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