@mmnto/cli 2.0.0 → 2.2.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.
Files changed (71) hide show
  1. package/dist/commands/describe.d.ts +13 -1
  2. package/dist/commands/describe.d.ts.map +1 -1
  3. package/dist/commands/describe.js +29 -1
  4. package/dist/commands/describe.js.map +1 -1
  5. package/dist/commands/describe.test.js +86 -3
  6. package/dist/commands/describe.test.js.map +1 -1
  7. package/dist/commands/doctor-parity-fetch.d.ts +93 -2
  8. package/dist/commands/doctor-parity-fetch.d.ts.map +1 -1
  9. package/dist/commands/doctor-parity-fetch.js +332 -11
  10. package/dist/commands/doctor-parity-fetch.js.map +1 -1
  11. package/dist/commands/doctor-parity-fetch.test.d.ts +6 -0
  12. package/dist/commands/doctor-parity-fetch.test.d.ts.map +1 -1
  13. package/dist/commands/doctor-parity-fetch.test.js +405 -1
  14. package/dist/commands/doctor-parity-fetch.test.js.map +1 -1
  15. package/dist/commands/doctor-parity.d.ts.map +1 -1
  16. package/dist/commands/doctor-parity.js +27 -1
  17. package/dist/commands/doctor-parity.js.map +1 -1
  18. package/dist/commands/doctor-parity.test.js +67 -0
  19. package/dist/commands/doctor-parity.test.js.map +1 -1
  20. package/dist/commands/eject-gate-needle.test.d.ts +2 -0
  21. package/dist/commands/eject-gate-needle.test.d.ts.map +1 -0
  22. package/dist/commands/eject-gate-needle.test.js +48 -0
  23. package/dist/commands/eject-gate-needle.test.js.map +1 -0
  24. package/dist/commands/eject.d.ts +10 -0
  25. package/dist/commands/eject.d.ts.map +1 -1
  26. package/dist/commands/eject.js +67 -12
  27. package/dist/commands/eject.js.map +1 -1
  28. package/dist/commands/eject.test.js +113 -0
  29. package/dist/commands/eject.test.js.map +1 -1
  30. package/dist/commands/gate-install.d.ts +37 -5
  31. package/dist/commands/gate-install.d.ts.map +1 -1
  32. package/dist/commands/gate-install.js +26 -38
  33. package/dist/commands/gate-install.js.map +1 -1
  34. package/dist/commands/gate-install.test.js +294 -48
  35. package/dist/commands/gate-install.test.js.map +1 -1
  36. package/dist/commands/gate.d.ts +24 -9
  37. package/dist/commands/gate.d.ts.map +1 -1
  38. package/dist/commands/gate.js +36 -17
  39. package/dist/commands/gate.js.map +1 -1
  40. package/dist/commands/gate.test.js +74 -3
  41. package/dist/commands/gate.test.js.map +1 -1
  42. package/dist/commands/host-hooks.d.ts +8 -2
  43. package/dist/commands/host-hooks.d.ts.map +1 -1
  44. package/dist/commands/host-hooks.js.map +1 -1
  45. package/dist/commands/init-templates.d.ts +3 -3
  46. package/dist/commands/init-templates.d.ts.map +1 -1
  47. package/dist/commands/init-templates.js +107 -48
  48. package/dist/commands/init-templates.js.map +1 -1
  49. package/dist/commands/init.d.ts.map +1 -1
  50. package/dist/commands/init.js +20 -16
  51. package/dist/commands/init.js.map +1 -1
  52. package/dist/commands/install-hooks.d.ts.map +1 -1
  53. package/dist/commands/install-hooks.js +159 -27
  54. package/dist/commands/install-hooks.js.map +1 -1
  55. package/dist/commands/install-hooks.test.js +460 -12
  56. package/dist/commands/install-hooks.test.js.map +1 -1
  57. package/dist/commands/legs.d.ts +35 -7
  58. package/dist/commands/legs.d.ts.map +1 -1
  59. package/dist/commands/legs.js +26 -7
  60. package/dist/commands/legs.js.map +1 -1
  61. package/dist/commands/legs.test.js +87 -0
  62. package/dist/commands/legs.test.js.map +1 -1
  63. package/dist/commands/release-train-shape.test.d.ts +2 -0
  64. package/dist/commands/release-train-shape.test.d.ts.map +1 -0
  65. package/dist/commands/release-train-shape.test.js +226 -0
  66. package/dist/commands/release-train-shape.test.js.map +1 -0
  67. package/dist/commands/tools-hook-parity.test.js +200 -0
  68. package/dist/commands/tools-hook-parity.test.js.map +1 -1
  69. package/dist/index.js +2 -2
  70. package/dist/index.js.map +1 -1
  71. package/package.json +2 -2
@@ -1,11 +1,11 @@
1
1
  import type { IngestTarget } from '@mmnto/totem';
2
2
  import type { ConfigFormat, EmbeddingTier } from './init-detect.js';
3
- export declare const REFLEX_VERSION = 13;
3
+ export declare const REFLEX_VERSION = 14;
4
4
  export declare const REFLEX_START = "<!-- totem:reflexes:start -->";
5
5
  export declare const REFLEX_END = "<!-- totem:reflexes:end -->";
6
6
  export declare const REFLEX_VERSION_RE: RegExp;
7
7
  export declare const LEGACY_SENTINEL = "## Totem AI Integration (Auto-Generated)";
