code-ai-installer 4.0.1-b → 4.0.1-c

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 (128) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -5
  3. package/dist/catalog.js +1 -1
  4. package/dist/contentTransformer.d.ts +1 -1
  5. package/dist/contentTransformer.js +39 -0
  6. package/dist/index.js +10 -5
  7. package/dist/mcp/cli.js +4 -4
  8. package/dist/mcp/scorecard.d.ts +2 -2
  9. package/dist/mcp/task_state.d.ts +2 -2
  10. package/dist/mcp/tools/advance_gate.js +1 -1
  11. package/dist/mcp/tools/classify_gate.d.ts +2 -2
  12. package/dist/mcp/tools/classify_gate.js +2 -2
  13. package/dist/mcp/tools/load_role.d.ts +2 -2
  14. package/dist/mcp/tools/load_role.js +2 -2
  15. package/dist/mcp/tools/report_exception.d.ts +3 -3
  16. package/dist/mcp/tools/report_exception.js +4 -4
  17. package/dist/mcp/tools/request_decision.d.ts +3 -3
  18. package/dist/mcp/tools/request_decision.js +5 -5
  19. package/dist/mcp/tools/review_proposal.d.ts +1 -1
  20. package/dist/mcp/tools/review_proposal.js +6 -6
  21. package/dist/mcp/tools/sign_off.d.ts +2 -2
  22. package/dist/mcp/tools/sign_off.js +7 -7
  23. package/dist/mcp/tools/verify_claim.d.ts +1 -1
  24. package/dist/mcp/tools/verify_claim.js +1 -1
  25. package/dist/mcp_setup.d.ts +84 -31
  26. package/dist/mcp_setup.js +182 -66
  27. package/dist/platforms/adapters.js +54 -19
  28. package/dist/shared/frontmatter.js +1 -1
  29. package/dist/shared/persona.d.ts +1 -1
  30. package/dist/shared/persona.js +1 -1
  31. package/dist/shared/pipeline.d.ts +10 -10
  32. package/dist/shared/pipeline.js +7 -7
  33. package/dist/shared/tools.d.ts +15 -15
  34. package/dist/shared/tools.js +3 -3
  35. package/dist/shared/vocabulary.d.ts +4 -4
  36. package/dist/shared/vocabulary.js +4 -4
  37. package/dist/types.d.ts +1 -1
  38. package/domains/analytics/.agents/workflows/analytics-pipeline-rules.md +13 -3
  39. package/domains/analytics/.agents/workflows/analyze.md +1 -0
  40. package/domains/analytics/.agents/workflows/quick-insight.md +1 -0
  41. package/domains/analytics/locales/en/.agents/workflows/analytics-pipeline-rules.md +13 -3
  42. package/domains/analytics/locales/en/.agents/workflows/analyze.md +1 -0
  43. package/domains/analytics/locales/en/.agents/workflows/quick-insight.md +1 -0
  44. package/domains/analytics/locales/en/agents/interviewer.md +2 -1
  45. package/domains/analytics/locales/en/agents/layouter.md +2 -1
  46. package/domains/analytics/locales/en/agents/mediator.md +2 -1
  47. package/domains/analytics/locales/en/agents/researcher.md +2 -1
  48. package/domains/analytics/locales/en/agents/strategist.md +2 -1
  49. package/domains/analytics/pipeline.yaml +10 -10
  50. package/domains/content/.agents/skills/content-release-gate/SKILL.md +3 -5
  51. package/domains/content/.agents/workflows/content-pipeline-rules.md +14 -11
  52. package/domains/content/.agents/workflows/edit-content.md +0 -1
  53. package/domains/content/.agents/workflows/quick-post.md +0 -1
  54. package/domains/content/.agents/workflows/start-content.md +0 -1
  55. package/domains/content/agents/conductor.md +1 -2
  56. package/domains/content/locales/en/.agents/skills/content-release-gate/SKILL.md +3 -5
  57. package/domains/content/locales/en/.agents/workflows/content-pipeline-rules.md +14 -11
  58. package/domains/content/locales/en/.agents/workflows/edit-content.md +0 -1
  59. package/domains/content/locales/en/.agents/workflows/quick-post.md +0 -1
  60. package/domains/content/locales/en/.agents/workflows/start-content.md +0 -1
  61. package/domains/content/locales/en/agents/conductor.md +1 -2
  62. package/domains/content/pipeline.yaml +8 -8
  63. package/domains/development/.agents/skills/handoff/SKILL.md +276 -276
  64. package/domains/development/.agents/skills/lava-flow-legacy-detection/SKILL.md +197 -197
  65. package/domains/development/.agents/skills/mcp-integration/SKILL.md +211 -211
  66. package/domains/development/.agents/skills/qa-test-data-management/SKILL.md +250 -250
  67. package/domains/development/.agents/workflows/bugfix.md +16 -82
  68. package/domains/development/.agents/workflows/hotfix.md +16 -66
  69. package/domains/development/.agents/workflows/pipeline-rules.md +49 -132
  70. package/domains/development/.agents/workflows/start-task.md +17 -121
  71. package/domains/development/AGENTS.md +8 -3
  72. package/domains/development/agents/architect.md +247 -247
  73. package/domains/development/agents/conductor.md +363 -363
  74. package/domains/development/agents/devops.md +297 -297
  75. package/domains/development/agents/reviewer.md +293 -293
  76. package/domains/development/agents/senior_full_stack.md +295 -295
  77. package/domains/development/agents/tester.md +395 -395
  78. package/domains/development/locales/en/.agents/skills/handoff/SKILL.md +276 -276
  79. package/domains/development/locales/en/.agents/skills/lava-flow-legacy-detection/SKILL.md +197 -197
  80. package/domains/development/locales/en/.agents/skills/mcp-integration/SKILL.md +211 -211
  81. package/domains/development/locales/en/.agents/skills/qa-test-data-management/SKILL.md +250 -250
  82. package/domains/development/locales/en/.agents/workflows/bugfix.md +16 -82
  83. package/domains/development/locales/en/.agents/workflows/hotfix.md +15 -65
  84. package/domains/development/locales/en/.agents/workflows/pipeline-rules.md +48 -131
  85. package/domains/development/locales/en/.agents/workflows/start-task.md +17 -121
  86. package/domains/development/locales/en/AGENTS.md +15 -0
  87. package/domains/development/locales/en/agents/architect.md +247 -247
  88. package/domains/development/locales/en/agents/conductor.md +363 -363
  89. package/domains/development/locales/en/agents/devops.md +297 -297
  90. package/domains/development/locales/en/agents/reviewer.md +293 -293
  91. package/domains/development/locales/en/agents/senior_full_stack.md +295 -295
  92. package/domains/development/locales/en/agents/tester.md +395 -395
  93. package/domains/development/locales/en/prompt-examples.md +34 -120
  94. package/domains/development/pipeline.yaml +150 -135
  95. package/domains/development/prompt-examples.md +33 -119
  96. package/domains/product/.agents/workflows/product-pipeline-rules.md +13 -2
  97. package/domains/product/.agents/workflows/quick-pm.md +1 -1
  98. package/domains/product/.agents/workflows/shape-prioritize.md +1 -0
  99. package/domains/product/.agents/workflows/ship-right-thing.md +1 -0
  100. package/domains/product/.agents/workflows/spec.md +1 -0
  101. package/domains/product/agents/tech_lead.md +1 -1
  102. package/domains/product/locales/en/.agents/workflows/product-pipeline-rules.md +13 -2
  103. package/domains/product/locales/en/.agents/workflows/quick-pm.md +1 -1
  104. package/domains/product/locales/en/.agents/workflows/shape-prioritize.md +1 -0
  105. package/domains/product/locales/en/.agents/workflows/ship-right-thing.md +1 -0
  106. package/domains/product/locales/en/.agents/workflows/spec.md +1 -0
  107. package/domains/product/locales/en/agents/conductor.md +2 -2
  108. package/domains/product/locales/en/agents/data_analyst.md +2 -1
  109. package/domains/product/locales/en/agents/designer.md +2 -1
  110. package/domains/product/locales/en/agents/discovery.md +2 -1
  111. package/domains/product/locales/en/agents/layouter.md +2 -1
  112. package/domains/product/locales/en/agents/mediator.md +2 -1
  113. package/domains/product/locales/en/agents/pm.md +2 -1
  114. package/domains/product/locales/en/agents/product_strategist.md +2 -1
  115. package/domains/product/locales/en/agents/tech_lead.md +3 -2
  116. package/domains/product/locales/en/agents/ux_designer.md +2 -1
  117. package/domains/product/pipeline.yaml +12 -12
  118. package/package.json +5 -5
  119. package/domains/analytics/CONTEXT.md +0 -25
  120. package/domains/analytics/locales/en/CONTEXT.md +0 -25
  121. package/domains/content/CONTEXT.md +0 -19
  122. package/domains/content/locales/en/CONTEXT.md +0 -19
  123. package/domains/development/.agents/workflows/auto-restart-containers.md +0 -56
  124. package/domains/development/CONTEXT.md +0 -62
  125. package/domains/development/locales/en/.agents/workflows/auto-restart-containers.md +0 -24
  126. package/domains/development/locales/en/CONTEXT.md +0 -62
  127. package/domains/product/CONTEXT.md +0 -40
  128. package/domains/product/locales/en/CONTEXT.md +0 -40
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Denis Harchenko
3
+ Copyright (c) 2026 Denish1209
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  **Code-AI Installer** ships two things in one npm package:
13
13
 
