@holmes-lab/holmes-kit 0.29.0 → 0.31.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 (169) hide show
  1. package/CHANGELOG.md +556 -0
  2. package/README.md +15 -5
  3. package/bin/holmes-hook-antigravity.js +4 -0
  4. package/bin/holmes-kit.js +4 -0
  5. package/bin/holmes-pre-push.js +3 -0
  6. package/bin/holmes-stop-antigravity.js +4 -0
  7. package/dist/.build-id +1 -1
  8. package/dist/holmes/cli/agents-guidance-history.d.ts +1 -1
  9. package/dist/holmes/cli/agents-guidance-history.js +11 -2
  10. package/dist/holmes/cli/agents-guidance.d.ts +1 -0
  11. package/dist/holmes/cli/agents-guidance.js +11 -8
  12. package/dist/holmes/cli/agents.d.ts +41 -0
  13. package/dist/holmes/cli/agents.js +382 -2
  14. package/dist/holmes/cli/attest.d.ts +2 -0
  15. package/dist/holmes/cli/attest.js +66 -15
  16. package/dist/holmes/cli/ci-gate.js +16 -1
  17. package/dist/holmes/cli/claude-switches.d.ts +95 -0
  18. package/dist/holmes/cli/claude-switches.js +967 -0
  19. package/dist/holmes/cli/codex-hooks.d.ts +77 -0
  20. package/dist/holmes/cli/codex-hooks.js +802 -0
  21. package/dist/holmes/cli/codex-oracle.d.ts +194 -0
  22. package/dist/holmes/cli/codex-oracle.js +1245 -0
  23. package/dist/holmes/cli/codex-toml.d.ts +58 -1
  24. package/dist/holmes/cli/codex-toml.js +456 -40
  25. package/dist/holmes/cli/doctor.d.ts +108 -8
  26. package/dist/holmes/cli/doctor.js +1408 -98
  27. package/dist/holmes/cli/index.js +23 -11
  28. package/dist/holmes/cli/init.d.ts +13 -0
  29. package/dist/holmes/cli/init.js +749 -77
  30. package/dist/holmes/cli/interactive-prompt.js +2 -2
  31. package/dist/holmes/cli/mcp-launcher.d.ts +64 -6
  32. package/dist/holmes/cli/mcp-launcher.js +189 -6
  33. package/dist/holmes/cli/mcp-version.js +13 -2
  34. package/dist/holmes/cli/settings-merge.js +8 -2
  35. package/dist/holmes/cli/upgrade.d.ts +13 -0
  36. package/dist/holmes/cli/upgrade.js +116 -23
  37. package/dist/holmes/cli/workspace-scope.d.ts +22 -0
  38. package/dist/holmes/cli/workspace-scope.js +375 -0
  39. package/dist/holmes/cli/worktree-readiness.d.ts +1 -0
  40. package/dist/holmes/cli/worktree-readiness.js +17 -3
  41. package/dist/holmes/cpg/cpg-scanner.d.ts +29 -0
  42. package/dist/holmes/cpg/cpg-scanner.js +403 -3
  43. package/dist/holmes/cpg/cycle-detect.js +2 -1
  44. package/dist/holmes/cpg/forbidden-edges.js +9 -2
  45. package/dist/holmes/cpg/required-calls.js +8 -1
  46. package/dist/holmes/governance/autonomy.d.ts +9 -0
  47. package/dist/holmes/governance/autonomy.js +28 -1
  48. package/dist/holmes/governance/constitution-debt.js +3 -2
  49. package/dist/holmes/governance/constitution.js +15 -3
  50. package/dist/holmes/governance/provenance-chain.js +3 -2
  51. package/dist/holmes/governance/push-gate-runner.js +4 -3
  52. package/dist/holmes/guardrail/dependency-delta.js +4 -3
  53. package/dist/holmes/guardrail/linear-match.d.ts +57 -0
  54. package/dist/holmes/guardrail/linear-match.js +256 -0
  55. package/dist/holmes/guardrail/risk-classifier.d.ts +6 -7
  56. package/dist/holmes/guardrail/risk-classifier.js +931 -44
  57. package/dist/holmes/guardrail/risk-types.d.ts +6 -0
  58. package/dist/holmes/guardrail/scope-judgment.d.ts +4 -24
  59. package/dist/holmes/guardrail/scope-judgment.js +100 -23
  60. package/dist/holmes/guardrail/shell-words.d.ts +42 -0
  61. package/dist/holmes/guardrail/shell-words.js +1720 -0
  62. package/dist/holmes/guardrail/write-target.d.ts +168 -3
  63. package/dist/holmes/guardrail/write-target.js +2379 -87
  64. package/dist/holmes/hooks/adapters/antigravity.d.ts +3 -1
  65. package/dist/holmes/hooks/adapters/antigravity.js +115 -11
  66. package/dist/holmes/hooks/pre-tool-use.d.ts +32 -6
  67. package/dist/holmes/hooks/pre-tool-use.js +923 -87
  68. package/dist/holmes/hooks/rtm-refresh-child.d.ts +22 -1
  69. package/dist/holmes/hooks/rtm-refresh-child.js +102 -18
  70. package/dist/holmes/hooks/rtm-refresh.d.ts +20 -1
  71. package/dist/holmes/hooks/rtm-refresh.js +60 -15
  72. package/dist/holmes/hooks/session-start.d.ts +10 -0
  73. package/dist/holmes/hooks/session-start.js +31 -7
  74. package/dist/holmes/hooks/stop.d.ts +2 -1
  75. package/dist/holmes/hooks/stop.js +197 -91
  76. package/dist/holmes/mcp/approval-adapters.d.ts +22 -0
  77. package/dist/holmes/mcp/approval-adapters.js +21 -0
  78. package/dist/holmes/mcp/approval-commit.d.ts +20 -0
  79. package/dist/holmes/mcp/approval-commit.js +108 -0
  80. package/dist/holmes/mcp/approval-intent.d.ts +44 -0
  81. package/dist/holmes/mcp/approval-intent.js +67 -0
  82. package/dist/holmes/mcp/approval-policy.d.ts +14 -0
  83. package/dist/holmes/mcp/approval-policy.js +18 -0
  84. package/dist/holmes/mcp/elicit-approval.d.ts +2 -0
  85. package/dist/holmes/mcp/elicit-approval.js +8 -3
  86. package/dist/holmes/mcp/handlers/graph-operations.d.ts +17 -1
  87. package/dist/holmes/mcp/handlers/graph-operations.js +15 -6
  88. package/dist/holmes/mcp/handlers/maintenance-analysis.js +11 -5
  89. package/dist/holmes/mcp/handlers/maintenance-evidence.js +3 -2
  90. package/dist/holmes/mcp/handlers/phase-queries.d.ts +22 -7
  91. package/dist/holmes/mcp/handlers/phase-queries.js +81 -2
  92. package/dist/holmes/mcp/handlers/requirement-triage.d.ts +26 -0
  93. package/dist/holmes/mcp/handlers/requirement-triage.js +48 -11
  94. package/dist/holmes/mcp/handlers/review-evidence.d.ts +2 -1
  95. package/dist/holmes/mcp/handlers/review-evidence.js +15 -5
  96. package/dist/holmes/mcp/handlers/slice-orchestration.d.ts +18 -0
  97. package/dist/holmes/mcp/handlers/slice-orchestration.js +122 -16
  98. package/dist/holmes/mcp/handlers/spec-approval.d.ts +35 -2
  99. package/dist/holmes/mcp/handlers/spec-approval.js +175 -57
  100. package/dist/holmes/mcp/handlers/spec-authoring.js +36 -3
  101. package/dist/holmes/mcp/handlers/spec-queries.d.ts +39 -3
  102. package/dist/holmes/mcp/handlers/spec-queries.js +114 -7
  103. package/dist/holmes/mcp/handlers/test-execution.js +9 -3
  104. package/dist/holmes/mcp/handlers.d.ts +126 -8
  105. package/dist/holmes/mcp/handlers.js +109 -18
  106. package/dist/holmes/mcp/harness-attestation.d.ts +20 -0
  107. package/dist/holmes/mcp/harness-attestation.js +179 -0
  108. package/dist/holmes/mcp/maintenance-analyze.js +28 -4
  109. package/dist/holmes/mcp/maintenance-evidence.js +1 -1
  110. package/dist/holmes/mcp/requirement-triage-evidence.d.ts +72 -2
  111. package/dist/holmes/mcp/requirement-triage-evidence.js +227 -1
  112. package/dist/holmes/mcp/server.js +24 -3
  113. package/dist/holmes/mcp/supervisor.js +7 -3
  114. package/dist/holmes/mcp/tool-schemas.d.ts +8 -0
  115. package/dist/holmes/mcp/tool-schemas.js +54 -7
  116. package/dist/holmes/mcp/validate-args.js +12 -0
  117. package/dist/holmes/project/bounded-io.d.ts +102 -0
  118. package/dist/holmes/project/bounded-io.js +212 -0
  119. package/dist/holmes/project/change-source.js +3 -1
  120. package/dist/holmes/project/ci-runs.js +3 -2
  121. package/dist/holmes/project/ignore.d.ts +31 -2
  122. package/dist/holmes/project/ignore.js +409 -50
  123. package/dist/holmes/project/regular-file-guard.d.ts +13 -0
  124. package/dist/holmes/project/regular-file-guard.js +149 -0
  125. package/dist/holmes/project/root.js +12 -3
  126. package/dist/holmes/refresh/freshness-coordinator.d.ts +67 -0
  127. package/dist/holmes/refresh/freshness-coordinator.js +230 -0
  128. package/dist/holmes/reverse/anchor.js +4 -3
  129. package/dist/holmes/reverse/scan.js +6 -2
  130. package/dist/holmes/review/commit-text.js +3 -2
  131. package/dist/holmes/review/condition-hunk-replay.d.ts +12 -0
  132. package/dist/holmes/review/condition-hunk-replay.js +13 -2
  133. package/dist/holmes/review/condition-hunk-resolution.js +59 -8
  134. package/dist/holmes/review/failed-test-names.js +13 -10
  135. package/dist/holmes/review/findings.js +3 -1
  136. package/dist/holmes/review/kills-check.js +6 -1
  137. package/dist/holmes/review/point-in-time-replay.js +5 -4
  138. package/dist/holmes/review/replay-corpus.js +5 -4
  139. package/dist/holmes/review/requirement-triage-human-records.d.ts +59 -0
  140. package/dist/holmes/review/requirement-triage-human-records.js +119 -0
  141. package/dist/holmes/review/run-replay.js +3 -2
  142. package/dist/holmes/review/scope.js +6 -1
  143. package/dist/holmes/review/temporal-prior.js +3 -2
  144. package/dist/holmes/review/test-evidence.js +3 -2
  145. package/dist/holmes/review/test-outcomes.d.ts +28 -0
  146. package/dist/holmes/review/test-outcomes.js +92 -2
  147. package/dist/holmes/review/test-runner.d.ts +6 -0
  148. package/dist/holmes/review/test-runner.js +36 -15
  149. package/dist/holmes/rtm/advisory-outcomes.js +3 -2
  150. package/dist/holmes/rtm/anchor-ids.js +42 -2
  151. package/dist/holmes/rtm/file-anchors.js +4 -1
  152. package/dist/holmes/rtm/ftt-fulfilment.js +8 -3
  153. package/dist/holmes/rtm/git-changes.js +3 -1
  154. package/dist/holmes/rtm/graph-store.js +3 -2
  155. package/dist/holmes/rtm/test-scope.js +9 -4
  156. package/dist/holmes/spec/compat-impact.d.ts +25 -4
  157. package/dist/holmes/spec/compat-impact.js +682 -11
  158. package/dist/holmes/spec/entity-git-snapshot.js +3 -2
  159. package/dist/holmes/spec/entity-integration.js +3 -2
  160. package/dist/holmes/spec/entity-renumber-transaction.d.ts +19 -0
  161. package/dist/holmes/spec/entity-renumber-transaction.js +79 -6
  162. package/dist/holmes/spec/remote-spec-refs.js +3 -2
  163. package/dist/holmes/spec/renumber.js +25 -10
  164. package/dist/holmes/spec/spec-parser.js +9 -3
  165. package/dist/holmes/spec/yaml-scalar.js +2 -2
  166. package/dist/holmes/update/refresh.js +3 -1
  167. package/dist/holmes/update/update-notice.d.ts +6 -0
  168. package/dist/holmes/update/update-notice.js +18 -1
  169. package/package.json +11 -4