8
- export declare const AI_PROMPT_BLOCK = "\n<!-- totem:reflexes:start -->\n<!-- totem:reflexes:version:13 -->\n\n## Totem AI Integration (Auto-Generated)\nYou have access to the Totem MCP for long-term project memory. You MUST operate with the following reflexes:\n\n### Memory Reflexes\n1. **BLOCKING \u2014 Pull Before Coding:** Before writing or modifying code that touches more than one file, you MUST call `search_knowledge` with a query describing what you're about to change. This is not optional. The vector DB contains traps, edge cases, and architectural constraints that prevent rework. Skip this and you risk repeating a mistake that's already been solved.\n2. **Pull Before Planning:** Before writing specs, architecture, or fixing complex bugs, use `search_knowledge` to retrieve domain constraints and past traps.\n3. **Pull on Session Start:** At the beginning of every session, call `search_knowledge` with a broad query about the current task or area of work. The vector DB is your institutional memory \u2014 use it before relying on your own context window.\n4. **Proactive Anchoring (The 3 Triggers):** You must autonomously call `add_lesson` when any of the following occur \u2014 do NOT wait for the user to ask:\n - **The Trap Trigger:** If you spend >2 turns fixing a bug caused by a framework quirk, unexpected API response, or edge case. (Anchor the symptom + fix).\n - **The Pivot Trigger:** If the user introduces a new architectural pattern or deprecates an old one. (Anchor the rule).\n - **The Handoff Trigger:** At the end of a session or when wrapping up a complex feature, extract the non-obvious lessons learned and anchor them.\n5. **Tool Preference (MCP over CLI):** Always prioritize using dedicated MCP tools (e.g., GitHub, Supabase, Vercel) over executing generic shell commands (like `gh issue view` or `curl`). MCP tools provide structured, un-truncated data optimized for your context window. Only fall back to bash execution if an MCP tool is unavailable or fails.\n\nLessons are automatically re-indexed in the background after each `add_lesson` call \u2014 no manual sync needed.\n\n### Memory Classification\nWhen deciding where to store information or rules, use this decision tree:\n- If forgetting this causes a mistake on an UNRELATED task (Core Safety): Store in your root agent memory file (e.g., CLAUDE.md or GEMINI.md).\n- If it's a stable, project-wide workflow rule: Store in project config (e.g., CLAUDE.md).\n- If it's a stable syntax/style pattern: Store in the project's styleguide or linter rules.\n- If it's domain knowledge, an edge case, or a past trap: You MUST use the Totem `add_lesson` tool to anchor it into the project's LanceDB.\n\n### Workflow Orchestrator Rituals\n[FOR LOCAL CLI/TERMINAL AGENTS ONLY] Do not attempt to run these commands if you are a headless bot or operating in a cloud PR environment (e.g., Gemini Code Assist on GitHub).\nTotem provides CLI commands that map to your development lifecycle. Use them at these moments:\n1. **Start of Session:** The SessionStart hook automatically runs `totem describe` to emit the project-orientation banner (project, tier, rule/lesson counts, targets, hooks). For richer derived project state (recent merged PRs, current branch + uncommitted files, latest strategy journal pointer, package versions, rule/lesson counts), call the MCP `describe_project` tool \u2014 the derived view replaces the retired `docs/active_work.md` convention (state is observed, not declared). For a freshness check (manifest staleness, shield drift, review state), run `totem status`. Run `totem triage` if you need to pick a new task. On a seat without the SessionStart hook (a cold start, or a vehicle that doesn't run hooks), run `totem orient` to derive in-flight and parked project state from primitives.\n2. **Before Implementation:** Run `totem spec <issue-url-or-topic>` to retrieve related context (lessons, specs, code) before writing code. Treat any generated plan as one retrieval input, never the contract \u2014 derive the actual design from primary sources (the issue, the code, project doctrine). Under the strict hook tier \u2014 which AI agents get automatically \u2014 this is REQUIRED, not optional: the pre-commit hook blocks until the checkout carries an ANCHORED `totem spec` run artifact, and prints the evidence it found. ANCHORED means the run was grounded on an ISSUE, or on a hand-authored design record bound with `totem spec --from <record>` \u2014 and that its SUBJECT carries the shape the command promises: for an issue run, every required heading with a non-empty body (or, when your project overrides the spec system prompt, just one heading with a body \u2014 a custom prompt is not held to the built-in skeleton); for a bound record, at least one heading with a body in the RECORD's own bytes, re-read from disk at commit time. A free-text topic run is NOT evidence (that is the confabulation surface the rule exists for), and neither is an artifact written before this rule \u2014 re-run it anchored. A response served from the cache writes no artifact, so add `--fresh` when the gate says there is nothing new (mmnto-ai/totem#2690, mmnto-ai/totem#2700). Under the same strict tier the pre-push hook additionally blocks a legs-owed push \u2014 a diff touching the paths in `hooks.legsOwed.globs` (doctrine, public copy, `.changeset/**` and the contract classes your project declares) \u2014 until the checkout carries a fresh leg deposit for its head, written with `totem legs deposit --sha HEAD --from <findings.json>` once the leg returns, and the gate prints the evidence it found (mmnto-ai/totem#2698).\n3. **Before Push:** Run `totem lint` \u2014 the deterministic enforcement floor (zero LLM, ~2s). **Before PR:** `totem review` runs supplementary AI lanes over the diff (~18s) \u2014 advisory sensors, not a merge gate; known limits are disclosed in the run output (LLM window truncation on large diffs; non-code files skipped). Your team's own review discipline decides what constitutes the review of record.\n4. **End of Session:** Run `totem handoff` to generate a snapshot for the next agent session with current progress and open threads.\n5. **Managed hooks self-repair:** `totem init` distributes `.totem/prepare.cjs` and wires `package.json` `prepare` to it only when no `prepare` script exists. The wrapper runs `totem hook install` on every `pnpm install`, drift-repairing the managed Claude/Gemini hooks \u2014 no manual re-install needed.\n\n### Cloud / PR Review Bots\n[FOR CLOUD BOTS ONLY \u2014 e.g., Gemini Code Assist, GitHub Copilot PR Review]\nYou do NOT have access to the local CLI. Instead, use the Totem MCP tools directly:\n1. **Before reviewing a PR:** Call `search_knowledge` with queries about the files and patterns being changed to check for known traps and architectural constraints.\n2. **Before suggesting changes:** Call `search_knowledge` to verify your suggestion aligns with established project patterns and past lessons.\n3. **When you spot a recurring issue:** Call `add_lesson` to persist the trap so future reviews catch it automatically.\n\n### Context Management Guardrail\nYou must be highly defensive of your own context window \u2014 and you are the ONLY party holding the denominator (your model's window size and current occupancy); no Totem tool can measure it for you. Large Totem tool responses may carry a self-closing `<size-disclosure ... />` line stating that payload's measured size and cumulative session totals \u2014 a measurement, never a risk claim. Weigh it against your own occupancy and escalate to the user only when the pressure is genuinely material, suggesting `totem handoff` to capture mid-task state before clearing the chat. If you receive a `<totem_system_warning>` tag in a tool response (e.g. index staleness or degraded retrieval), read it silently and act on it or surface it naturally. Do NOT echo raw XML tags to the user.\n<!-- totem:reflexes:end -->\n";
8
+ export declare const AI_PROMPT_BLOCK = "\n<!-- totem:reflexes:start -->\n<!-- totem:reflexes:version:14 -->\n\n## Totem AI Integration (Auto-Generated)\nYou have access to the Totem MCP for long-term project memory. You MUST operate with the following reflexes:\n\n### Memory Reflexes\n1. **BLOCKING \u2014 Pull Before Coding:** Before writing or modifying code that touches more than one file, you MUST call `search_knowledge` with a query describing what you're about to change. This is not optional. The vector DB contains traps, edge cases, and architectural constraints that prevent rework. Skip this and you risk repeating a mistake that's already been solved.\n2. **Pull Before Planning:** Before writing specs, architecture, or fixing complex bugs, use `search_knowledge` to retrieve domain constraints and past traps.\n3. **Pull on Session Start:** At the beginning of every session, call `search_knowledge` with a broad query about the current task or area of work. The vector DB is your institutional memory \u2014 use it before relying on your own context window.\n4. **Proactive Anchoring (The 3 Triggers):** You must autonomously call `add_lesson` when any of the following occur \u2014 do NOT wait for the user to ask:\n - **The Trap Trigger:** If you spend >2 turns fixing a bug caused by a framework quirk, unexpected API response, or edge case. (Anchor the symptom + fix).\n - **The Pivot Trigger:** If the user introduces a new architectural pattern or deprecates an old one. (Anchor the rule).\n - **The Handoff Trigger:** At the end of a session or when wrapping up a complex feature, extract the non-obvious lessons learned and anchor them.\n5. **Tool Preference (MCP over CLI):** Always prioritize using dedicated MCP tools (e.g., GitHub, Supabase, Vercel) over executing generic shell commands (like `gh issue view` or `curl`). MCP tools provide structured, un-truncated data optimized for your context window. Only fall back to bash execution if an MCP tool is unavailable or fails.\n\nLessons are automatically re-indexed in the background after each `add_lesson` call \u2014 no manual sync needed.\n\n### Memory Classification\nWhen deciding where to store information or rules, use this decision tree:\n- If forgetting this causes a mistake on an UNRELATED task (Core Safety): Store in your root agent memory file (e.g., CLAUDE.md or GEMINI.md).\n- If it's a stable, project-wide workflow rule: Store in project config (e.g., CLAUDE.md).\n- If it's a stable syntax/style pattern: Store in the project's styleguide or linter rules.\n- If it's domain knowledge, an edge case, or a past trap: You MUST use the Totem `add_lesson` tool to anchor it into the project's LanceDB.\n\n### Workflow Orchestrator Rituals\n[FOR LOCAL CLI/TERMINAL AGENTS ONLY] Do not attempt to run these commands if you are a headless bot or operating in a cloud PR environment (e.g., Gemini Code Assist on GitHub).\nTotem provides CLI commands that map to your development lifecycle. Use them at these moments:\n1. **Start of Session:** The SessionStart hook automatically runs `totem describe` to emit the project-orientation banner (project, tier, rule/lesson counts, targets, hooks). For richer derived project state (recent merged PRs, current branch + uncommitted files, latest strategy journal pointer, package versions, rule/lesson counts), call the MCP `describe_project` tool \u2014 the derived view replaces the retired `docs/active_work.md` convention (state is observed, not declared). For a freshness check (manifest staleness, shield drift, review state), run `totem status`. Run `totem triage` if you need to pick a new task. On a seat without the SessionStart hook (a cold start, or a vehicle that doesn't run hooks), run `totem orient` to derive in-flight and parked project state from primitives.\n2. **Before Implementation:** Run `totem spec <issue-url-or-topic>` to retrieve related context (lessons, specs, code) before writing code. Treat any generated plan as one retrieval input, never the contract \u2014 derive the actual design from primary sources (the issue, the code, project doctrine). Under the strict hook tier \u2014 which AI agents get automatically \u2014 this is REQUIRED, not optional: the pre-commit hook blocks until the checkout carries an ANCHORED `totem spec` run artifact, and prints the evidence it found. ANCHORED means the run was grounded on an ISSUE, or on a hand-authored design record bound with `totem spec --from <record>` \u2014 and that its SUBJECT carries the shape the command promises: for an issue run, every required heading with a non-empty body (or, when your project overrides the spec system prompt, just one heading with a body \u2014 a custom prompt is not held to the built-in skeleton); for a bound record, at least one heading with a body in the RECORD's own bytes, re-read from disk at commit time. A free-text topic run is NOT evidence (that is the confabulation surface the rule exists for), and neither is an artifact written before this rule \u2014 re-run it anchored. A response served from the cache writes no artifact, so add `--fresh` when the gate says there is nothing new (mmnto-ai/totem#2690, mmnto-ai/totem#2700). Under the same strict tier the pre-push hook additionally blocks a legs-owed push \u2014 a diff touching the paths in `hooks.legsOwed.globs` (doctrine, public copy, `.changeset/**` and the contract classes your project declares) \u2014 until the checkout carries a fresh leg deposit for its head, written with `totem legs deposit --sha HEAD --from <findings.json>` once the leg returns, and the gate prints the evidence it found (mmnto-ai/totem#2698). That legs gate can also be armed on its own, at any tier, with `hooks.legsOwed.enforce: 'block'` \u2014 a standard-tier install then refuses a legs-owed push too, and the gate's line names the key (mmnto-ai/totem#2771).\n3. **Before Push:** Run `totem lint` \u2014 the deterministic enforcement floor (zero LLM, ~2s). **Before PR:** `totem review` runs supplementary AI lanes over the diff (~18s) \u2014 advisory sensors, not a merge gate; known limits are disclosed in the run output (LLM window truncation on large diffs; non-code files skipped). Your team's own review discipline decides what constitutes the review of record.\n4. **End of Session:** Run `totem handoff` to generate a snapshot for the next agent session with current progress and open threads.\n5. **Managed hooks self-repair:** `totem init` distributes `.totem/prepare.cjs` and wires `package.json` `prepare` to it only when no `prepare` script exists. The wrapper runs `totem hook install` on every `pnpm install`, drift-repairing the managed Claude/Gemini hooks \u2014 no manual re-install needed.\n\n### Cloud / PR Review Bots\n[FOR CLOUD BOTS ONLY \u2014 e.g., Gemini Code Assist, GitHub Copilot PR Review]\nYou do NOT have access to the local CLI. Instead, use the Totem MCP tools directly:\n1. **Before reviewing a PR:** Call `search_knowledge` with queries about the files and patterns being changed to check for known traps and architectural constraints.\n2. **Before suggesting changes:** Call `search_knowledge` to verify your suggestion aligns with established project patterns and past lessons.\n3. **When you spot a recurring issue:** Call `add_lesson` to persist the trap so future reviews catch it automatically.\n\n### Context Management Guardrail\nYou must be highly defensive of your own context window \u2014 and you are the ONLY party holding the denominator (your model's window size and current occupancy); no Totem tool can measure it for you. Large Totem tool responses may carry a self-closing `<size-disclosure ... />` line stating that payload's measured size and cumulative session totals \u2014 a measurement, never a risk claim. Weigh it against your own occupancy and escalate to the user only when the pressure is genuinely material, suggesting `totem handoff` to capture mid-task state before clearing the chat. If you receive a `<totem_system_warning>` tag in a tool response (e.g. index staleness or degraded retrieval), read it silently and act on it or surface it naturally. Do NOT echo raw XML tags to the user.\n<!-- totem:reflexes:end -->\n";
9
9
  export declare const TOTEM_FILE_MARKER = "// [totem] auto-generated";