14
14
  1. **`code-ai`** — a production-ready CLI that injects your `.agents/`, `.agents/skills/`, and `.agents/workflows/` into the exact environment layout each AI tool expects. Author your agentic pipelines once, deploy them to Copilot, Codex, Claude, Qwen, Kimi, or Google Antigravity.
15
- 2. **`code-ai-mcp`** — a bundled MCP (Model Context Protocol) server that turns those agents and skills into a **governed, gate-by-gate pipeline**: each stage produces an artifact, gets classified, and waits for a human sign-off before the next stage runs. Auto-registered for Claude via `.mcp.json`.
15
+ 2. **`code-ai-mcp`** — a bundled MCP (Model Context Protocol) server that turns those agents and skills into a **governed, gate-by-gate pipeline**: each stage produces an artifact, gets classified, and waits for a human sign-off before the next stage runs. Auto-registered for Claude in your global (user-scope) MCP config.
16
16
 
17
17
  > The agents, the skills, and the MCP server are one product: the agents assume the MCP gate tools exist, and the MCP server assumes the installer registered it. `npm install -g code-ai-installer` brings the whole thing.
18
18
 
@@ -21,7 +21,7 @@
21
21
  ## ✨ Features
22
22
 
23
23
  - 🚪 **Gate-based pipeline** — agents don't free-run. Work advances through ordered gates (classify → produce → human sign-off → advance), enforced by the MCP server's state machine, with a circuit breaker on repeated rollbacks.
24
- - 🧰 **Bundled MCP server** — `code-ai-mcp` exposes 31 tools (gate machine, skill fetch with telemetry, artifact/decision log, audit + action tools). Auto-wired into Claude's `.mcp.json` at install time.
24
+ - 🧰 **Bundled MCP server** — `code-ai-mcp` exposes 31 tools (gate machine, skill fetch with telemetry, artifact/decision log, audit + action tools). Auto-registered in Claude's global (user-scope) MCP config at install time, available across all your projects.
25
25
  - 🔭 **Self-improving Auditor** — a meta-agent reads aggregate run metrics after ≥3 completed runs and *proposes* (never forces) tweaks to skills/agents; the human approves.