@@ -33,9 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.renderPlan = renderPlan;
36
37
  exports.runUpgrade = runUpgrade;
37
38
  // @implements A-SPEC-709
38
39
  // @implements A-SPEC-543.2
40
+ // @implements A-SPEC-251.1
39
41
  const fs = __importStar(require("node:fs"));
40
42
  const os = __importStar(require("node:os"));
41
43
  const path = __importStar(require("node:path"));
@@ -45,6 +47,7 @@ const workspaces_1 = require("../update/workspaces");
45
47
  const upgrade_plan_1 = require("../update/upgrade-plan");
46
48
  const session_start_1 = require("../hooks/session-start");
47
49
  const npx_bin_1 = require("../project/npx-bin");
50
+ const codex_oracle_1 = require("./codex-oracle");
48
51
  const PKG = '@holmes-lab/holmes-kit';
49
52
  // Local copy of index.ts's packageRoot (dist/holmes/cli/upgrade.js → 3 up) — avoids a require cycle,
50
53
  // since index.ts lazily requires THIS module.
@@ -61,14 +64,72 @@ function currentVersion(root) {
61
64
  }
62
65
  /** `npm` on POSIX, `npm.cmd` on win32 — the shim a spawn resolves (same binary-name reasoning as npxBin). */
63
66
  function npmBin() { return process.platform === 'win32' ? 'npm.cmd' : 'npm'; }