10
10
  /**
11
11
  * The end marker that CLOSES every managed whole-file session hook template
@@ -81,7 +81,7 @@ export declare const CLAUDE_SESSION_START_ENTRY: {
81
81
  timeout: number;
82
82
  }[];
83
83
  };
84
- export declare const CLAUDE_GATE_WRAPPER = "// [totem] auto-generated \u2014 Claude Code action-gate wrapper\n// ONE parameterized PreToolUse wrapper for the Totem gate engine (PR-C,\n// mmnto-ai/totem#2048). Reads --event <name> from argv (baked per-entry into\n// the installed command), reads the PreToolUse stdin envelope, shells to\n// `totem gate check`, and maps the GateVerdict disposition \u2192 host exit code.\n// `.cjs` extension because package.json may have \"type\": \"module\" \u2014 Claude\n// Code execs hooks via plain `node`, which would otherwise treat `.js` as ESM.\n//\n// Exit-code contract (LOAD-BEARING \u2014 ADR-109 \u00A72; branch ONLY on disposition):\n// 0 = allow | warn | --pilot deny | NOT-APPLICABLE fail-soft\n// (unparseable/non-object envelope, no-declared-subsystem pass-through)\n// 2 = deny (--strict, Claude block convention)\n// | APPLICABLE-gate-not-evaluable fail-closed (missing CLI, non-zero\n// `gate check`, unparseable verdict, or unknown disposition)\n'use strict';\n\nconst { spawnSync } = require('child_process');\nconst { existsSync } = require('fs');\nconst { join } = require('path');\n\n// \u2500\u2500\u2500 Parse baked args (--event <name>, optional --pilot / --strict) \u2500\u2500\u2500\u2500\u2500\n// The tier is read ONLY from argv (baked into the installed command at\n// install time). There is NO env-var override: env sourcing would be a\n// fail-open (any shell with TOTEM_GATE_TIER=pilot could silently downgrade\n// enforcement). Default (no flag) = strict, so a default install is\n// environment-immune; --pilot is an explicit install-time opt-in.\nconst argv = process.argv.slice(2);\nlet event = '';\nlet tier = 'strict';\nfor (let i = 0; i < argv.length; i++) {\n if (argv[i] === '--event') {\n event = argv[i + 1] || '';\n i++;\n } else if (argv[i] === '--pilot') {\n tier = 'pilot';\n } else if (argv[i] === '--strict') {\n tier = 'strict';\n }\n}\n\n// Read the PreToolUse stdin envelope.\nlet stdin = '';\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', (chunk) => {\n stdin += chunk;\n});\nprocess.stdin.on('end', () => {\n let parsed;\n try {\n parsed = stdin ? JSON.parse(stdin) : {};\n } catch (err) {\n // Fail-soft on a malformed envelope (mirror PreWriteShield): a broken\n // host envelope is not an applicable gate, so it must NOT block.\n process.stderr.write('[totem gate-wrapper] could not parse stdin JSON; allowing\\n');\n process.exit(0);\n }\n\n // Valid JSON can still be a non-object (the bytes `null`, `123`, or a bare\n // quoted string). Such an envelope carries no `tool_input` to dereference and\n // is NOT an applicable gate \u2192 fail-soft (exit 0). Guarding here also prevents\n // a TypeError-on-deref from leaking as exit 1.\n if (parsed === null || typeof parsed !== 'object') {\n process.stderr.write('[totem gate-wrapper] stdin JSON is not an object; allowing\\n');\n process.exit(0);\n }\n\n const input =\n typeof parsed.tool_input === 'object' && parsed.tool_input !== null ? parsed.tool_input : {};\n\n // \u2500\u2500\u2500 THE EMPTY-SUBSYSTEM GUARDRAIL \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // freeze-check's predicate is on a DECLARED subsystem. A normal Edit/Write\n // carries tool_input.file_path (a path), NOT a subsystem. With no declared\n // subsystem, NO GATE APPLIES \u2192 pass through (exit 0). Do NOT shell out \u2014 a\n // blanket fail-closed here would block every ordinary edit.\n const declaredSubsystem =\n typeof input.subsystem === 'string' && input.subsystem.trim() !== ''\n ? input.subsystem.trim()\n : '';\n if (declaredSubsystem === '') {\n process.exit(0);\n }\n\n // A gate genuinely applies. Build the --payload from the declared fields.\n // NOTE: this payload projection is freeze-check-shaped (subsystem-only). The\n // wrapper is --event-parameterized, but the payload it builds is currently\n // freeze-check-specific; a future gate needing a different payload field must\n // extend this projection (e.g. branch on `event`).\n const payload = JSON.stringify({ subsystem: declaredSubsystem });\n\n // Resolve the LOCAL Totem CLI (the global `totem` binary may be stale and\n // missing deps \u2014 the known repo gotcha). Invoke node on the installed dist\n // entry.\n //\n // FAIL-CLOSED on a missing CLI: we are PAST the empty-subsystem guardrail, so\n // a gate genuinely APPLIES here. freeze-check has NO commit-time hard floor\n // (unlike PreWriteShield, whose fail-soft is backed by `totem-lint` at\n // commit), so an APPLICABLE gate that cannot be evaluated for ANY reason\n // (missing CLI OR corrupt freeze.json) must fail closed \u2014 not silently allow\n // (guardrail rule + Tenet 4 fail-closed). Fail-SOFT (exit 0) is reserved for\n // genuinely NOT-APPLICABLE inputs (unparseable/non-object envelope, no\n // declared subsystem), all of which already returned above.\n const cliPath = join(process.cwd(), 'node_modules', '@mmnto', 'cli', 'dist', 'index.js');\n if (!existsSync(cliPath)) {\n process.stderr.write(\n '[totem gate] ' +\n event +\n ' applies but the totem CLI is not resolvable; failing closed. ' +\n 'Reinstall totem or run `totem eject` to remove the gate.\\n',\n );\n process.exit(2);\n }\n\n const result = spawnSync(\n process.execPath,\n [cliPath, 'gate', 'check', '--event', event, '--payload', payload],\n { encoding: 'utf-8', timeout: 30000 },\n );\n\n // \u2500\u2500\u2500 FAIL-CLOSED \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // A gate genuinely applies (a declared subsystem was present) and the\n // evaluation itself failed (non-zero exit: corrupt freeze.json, spawn\n // error, etc.). Never silently allow when an applicable gate's source is\n // broken \u2192 exit 2. (No-declared-subsystem already returned exit 0 above,\n // so this only blocks when a subsystem was actually declared.)\n if (result.error || typeof result.status !== 'number' || result.status !== 0) {\n process.stderr.write(\n '[totem gate-wrapper] gate \"' +\n event +\n '\" evaluation failed (source broken or unavailable) \u2014 blocking (fail-closed).\\n' +\n (result.stderr || (result.error ? String(result.error.message || result.error) : '')) +\n '\\n',\n );\n process.exit(2);\n }\n\n let verdict;\n try {\n verdict = JSON.parse(result.stdout || '');\n } catch (err) {\n // The command emitted unparseable stdout despite a 0 exit \u2014 an applicable\n // gate whose verdict we cannot read is a broken source \u2192 fail-closed.\n process.stderr.write(\n '[totem gate-wrapper] gate \"' + event + '\" emitted unparseable verdict \u2014 blocking (fail-closed).\\n',\n );\n process.exit(2);\n }\n\n // \u2500\u2500\u2500 Disposition \u2192 host exit code (branch ONLY on disposition) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const disposition = verdict && typeof verdict.disposition === 'string' ? verdict.disposition : '';\n // reason/provenance are OPAQUE stderr passthrough \u2014 never parsed for control flow.\n const detail =\n (verdict && verdict.reason ? verdict.reason : '') +\n (verdict && verdict.provenance ? ' [' + JSON.stringify(verdict.provenance) + ']' : '');\n\n if (disposition === 'allow') {\n process.exit(0);\n }\n if (disposition === 'warn') {\n process.stderr.write('[totem gate-wrapper] ' + event + ' (warn): ' + detail + '\\n');\n process.exit(0);\n }\n if (disposition === 'deny') {\n process.stderr.write('[totem gate-wrapper] ' + event + ' (deny): ' + detail + '\\n');\n process.exit(tier === 'pilot' ? 0 : 2);\n }\n\n // Unknown disposition from an applicable gate \u2014 fail-closed.\n process.stderr.write(\n '[totem gate-wrapper] gate \"' + event + '\" returned unknown disposition \"' + disposition + '\" \u2014 blocking (fail-closed).\\n',\n );\n process.exit(2);\n});\n// [totem] end auto-generated\n";
84
+ export declare const CLAUDE_GATE_WRAPPER = "// [totem] auto-generated \u2014 Claude Code action-gate wrapper\n// ONE parameterized PreToolUse wrapper for the Totem gate engine (PR-C,\n// mmnto-ai/totem#2048). Reads --event <name> from argv (baked per-entry into\n// the installed command), reads the PreToolUse stdin envelope, shells to\n// `totem gate check`, and maps the GateVerdict disposition \u2192 host exit code.\n// `.cjs` extension because package.json may have \"type\": \"module\" \u2014 Claude\n// Code execs hooks via plain `node`, which would otherwise treat `.js` as ESM.\n//\n// Exit-code contract (LOAD-BEARING \u2014 ADR-109 \u00A72; branch ONLY on disposition):\n// 0 = allow | warn | --pilot deny | NOT-APPLICABLE fail-soft\n// (unparseable/non-object envelope; freeze-check with no declared\n// subsystem; transport-shield on a tool other than Bash/PowerShell or\n// with no non-empty string command)\n// 2 = deny (--strict, Claude block convention)\n// | APPLICABLE-gate-not-evaluable fail-closed (missing CLI, non-zero\n// `gate check`, unparseable verdict, or unknown disposition)\n// | an --event this wrapper has no payload projection for (a baked event\n// it cannot project is an applicable gate it cannot evaluate)\n'use strict';\n\nconst { spawnSync } = require('child_process');\nconst { existsSync } = require('fs');\nconst { join } = require('path');\n\n// \u2500\u2500\u2500 Parse baked args (--event <name>, optional --pilot / --strict) \u2500\u2500\u2500\u2500\u2500\n// The tier is read ONLY from argv (baked into the installed command at\n// install time). There is NO env-var override: env sourcing would be a\n// fail-open (any shell with TOTEM_GATE_TIER=pilot could silently downgrade\n// enforcement). Default (no flag) = strict, so a default install is\n// environment-immune; --pilot is an explicit install-time opt-in.\nconst argv = process.argv.slice(2);\nlet event = '';\nlet tier = 'strict';\nfor (let i = 0; i < argv.length; i++) {\n if (argv[i] === '--event') {\n event = argv[i + 1] || '';\n i++;\n } else if (argv[i] === '--pilot') {\n tier = 'pilot';\n } else if (argv[i] === '--strict') {\n tier = 'strict';\n }\n}\n\n// Read the PreToolUse stdin envelope.\nlet stdin = '';\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', (chunk) => {\n stdin += chunk;\n});\nprocess.stdin.on('end', () => {\n let parsed;\n try {\n parsed = stdin ? JSON.parse(stdin) : {};\n } catch (err) {\n // Fail-soft on a malformed envelope (mirror PreWriteShield): a broken\n // host envelope is not an applicable gate, so it must NOT block.\n process.stderr.write('[totem gate-wrapper] could not parse stdin JSON; allowing\\n');\n process.exit(0);\n }\n\n // Valid JSON can still be a non-object (the bytes `null`, `123`, or a bare\n // quoted string). Such an envelope carries no `tool_input` to dereference and\n // is NOT an applicable gate \u2192 fail-soft (exit 0). Guarding here also prevents\n // a TypeError-on-deref from leaking as exit 1.\n if (parsed === null || typeof parsed !== 'object') {\n process.stderr.write('[totem gate-wrapper] stdin JSON is not an object; allowing\\n');\n process.exit(0);\n }\n\n const input =\n typeof parsed.tool_input === 'object' && parsed.tool_input !== null ? parsed.tool_input : {};\n\n // \u2500\u2500\u2500 PER-EVENT PAYLOAD PROJECTION \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Each gate reads a DIFFERENT slice of the PreToolUse envelope, so the\n // projection branches on the baked --event. Every branch owns its own\n // NOT-APPLICABLE test \u2014 the point past which a gate genuinely applies and\n // any evaluation failure must fail CLOSED.\n //\n // event | applies when | payload\n // -----------------|----------------------------------|---------------------------\n // freeze-check | tool_input.subsystem is a | { subsystem }\n // | non-empty string |\n // transport-shield | tool_name is Bash or PowerShell | { tool, command, platform }\n // | AND tool_input.command is a |\n // | non-empty string |\n // (anything else) | \u2014 no projection \u2192 fail closed | \u2014\n let payload = '';\n\n if (event === 'freeze-check') {\n // THE EMPTY-SUBSYSTEM GUARDRAIL: freeze-check's predicate is on a DECLARED\n // subsystem. A normal Edit/Write carries tool_input.file_path (a path), NOT\n // a subsystem. With no declared subsystem, NO GATE APPLIES \u2192 pass through\n // (exit 0). Do NOT shell out \u2014 a blanket fail-closed here would block every\n // ordinary edit.\n const declaredSubsystem =\n typeof input.subsystem === 'string' && input.subsystem.trim() !== ''\n ? input.subsystem.trim()\n : '';\n if (declaredSubsystem === '') {\n process.exit(0);\n }\n payload = JSON.stringify({ subsystem: declaredSubsystem });\n } else if (event === 'transport-shield') {\n // transport-shield's predicate is on a SHELL COMMAND. Anything that is not\n // a Bash/PowerShell invocation carrying a command string is NOT an\n // applicable gate \u2192 pass through (exit 0), mirroring the guardrail above.\n // The installed matcher is the CLI's own, so a foreign tool_name here means\n // a hand-edited settings entry, not a shape to judge.\n const tool = parsed.tool_name;\n if (tool !== 'Bash' && tool !== 'PowerShell') {\n process.exit(0);\n }\n if (typeof input.command !== 'string' || input.command.trim() === '') {\n process.exit(0);\n }\n payload = JSON.stringify({\n tool: tool,\n command: input.command,\n platform: process.platform,\n });\n } else {\n // A baked --event this wrapper cannot project is an APPLICABLE gate it\n // cannot evaluate \u2192 fail closed (ADR-109). Reinstalling refreshes the\n // wrapper (`totem gate install` drift-repairs the bounded region).\n process.stderr.write(\n '[totem gate-wrapper] no payload projection for event \"' + event + '\"; failing closed.\\n',\n );\n process.exit(2);\n }\n\n // Resolve the LOCAL Totem CLI (the global `totem` binary may be stale and\n // missing deps \u2014 the known repo gotcha). Invoke node on the installed dist\n // entry.\n //\n // FAIL-CLOSED on a missing CLI: we are PAST the per-event applicability\n // guardrail (freeze-check: a declared subsystem; transport-shield: a Bash or\n // PowerShell command), so a gate genuinely APPLIES here. Neither gate has a\n // commit-time hard floor (unlike PreWriteShield, whose fail-soft is backed by\n // `totem-lint` at commit), so an APPLICABLE gate that cannot be evaluated\n // for ANY reason (missing CLI OR a broken source) must fail closed \u2014 not\n // silently allow (guardrail rule + Tenet 4 fail-closed). Fail-SOFT (exit 0)\n // is reserved for genuinely NOT-APPLICABLE inputs (unparseable/non-object\n // envelope, no declared subsystem, no shell command), all of which already\n // returned above.\n const cliPath = join(process.cwd(), 'node_modules', '@mmnto', 'cli', 'dist', 'index.js');\n if (!existsSync(cliPath)) {\n process.stderr.write(\n '[totem gate] ' +\n event +\n ' applies but the totem CLI is not resolvable; failing closed. ' +\n 'Reinstall totem or run `totem eject` to remove the gate.\\n',\n );\n process.exit(2);\n }\n\n // The payload rides on the child's STDIN (`--payload -`), never argv: a Bash\n // command can run to tens of kilobytes and win32 caps a command line at\n // 32,767 characters \u2014 an argv payload past it fails the spawn with\n // ENAMETOOLONG and would land in the fail-closed arm below with nothing\n // broken (mmnto-ai/totem#2799, pass 3).\n const result = spawnSync(\n process.execPath,\n [cliPath, 'gate', 'check', '--event', event, '--payload', '-'],\n { encoding: 'utf-8', timeout: 30000, input: payload },\n );\n\n // \u2500\u2500\u2500 FAIL-CLOSED \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // A gate genuinely applies (the per-event projection above found its input:\n // a declared subsystem, or a Bash/PowerShell command) and the evaluation\n // itself failed (non-zero exit: corrupt freeze.json, an invalid payload,\n // spawn error, etc.). Never silently allow when an applicable gate's source\n // is broken \u2192 exit 2. (Not-applicable envelopes already returned exit 0\n // above, so this only blocks when the gate's input was actually present.)\n if (result.error || typeof result.status !== 'number' || result.status !== 0) {\n process.stderr.write(\n '[totem gate-wrapper] gate \"' +\n event +\n '\" evaluation failed (source broken or unavailable) \u2014 blocking (fail-closed).\\n' +\n (result.stderr || (result.error ? String(result.error.message || result.error) : '')) +\n '\\n',\n );\n process.exit(2);\n }\n\n let verdict;\n try {\n verdict = JSON.parse(result.stdout || '');\n } catch (err) {\n // The command emitted unparseable stdout despite a 0 exit \u2014 an applicable\n // gate whose verdict we cannot read is a broken source \u2192 fail-closed.\n process.stderr.write(\n '[totem gate-wrapper] gate \"' + event + '\" emitted unparseable verdict \u2014 blocking (fail-closed).\\n',\n );\n process.exit(2);\n }\n\n // \u2500\u2500\u2500 Disposition \u2192 host exit code (branch ONLY on disposition) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const disposition = verdict && typeof verdict.disposition === 'string' ? verdict.disposition : '';\n // reason/provenance are OPAQUE stderr passthrough \u2014 never parsed for control flow.\n const detail =\n (verdict && verdict.reason ? verdict.reason : '') +\n (verdict && verdict.provenance ? ' [' + JSON.stringify(verdict.provenance) + ']' : '');\n\n if (disposition === 'allow') {\n process.exit(0);\n }\n if (disposition === 'warn') {\n process.stderr.write('[totem gate-wrapper] ' + event + ' (warn): ' + detail + '\\n');\n process.exit(0);\n }\n if (disposition === 'deny') {\n process.stderr.write('[totem gate-wrapper] ' + event + ' (deny): ' + detail + '\\n');\n process.exit(tier === 'pilot' ? 0 : 2);\n }\n\n // Unknown disposition from an applicable gate \u2014 fail-closed.\n process.stderr.write(\n '[totem gate-wrapper] gate \"' + event + '\" returned unknown disposition \"' + disposition + '\" \u2014 blocking (fail-closed).\\n',\n );\n process.exit(2);\n});\n// [totem] end auto-generated\n";
85
85
  export declare const CLAUDE_GATE_WRAPPER_ENTRY: {
86
86
  matcher: string;
87
87
  hooks: {
@@ -1 +1 @@
1
- {"version":3,"file":"init-templates.d.ts","sourceRoot":"","sources":["../../src/commands/init-templates.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMpE,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,YAAY,kCAAkC,CAAC;AAC5D,eAAO,MAAM,UAAU,gCAAgC,CAAC;AACxD,eAAO,MAAM,iBAAiB,QAA0C,CAAC;AACzE,eAAO,MAAM,eAAe,6CAA6C,CAAC;AAE1E,eAAO,MAAM,eAAe,gxPA6C3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,kCAAkC,CAAC;AAE9D;;;;;;;;;GASG;AACH,wBAAgB,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AgBzE,CAAC;AAwBF,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAC/D,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D,eAAO,MAAM,qBAAqB,QA0DjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,ghKAoBhC,CAAC;AAEF,eAAO,MAAM,0BAA0B,owLA+EtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,w+KA0CrC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAK5B,CAAC;AAIX,wBAAsB,cAAc,CAClC,OAAO,EAAE,YAAY,EAAE,EACvB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAyCjB;AAoDD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,YAAY,EAAE,EACvB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,YAAY,EAAE,EACvB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,YAAY,EAAE,EACvB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBhD"}
@@ -3,7 +3,7 @@
3
3
  // ─── Reflex versioning ────────────────────────────────────
4
4
  // Bump REFLEX_VERSION whenever the AI_PROMPT_BLOCK content changes materially.
5
5
  // This allows `totem init` to detect stale blocks and offer upgrades.
6
- export const REFLEX_VERSION = 13;
6
+ export const REFLEX_VERSION = 14;
7
7
  export const REFLEX_START = '<!-- totem:reflexes:start -->';
8
8
  export const REFLEX_END = '<!-- totem:reflexes:end -->';
9
9
  export const REFLEX_VERSION_RE = /<!-- totem:reflexes:version:(\d+) -->/;
@@ -38,7 +38,7 @@ When deciding where to store information or rules, use this decision tree:
38
38
  [FOR LOCAL CLI/TERMINAL AGENTS ONLY] Do not attempt to run these commands if you are a headless bot or operating in a cloud PR environment (e.g., Gemini Code Assist on GitHub).
39
39
  Totem provides CLI commands that map to your development lifecycle. Use them at these moments:
40
40
  1. **Start of Session:** The SessionStart hook automatically runs \`totem describe\` to emit the project-orientation banner (project, tier, rule/lesson counts, targets, hooks). For richer derived project state (recent merged PRs, current branch + uncommitted files, latest strategy journal pointer, package versions, rule/lesson counts), call the MCP \`describe_project\` tool — the derived view replaces the retired \`docs/active_work.md\` convention (state is observed, not declared). For a freshness check (manifest staleness, shield drift, review state), run \`totem status\`. Run \`totem triage\` if you need to pick a new task. On a seat without the SessionStart hook (a cold start, or a vehicle that doesn't run hooks), run \`totem orient\` to derive in-flight and parked project state from primitives.
41
- 2. **Before Implementation:** Run \`totem spec <issue-url-or-topic>\` to retrieve related context (lessons, specs, code) before writing code. Treat any generated plan as one retrieval input, never the contract — derive the actual design from primary sources (the issue, the code, project doctrine). Under the strict hook tier — which AI agents get automatically — this is REQUIRED, not optional: the pre-commit hook blocks until the checkout carries an ANCHORED \`totem spec\` run artifact, and prints the evidence it found. ANCHORED means the run was grounded on an ISSUE, or on a hand-authored design record bound with \`totem spec --from <record>\` — and that its SUBJECT carries the shape the command promises: for an issue run, every required heading with a non-empty body (or, when your project overrides the spec system prompt, just one heading with a body — a custom prompt is not held to the built-in skeleton); for a bound record, at least one heading with a body in the RECORD's own bytes, re-read from disk at commit time. A free-text topic run is NOT evidence (that is the confabulation surface the rule exists for), and neither is an artifact written before this rule — re-run it anchored. A response served from the cache writes no artifact, so add \`--fresh\` when the gate says there is nothing new (mmnto-ai/totem#2690, mmnto-ai/totem#2700). Under the same strict tier the pre-push hook additionally blocks a legs-owed push — a diff touching the paths in \`hooks.legsOwed.globs\` (doctrine, public copy, \`.changeset/**\` and the contract classes your project declares) — until the checkout carries a fresh leg deposit for its head, written with \`totem legs deposit --sha HEAD --from <findings.json>\` once the leg returns, and the gate prints the evidence it found (mmnto-ai/totem#2698).
41
+ 2. **Before Implementation:** Run \`totem spec <issue-url-or-topic>\` to retrieve related context (lessons, specs, code) before writing code. Treat any generated plan as one retrieval input, never the contract — derive the actual design from primary sources (the issue, the code, project doctrine). Under the strict hook tier — which AI agents get automatically — this is REQUIRED, not optional: the pre-commit hook blocks until the checkout carries an ANCHORED \`totem spec\` run artifact, and prints the evidence it found. ANCHORED means the run was grounded on an ISSUE, or on a hand-authored design record bound with \`totem spec --from <record>\` — and that its SUBJECT carries the shape the command promises: for an issue run, every required heading with a non-empty body (or, when your project overrides the spec system prompt, just one heading with a body — a custom prompt is not held to the built-in skeleton); for a bound record, at least one heading with a body in the RECORD's own bytes, re-read from disk at commit time. A free-text topic run is NOT evidence (that is the confabulation surface the rule exists for), and neither is an artifact written before this rule — re-run it anchored. A response served from the cache writes no artifact, so add \`--fresh\` when the gate says there is nothing new (mmnto-ai/totem#2690, mmnto-ai/totem#2700). Under the same strict tier the pre-push hook additionally blocks a legs-owed push — a diff touching the paths in \`hooks.legsOwed.globs\` (doctrine, public copy, \`.changeset/**\` and the contract classes your project declares) — until the checkout carries a fresh leg deposit for its head, written with \`totem legs deposit --sha HEAD --from <findings.json>\` once the leg returns, and the gate prints the evidence it found (mmnto-ai/totem#2698). That legs gate can also be armed on its own, at any tier, with \`hooks.legsOwed.enforce: 'block'\` — a standard-tier install then refuses a legs-owed push too, and the gate's line names the key (mmnto-ai/totem#2771).
42
42
  3. **Before Push:** Run \`totem lint\` — the deterministic enforcement floor (zero LLM, ~2s). **Before PR:** \`totem review\` runs supplementary AI lanes over the diff (~18s) — advisory sensors, not a merge gate; known limits are disclosed in the run output (LLM window truncation on large diffs; non-code files skipped). Your team's own review discipline decides what constitutes the review of record.
43
43
  4. **End of Session:** Run \`totem handoff\` to generate a snapshot for the next agent session with current progress and open threads.
44
44
  5. **Managed hooks self-repair:** \`totem init\` distributes \`.totem/prepare.cjs\` and wires \`package.json\` \`prepare\` to it only when no \`prepare\` script exists. The wrapper runs \`totem hook install\` on every \`pnpm install\`, drift-repairing the managed Claude/Gemini hooks — no manual re-install needed.
@@ -1311,7 +1311,9 @@ export const CLAUDE_SESSION_START_ENTRY = {
1311
1311
  // ONE parameterized PreToolUse wrapper that generalizes the shipped
1312
1312
  // `review-gate.sh` content-hash pattern into a reusable form. It reads the
1313
1313
  // PreToolUse stdin envelope, shells to `totem gate check --event <name>
1314
- // --payload <json>`, parses the emitted `GateVerdict`, and maps
1314
+ // --payload -` with the projected JSON on the child's stdin (never argv: a
1315
+ // Bash command can run to tens of kilobytes and win32 caps a command line at
1316
+ // 32,767 characters), parses the emitted `GateVerdict`, and maps
1315
1317
  // `disposition` → host exit code (ADR-109 §2). One wrapper, N gates: each
1316
1318
  // installed PreToolUse entry points at this same script with a different
1317
1319
  // `--event` arg baked into the `command` string, so new gates need no new
@@ -1359,10 +1361,14 @@ export const CLAUDE_GATE_WRAPPER = `// [totem] auto-generated — Claude Code ac
1359
1361
  //
1360
1362
  // Exit-code contract (LOAD-BEARING — ADR-109 §2; branch ONLY on disposition):
1361
1363
  // 0 = allow | warn | --pilot deny | NOT-APPLICABLE fail-soft
1362
- // (unparseable/non-object envelope, no-declared-subsystem pass-through)
1364
+ // (unparseable/non-object envelope; freeze-check with no declared
1365
+ // subsystem; transport-shield on a tool other than Bash/PowerShell or
1366
+ // with no non-empty string command)
1363
1367
  // 2 = deny (--strict, Claude block convention)
1364
1368
  // | APPLICABLE-gate-not-evaluable fail-closed (missing CLI, non-zero
1365
1369
  // \`gate check\`, unparseable verdict, or unknown disposition)
1370
+ // | an --event this wrapper has no payload projection for (a baked event
1371
+ // it cannot project is an applicable gate it cannot evaluate)
1366
1372
  'use strict';
1367
1373
 
1368
1374
  const { spawnSync } = require('child_process');
@@ -1418,38 +1424,78 @@ process.stdin.on('end', () => {
1418
1424
  const input =
1419
1425
  typeof parsed.tool_input === 'object' && parsed.tool_input !== null ? parsed.tool_input : {};
1420
1426
 
1421
- // ─── THE EMPTY-SUBSYSTEM GUARDRAIL ────────────────────────────────────
1422
- // freeze-check's predicate is on a DECLARED subsystem. A normal Edit/Write
1423
- // carries tool_input.file_path (a path), NOT a subsystem. With no declared
1424
- // subsystem, NO GATE APPLIES pass through (exit 0). Do NOT shell out — a
1425
- // blanket fail-closed here would block every ordinary edit.
1426
- const declaredSubsystem =
1427
- typeof input.subsystem === 'string' && input.subsystem.trim() !== ''
1428
- ? input.subsystem.trim()
1429
- : '';
1430
- if (declaredSubsystem === '') {
1431
- process.exit(0);
1427
+ // ─── PER-EVENT PAYLOAD PROJECTION ─────────────────────────────────────
1428
+ // Each gate reads a DIFFERENT slice of the PreToolUse envelope, so the
1429
+ // projection branches on the baked --event. Every branch owns its own
1430
+ // NOT-APPLICABLE test the point past which a gate genuinely applies and
1431
+ // any evaluation failure must fail CLOSED.
1432
+ //
1433
+ // event | applies when | payload
1434
+ // -----------------|----------------------------------|---------------------------
1435
+ // freeze-check | tool_input.subsystem is a | { subsystem }
1436
+ // | non-empty string |
1437
+ // transport-shield | tool_name is Bash or PowerShell | { tool, command, platform }
1438
+ // | AND tool_input.command is a |
1439
+ // | non-empty string |
1440
+ // (anything else) | — no projection → fail closed | —
1441
+ let payload = '';
1442
+
1443
+ if (event === 'freeze-check') {
1444
+ // THE EMPTY-SUBSYSTEM GUARDRAIL: freeze-check's predicate is on a DECLARED
1445
+ // subsystem. A normal Edit/Write carries tool_input.file_path (a path), NOT
1446
+ // a subsystem. With no declared subsystem, NO GATE APPLIES → pass through
1447
+ // (exit 0). Do NOT shell out — a blanket fail-closed here would block every
1448
+ // ordinary edit.
1449
+ const declaredSubsystem =
1450
+ typeof input.subsystem === 'string' && input.subsystem.trim() !== ''
1451
+ ? input.subsystem.trim()
1452
+ : '';
1453
+ if (declaredSubsystem === '') {
1454
+ process.exit(0);
1455
+ }
1456
+ payload = JSON.stringify({ subsystem: declaredSubsystem });
1457
+ } else if (event === 'transport-shield') {
1458
+ // transport-shield's predicate is on a SHELL COMMAND. Anything that is not
1459
+ // a Bash/PowerShell invocation carrying a command string is NOT an
1460
+ // applicable gate → pass through (exit 0), mirroring the guardrail above.
1461
+ // The installed matcher is the CLI's own, so a foreign tool_name here means
1462
+ // a hand-edited settings entry, not a shape to judge.
1463
+ const tool = parsed.tool_name;
1464
+ if (tool !== 'Bash' && tool !== 'PowerShell') {
1465
+ process.exit(0);
1466
+ }
1467
+ if (typeof input.command !== 'string' || input.command.trim() === '') {
1468
+ process.exit(0);
1469
+ }
1470
+ payload = JSON.stringify({
1471
+ tool: tool,
1472
+ command: input.command,
1473
+ platform: process.platform,
1474
+ });
1475
+ } else {
1476
+ // A baked --event this wrapper cannot project is an APPLICABLE gate it
1477
+ // cannot evaluate → fail closed (ADR-109). Reinstalling refreshes the
1478
+ // wrapper (\`totem gate install\` drift-repairs the bounded region).
1479
+ process.stderr.write(
1480
+ '[totem gate-wrapper] no payload projection for event "' + event + '"; failing closed.\\n',
1481
+ );
1482
+ process.exit(2);
1432
1483
  }
1433
1484
 
1434
- // A gate genuinely applies. Build the --payload from the declared fields.
1435
- // NOTE: this payload projection is freeze-check-shaped (subsystem-only). The
1436
- // wrapper is --event-parameterized, but the payload it builds is currently
1437
- // freeze-check-specific; a future gate needing a different payload field must
1438
- // extend this projection (e.g. branch on \`event\`).
1439
- const payload = JSON.stringify({ subsystem: declaredSubsystem });
1440
-
1441
1485
  // Resolve the LOCAL Totem CLI (the global \`totem\` binary may be stale and
1442
1486
  // missing deps — the known repo gotcha). Invoke node on the installed dist
1443
1487
  // entry.
1444
1488
  //
1445
- // FAIL-CLOSED on a missing CLI: we are PAST the empty-subsystem guardrail, so
1446
- // a gate genuinely APPLIES here. freeze-check has NO commit-time hard floor
1447
- // (unlike PreWriteShield, whose fail-soft is backed by \`totem-lint\` at
1448
- // commit), so an APPLICABLE gate that cannot be evaluated for ANY reason
1449
- // (missing CLI OR corrupt freeze.json) must fail closed not silently allow
1450
- // (guardrail rule + Tenet 4 fail-closed). Fail-SOFT (exit 0) is reserved for
1451
- // genuinely NOT-APPLICABLE inputs (unparseable/non-object envelope, no
1452
- // declared subsystem), all of which already returned above.
1489
+ // FAIL-CLOSED on a missing CLI: we are PAST the per-event applicability
1490
+ // guardrail (freeze-check: a declared subsystem; transport-shield: a Bash or
1491
+ // PowerShell command), so a gate genuinely APPLIES here. Neither gate has a
1492
+ // commit-time hard floor (unlike PreWriteShield, whose fail-soft is backed by
1493
+ // \`totem-lint\` at commit), so an APPLICABLE gate that cannot be evaluated
1494
+ // for ANY reason (missing CLI OR a broken source) must fail closed not
1495
+ // silently allow (guardrail rule + Tenet 4 fail-closed). Fail-SOFT (exit 0)
1496
+ // is reserved for genuinely NOT-APPLICABLE inputs (unparseable/non-object
1497
+ // envelope, no declared subsystem, no shell command), all of which already
1498
+ // returned above.
1453
1499
  const cliPath = join(process.cwd(), 'node_modules', '@mmnto', 'cli', 'dist', 'index.js');
1454
1500
  if (!existsSync(cliPath)) {
1455
1501
  process.stderr.write(
@@ -1461,18 +1507,24 @@ process.stdin.on('end', () => {
1461
1507
  process.exit(2);
1462
1508
  }
1463
1509
 
1510
+ // The payload rides on the child's STDIN (\`--payload -\`), never argv: a Bash
1511
+ // command can run to tens of kilobytes and win32 caps a command line at
1512
+ // 32,767 characters — an argv payload past it fails the spawn with
1513
+ // ENAMETOOLONG and would land in the fail-closed arm below with nothing
1514
+ // broken (mmnto-ai/totem#2799, pass 3).
1464
1515
  const result = spawnSync(
1465
1516
  process.execPath,
1466
- [cliPath, 'gate', 'check', '--event', event, '--payload', payload],
1467
- { encoding: 'utf-8', timeout: 30000 },
1517
+ [cliPath, 'gate', 'check', '--event', event, '--payload', '-'],
1518
+ { encoding: 'utf-8', timeout: 30000, input: payload },
1468
1519
  );
1469
1520
 
1470
1521
  // ─── FAIL-CLOSED ──────────────────────────────────────────────────────
1471
- // A gate genuinely applies (a declared subsystem was present) and the
1472
- // evaluation itself failed (non-zero exit: corrupt freeze.json, spawn
1473
- // error, etc.). Never silently allow when an applicable gate's source is
1474
- // broken exit 2. (No-declared-subsystem already returned exit 0 above,
1475
- // so this only blocks when a subsystem was actually declared.)
1522
+ // A gate genuinely applies (the per-event projection above found its input:
1523
+ // a declared subsystem, or a Bash/PowerShell command) and the evaluation
1524
+ // itself failed (non-zero exit: corrupt freeze.json, an invalid payload,
1525
+ // spawn error, etc.). Never silently allow when an applicable gate's source
1526
+ // is broken exit 2. (Not-applicable envelopes already returned exit 0
1527
+ // above, so this only blocks when the gate's input was actually present.)
1476
1528
  if (result.error || typeof result.status !== 'number' || result.status !== 0) {
1477
1529
  process.stderr.write(
1478
1530
  '[totem gate-wrapper] gate "' +
@@ -1523,21 +1575,28 @@ process.stdin.on('end', () => {
1523
1575
  });
1524
1576
  ${TOTEM_FILE_END}
1525
1577
  `;
1526
- // The PreToolUse entry constant for the freeze-check gate. The \`--event\`
1527
- // is baked into the command string per-entry (one wrapper, N gates = N
1528
- // entries pointing at the same script with different --event args).
1529
- // Matches the \`Write|Edit\` matcher so the wrapper sees every write the
1530
- // empty-subsystem guardrail (in the wrapper) is what keeps ordinary edits
1531
- // passing through. Installed into committed \`.claude/settings.json\`
1532
- // (team-level governance gate opt-in is repo policy, Tenet 12).
1578
+ // The PreToolUse entry constant for the freeze-check gate the EXEMPLAR of the
1579
+ // installed shape, not a template every gate is stamped from. The \`--event\` is
1580
+ // baked into the command string per-entry (one wrapper, N gates = N entries
1581
+ // pointing at the same script with different --event args).
1582
+ //
1583
+ // SOURCE OF TRUTH for the MATCHER is the core gate registry
1584
+ // (mmnto-ai/totem#2799): \`knownGates()\` carries each gate's own matcher, the
1585
+ // caller resolves it, and \`gateEntry()\` writes THAT — freeze-check under
1586
+ // \`Write|Edit\` (so the wrapper sees every write; the empty-subsystem guardrail
1587
+ // is what keeps ordinary edits passing through), transport-shield under
1588
+ // \`Bash|PowerShell\`. This constant stays the \`Write|Edit\` freeze-check
1589
+ // exemplar and is never consulted for another gate's matcher.
1533
1590
  //
1534
1591
  // SOURCE OF TRUTH for the ACTUAL installed command is
1535
1592
  // gate-install.ts \`gateCommand(event, tier)\` — it builds the per-gate,
1536
1593
  // per-tier string at install time. This constant supplies ONLY the canonical
1537
- // \`matcher\` and hook \`type\` (the fields \`gateEntry()\` reads); its \`command\`
1538
- // here mirrors the DEFAULT install (freeze-check at the default \`--strict\`
1539
- // tier) so a reader sees exactly what a default \`totem gate install\` bakes,
1540
- // not a tier-less never-installed string.
1594
+ // hook \`type\` (the one field \`gateEntry()\` still reads); its \`matcher\` and
1595
+ // \`command\` here mirror the DEFAULT freeze-check install (at the default
1596
+ // \`--strict\` tier) so a reader sees exactly what a default
1597
+ // \`totem gate install freeze-check\` bakes, not a tier-less never-installed
1598
+ // string. Installed into committed \`.claude/settings.json\` (team-level
1599
+ // governance — gate opt-in is repo policy, Tenet 12).
1541
1600
  export const CLAUDE_GATE_WRAPPER_ENTRY = {
1542
1601
  matcher: 'Write|Edit',
1543
1602
  hooks: [
@@ -1 +1 @@
1
- {"version":3,"file":"init-templates.js","sourceRoot":"","sources":["../../src/commands/init-templates.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,qEAAqE;AAMrE,6DAA6D;AAC7D,+EAA+E;AAC/E,sEAAsE;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,0CAA0C,CAAC;AAE1E,MAAM,CAAC,MAAM,eAAe,GAAG;EAC7B,YAAY;8BACgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAE9D,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAchE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAmDpF;AAgCD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAK9E;AAED,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;8EAG0E;IAC1E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;wEAGoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;oEAEgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;mEAG+D;IAC/D,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA02BhB"}
@@ -1604,18 +1604,22 @@ export default {
1604
1604
  // --- Always run: action-gate install (--gates=, PR-C mmnto-ai/totem#2048) ---
1605
1605
  // Thin sugar that is INTENTIONALLY outside the bare-mode branch: gate
1606
1606
  // opt-in is an independent, explicit flag (it works in bare repos too).
1607
- // Parses the comma-list (or `all`), validates each member against
1608
- // knownGateEvents() (fail loud on unknown), and routes through the SAME
1609
- // installGates() path the `gate install` verb uses no second copy of
1610
- // the merge logic.
1607
+ // Parses the comma-list (or `all`), resolves each member against the core
1608
+ // registry via resolveGates() (fail loud on unknown; the gate's PreToolUse
1609
+ // matcher comes back with it), and routes through the SAME installGates()
1610
+ // path the `gate install` verb uses — no second copy of the merge logic.
1611
1611
  if (options?.gates) {
1612
- const { resolveGateEvents } = await import('./gate.js');
1612
+ const { resolveGates } = await import('./gate.js');
1613
1613
  const { installGates } = await import('./gate-install.js');
1614
1614
  const { TotemError, knownGateEvents } = await import('@mmnto/totem');
1615
1615
  const requested = options.gates.trim();
1616
- let gateEvents;
1616
+ // `{ event, matcher }` pairs, resolved through the core registry by
1617
+ // `resolveGates` — the same source `gate install` reads, so init can never
1618
+ // install a gate under a matcher the registry does not declare
1619
+ // (mmnto-ai/totem#2799).
1620
+ let gates;
1617
1621
  if (requested.toLowerCase() === 'all') {
1618
- gateEvents = await resolveGateEvents({ all: true });
1622
+ gates = [...(await resolveGates({ all: true }))];
1619
1623
  }
1620
1624
  else {
1621
1625
  const names = requested
@@ -1624,30 +1628,30 @@ export default {
1624
1628
  .filter((n) => n.length > 0);
1625
1629
  // Empty after parse/trim/filter (e.g. `--gates=,` or whitespace-only):
1626
1630
  // fail loud rather than scaffolding an orphan wrapper with no entry.
1627
- // Restores parity with the verb's resolveGateEvents no-selection
1628
- // fail-loud (no default-install).
1631
+ // Restores parity with the verb's resolveGates no-selection fail-loud
1632
+ // (no default-install).
1629
1633
  if (names.length === 0) {
1630
1634
  throw new TotemError('GATE_INVALID', 'No gate selected in --gates=.', `Pass --gates=all or one of: ${knownGateEvents().join(', ')}.`);
1631
1635
  }
1632
- gateEvents = [];
1636
+ gates = [];
1633
1637
  for (const name of names) {
1634
- // resolveGateEvents validates a single name against the registry
1635
- // and throws (fail-loud) on unknown — no default-install.
1636
- const [validated] = await resolveGateEvents({ name });
1637
- // resolveGateEvents returns a non-empty array or throws, so this
1638
+ // resolveGates validates a single name against the registry and
1639
+ // throws (fail-loud) on unknown — no default-install.
1640
+ const [validated] = await resolveGates({ name });
1641
+ // resolveGates returns a non-empty array or throws, so this
1638
1642
  // never fires today — but guard explicitly (no fragile `!`): fail
1639
1643
  // loud rather than push `undefined` if it ever returns empty.
1640
1644
  if (!validated) {
1641
1645
  throw new TotemError('GATE_INVALID', `Gate "${name}" did not resolve.`, 'This is an internal error — the gate registry returned no event for a validated name.');
1642
1646
  }
1643
- gateEvents.push(validated);
1647
+ gates.push(validated);
1644
1648
  }
1645
1649
  }
1646
1650
  // Tier is derived from the existing init options (pilot vs strict) and
1647
1651
  // BAKED into the installed command at install time (the wrapper reads it
1648
1652
  // ONLY from argv — no env override). Default install bakes --strict.
1649
1653
  const gateTier = options?.pilot ? 'pilot' : 'strict';
1650
- const gateResults = installGates(cwd, gateEvents, gateTier);
1654
+ const gateResults = installGates(cwd, gates, gateTier);
1651
1655
  for (const result of gateResults) {
1652
1656
  if (result.err) {
1653
1657
  log.error('Totem Error', `Gate install failed for ${result.file}: ${result.err}`);