26
26
  - 🚀 **Interactive wizard** — pick target, domain, agents, and skills from a guided CLI.
27
27
  - 🌍 **Multi-AI support** — adapts instructions, reasoning hints, and file layout for Copilot, GPT Codex, Claude, Qwen 3.5, Moonshot Kimi, and Google Antigravity.
@@ -48,7 +48,7 @@ Every domain also carries a meta **Auditor** beside the pipeline. Each skill dec
48
48
 
49
49
  ## 🚪 The MCP Gate Pipeline
50
50
 
51
- When you install for **Claude**, the installer registers `code-ai-mcp` in your project's `.mcp.json`. From then on, the agents drive the work *through the server*, not by free-form prompting:
51
+ When you install for **Claude**, the installer registers `code-ai-mcp` in your global (user-scope) Claude config via `claude mcp add --scope user` (idempotent — a server already present in user scope is left untouched). From then on, the agents drive the work *through the server*, not by free-form prompting:
52
52
 
53
53
  1. **`current_gate` / `classify_gate`** — the conductor reads where the run is and classifies the gate outcome (`auto_resolve` / `fork` / `exception`).
54
54
  2. **`get_skill`** — the active role fetches the skills it owns at this gate (the fetch is logged as telemetry for the Auditor).
@@ -151,7 +151,7 @@ Depending on `--target`, `code-ai` restructures your project:
151
151
  1. **Orchestration entry** — `AGENTS.md` (plus tool aliases like `CLAUDE.md`, `CODEX.md`, `GEMINI.md`, `QWEN.md`, `KIMI.md`).
152
152
  2. **Agents** — roles copied into the target's layout (e.g. `.claude/agents/<role>.md`, `.github/copilot-instructions.md`).
153
153
  3. **Skills & workflows** — the execution skillsets, with per-tool metadata sidecars.