64
- /** Render the plan for the human, one line per fact. */
65
- function renderPlan(plan) {
67
+ /** A-SPEC-251.1 (round 26): npm's own update check is not upgrade's egress (it raced every npm child — measured). */
68
+ const NPM_QUIET = ['--no-update-notifier'];
69
+ const realOrResolve = (p) => {
70
+ try {
71
+ return fs.realpathSync.native(p);
72
+ }
73
+ catch { /* not there yet */ }
74
+ try {
75
+ return path.join(fs.realpathSync.native(path.dirname(p)), path.basename(p));
76
+ }
77
+ catch {
78
+ return path.resolve(p);
79
+ }
80
+ };
81
+ /**
82
+ * @implements A-SPEC-251.1 (confirmation round 24) — the holmes-kit install a workspace uses, found the way node finds a
83
+ * package: the nearest ancestor `node_modules/@holmes-lab/holmes-kit`. `pending` (the install this upgrade is about to
84
+ * write) counts even before it exists. A path-prefix test re-pinned an independent project nested under the installing
85
+ * one, and every workspace under a stray `~/node_modules` install (measured).
86
+ */
87
+ function installOf(target, pending) {
88
+ let d = realOrResolve(target);
89
+ for (;;) {
90
+ const cand = path.join(d, 'node_modules', PKG);
91
+ const real = realOrResolve(cand);
92
+ if (real === pending || fs.existsSync(path.join(cand, 'package.json')))
93
+ return real;
94
+ const parent = path.dirname(d);
95
+ if (parent === d)
96
+ return null;
97
+ d = parent;
98
+ }
99
+ }
100
+ function decideRepin(w, installMode, pkgDir) {
101
+ const agents = w.agents.length ? w.agents : ['claude'];
102
+ if (!fs.existsSync(w.target))
103
+ return { target: w.target, agents, skip: 'no path' };
104
+ const own = installOf(w.target, pkgDir);
105
+ // local-dep: only the workspaces that resolve to this install. global: all but those resolving to an install of their own.
106
+ if (installMode === 'local-dep' && own === null)
107
+ return { target: w.target, agents, skip: 'not using this install' }; // round 25 wording
108
+ if (installMode === 'local-dep' ? own !== pkgDir : own !== null && own !== pkgDir)
109
+ return { target: w.target, agents, skip: 'its own install' };
110
+ // Round 23: Codex's wiring is user-level, shared by every workspace — a project-local re-pin moved every Codex session
111
+ // onto one project's install (measured). It is left as it is, and said so.
112
+ const kept = installMode === 'local-dep' ? agents.filter((a) => a !== 'codex') : agents;
113
+ if (kept.length === 0)
114
+ return { target: w.target, agents, skip: 'Codex only', codexLeft: true };
115
+ return { target: w.target, agents: kept, ...(kept.length < agents.length ? { codexLeft: true } : {}) };
116
+ }
117
+ /** Render the plan for the human, one line per fact — from the same decisions the run carries out (round 24). */
118
+ function renderPlan(plan, decisions, installAt) {
119
+ // @implements A-SPEC-251.2 (round 46) — a registry value is printed escaped (a newline in a target forged a plan line, an OSC
120
+ // sequence retitled the terminal — measured).
121
+ const shown = (v) => (0, codex_oracle_1.escapeForDisplay)(String(v));
122
+ const repins = decisions.filter((d) => d.skip === undefined);
123
+ const skips = decisions.filter((d) => d.skip !== undefined);
66
124
  const lines = [
67
125
  `Holmes-Kit upgrade: ${plan.current} → ${plan.latest} (install mode: ${plan.installMode})`,
68
- plan.repins.length
69
- ? `Will re-pin ${plan.repins.length} workspace(s):`
70
- : 'No wired workspaces recorded yet — install only.',
71
- ...plan.repins.map((w) => ` • ${w.target} [${w.agents.join(', ')}]`),
126
+ `Install location: ${installAt}`, // round 25: the plan never named where it would install
127
+ repins.length
128
+ ? `Will re-pin ${repins.length} workspace(s):`
129
+ : 'No workspace uses this install — install only.',
130
+ ...repins.map((d) => ` • ${shown(d.target)} [${shown(d.agents.join(', '))}]`),
131
+ ...(skips.length ? [`Will skip ${skips.length}:`, ...skips.map((d) => ` • ${shown(d.target)} (${shown(d.skip)})`)] : []),
132
+ ...(decisions.some((d) => d.codexLeft) ? ["Codex's user-level wiring is shared by every workspace and is left as it is."] : []),
72
133
  ];
73
134
  return lines.join('\n') + '\n';
74
135
  }
@@ -96,15 +157,39 @@ async function runUpgrade(io) {
96
157
  io.stdout(`${plan.reason}\n`);
97
158
  return 0;
98
159
  }
99
- io.stdout(renderPlan(plan));
100
- if (io.dryRun) {
101
- io.stdout('(dry-run — nothing installed or re-pinned)\n');
102
- return 0;
160
+ // @implements A-SPEC-251.1 (round 27) — only a strict semver is installed (`PKG@<latest>`): a cached `9.0.0.tgz` was read
161
+ // by npm as a local file (measured). The cache reader refuses such a value; this is the second line.
162
+ if (!(0, update_notice_1.isStrictSemver)(plan.latest)) {
163
+ io.stderr(`the cached latest version is not a version (${String(plan.latest).slice(0, 80)}); nothing installed or re-pinned.\n`);
164
+ return 1;
103
165
  }
166
+ // Round 25: a source checkout is refused before any plan (its dry run printed "Will re-pin N" — code read).
104
167
  if (plan.installMode === 'source') {
105
168
  io.stderr('source checkout: upgrade via git (git pull && npm run build), not npm install.\n');
106
169
  return 1;
107
170
  }
171
+ // Round 24: where the install goes is known before installing (`npm root` only names the directory), so the plan
172
+ // shown before "Continue?" is the run's own decisions.
173
+ let pkgDir; // compared (real path)
174
+ let pkgPath; // run (as npm names it)
175
+ try {
176
+ const modulesRoot = (0, node_child_process_1.execFileSync)(npmBin(), ['root', ...(plan.installMode === 'global-npx' ? ['-g'] : []), ...NPM_QUIET], { cwd: process.cwd(), encoding: 'utf8', timeout: 30_000 }).trim();
177
+ // Round 25: npm redacts UUID-shaped path segments in its output (`***`) — such a path is no location (measured).
178
+ if (modulesRoot.includes('***'))
179
+ throw new Error(`npm root answered a redacted path (${modulesRoot.slice(0, 200)})`);
180
+ pkgPath = path.join(modulesRoot, PKG);
181
+ pkgDir = realOrResolve(pkgPath);
182
+ }
183
+ catch (e) {
184
+ io.stderr(`the install location could not be resolved (npm root); nothing installed or re-pinned: ${String(e)}\n`);
185
+ return 1;
186
+ }
187
+ const decisions = registry.workspaces.map((w) => decideRepin(w, plan.installMode, pkgDir));
188
+ io.stdout(renderPlan(plan, decisions, pkgPath));
189
+ if (io.dryRun) {
190
+ io.stdout('(dry-run — nothing installed or re-pinned)\n');
191
+ return 0;
192
+ }
108
193
  const go = io.yes || await io.confirm('Continue? [y/N] ');
109
194
  if (!go) {
110
195
  io.stdout(io.yes ? '' : 'aborted — nothing installed or re-pinned.\n');
@@ -117,7 +202,7 @@ async function runUpgrade(io) {
117
202
  const args = plan.installMode === 'global-npx'
118
203
  ? ['i', '-g', `${PKG}@${plan.latest}`]
119
204
  : ['i', '-D', `${PKG}@${plan.latest}`];
120
- (0, node_child_process_1.execFileSync)(npmBin(), args, { stdio: 'inherit', cwd: process.cwd() });
205
+ (0, node_child_process_1.execFileSync)(npmBin(), [...args, ...NPM_QUIET], { stdio: 'inherit', cwd: process.cwd() });
121
206
  }
122
207
  catch {
123
208
  io.stderr(`install failed — nothing re-pinned. Try manually: ${npmBin()} i ${plan.installMode === 'global-npx' ? '-g' : '-D'} ${PKG}@${plan.latest}\n`);
@@ -133,12 +218,10 @@ async function runUpgrade(io) {
133
218
  }
134
219
  }
135
220
  catch { /* cache clear is best-effort */ }
136
- // (3) re-pin every registered workspace that still exists.
221
+ // (3) re-pin the workspaces the decisions name.
137
222
  // Load the newly installed package in a fresh process: the caller already cached old init.
138
- let newCli;
223
+ const newCli = path.join(pkgPath, 'bin', 'holmes-kit.js');
139
224
  try {
140
- const modulesRoot = (0, node_child_process_1.execFileSync)(npmBin(), ['root', ...(plan.installMode === 'global-npx' ? ['-g'] : [])], { cwd: process.cwd(), encoding: 'utf8' }).trim();
141
- newCli = path.join(modulesRoot, PKG, 'bin', 'holmes-kit.js');
142
225
  if (!fs.statSync(newCli).isFile())
143
226
  throw new Error('new CLI is not a file');
144
227
  }
@@ -146,29 +229,39 @@ async function runUpgrade(io) {
146
229
  io.stderr(`Installed package CLI could not be resolved; no workspace re-pinned: ${String(e)}\n`);
147
230
  return 1;
148
231
  }
232
+ // @implements A-SPEC-251.1 (confirmation round 25) — the install at the planned location must be the planned version:
233
+ // from an npm-workspaces member, `npm i -D` installed into the member while `npm root` named the root's old install,
234
+ // and the old CLI re-pinned everything and said "Upgraded" (measured).
235
+ const landed = currentVersion(pkgPath);
236
+ if (landed !== plan.latest) {
237
+ io.stderr(`npm did not install ${plan.latest} at ${pkgPath} (found ${landed}); no workspace re-pinned. Run holmes-kit upgrade from the project whose node_modules holds holmes-kit.\n`);
238
+ return 1;
239
+ }
149
240
  let repinned = 0, skipped = 0, failed = 0;
150
241
  io.stdout('\nRe-pinning workspaces:\n');
151
- for (const w of registry.workspaces) {
152
- if (!fs.existsSync(w.target)) {
153
- io.stdout(` skipped (no path): ${w.target}\n`);
242
+ for (const d of decisions) {
243
+ if (d.skip !== undefined) {
244
+ io.stdout(` skipped (${(0, codex_oracle_1.escapeForDisplay)(String(d.skip))}): ${(0, codex_oracle_1.escapeForDisplay)(d.target)}${d.skip === 'its own install' ? ' — run holmes-kit upgrade from that install' : ''}\n`);
154
245
  skipped++;
155
246
  continue;
156
247
  }
157
248
  try {
158
- const agents = w.agents.length ? w.agents.join(',') : 'claude';
159
- const output = (0, node_child_process_1.execFileSync)(process.execPath, [newCli, 'init', '--target', w.target,
160
- '--agent', agents, '--mode', 'guardrail', '--mcp-launcher', 'npx'], { cwd: process.cwd(), encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
249
+ const output = (0, node_child_process_1.execFileSync)(process.execPath, [newCli, 'init', '--target', d.target,
250
+ '--agent', d.agents.join(','), '--mode', 'guardrail'], { cwd: process.cwd(), encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
161
251
  io.stdout(output);
162
- io.stdout(` re-pinned: ${w.target}\n`);
252
+ io.stdout(` re-pinned: ${(0, codex_oracle_1.escapeForDisplay)(d.target)}\n`);
163
253
  repinned++;
164
254
  }
165
255
  catch (e) {
166
256
  const failure = e;
167
- io.stdout(` failed: ${w.target}: ${String(failure.stderr ?? failure.message ?? e)}\n`);
257
+ io.stdout(` failed: ${(0, codex_oracle_1.escapeForDisplay)(d.target)}: ${String(failure.stderr ?? failure.message ?? e).split('\n').map(codex_oracle_1.escapeForDisplay).join('\n ')}\n`);
168
258
  failed++;
169
259
  }
170
260
  }
261
+ const codexLeft = decisions.some((d) => d.codexLeft);
171
262
  io.stdout(`\nUpgraded to ${plan.latest}. re-pinned ${repinned} · skipped ${skipped} · failed ${failed}. A new session's hooks/MCP will read the new wiring.\n`);
263
+ if (codexLeft)
264
+ io.stdout(`Codex's user-level wiring was left as it is: it is shared by every workspace, so it is not moved onto this project's install. Re-wire it by running \`holmes-kit init --agent codex --force\` from the install you mean to share (a global install, outside any project).\n`);
172
265
  io.stdout(`(You can re-wire any individual workspace at any time with ${(0, npx_bin_1.npxBin)()} holmes-kit init --agent <…> --force.)\n`);
173
266
  return failed > 0 ? 1 : 0;
174
267
  }
@@ -0,0 +1,22 @@
1
+ export declare function workspaceRoots(realTarget: string): string[];
2
+ /**
3
+ * @implements A-SPEC-251.2 (round 34) — a real path is the workspace's when it lies under a workspace root, or when a
4
+ * directory above it holds a `.git` whose common git directory is (or lies under — a submodule's `modules/`) the common git
5
+ * directory of a workspace repository: round 33 listed `worktrees/` and kept the first 64 (the 65th sibling's wrapper ran
6
+ * and passed), re-reading the listing for every `.git` file (200,000 entries: 88 s — measured).
7
+ */
8
+ /**
9
+ * @implements A-SPEC-251.2 (round 51) — whether the target is the home directory or lies above it (a dotfiles repository
10
+ * taken as the target): every install under home (nvm, volta) is then "inside the workspace", so a `node` found through an
11
+ * ABSOLUTE PATH entry is not read as the workspace's there (an untouched canonical wiring read FAIL three times — measured).
12
+ */
13
+ export declare function targetHoldsHome(realTarget: string): boolean;
14
+ export declare function inWorkspace(realTarget: string, real: string): boolean;
15
+ export declare const REMOTE_GIT = "\0remote";
16
+ /**
17
+ * The common git directory of the repository whose `.git` sits in `dir`, `REMOTE_GIT` when it names a network path, or null.
18
+ * Round 35: a symlinked `.git` is followed (a `repo`-tool main checkout's wrapper ran — measured); `.git`, `commondir` and
19
+ * `gitdir` files are read to 64 KiB (four 2 GB `.git` files took 12.5 s — measured).
20
+ */
21
+ export declare function commonGitDirAt(dir: string): string | null;
22
+ export declare function isWithin(root: string, p: string): boolean;
@@ -0,0 +1,375 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.REMOTE_GIT = void 0;
37
+ exports.workspaceRoots = workspaceRoots;
38
+ exports.targetHoldsHome = targetHoldsHome;
39
+ exports.inWorkspace = inWorkspace;
40
+ exports.commonGitDirAt = commonGitDirAt;
41
+ exports.isWithin = isWithin;
42
+ // @implements A-SPEC-251.2
43
+ // The workspace a wiring must not run a program from — shared by doctor and init (round 50: init judged by the target
44
+ // alone). Moved here from doctor.ts unchanged, so that init can use it without importing doctor (doctor imports init).
45
+ const fs = __importStar(require("node:fs"));
46
+ const os = __importStar(require("node:os"));
47
+ const path = __importStar(require("node:path"));
48
+ const codex_oracle_1 = require("./codex-oracle");
49
+ const claude_switches_1 = require("./claude-switches");
50
+ const ROOTS_MEMO = new Map();
51
+ function workspaceOf(realTarget) {
52
+ // Round 33: once per target within a doctor run, each directory walked once (`.git` files naming one `.git`-less
53
+ // directory made the walk (m+1)^8: 11 s at 3 levels, 66 s at 4 — measured).
54
+ const hit = ROOTS_MEMO.get(realTarget);
55
+ if (hit !== undefined && Date.now() - hit.at < 5000)
56
+ return hit.ws;
57
+ const ws = workspaceUncached(realTarget);
58
+ ROOTS_MEMO.set(realTarget, { at: Date.now(), ws });
59
+ return ws;
60
+ }
61
+ function workspaceRoots(realTarget) { return workspaceOf(realTarget).roots; }
62
+ /**
63
+ * @implements A-SPEC-251.2 (round 34) — a real path is the workspace's when it lies under a workspace root, or when a
64
+ * directory above it holds a `.git` whose common git directory is (or lies under — a submodule's `modules/`) the common git
65
+ * directory of a workspace repository: round 33 listed `worktrees/` and kept the first 64 (the 65th sibling's wrapper ran
66
+ * and passed), re-reading the listing for every `.git` file (200,000 entries: 88 s — measured).
67
+ */
68
+ /**
69
+ * @implements A-SPEC-251.2 (round 51) — whether the target is the home directory or lies above it (a dotfiles repository
70
+ * taken as the target): every install under home (nvm, volta) is then "inside the workspace", so a `node` found through an
71
+ * ABSOLUTE PATH entry is not read as the workspace's there (an untouched canonical wiring read FAIL three times — measured).
72
+ */
73
+ function targetHoldsHome(realTarget) {
74
+ const home = (() => { try {
75
+ return fs.realpathSync.native(process.platform !== 'win32' && process.env.HOME ? process.env.HOME : os.homedir());
76
+ }
77
+ catch {
78
+ return '';
79
+ } })();
80
+ return home !== '' && (home === realTarget || isWithin(realTarget, home));
81
+ }
82
+ function inWorkspace(realTarget, real) {
83
+ const ws = workspaceOf(realTarget);
84
+ if (ws.roots.some((r) => isWithin(r, real)))
85
+ return true;
86
+ if (ws.commons.length === 0)
87
+ return false;
88
+ for (let d = real, i = 0; i < 256; i++) {
89
+ const c = commonGitDirAt(d);
90
+ // Round 35: a `.git` naming a network path cannot be checked — it is read as the workspace's (never run).
91
+ if (c === exports.REMOTE_GIT)
92
+ return true;
93
+ if (c !== null && ws.commons.some((w) => isWithin(w, c)))
94
+ return true;
95
+ const parent = path.dirname(d);
96
+ if (parent === d)
97
+ break;
98
+ d = parent;
99
+ }
100
+ // @implements A-SPEC-251.2 (round 35) — a worktree the common directory lists whose own `.git` file is gone (round 34
101
+ // dropped the listing and its wrapper ran — measured): read once per common directory, only here.
102
+ for (const c of ws.commons) {
103
+ const listed = listedWorktrees(c);
104
+ if (listed === null || listed.some((w) => isWithin(w, real)))
105
+ return true;
106
+ // Round 36: what the text does not match is walked within one budget (4,096 entries naming a 428-level directory took
107
+ // 44 s — measured); past it the path is read as the workspace's.
108
+ const resolved = resolvedWorktrees(c, listed);
109
+ if (resolved === null || resolved.some((w) => isWithin(w, real)))
110
+ return true;
111
+ }
112
+ return false;
113
+ }
114
+ exports.REMOTE_GIT = '\u0000remote';
115
+ /**
116
+ * The common git directory of the repository whose `.git` sits in `dir`, `REMOTE_GIT` when it names a network path, or null.
117
+ * Round 35: a symlinked `.git` is followed (a `repo`-tool main checkout's wrapper ran — measured); `.git`, `commondir` and
118
+ * `gitdir` files are read to 64 KiB (four 2 GB `.git` files took 12.5 s — measured).
119
+ */
120
+ function commonGitDirAt(dir) {
121
+ const gitPath = path.join(dir, '.git');
122
+ let st;
123
+ try {
124
+ st = fs.lstatSync(gitPath);
125
+ }
126
+ catch {
127
+ return null;
128
+ }
129
+ let file = gitPath;
130
+ if (st.isSymbolicLink()) {
131
+ const walked = (0, claude_switches_1.localPhysicalRealpath)(gitPath);
132
+ if (walked.refused)
133
+ return exports.REMOTE_GIT;
134
+ if (walked.path === null)
135
+ return null;
136
+ try {
137
+ st = fs.statSync(walked.path);
138
+ }
139
+ catch {
140
+ return null;
141
+ }
142
+ if (st.isDirectory())
143
+ return walked.path;
144
+ file = walked.path;
145
+ }
146
+ else if (st.isDirectory()) {
147
+ try {
148
+ return fs.realpathSync.native(gitPath);
149
+ }
150
+ catch {
151
+ return gitPath;
152
+ }
153
+ }
154
+ if (!st.isFile())
155
+ return null;
156
+ const m = /^gitdir:[ \t]*(.+?)[ \t]*$/m.exec((0, claude_switches_1.readFileHead)(file) ?? '');
157
+ if (m === null)
158
+ return null;
159
+ const asWritten = path.resolve(dir, m[1]);
160
+ if (!(0, codex_oracle_1.openableLocalPath)(asWritten))
161
+ return exports.REMOTE_GIT;
162
+ // Round 36: walked before it is read (`gitdir: lnk/wt/.git/…` with `lnk -> /net/…` opened `commondir` — measured).
163
+ const walkedGitdir = (0, claude_switches_1.localPhysicalRealpath)(asWritten);
164
+ if (walkedGitdir.refused)
165
+ return exports.REMOTE_GIT;
166
+ const gitdir = walkedGitdir.path ?? asWritten;
167
+ // Round 37: the `commondir` file is walked too (a link into /net was opened — measured).
168
+ const commondirFile = walkedGitdir.path === null ? null : (0, claude_switches_1.localPhysicalRealpath)(path.join(gitdir, 'commondir'));
169
+ if (commondirFile?.refused)
170
+ return exports.REMOTE_GIT;
171
+ const commondir = commondirFile?.path ? (0, claude_switches_1.readFileHead)(commondirFile.path) : null;
172
+ const common = commondir === null ? gitdir : path.resolve(gitdir, commondir.trim());
173
+ if (!(0, codex_oracle_1.openableLocalPath)(common))
174
+ return exports.REMOTE_GIT;
175
+ const walked = (0, claude_switches_1.localPhysicalRealpath)(common);
176
+ return walked.refused ? exports.REMOTE_GIT : walked.path ?? common;
177
+ }
178
+ const LISTED_MEMO = new Map();
179
+ /**
180
+ * The checkouts each `<common>/worktrees/<id>/gitdir` names, as written (null past 4,096 entries, or when the `worktrees`
181
+ * directory reaches a network path: read as the workspace's). Round 36: the directory is walked before it is listed (a
182
+ * `worktrees -> /net/…` link was listed — measured).
183
+ */
184
+ function listedWorktrees(common) {
185
+ const hit = LISTED_MEMO.get(common);
186
+ if (hit !== undefined && Date.now() - hit.at < 5000)
187
+ return hit.dirs;
188
+ const at = (0, claude_switches_1.localPhysicalRealpath)(path.join(common, 'worktrees'));
189
+ let dirs = [];
190
+ if (at.refused)
191
+ dirs = null;
192
+ else if (at.path !== null) {
193
+ let ids = [];
194
+ try {
195
+ ids = fs.readdirSync(at.path);
196
+ }
197
+ catch { /* none */ }
198
+ if (ids.length > 4096)
199
+ dirs = null;
200
+ else {
201
+ // Round 38: a plain entry and `gitdir` file cost two look-ups; only a link is walked, within 20,000 components for the
202
+ // whole list (4,096 entries linked to 428-level directories took 53 s — measured, a round-37 regression), past which
203
+ // the list is read as the workspace's.
204
+ const budget = { left: 20_000 };
205
+ for (const id of ids) {
206
+ // Round 37: the entry and its `gitdir` file are walked too (links into /net were opened — measured).
207
+ const gd = path.join(at.path, id, 'gitdir');
208
+ let fileAt = null;
209
+ try {
210
+ budget.left -= 2;
211
+ if (!fs.lstatSync(path.join(at.path, id)).isSymbolicLink() && fs.lstatSync(gd).isFile())
212
+ fileAt = gd;
213
+ }
214
+ catch {
215
+ continue;
216
+ }
217
+ if (budget.left < 0) {
218
+ dirs = null;
219
+ break;
220
+ }
221
+ if (fileAt === null) {
222
+ const file = (0, claude_switches_1.localPhysicalRealpath)(gd, budget);
223
+ if (file.exhausted) {
224
+ dirs = null;
225
+ break;
226
+ }
227
+ if (file.refused || file.path === null)
228
+ continue;
229
+ fileAt = file.path;
230
+ }
231
+ const g = (0, claude_switches_1.readFileHead)(fileAt)?.trim();
232
+ if (g === undefined || g === '')
233
+ continue;
234
+ const w = path.dirname(path.resolve(at.path, id, g));
235
+ if ((0, codex_oracle_1.openableLocalPath)(w))
236
+ dirs.push(w);
237
+ }
238
+ }
239
+ }
240
+ LISTED_MEMO.set(common, { at: Date.now(), dirs });
241
+ return dirs;
242
+ }
243
+ const RESOLVED_MEMO = new Map();
244
+ /** The same checkouts' real paths, all walked within 20,000 components in total (null past the budget or on a network path). */
245
+ function resolvedWorktrees(common, listed) {
246
+ const hit = RESOLVED_MEMO.get(common);
247
+ if (hit !== undefined && Date.now() - hit.at < 5000)
248
+ return hit.dirs;
249
+ // Round 37: each parent directory is walked once (siblings share it — 1,250 worktrees ran out of the budget and every node
250
+ // wiring read FAIL, a round-36 regression, measured); an entry on a network path drops only itself.
251
+ const budget = { left: 20_000 };
252
+ const parents = new Map();
253
+ let dirs = [];
254
+ for (const w of listed) {
255
+ const parent = path.dirname(w);
256
+ let real = parents.get(parent);
257
+ if (real === undefined) {
258
+ const walked = (0, claude_switches_1.localPhysicalRealpath)(parent, budget);
259
+ if (walked.exhausted) {
260
+ dirs = null;
261
+ break;
262
+ }
263
+ real = walked.path;
264
+ parents.set(parent, real);
265
+ }
266
+ if (real === null)
267
+ continue;
268
+ // Only the last component is new: a link there is walked in full.
269
+ const full = path.join(real, path.basename(w));
270
+ if (--budget.left < 0) {
271
+ dirs = null;
272
+ break;
273
+ }
274
+ let st;
275
+ try {
276
+ st = fs.lstatSync(full);
277
+ }
278
+ catch {
279
+ continue;
280
+ }
281
+ if (!st.isSymbolicLink()) {
282
+ dirs.push(full);
283
+ continue;
284
+ }
285
+ const walked = (0, claude_switches_1.localPhysicalRealpath)(full, budget);
286
+ if (walked.exhausted) {
287
+ dirs = null;
288
+ break;
289
+ }
290
+ if (walked.path !== null)
291
+ dirs.push(walked.path);
292
+ }
293
+ RESOLVED_MEMO.set(common, { at: Date.now(), dirs });
294
+ return dirs;
295
+ }
296
+ function workspaceUncached(realTarget) {
297
+ // Round 32: every repository around the target (below the home directory), and the repository that owns a `.git` FILE
298
+ // — a submodule's or a linked worktree's — followed through its `gitdir:` (the owning, enclosing or main checkout's
299
+ // wrapper, spelled as a known absolute path, ran and passed — measured).
300
+ // `$HOME` as os.homedir() reads it on POSIX, from this process's environment.
301
+ const home = (() => { try {
302
+ return fs.realpathSync.native(process.platform !== 'win32' && process.env.HOME ? process.env.HOME : os.homedir());
303
+ }
304
+ catch {
305
+ return '';
306
+ } })();
307
+ const atOrAboveHome = (d) => home !== '' && (d === home || isWithin(d, home));
308
+ const roots = new Set([realTarget]);
309
+ const commons = new Set();
310
+ // Round 34: a common git directory counts unless its checkout is the home directory or above it (round 33 added a home
311
+ // dotfiles repository as an owner: nvm's node under home read FAIL — measured, a regression).
312
+ const addCommon = (d) => {
313
+ const c = commonGitDirAt(d);
314
+ if (c === null || c === exports.REMOTE_GIT)
315
+ return;
316
+ if (path.basename(c) === '.git' && atOrAboveHome(path.dirname(c)))
317
+ return;
318
+ commons.add(c);
319
+ };
320
+ const walked = new Set();
321
+ const visit = (start, depth) => {
322
+ for (let d = start;;) {
323
+ if (walked.has(d) || walked.size > 4096)
324
+ return;
325
+ walked.add(d);
326
+ if (atOrAboveHome(d))
327
+ return;
328
+ let st = null;
329
+ try {
330
+ st = fs.lstatSync(path.join(d, '.git'));
331
+ }
332
+ catch { /* none here */ }
333
+ if (st !== null) {
334
+ roots.add(d);
335
+ addCommon(d);
336
+ if (st.isFile() && depth < 8)
337
+ for (const owner of gitdirOwners(d)) {
338
+ if (atOrAboveHome(owner))
339
+ continue;
340
+ roots.add(owner);
341
+ visit(owner, depth + 1);
342
+ }
343
+ }
344
+ const parent = path.dirname(d);
345
+ if (parent === d)
346
+ return;
347
+ d = parent;
348
+ }
349
+ };
350
+ visit(realTarget, 0);
351
+ return { roots: [...roots], commons: [...commons] };
352
+ }
353
+ /**
354
+ * The checkout a `.git` file shares a repository with: the parent of the `.git` directory its `gitdir:` points into (a
355
+ * submodule's super-repository, a worktree's main checkout). Round 34: sibling worktrees are found by their common git
356
+ * directory (`inWorkspace`), not by listing `worktrees/`.
357
+ */
358
+ function gitdirOwners(dir) {
359
+ const c = commonGitDirAt(dir);
360
+ if (c === null || c === exports.REMOTE_GIT)
361
+ return [];
362
+ for (let d = c, i = 0; i < 64; i++) {
363
+ if (path.basename(d) === '.git')
364
+ return [path.dirname(d)];
365
+ const parent = path.dirname(d);
366
+ if (parent === d)
367
+ break;
368
+ d = parent;
369
+ }
370
+ return [];
371
+ }
372
+ function isWithin(root, p) {
373
+ const rel = path.relative(root, p);
374
+ return rel === '' || (rel !== '..' && !rel.startsWith('..' + path.sep) && !path.isAbsolute(rel));
375
+ }
@@ -3,4 +3,5 @@ import type { Check } from './doctor-check';
3
3
  /** Disk preparation evidence for one selected harness. It never observes a client's loaded config. */
4
4
  export declare function worktreeReadinessChecks(packageRoot: string, target: string, opts?: {
5
5
  agent?: Agent;
6
+ codexConfigPath?: string;
6
7
  }): Check[];
@@ -34,16 +34,27 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.worktreeReadinessChecks = worktreeReadinessChecks;
37
- // @implements A-SPEC-704
37
+ // @implements A-SPEC-724, A-SPEC-704
38
38
  const fs = __importStar(require("node:fs"));
39
39
  const path = __importStar(require("node:path"));
40
40
  const workspace_checkout_1 = require("../project/workspace-checkout");
41
41
  const workspace_identity_1 = require("../project/workspace-identity");
42
+ const codex_toml_1 = require("./codex-toml");
43
+ // Codex's MCP entry lives in its user-level config (A-SPEC-721), judged separately below; the
44
+ // repository-local .codex/config.toml is inactive and init no longer writes it (A-SPEC-724).
42
45
  const WIRING = {
43
46
  claude: ['.mcp.json'],
44
- codex: ['.codex/config.toml', '.claude-plugin/marketplace.json'],
47
+ codex: ['.claude-plugin/marketplace.json'],
45
48
  antigravity: ['.agents/mcp_config.json', '.agents/hooks.json'],
46
49
  };
50
+ function codexActiveEntryPresent(configPath) {
51
+ try {
52
+ return (0, codex_toml_1.hasCodexHolmesTable)(fs.readFileSync(configPath, 'utf8'));
53
+ }
54
+ catch {
55
+ return false;
56
+ }
57
+ }
47
58
  /** Disk preparation evidence for one selected harness. It never observes a client's loaded config. */
48
59
  function worktreeReadinessChecks(packageRoot, target, opts = {}) {
49
60
  const agent = opts.agent;
@@ -63,12 +74,15 @@ function worktreeReadinessChecks(packageRoot, target, opts = {}) {
63
74
  }
64
75
  const files = WIRING[agent];
65
76
  const missing = files.filter((file) => !fs.existsSync(path.join(target, file)));
77
+ const codexConfig = opts.codexConfigPath ?? (0, codex_toml_1.defaultCodexConfigPath)();
78
+ if (agent === 'codex' && !codexActiveEntryPresent(codexConfig))
79
+ missing.unshift(`holmes-kit entry in the active Codex config ${codexConfig}`);
66
80
  const build = fs.existsSync(path.join(packageRoot, 'dist', 'holmes', 'mcp', 'server.js'));
67
81
  const level = missing.length || identityWarning || checkout.kind === 'unknown' || !build ? 'WARN' : 'PASS';
68
82
  const repair = `Run holmes-kit init --target ${target} --agent ${agent}, then restart that harness session.`;
69
83
  const detail = [
70
84
  `disk preparation only: ${agent}; checkout=${checkout.kind}${checkout.detached ? ' (detached)' : ''}; identity=${identity}.`,
71
- missing.length ? `missing local wiring: ${missing.join(', ')}.` : `local wiring present: ${files.join(', ')}.`,
85
+ missing.length ? `missing local wiring: ${missing.join(', ')}.` : `local wiring present: ${[...(agent === 'codex' ? [codexConfig] : []), ...files].join(', ')}.`,
72
86
  build ? 'package build is present.' : 'package build is absent.',
73
87
  'This does not prove whether a current client loaded hooks or MCP configuration.',
74
88
  ].join(' ');