154
- 4. **MCP wiring (Claude only)** — `.mcp.json` registering `code-ai-mcp` (run as `npx -p code-ai-installer code-ai-mcp`), plus an optional [MemPalace](https://www.npmjs.com/package/mempalace) memory server when present, and a `.code-ai/config.json` that records the active domain and decision-store backend.
154
+ 4. **MCP wiring (Claude only)** — registers `code-ai-mcp` (run as `npx -p code-ai-installer code-ai-mcp`) in your global (user-scope) Claude config via `claude mcp add --scope user`, plus an optional [MemPalace](https://www.npmjs.com/package/mempalace) memory server when present, and a project-local `.code-ai/config.json` that records the active domain and decision-store backend. If the `claude` CLI isn't on PATH, the installer prints the exact commands to run instead of editing your config by hand.
155
155
 
156
156
  ---
157
157
 
@@ -159,7 +159,7 @@ Depending on `--target`, `code-ai` restructures your project:
159
159
 
160
160
  `code-ai-installer` is on **v4.0.0**.
161
161
 
162
- - **v4.0.0** — consolidated the previously separate `code-ai-mcp` and types packages into this single package with **two bins** (`code-ai` + `code-ai-mcp`). Installing the CLI now also delivers the MCP server; for Claude it is auto-registered in `.mcp.json`. Existing 3.x CLI behavior is unchanged.
162
+ - **v4.0.0** — consolidated the previously separate `code-ai-mcp` and types packages into this single package with **two bins** (`code-ai` + `code-ai-mcp`). Installing the CLI now also delivers the MCP server; for Claude it is auto-registered in your global (user-scope) MCP config. Existing 3.x CLI behavior is unchanged.
163
163
  - **v3.0.0 (breaking)** — removed the legacy flat root layout (`AGENTS.md` + `agents/` + `.agents/` at package root); the CLI now reads exclusively from `domains/<id>/`. **Migrating from v2.x:** add `--domain <development|content|analytics|product>` to every CLI call. If you used a custom `--project-dir`, restructure it to `domains/<id>/` instead of a flat layout.
164
164
 
165
165
  ---
package/dist/catalog.js CHANGED
@@ -159,7 +159,7 @@ async function mapWorkflowFiles(workflowsDir) {
159
159
  /**
160
160
  * Known root-level extra files to include in install.
161
161
  */
162
- const EXTRA_FILE_NAMES = ["prompt-examples.md", "CONTEXT.md"];
162
+ const EXTRA_FILE_NAMES = ["prompt-examples.md"];
163
163
  /**
164
164
  * Maps optional root-level extra files for installation.
165
165
  * @param projectDir Absolute project root path.
@@ -6,4 +6,4 @@ import type { TargetId } from "./types.js";
6
6
  * @param assetType Installed asset type.
7
7
  * @returns Target-normalized markdown content.
8
8
  */
9
- export declare function transformContentForTarget(input: string, target: TargetId, assetType: "orchestrator" | "agent" | "skill"): string;
9
+ export declare function transformContentForTarget(input: string, target: TargetId, assetType: "orchestrator" | "agent" | "skill" | "workflow"): string;
@@ -1,4 +1,36 @@
1
1
  const hintRegex = /<!--\s*(codex|copilot|claude|qwen|gemini|kimi)\s*:\s*([\s\S]*?)-->\s*\n?/gi;
2
+ /**
3
+ * Per-target tool-vocabulary map, applied to workflow files only. Source files
4
+ * use the Codex/Antigravity tool names; each target gets its native equivalents.
5
+ * Only unambiguous 1:1 tool-name renames live here — conceptual terms
6
+ * (notify_user, ShouldAutoProceed) are handled in the content rewrite, not
7
+ * mechanically substituted. Targets without an entry keep the source names.
8
+ */
9
+ const WORKFLOW_TOOL_VOCABULARY = {
10
+ claude: {
11
+ view_file: "Read",
12
+ write_to_file: "Write",
13
+ replace_file_content: "Edit",
14
+ },
15
+ };
16
+ /**
17
+ * Substitutes tool-name tokens for the target using WORKFLOW_TOOL_VOCABULARY,
18
+ * matching whole words only so substrings are never mangled.
19
+ * @param content Normalized workflow content.
20
+ * @param target Destination target id.
21
+ * @returns Content with target-native tool names.
22
+ */
23
+ function applyToolVocabulary(content, target) {
24
+ const map = WORKFLOW_TOOL_VOCABULARY[target];
25
+ if (!map) {
26
+ return content;
27
+ }
28
+ let out = content;
29
+ for (const [from, to] of Object.entries(map)) {
30
+ out = out.replace(new RegExp(`\\b${from}\\b`, "g"), to);
31
+ }
32
+ return out;
33
+ }
2
34
  /**
3
35
  * Transforms markdown content for selected AI target.
4
36
  * @param input Original file content.
@@ -8,6 +40,13 @@ const hintRegex = /<!--\s*(codex|copilot|claude|qwen|gemini|kimi)\s*:\s*([\s\S]*
8
40
  */
9
41
  export function transformContentForTarget(input, target, assetType) {
10
42
  const normalizedInput = stripBom(input).replace(/\r\n/g, "\n");
43
+ // Workflow files become user-facing slash commands / reference docs: emit no
44
+ // provenance marker or model hint (keep them clean) — only adapt the tool
45
+ // vocabulary for the target.
46
+ if (assetType === "workflow") {
47
+ const adapted = applyToolVocabulary(normalizedInput.trimStart(), target);
48
+ return adapted.endsWith("\n") ? adapted : `${adapted}\n`;
49
+ }
11
50
  const parsedHints = [];
12
51
  const foundHints = new Set();
13
52
  const cleaned = normalizedInput.replace(hintRegex, (_match, model, payload) => {
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { listDomains, resolveDomainSourceRoot, normalizeDomain, resolveDomainAwa
9
9
  import { runDoctor } from "./doctor.js";
10
10
  import { runInstall, runUninstall } from "./installer.js";
11
11
  import { error, info, success, warn } from "./logger.js";
12
- import { setupMcp } from "./mcp_setup.js";
12
+ import { setupMcp, teardownMcp } from "./mcp_setup.js";
13
13
  import { getPlatformAdapters } from "./platforms/adapters.js";
14
14
  import { resolveSourceRoot } from "./sourceResolver.js";
15
15
  import { printBanner } from "./banner.js";
@@ -42,7 +42,7 @@ const WIZARD_TEXT = {
42
42
  doctorFailed: "Doctor checks failed. Fix issues and run again.",
43
43
  dryRunMode: "Preview mode selected (no file writes).",
44
44
  previewCompleted: "Preview completed.",
45
- mempalaceUsePrompt: "Use MemPalace for long-term decision memory? Recommended — installer will install MemPalace (via uv/pipx/pip) and register it in .mcp.json.",
45
+ mempalaceUsePrompt: "Use MemPalace for long-term decision memory? Recommended — installer will install MemPalace (via uv/pipx/pip) and register it in your global (user-scope) MCP config.",
46
46
  mempalaceSetupHeader: "MCP auto-setup for Claude Code:",
47
47
  },
48
48
  ru: {
@@ -69,7 +69,7 @@ const WIZARD_TEXT = {
69
69
  doctorFailed: "Doctor не пройден. Исправь ошибки и запусти снова.",
70
70
  dryRunMode: "Выбран preview-режим без записи файлов.",
71
71
  previewCompleted: "Preview completed.",
72
- mempalaceUsePrompt: "Использовать MemPalace для долгосрочной памяти решений? (рекомендуется — установщик поставит MemPalace через uv/pipx/pip и зарегистрирует в .mcp.json)",
72
+ mempalaceUsePrompt: "Использовать MemPalace для долгосрочной памяти решений? (рекомендуется — установщик поставит MemPalace через uv/pipx/pip и зарегистрирует в глобальном (user-scope) MCP-конфиге)",
73
73
  mempalaceSetupHeader: "Авто-настройка MCP для Claude Code:",
74
74
  },
75
75
  };
@@ -228,7 +228,7 @@ program
228
228
  });
229
229
  for (const notice of report.notices)
230
230
  info(` ${notice}`);
231
- info(` .mcp.json: ${report.mcpJsonAction} at ${report.mcpJsonPath}`);
231
+ info(` MCP (${report.registration}): registered [${report.serversRegistered.join(", ") || "—"}], already present [${report.serversAlreadyPresent.join(", ") || "—"}]`);
232
232
  info(` .code-ai/config.json: written at ${report.configPath} (decision_store=${report.mempalaceUsed ? "mempalace" : "jsonl"})`);
233
233
  }
234
234
  if (dryRun) {
@@ -262,6 +262,11 @@ program
262
262
  const result = await runUninstall(destinationDir, target, dryRun, domainId);
263
263
  info(`Files removed/planned: ${result.removed.length}`);
264
264
  info(`Files missing: ${result.missing.length}`);
265
+ if (target === "claude") {
266
+ const teardown = await teardownMcp({ dryRun });
267
+ for (const notice of teardown.notices)
268
+ info(` ${notice}`);
269
+ }
265
270
  if (dryRun) {
266
271
  success("Uninstall dry-run completed.");
267
272
  }
@@ -489,7 +494,7 @@ async function runInteractiveWizard() {
489
494
  });
490
495
  for (const notice of report.notices)
491
496
  info(` ${notice}`);
492
- info(` .mcp.json: ${report.mcpJsonAction} at ${report.mcpJsonPath}`);
497
+ info(` MCP (${report.registration}): registered [${report.serversRegistered.join(", ") || "—"}], already present [${report.serversAlreadyPresent.join(", ") || "—"}]`);
493
498
  info(` .code-ai/config.json: written at ${report.configPath} (decision_store=${report.mempalaceUsed ? "mempalace" : "jsonl"})`);
494
499
  }
495
500
  success("Install completed.");
package/dist/mcp/cli.js CHANGED
@@ -27,15 +27,15 @@ const TOOL_DESCRIPTIONS = {
27
27
  load_role: "Load an agent role: frontmatter, body, merged persona, and the role's skill list. Use at SessionStart for an agent.",
28
28
  list_skills: "List skills in a domain. Optional filters: type, gate, tech, topic, owner.",
29
29
  get_skill: "Fetch a skill's frontmatter + body by name. Pass task_id (+ optional gate) to log the fetch as a skill invocation for Auditor telemetry; omit for plain lookups.",
30
- request_decision: "Open a pending decision envelope. Returns a synthetic ADR-PENDING id; Claude relays the question to DEN in chat, then commits the answer via record_decision.",
30
+ request_decision: "Open a pending decision envelope. Returns a synthetic ADR-PENDING id; Claude relays the question to the user in chat, then commits the answer via record_decision.",
31
31
  record_decision: "Commit a chosen decision: writes ADR file, decision log entry, and KG triple. Resets the circuit breaker on new ARCH ADR.",
32
32
  classify_gate: "Record the current gate's classification (auto_resolve / fork / exception) with a rationale.",
33
33
  advance_gate: "Advance task from from_gate to to_gate after sign-off. Enforces gate sequence; trips the circuit breaker on dev_rollback_count threshold.",
34
34
  current_gate: "Return the task's current gate, allowed tools, and required handoff fields. Auto-creates task state on first touch.",
35
- sign_off: "Record a sign-off event for the current gate. Validates signer against the gate's sign_off_policy (den / mcp_auto_pass / either).",
35
+ sign_off: "Record a sign-off event for the current gate. Validates signer against the gate's sign_off_policy (user / mcp_auto_pass / either).",
36
36
  submit_artifact: "Write an artifact (skill / role / ADR / handoff / diary / working_report / plan / spec). Enforces line caps + frontmatter validation + path safety.",
37
37
  verify_claim: "Verify a code-checkable claim. Wired: owners_present, no_orphan_skills, vocab_valid. Pending Phase 2: tests_pass, build_succeeds, lint_clean, custom.",
38
- report_exception: "Append an exception record for DEN review (gate failed, breakdown of errors, optional evidence).",
38
+ report_exception: "Append an exception record for the user review (gate failed, breakdown of errors, optional evidence).",
39
39
  get_artifact: "Fetch a previously-submitted artifact by (task_id, gate). format: raw or summary.",
40
40
  list_artifacts: "List artifacts indexed for a task.",
41
41
  audit_trail: "Reconstruct the timeline of events for a task: classifications, sign-offs, decisions, artifacts, exceptions. Sorted by timestamp.",
@@ -47,7 +47,7 @@ const TOOL_DESCRIPTIONS = {
47
47
  aggregate_run_metrics: "Aggregate completed-run scorecards from the local audit ledger (.code-ai/state/audit/runs.jsonl) into deterministic per-agent (gate→role), per-workflow (mode), and per-skill (invocation frequency) statistics. min_runs (default 3) guards small samples. Read-only; the Auditor's data foundation — numbers only, no judgment.",
48
48
  propose_change: "Record an Auditor proposal (a draft change to an agent/skill) as a pending entry in the local proposal store (.code-ai/state/audit/proposals.jsonl). Carries change_kind (edit_minor/add_asset/destructive → risk tier), rationale, evidence, threshold_met, and the inline draft. Pure surfacing — writes nothing to the asset; inert until approved/applied (item 4b).",
49
49
  list_proposals: "List stored Auditor proposals, newest first, with optional filters (status / risk / domain). Read-only.",
50
- review_proposal: "Authorize a proposal status transition (approve/reject a pending one; mark an approved one applied) and get a mandatory report. Enforces the autonomy matrix + .code-ai/config.json approval gate: decided_by='auditor_auto' may approve only low/additive AND only when the gate is OFF; destructive (high) and gate-ON always require den. Auto-adding a new skill also runs an additive-dedup guard — if it overlaps an existing skill it is routed to den, not auto-added. Authorization only — the byte write into the asset is a separate submit_artifact/edit step (see next_step).",
50
+ review_proposal: "Authorize a proposal status transition (approve/reject a pending one; mark an approved one applied) and get a mandatory report. Enforces the autonomy matrix + .code-ai/config.json approval gate: decided_by='auditor_auto' may approve only low/additive AND only when the gate is OFF; destructive (high) and gate-ON always require user. Auto-adding a new skill also runs an additive-dedup guard — if it overlaps an existing skill it is routed to user, not auto-added. Authorization only — the byte write into the asset is a separate submit_artifact/edit step (see next_step).",
51
51
  run_tests: "[stub] Run the test suite for a target (vitest / pytest).",
52
52
  apply_diff: "[stub] Apply a unified diff to a file with safety checks.",
53
53
  git_commit: "[stub] Stage and commit changes through a typed contract instead of raw shell.",
@@ -42,7 +42,7 @@ export declare const GateScore: z.ZodObject<{
42
42
  }>;
43
43
  signoff_count: z.ZodNumber;
44
44
  last_signer: z.ZodNullable<z.ZodEnum<{
45
- den: "den";
45
+ user: "user";
46
46
  mcp: "mcp";
47
47
  system: "system";
48
48
  }>>;
@@ -99,7 +99,7 @@ export declare const RunScorecard: z.ZodObject<{
99
99
  }>;
100
100
  signoff_count: z.ZodNumber;
101
101
  last_signer: z.ZodNullable<z.ZodEnum<{
102
- den: "den";
102
+ user: "user";
103
103
  mcp: "mcp";
104
104
  system: "system";
105
105
  }>>;
@@ -35,7 +35,7 @@ export declare const GateSignoff: z.ZodObject<{
35
35
  TECH_LEAD: "TECH_LEAD";
36
36
  }>;
37
37
  signer: z.ZodEnum<{
38
- den: "den";
38
+ user: "user";
39
39
  mcp: "mcp";
40
40
  system: "system";
41
41
  }>;
@@ -137,7 +137,7 @@ export declare const TaskState: z.ZodObject<{
137
137
  TECH_LEAD: "TECH_LEAD";
138
138
  }>;
139
139
  signer: z.ZodEnum<{
140
- den: "den";
140
+ user: "user";
141
141
  mcp: "mcp";
142
142
  system: "system";
143
143
  }>;
@@ -54,7 +54,7 @@ export async function advanceGate(input) {
54
54
  ` 2) Read skills: ${skills}`,
55
55
  ` 3) Produce architect audit (root-cause analysis, not patch attempt).`,
56
56
  ` 4) record_decision(task_id="${input.task_id}", gate="ARCH", ...) — new ARCH ADR resets dev_rollback_count to 0 via reset_on=new_arch_adr.`,
57
- ` 5) After reset, re-run sign_off("DEV", "den") + advance_gate(DEV → ${input.from_gate}).`,
57
+ ` 5) After reset, re-run sign_off("DEV", "user") + advance_gate(DEV → ${input.from_gate}).`,
58
58
  ].join("\n"));
59
59
  }
60
60
  state.dev_rollback_count = nextCount;
@@ -5,8 +5,8 @@ import { type ClassifyGateInput, type ClassifyGateOutput } from "../../shared/in
5
5
  *
6
6
  * Outcomes map to next_required_action:
7
7
  * auto_resolve → produce_artifact (silent path)
8
- * fork → open_request_decision (DEN must choose)
9
- * exception → open_report_exception (auto-check failed; needs DEN review)
8
+ * fork → open_request_decision (the user must choose)
9
+ * exception → open_report_exception (auto-check failed; needs the user review)
10
10
  *
11
11
  * No-op-safe if called multiple times for the same gate — each call appends
12
12
  * a new classification entry. latestClassification() returns the most recent.
@@ -7,8 +7,8 @@ import { resolveActiveDomain } from "../config.js";
7
7
  *
8
8
  * Outcomes map to next_required_action:
9
9
  * auto_resolve → produce_artifact (silent path)
10
- * fork → open_request_decision (DEN must choose)
11
- * exception → open_report_exception (auto-check failed; needs DEN review)
10
+ * fork → open_request_decision (the user must choose)
11
+ * exception → open_report_exception (auto-check failed; needs the user review)
12
12
  *
13
13
  * No-op-safe if called multiple times for the same gate — each call appends
14
14
  * a new classification entry. latestClassification() returns the most recent.
@@ -6,8 +6,8 @@ import { type LoadRoleInput, type LoadRoleOutput } from "../../shared/index.js";
6
6
  * `domains/<domain>/persona/persona-base.md` (resolved per active domain via
7
7
  * resolvePersonaBase); absent file degrades gracefully to no base layer.
8
8
  *
9
- * User-layer persona is currently always absent (persona-user-denis.md is
10
- * gitignored and not loaded by name match). Future versions read the user
9
+ * User-layer persona is currently always absent (the gitignored user-layer
10
+ * persona file is not loaded by name match). Future versions read the user
11
11
  * handle from env or config.
12
12
  */
13
13
  export declare function loadRole(input: LoadRoleInput): Promise<LoadRoleOutput>;
@@ -10,8 +10,8 @@ import { listSkills } from "./list_skills.js";
10
10
  * `domains/<domain>/persona/persona-base.md` (resolved per active domain via
11
11
  * resolvePersonaBase); absent file degrades gracefully to no base layer.
12
12
  *
13
- * User-layer persona is currently always absent (persona-user-denis.md is
14
- * gitignored and not loaded by name match). Future versions read the user
13
+ * User-layer persona is currently always absent (the gitignored user-layer
14
+ * persona file is not loaded by name match). Future versions read the user
15
15
  * handle from env or config.
16
16
  */
17
17
  export async function loadRole(input) {
@@ -3,9 +3,9 @@ import type { ReportExceptionInput, ReportExceptionOutput } from "../../shared/i
3
3
  * The exception channel of the silent-by-default pipeline. When an auto-check
4
4
  * fails (vocab violation, missing artifact, line cap breach, drift...), the
5
5
  * caller surfaces it here. We append a structured entry to
6
- * .code-ai/state/exceptions.jsonl and tell the caller it was surfaced to DEN.
6
+ * .code-ai/state/exceptions.jsonl and tell the caller it was surfaced to the user.
7
7
  *
8
- * For v1 every exception surfaces to "den". The hook layer is responsible for
9
- * waking DEN (toast / push) — MCP only records.
8
+ * For v1 every exception surfaces to "user". The hook layer is responsible for
9
+ * waking the user (toast / push) — MCP only records.
10
10
  */
11
11
  export declare function reportException(input: ReportExceptionInput): Promise<ReportExceptionOutput>;
@@ -4,10 +4,10 @@ import { join } from "node:path";
4
4
  * The exception channel of the silent-by-default pipeline. When an auto-check
5
5
  * fails (vocab violation, missing artifact, line cap breach, drift...), the
6
6
  * caller surfaces it here. We append a structured entry to
7
- * .code-ai/state/exceptions.jsonl and tell the caller it was surfaced to DEN.
7
+ * .code-ai/state/exceptions.jsonl and tell the caller it was surfaced to the user.
8
8
  *
9
- * For v1 every exception surfaces to "den". The hook layer is responsible for
10
- * waking DEN (toast / push) — MCP only records.
9
+ * For v1 every exception surfaces to "user". The hook layer is responsible for
10
+ * waking the user (toast / push) — MCP only records.
11
11
  */
12
12
  export async function reportException(input) {
13
13
  const stateDir = join(process.cwd(), ".code-ai", "state");
@@ -26,6 +26,6 @@ export async function reportException(input) {
26
26
  await appendFile(path, JSON.stringify(entry) + "\n", "utf8");
27
27
  return {
28
28
  exception_id: exceptionId,
29
- surfaced_to: "den",
29
+ surfaced_to: "user",
30
30
  };
31
31
  }
@@ -7,8 +7,8 @@ import { recordDecision } from "./record_decision.js";
7
7
  * two parts:
8
8
  * 1. Caller invokes request_decision with question + options. The tool
9
9
  * validates input but does NOT record an ADR yet. It returns a structured
10
- * "pending" envelope that Claude (the LLM) relays to DEN in chat.
11
- * 2. After DEN replies in chat, Claude calls record_decision with the chosen
10
+ * "pending" envelope that Claude (the LLM) relays to the user in chat.
11
+ * 2. After the user replies in chat, Claude calls record_decision with the chosen
12
12
  * option_id + rationale, which writes the ADR atomically (3 places).
13
13
  *
14
14
  * The returned object satisfies the RequestDecisionOutput contract by emitting
@@ -23,7 +23,7 @@ import { recordDecision } from "./record_decision.js";
23
23
  export declare function requestDecision(input: RequestDecisionInput): Promise<RequestDecisionOutput>;
24
24
  /**
25
25
  * Convenience: convert request_decision output into a record_decision input
26
- * once Claude has surfaced the question to DEN and received an answer.
26
+ * once Claude has surfaced the question to the user and received an answer.
27
27
  * Not part of the MCP surface — use as a helper from the LLM relay flow.
28
28
  */
29
29
  export declare function commitRequestedDecision(args: {
@@ -6,8 +6,8 @@ import { recordDecision } from "./record_decision.js";
6
6
  * two parts:
7
7
  * 1. Caller invokes request_decision with question + options. The tool
8
8
  * validates input but does NOT record an ADR yet. It returns a structured
9
- * "pending" envelope that Claude (the LLM) relays to DEN in chat.
10
- * 2. After DEN replies in chat, Claude calls record_decision with the chosen
9
+ * "pending" envelope that Claude (the LLM) relays to the user in chat.
10
+ * 2. After the user replies in chat, Claude calls record_decision with the chosen
11
11
  * option_id + rationale, which writes the ADR atomically (3 places).
12
12
  *
13
13
  * The returned object satisfies the RequestDecisionOutput contract by emitting
@@ -24,14 +24,14 @@ export async function requestDecision(input) {
24
24
  const safeTask = input.task_id.toUpperCase().replace(/[^A-Z0-9-]/g, "");
25
25
  return {
26
26
  chosen_option_id: "__pending__",
27
- signer: "den",
27
+ signer: "user",
28
28
  adr_id: `ADR-PENDING-${safeTask}-${input.gate}-${hash}`,
29
29
  timestamp: new Date().toISOString(),
30
30
  };
31
31
  }
32
32
  /**
33
33
  * Convenience: convert request_decision output into a record_decision input
34
- * once Claude has surfaced the question to DEN and received an answer.
34
+ * once Claude has surfaced the question to the user and received an answer.
35
35
  * Not part of the MCP surface — use as a helper from the LLM relay flow.
36
36
  */
37
37
  export async function commitRequestedDecision(args) {
@@ -42,7 +42,7 @@ export async function commitRequestedDecision(args) {
42
42
  options: args.input.options,
43
43
  chosen_option_id: args.chosen_option_id,
44
44
  rationale: args.rationale,
45
- signer: "den",
45
+ signer: "user",
46
46
  });
47
47
  }
48
48
  function simpleHash(s) {
@@ -12,6 +12,6 @@ import { type ReviewProposalInput, type ReviewProposalOutput } from "../../share
12
12
  * applied approved → applied (bookkeeping marker after the caller wrote the asset)
13
13
  *
14
14
  * Matrix (ADR-DEV-122): auditor_auto may approve only low/additive AND only when the approval
15
- * gate is OFF; destructive (high) and gate-ON always require den. den may always act.
15
+ * gate is OFF; destructive (high) and gate-ON always require user. user may always act.
16
16
  */
17
17
  export declare function reviewProposal(input: ReviewProposalInput): Promise<ReviewProposalOutput>;
@@ -14,7 +14,7 @@ import { readDomainSkillMeta, findOverlaps } from "../proposal_dedup.js";
14
14
  * applied approved → applied (bookkeeping marker after the caller wrote the asset)
15
15
  *
16
16
  * Matrix (ADR-DEV-122): auditor_auto may approve only low/additive AND only when the approval
17
- * gate is OFF; destructive (high) and gate-ON always require den. den may always act.
17
+ * gate is OFF; destructive (high) and gate-ON always require user. user may always act.
18
18
  */
19
19
  export async function reviewProposal(input) {
20
20
  const proposals = await readProposals();
@@ -38,13 +38,13 @@ export async function reviewProposal(input) {
38
38
  if (input.decision === "approve" && input.decided_by === "auditor_auto") {
39
39
  const cfg = await loadCodeAiConfig();
40
40
  if (cfg.auditor.approval_gate) {
41
- throw new Error(`review_proposal: approval gate is ON — '${input.id}' requires den approval, not auditor_auto`);
41
+ throw new Error(`review_proposal: approval gate is ON — '${input.id}' requires user approval, not auditor_auto`);
42
42
  }
43
43
  if (p.risk === "high") {
44
- throw new Error(`review_proposal: '${input.id}' is high-risk (destructive) — always requires den, even in autonomy`);
44
+ throw new Error(`review_proposal: '${input.id}' is high-risk (destructive) — always requires user, even in autonomy`);
45
45
  }
46
46
  // Additive-dedup guard (ADR-DEV-125): before auto-adding a NEW skill, block silent
47
- // library bloat — if it overlaps an existing skill, route to den instead of auto-adding.
47
+ // library bloat — if it overlaps an existing skill, route to user instead of auto-adding.
48
48
  if (p.change_kind === "add_asset" && p.target.asset === "skill") {
49
49
  const skills = await readDomainSkillMeta(p.target.domain);
50
50
  const overlaps = findOverlaps({
@@ -56,7 +56,7 @@ export async function reviewProposal(input) {
56
56
  const summary = overlaps
57
57
  .map((o) => `${o.skill} (${o.reasons.join("; ")})`)
58
58
  .join("; ");
59
- throw new Error(`review_proposal: '${input.id}' may duplicate existing skill(s) [${summary}] — additive-dedup guard routes it to den, not auto-add`);
59
+ throw new Error(`review_proposal: '${input.id}' may duplicate existing skill(s) [${summary}] — additive-dedup guard routes it to user, not auto-add`);
60
60
  }
61
61
  }
62
62
  }
@@ -84,7 +84,7 @@ export async function reviewProposal(input) {
84
84
  }
85
85
  /** Mandatory report — every decision (especially autonomous) returns a plain-language next step. */
86
86
  function buildNextStep(status, target, draft, decided_by, change_kind) {
87
- const who = decided_by === "auditor_auto" ? "Auditor (autonomous)" : "den";
87
+ const who = decided_by === "auditor_auto" ? "Auditor (autonomous)" : "user";
88
88
  const asset = `${target.asset} '${target.name}' in domain '${target.domain}'`;
89
89
  if (status === "approved") {
90
90
  const bloatNote = decided_by === "auditor_auto" && change_kind === "add_asset"
@@ -3,9 +3,9 @@ import { type SignOffInput, type SignOffOutput } from "../../shared/index.js";
3
3
  * Records a sign-off event for the task's current gate. Validates that:
4
4
  * 1. Task exists and is at the named gate.
5
5
  * 2. Signer matches sign_off_policy:
6
- * sign_off_policy=den → signer must be "den"
6
+ * sign_off_policy=user → signer must be "user"
7
7
  * sign_off_policy=mcp_auto_pass → signer must be "mcp"
8
- * sign_off_policy=either → signer must be "den" or "mcp"
8
+ * sign_off_policy=either → signer must be "user" or "mcp"
9
9
  * 3. Gate has a classification recorded if classify_required=true.
10
10
  *
11
11
  * Does NOT advance the gate — that's advance_gate's job. sign_off only
@@ -6,9 +6,9 @@ import { resolveActiveDomain } from "../config.js";
6
6
  * Records a sign-off event for the task's current gate. Validates that:
7
7
  * 1. Task exists and is at the named gate.
8
8
  * 2. Signer matches sign_off_policy:
9
- * sign_off_policy=den → signer must be "den"
9
+ * sign_off_policy=user → signer must be "user"
10
10
  * sign_off_policy=mcp_auto_pass → signer must be "mcp"
11
- * sign_off_policy=either → signer must be "den" or "mcp"
11
+ * sign_off_policy=either → signer must be "user" or "mcp"
12
12
  * 3. Gate has a classification recorded if classify_required=true.
13
13
  *
14
14
  * Does NOT advance the gate — that's advance_gate's job. sign_off only
@@ -25,9 +25,9 @@ export async function signOff(input) {
25
25
  }
26
26
  const gateCfg = getGateConfig(pipeline, state.mode, input.gate);
27
27
  switch (gateCfg.sign_off_policy) {
28
- case "den":
29
- if (input.signer !== "den") {
30
- throw new Error(`sign_off: gate ${input.gate} requires signer 'den' (policy=den), got '${input.signer}'`);
28
+ case "user":
29
+ if (input.signer !== "user") {
30
+ throw new Error(`sign_off: gate ${input.gate} requires signer 'user' (policy=user), got '${input.signer}'`);
31
31
  }
32
32
  break;
33
33
  case "mcp_auto_pass":
@@ -36,8 +36,8 @@ export async function signOff(input) {
36
36
  }
37
37
  break;
38
38
  case "either":
39
- if (input.signer !== "den" && input.signer !== "mcp") {
40
- throw new Error(`sign_off: gate ${input.gate} requires signer 'den' or 'mcp' (policy=either), got '${input.signer}'`);
39
+ if (input.signer !== "user" && input.signer !== "mcp") {
40
+ throw new Error(`sign_off: gate ${input.gate} requires signer 'user' or 'mcp' (policy=either), got '${input.signer}'`);
41
41
  }
42
42
  break;
43
43
  }
@@ -2,7 +2,7 @@ import { type VerifyClaimInput, type VerifyClaimOutput } from "../../shared/inde
2
2
  /**
3
3
  * Code-verifiable claims. Per the silent-by-default contract, every claim a
4
4
  * gate makes ("tests pass", "no orphan skills", "vocab clean") should be
5
- * verifiable by a deterministic check — not by DEN reading the report.
5
+ * verifiable by a deterministic check — not by the user reading the report.
6
6
  *
7
7
  * v1 implements three corpus-level checks against the installed development
8
8
  * domain on disk:
@@ -9,7 +9,7 @@ import { build } from "./build.js";
9
9
  /**
10
10
  * Code-verifiable claims. Per the silent-by-default contract, every claim a
11
11
  * gate makes ("tests pass", "no orphan skills", "vocab clean") should be
12
- * verifiable by a deterministic check — not by DEN reading the report.
12
+ * verifiable by a deterministic check — not by the user reading the report.
13
13
  *
14
14
  * v1 implements three corpus-level checks against the installed development
15
15
  * domain on disk: