@holmes-lab/holmes-kit 0.35.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/README.md +5 -0
- package/dist/.build-id +1 -1
- package/dist/holmes/cli/codex-oracle.js +36 -2
- package/dist/holmes/cli/doctor.d.ts +14 -1
- package/dist/holmes/cli/doctor.js +335 -71
- package/dist/holmes/cli/index.d.ts +1 -1
- package/dist/holmes/cli/index.js +38 -5
- package/dist/holmes/cli/runtime-binding-approval.d.ts +7 -0
- package/dist/holmes/cli/runtime-binding-approval.js +102 -0
- package/dist/holmes/cli/runtime-binding.d.ts +29 -0
- package/dist/holmes/cli/runtime-binding.js +570 -0
- package/dist/holmes/governance/approval-queue.d.ts +2 -0
- package/dist/holmes/governance/approval-queue.js +11 -4
- package/dist/holmes/guardrail/risk-classifier.js +45 -24
- package/dist/holmes/guardrail/shell-argument-roles.d.ts +15 -0
- package/dist/holmes/guardrail/shell-argument-roles.js +209 -0
- package/dist/holmes/guardrail/shell-syntax.d.ts +20 -0
- package/dist/holmes/guardrail/shell-syntax.js +489 -0
- package/dist/holmes/guardrail/shell-words.d.ts +2 -18
- package/dist/holmes/guardrail/shell-words.js +15 -441
- package/dist/holmes/guardrail/write-target.d.ts +54 -0
- package/dist/holmes/guardrail/write-target.js +327 -1
- package/dist/holmes/hooks/pre-tool-use.d.ts +12 -0
- package/dist/holmes/hooks/pre-tool-use.js +377 -66
- package/dist/holmes/mcp/handlers.d.ts +9 -1
- package/dist/holmes/mcp/handlers.js +6 -4
- package/dist/holmes/mcp/operator-recovery.d.ts +9 -0
- package/dist/holmes/mcp/operator-recovery.js +63 -0
- package/dist/holmes/runtime/binding.d.ts +30 -0
- package/dist/holmes/runtime/binding.js +164 -0
- package/dist/holmes/runtime/dispatch.d.ts +9 -0
- package/dist/holmes/runtime/dispatch.js +169 -0
- package/dist/holmes/runtime/hook-process.d.ts +11 -0
- package/dist/holmes/runtime/hook-process.js +130 -0
- package/docs/install-guide.md +65 -0
- package/package.json +1 -1
|
@@ -67,7 +67,7 @@ exports.wiringHandshakeChecks = wiringHandshakeChecks;
|
|
|
67
67
|
exports.semanticCoverageCheck = semanticCoverageCheck;
|
|
68
68
|
exports.semanticTierVerdict = semanticTierVerdict;
|
|
69
69
|
exports.detectTreeKeyTemporary = detectTreeKeyTemporary;
|
|
70
|
-
// @implements A-SPEC-733, A-SPEC-727, A-SPEC-721, A-SPEC-738, A-SPEC-734
|
|
70
|
+
// @implements A-SPEC-733, A-SPEC-727, A-SPEC-721, A-SPEC-738, A-SPEC-734, A-SPEC-751
|
|
71
71
|
// @implements A-SPEC-704, A-SPEC-710, A-SPEC-712
|
|
72
72
|
const doctor_guidance_1 = require("./doctor-guidance");
|
|
73
73
|
// @implements A-SPEC-264, A-SPEC-423, A-SPEC-549.1, A-SPEC-590
|
|
@@ -207,6 +207,129 @@ function resolvesToPackage(filePath, packageRoot) {
|
|
|
207
207
|
return false;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
+
const runtime_binding_1 = require("./runtime-binding");
|
|
211
|
+
const binding_1 = require("../runtime/binding");
|
|
212
|
+
const RUNTIME_REPAIR = 'Run runtime-binding status and runtime-binding setup --dry-run to review the operator installation.';
|
|
213
|
+
function routedNativeState(raw, command) {
|
|
214
|
+
const doc = JSON.parse(raw);
|
|
215
|
+
const indices = [];
|
|
216
|
+
let stops = 0;
|
|
217
|
+
const bad = [];
|
|
218
|
+
for (const event of ['PreToolUse', 'Stop']) {
|
|
219
|
+
for (const [i, group] of (doc.hooks?.[event] ?? []).entries()) {
|
|
220
|
+
for (const [j, hook] of (group.hooks ?? []).entries()) {
|
|
221
|
+
if (hook.command !== command(event === 'PreToolUse' ? 'pre-tool-use' : 'stop'))
|
|
222
|
+
continue;
|
|
223
|
+
if (hook.type !== 'command' || hook.async === true || group.hooks.some((h) => h.type === 'prompt' || h.type === 'agent') || (event === 'PreToolUse' && group.matcher !== '.*'))
|
|
224
|
+
bad.push(`${event} must be a synchronous command with the full matcher`);
|
|
225
|
+
if (event === 'PreToolUse')
|
|
226
|
+
indices.push(`${i}:${j}`);
|
|
227
|
+
else
|
|
228
|
+
stops++;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return { indices, stops, bad, emptyStop: Array.isArray(doc.hooks?.Stop) && doc.hooks.Stop.length === 0 };
|
|
233
|
+
}
|
|
234
|
+
function routedCodexDisabled(raw, hooksPath, indices, event = 'pre_tool_use') {
|
|
235
|
+
if (raw === null)
|
|
236
|
+
return false;
|
|
237
|
+
const parsed = (0, codex_toml_1.parseCodexConfig)(raw);
|
|
238
|
+
if (!parsed.ok)
|
|
239
|
+
return false;
|
|
240
|
+
const doc = parsed.doc;
|
|
241
|
+
if (doc.features?.hooks === false)
|
|
242
|
+
return true;
|
|
243
|
+
const paths = new Set([hooksPath]);
|
|
244
|
+
try {
|
|
245
|
+
paths.add(fs.realpathSync(hooksPath));
|
|
246
|
+
paths.add(fs.realpathSync.native(hooksPath));
|
|
247
|
+
}
|
|
248
|
+
catch { /* unreadable source is diagnosed separately */ }
|
|
249
|
+
const norm = (s) => process.platform === 'win32' ? s.toLowerCase() : s;
|
|
250
|
+
const keys = new Set([...paths].flatMap((p) => indices.map((i) => norm(`${p}:${event}:${i}`))));
|
|
251
|
+
return Object.entries(doc.hooks?.state ?? {}).some(([k, v]) => keys.has(norm(k)) && v?.enabled === false);
|
|
252
|
+
}
|
|
253
|
+
// Diagnose sources together: a disabled user hook does not disable a project hook.
|
|
254
|
+
// Native listings lack source paths, so even a matching listing cannot prove live trust.
|
|
255
|
+
function possibleCodexGate(command) {
|
|
256
|
+
// Recognition is diagnostic only: a familiar dispatcher basename confers no trust.
|
|
257
|
+
return (0, settings_merge_1.isHolmesCommand)(command) || /[/\\]codex-(?:pre-tool-use|stop)\.js(?:["'\s]|$)/.test(command);
|
|
258
|
+
}
|
|
259
|
+
function readCodexNativeSource(file) {
|
|
260
|
+
const max = 2 * 1024 * 1024;
|
|
261
|
+
const fd = fs.openSync(file, fs.constants.O_RDONLY | (fs.constants.O_NONBLOCK ?? 0));
|
|
262
|
+
try {
|
|
263
|
+
const stat = fs.fstatSync(fd);
|
|
264
|
+
if (!stat.isFile() || stat.size > max)
|
|
265
|
+
throw new Error(`Not a bounded regular hook file: ${file}`);
|
|
266
|
+
const bytes = Buffer.alloc(max + 1);
|
|
267
|
+
let size = 0;
|
|
268
|
+
while (size < bytes.length) {
|
|
269
|
+
const count = fs.readSync(fd, bytes, size, bytes.length - size, null);
|
|
270
|
+
if (!count)
|
|
271
|
+
break;
|
|
272
|
+
size += count;
|
|
273
|
+
}
|
|
274
|
+
if (size > max)
|
|
275
|
+
throw new Error(`Hook file exceeds size limit: ${file}`);
|
|
276
|
+
// Unlike generic text reads, preserve a BOM so the native parser can reject it.
|
|
277
|
+
const decoded = (0, codex_hooks_1.decodeCodexHooksBytes)(bytes.subarray(0, size));
|
|
278
|
+
if (!decoded.ok)
|
|
279
|
+
throw new Error(`${file}: ${decoded.reason}`);
|
|
280
|
+
return decoded.text;
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
fs.closeSync(fd);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function routedCodexSources(target, userPath, userRaw, configRaw, routed) {
|
|
287
|
+
const configs = [configRaw];
|
|
288
|
+
const projectConfig = path.join(target, '.codex/config.toml');
|
|
289
|
+
if (fs.existsSync(projectConfig))
|
|
290
|
+
configs.push((0, binding_1.readBounded)(projectConfig));
|
|
291
|
+
for (const raw of configs)
|
|
292
|
+
if (raw !== null && !(0, codex_toml_1.parseCodexConfig)(raw).ok)
|
|
293
|
+
throw new Error('Codex configuration cannot be parsed');
|
|
294
|
+
const projectPath = path.join(target, '.codex/hooks.json');
|
|
295
|
+
return [{ name: 'codex user hooks', file: userPath, raw: userRaw },
|
|
296
|
+
{ name: 'codex project hooks', file: projectPath, raw: fs.existsSync(projectPath) ? readCodexNativeSource(projectPath) : null }].map((source) => {
|
|
297
|
+
if (source.raw !== null) {
|
|
298
|
+
const shape = (0, codex_hooks_1.inspectCodexUserHooks)(source.raw);
|
|
299
|
+
if (shape.state === 'invalid')
|
|
300
|
+
throw new Error(`${source.file}: ${shape.reason}`);
|
|
301
|
+
}
|
|
302
|
+
const doc = source.raw === null ? {} : JSON.parse(source.raw);
|
|
303
|
+
const issues = [];
|
|
304
|
+
const active = [];
|
|
305
|
+
let disabled = 0;
|
|
306
|
+
for (const event of ['PreToolUse', 'Stop']) {
|
|
307
|
+
const groups = doc.hooks?.[event] ?? [];
|
|
308
|
+
if (!Array.isArray(groups))
|
|
309
|
+
throw new Error(`${source.file}: ${event} must be an array`);
|
|
310
|
+
for (const [i, group] of groups.entries()) {
|
|
311
|
+
const entries = group.hooks ?? [];
|
|
312
|
+
for (const [j, hook] of entries.entries()) {
|
|
313
|
+
if (!hook || typeof hook !== 'object')
|
|
314
|
+
throw new Error(`${source.file}: invalid hook`);
|
|
315
|
+
const expected = routed.command('codex', event === 'PreToolUse' ? 'pre-tool-use' : 'stop');
|
|
316
|
+
if (hook.command !== expected && !(typeof hook.command === 'string' && possibleCodexGate(hook.command)))
|
|
317
|
+
continue;
|
|
318
|
+
if (configs.some((raw) => routedCodexDisabled(raw, source.file, [`${i}:${j}`], event === 'PreToolUse' ? 'pre_tool_use' : 'stop'))) {
|
|
319
|
+
disabled++;
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
if (hook.command !== expected)
|
|
323
|
+
issues.push(`${event} has an active legacy or conflicting Holmes command`);
|
|
324
|
+
if (hook.type !== 'command' || hook.async === true || entries.some((h) => h?.type === 'prompt' || h?.type === 'agent') || (event === 'PreToolUse' && group.matcher !== '.*'))
|
|
325
|
+
issues.push(`${event} must be a synchronous command with the full matcher`);
|
|
326
|
+
active.push(event);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return { ...source, issues, active, disabled, emptyStop: Array.isArray(doc.hooks?.Stop) && doc.hooks.Stop.length === 0 };
|
|
331
|
+
});
|
|
332
|
+
}
|
|
210
333
|
const worktree_readiness_1 = require("./worktree-readiness");
|
|
211
334
|
const linear_match_1 = require("../guardrail/linear-match");
|
|
212
335
|
const bounded_io_1 = require("../project/bounded-io");
|
|
@@ -582,6 +705,25 @@ function resolveWiringPath(target, arg) {
|
|
|
582
705
|
async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
583
706
|
const checks = (0, doctor_guidance_1.guidanceChecks)(packageRoot, target ?? process.cwd());
|
|
584
707
|
const add = (name, level, detail, fix) => checks.push({ name, level, detail, fix });
|
|
708
|
+
const runtimeRegistry = opts?.runtimeRegistryPath ?? (0, runtime_binding_1.defaultRuntimeRegistry)();
|
|
709
|
+
let routed;
|
|
710
|
+
if (fs.existsSync(runtimeRegistry)) {
|
|
711
|
+
try {
|
|
712
|
+
const report = (0, runtime_binding_1.runtimeBindingStatus)(runtimeRegistry, target ?? process.cwd());
|
|
713
|
+
const s = report.selection;
|
|
714
|
+
if (report.conflicts.length === 0) {
|
|
715
|
+
const script = (h, e) => path.join(path.dirname(runtimeRegistry), `${h}-${e}.js`);
|
|
716
|
+
routed = { script, command: (h, e) => (0, runtime_binding_1.runtimeHookCommand)(runtimeRegistry, h, e),
|
|
717
|
+
mcp: (h, e) => ['claude', 'codex', 'antigravity'].includes(h) && e?.command === process.execPath
|
|
718
|
+
&& Array.isArray(e.args) && e.args.length === 1 && e.args[0] === script(h, 'mcp') };
|
|
719
|
+
}
|
|
720
|
+
add('runtime binding', report.conflicts.length ? 'FAIL' : 'WARN', `${s.mode}: workspace=${s.workspaceRoot}; package=${s.packageRoot}; build=${s.buildId}; specs=${s.specsRoot}; live activation unverified`
|
|
721
|
+
+ (report.conflicts.length ? `; ${report.conflicts.join('; ')}` : ''), 'Use runtime-binding status and setup --dry-run to inspect routed wiring. Native hook trust and enable state remain operator-controlled.');
|
|
722
|
+
}
|
|
723
|
+
catch (e) {
|
|
724
|
+
add('runtime binding', 'FAIL', e.message, 'Repair the registered build or preview runtime-binding setup; never silently fall back to a release.');
|
|
725
|
+
}
|
|
726
|
+
}
|
|
585
727
|
// Round 43: every wiring-derived script is walked once per run.
|
|
586
728
|
const judge = scriptJudge(packageRoot);
|
|
587
729
|
// Round 50: and every launch started once per run.
|
|
@@ -696,7 +838,7 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
696
838
|
// prove the wiring each harness will really run reaches a server. Measured: 367ms for three.
|
|
697
839
|
// A doctor run with no target has no harness wiring to prove — skipped, not failed.
|
|
698
840
|
if (target)
|
|
699
|
-
checks.push(...await wiringHandshakeChecks(target, opts?.codexConfigPath));
|
|
841
|
+
checks.push(...await wiringHandshakeChecks(target, opts?.codexConfigPath, packageRoot, routed));
|
|
700
842
|
// @implements A-SPEC-251.2 (0.31.0) — an npx wiring hands each session workspace the server's launch.
|
|
701
843
|
if (target)
|
|
702
844
|
checks.push(...wiringLauncherChecks(target, opts?.codexConfigPath));
|
|
@@ -716,64 +858,106 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
716
858
|
// itself is worse than either verdict alone, because the remedy it prints re-runs a completed
|
|
717
859
|
// install. Both checks now read the file the target actually uses.
|
|
718
860
|
const sp = wiredSettingsPath(target);
|
|
719
|
-
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
for (const g of groups)
|
|
726
|
-
for (const h of Array.isArray(g?.hooks) ? g.hooks : [])
|
|
727
|
-
if ((0, settings_merge_1.isHolmesCommand)(h?.command))
|
|
728
|
-
cmds.push(h.command);
|
|
861
|
+
if (routed) {
|
|
862
|
+
const env = (0, claude_switches_1.claudeSwitchEnv)();
|
|
863
|
+
if (opts?.claudeHome) {
|
|
864
|
+
env.home = opts.claudeHome;
|
|
865
|
+
env.claudeConfigDir = path.join(opts.claudeHome, '.claude');
|
|
866
|
+
delete env.rawConfigDir;
|
|
729
867
|
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
868
|
+
const switches = (0, claude_switches_1.claudeSwitches)(target, env);
|
|
869
|
+
const sources = [(0, claude_switches_1.claudeUserSettingsPath)(env), path.join(target, '.claude/settings.json'), path.join(target, '.claude/settings.local.json')].filter((p) => p !== null);
|
|
870
|
+
let pre = 0;
|
|
871
|
+
let stop = 0;
|
|
872
|
+
let emptyStop = false;
|
|
873
|
+
const issues = [];
|
|
874
|
+
for (const file of sources) {
|
|
875
|
+
if (!fs.existsSync(file))
|
|
876
|
+
continue;
|
|
877
|
+
try {
|
|
878
|
+
const settings = readSettingsBounded(file);
|
|
879
|
+
if (settings === 'large') {
|
|
880
|
+
issues.push(`${file} exceeds the native size limit`);
|
|
881
|
+
continue;
|
|
882
|
+
}
|
|
883
|
+
const native = routedNativeState(JSON.stringify(settings), (e) => routed.command('claude', e));
|
|
884
|
+
pre += native.indices.length;
|
|
885
|
+
stop += native.stops;
|
|
886
|
+
emptyStop ||= native.emptyStop;
|
|
887
|
+
issues.push(...native.bad.map((s) => `${file}: ${s}`));
|
|
748
888
|
}
|
|
749
889
|
catch {
|
|
750
|
-
|
|
751
|
-
}
|
|
752
|
-
const claudeNode = cmds.some((c) => /^node\s/.test(c.trim())) ? (0, mcp_launcher_1.gateNodeFinding)(target, (place) => !(0, workspace_scope_1.targetHoldsHome)(realTargetHere) && ((0, workspace_scope_1.inWorkspace)(realTargetHere, place) || (0, workspace_scope_1.isWithin)(path.resolve(target), place)), false) : null;
|
|
753
|
-
if (stale.length > 0)
|
|
754
|
-
add('target wiring', 'FAIL', `stale/foreign command(s): ${(0, codex_oracle_1.cappedList)(stale)}`, 'Re-run `holmes-kit init --force` in the target to refresh the absolute paths.');
|
|
755
|
-
else if (claudeNode !== null && claudeNode.level === 'FAIL')
|
|
756
|
-
add('target wiring', 'FAIL', `Claude runs the hook commands in ${target}, where "node" is found as ${(0, codex_oracle_1.clipText)(claudeNode.file)} through that directory or a relative PATH entry — whatever file is there runs as the gate`, 'Remove that file, or the relative entry in PATH that finds it.');
|
|
757
|
-
else if (claudeNode !== null)
|
|
758
|
-
add('target wiring', 'WARN', (0, mcp_launcher_1.gateNodeUnconfirmed)(claudeNode, (s) => (0, codex_oracle_1.clipText)(s)), 'Confirm that file is node, or put the node you trust first in PATH.');
|
|
759
|
-
else if (rel.length > 0)
|
|
760
|
-
add('target wiring', 'WARN', relativeDetail(rel), RELATIVE_FIX);
|
|
761
|
-
else if (unknown.length > 0)
|
|
762
|
-
add('target wiring', 'WARN', UNKNOWN_DETAIL(unknown), RELATIVE_FIX);
|
|
763
|
-
else if (abs.length > HOOK_SCRIPTS_JUDGED)
|
|
764
|
-
add('target wiring', 'WARN', `${abs.length} distinct holmes hook scripts, of which only the first ${HOOK_SCRIPTS_JUDGED} were judged — not confirmed`, RELATIVE_FIX);
|
|
765
|
-
else
|
|
766
|
-
add('target wiring', 'PASS', `${cmds.length} holmes hook(s) resolve to this install`);
|
|
890
|
+
issues.push(`${file} cannot be parsed`);
|
|
891
|
+
}
|
|
767
892
|
}
|
|
893
|
+
if (pre !== 1 || (stop !== 1 && !(emptyStop && stop === 0)))
|
|
894
|
+
issues.push('expected exactly one registered PreToolUse and Stop across Claude sources');
|
|
895
|
+
issues.push(...switches.hooksOff.map((p) => `hooks switched off by ${p}`), ...switches.toolsOff.map((p) => `MCP tools disabled by ${p}`), ...switches.unreadable);
|
|
896
|
+
add('target wiring', issues.length ? 'FAIL' : 'WARN', issues.length ? issues.join('; ') : `Registered Claude dispatcher commands verified; ${emptyStop && stop === 0 ? 'Stop remains explicitly empty; ' : ''}native trust and live activation unverified`, RUNTIME_REPAIR);
|
|
897
|
+
const uncertainty = [...switches.notApplied, ...switches.unconfirmed, ...switches.spared];
|
|
898
|
+
if (uncertainty.length)
|
|
899
|
+
add('claude native policy', 'WARN', uncertainty.join('; '), 'Review the named native policy before treating the gate as active.');
|
|
768
900
|
}
|
|
769
|
-
|
|
770
|
-
|
|
901
|
+
else {
|
|
902
|
+
try {
|
|
903
|
+
const settings = readSettingsBounded(sp);
|
|
904
|
+
const cmds = [];
|
|
905
|
+
for (const groups of settings === 'large' ? [] : Object.values(settings.hooks ?? {})) {
|
|
906
|
+
if (!Array.isArray(groups))
|
|
907
|
+
continue; // A-SPEC-251.2 round 34: a key beside the events Claude drops
|
|
908
|
+
for (const g of groups)
|
|
909
|
+
for (const h of Array.isArray(g?.hooks) ? g.hooks : [])
|
|
910
|
+
if ((0, settings_merge_1.isHolmesCommand)(h?.command))
|
|
911
|
+
cmds.push(h.command);
|
|
912
|
+
}
|
|
913
|
+
if (settings === 'large')
|
|
914
|
+
add('target wiring', 'WARN', `${sp} is larger than ${claude_switches_1.CLAUDE_SETTINGS_MAX_BYTES / (1024 * 1024)} MiB, which Claude does not read — not judged`, 'Run `holmes-kit init` in the target.');
|
|
915
|
+
else if (cmds.length === 0)
|
|
916
|
+
add('target wiring', 'WARN', `no holmes hooks found in ${sp}`, 'Run `holmes-kit init` in the target.');
|
|
917
|
+
else {
|
|
918
|
+
// Round 43: each distinct script once, and at most 16 of them.
|
|
919
|
+
const scripts = [...new Set(cmds.map((c) => (0, settings_merge_1.hookScriptPath)(c)))];
|
|
920
|
+
const rel = scripts.filter(relativeScript);
|
|
921
|
+
const abs = scripts.filter((p) => !relativeScript(p));
|
|
922
|
+
const judged = abs.slice(0, HOOK_SCRIPTS_JUDGED).map((p) => ({ p, v: judge(p) }));
|
|
923
|
+
const staleScripts = new Set(judged.filter((j) => j.v !== 'this' && j.v !== 'unknown').map((j) => j.p));
|
|
924
|
+
const stale = [...new Set(cmds.filter((c) => staleScripts.has((0, settings_merge_1.hookScriptPath)(c))))];
|
|
925
|
+
const unknown = judged.filter((j) => j.v === 'unknown').map((j) => j.p);
|
|
926
|
+
// @implements A-SPEC-251.2 (round 46) — Claude runs a command hook in the session's directory: a `node` the launcher finds
|
|
927
|
+
// there first (a relative PATH entry; win32 looks in the directory first) is the workspace's, not node.
|
|
928
|
+
// Round 47: by how it was found — a relative PATH entry or the directory is FAIL, an absolute entry into the workspace WARN.
|
|
929
|
+
const realTargetHere = (() => { try {
|
|
930
|
+
return fs.realpathSync.native(target);
|
|
931
|
+
}
|
|
932
|
+
catch {
|
|
933
|
+
return path.resolve(target);
|
|
934
|
+
} })();
|
|
935
|
+
const claudeNode = cmds.some((c) => /^node\s/.test(c.trim())) ? (0, mcp_launcher_1.gateNodeFinding)(target, (place) => !(0, workspace_scope_1.targetHoldsHome)(realTargetHere) && ((0, workspace_scope_1.inWorkspace)(realTargetHere, place) || (0, workspace_scope_1.isWithin)(path.resolve(target), place)), false) : null;
|
|
936
|
+
if (stale.length > 0)
|
|
937
|
+
add('target wiring', 'FAIL', `stale/foreign command(s): ${(0, codex_oracle_1.cappedList)(stale)}`, 'Re-run `holmes-kit init --force` in the target to refresh the absolute paths.');
|
|
938
|
+
else if (claudeNode !== null && claudeNode.level === 'FAIL')
|
|
939
|
+
add('target wiring', 'FAIL', `Claude runs the hook commands in ${target}, where "node" is found as ${(0, codex_oracle_1.clipText)(claudeNode.file)} through that directory or a relative PATH entry — whatever file is there runs as the gate`, 'Remove that file, or the relative entry in PATH that finds it.');
|
|
940
|
+
else if (claudeNode !== null)
|
|
941
|
+
add('target wiring', 'WARN', (0, mcp_launcher_1.gateNodeUnconfirmed)(claudeNode, (s) => (0, codex_oracle_1.clipText)(s)), 'Confirm that file is node, or put the node you trust first in PATH.');
|
|
942
|
+
else if (rel.length > 0)
|
|
943
|
+
add('target wiring', 'WARN', relativeDetail(rel), RELATIVE_FIX);
|
|
944
|
+
else if (unknown.length > 0)
|
|
945
|
+
add('target wiring', 'WARN', UNKNOWN_DETAIL(unknown), RELATIVE_FIX);
|
|
946
|
+
else if (abs.length > HOOK_SCRIPTS_JUDGED)
|
|
947
|
+
add('target wiring', 'WARN', `${abs.length} distinct holmes hook scripts, of which only the first ${HOOK_SCRIPTS_JUDGED} were judged — not confirmed`, RELATIVE_FIX);
|
|
948
|
+
else
|
|
949
|
+
add('target wiring', 'PASS', `${cmds.length} holmes hook(s) resolve to this install`);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
catch {
|
|
953
|
+
add('target wiring', 'WARN', `could not read ${sp}`, 'Run `holmes-kit init` in the target.');
|
|
954
|
+
}
|
|
771
955
|
}
|
|
772
956
|
// @implements A-SPEC-251.2 (round 30) — the files that switch Claude's hooks off (a committed `disableAllHooks`
|
|
773
957
|
// left every check above PASS while no hook ran — measured). Asked wherever the target carries Claude wiring.
|
|
774
958
|
// Round 31: only where Holmes's Claude wiring is (a target whose `.mcp.json` named another server got a FAIL — measured).
|
|
775
959
|
// Round 40: the canonical gate's script is judged against this install (a gate naming a missing old install read PASS).
|
|
776
|
-
if (holmesClaudeWired(target)) {
|
|
960
|
+
if (!routed && holmesClaudeWired(target)) {
|
|
777
961
|
// Round 42: a path doctor refuses to look up (network) is unknown, not missing (a `/net/…` gate read FAIL — measured).
|
|
778
962
|
// Round 43: and so is one past the walk's bound; each script is walked once.
|
|
779
963
|
checks.push((0, claude_switches_1.claudeHookSwitchesCheck)(target, undefined, (script) => {
|
|
@@ -1309,6 +1493,9 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1309
1493
|
if (!server || typeof server.command !== 'string' || !Array.isArray(server.args) || !server.args.every((a) => typeof a === 'string')) {
|
|
1310
1494
|
add('mcp wiring spawn', 'WARN', `.mcp.json carries no runnable ${init_1.SERVER_NAME} entry`, 'Run `holmes-kit init` in the target to write the wiring.');
|
|
1311
1495
|
}
|
|
1496
|
+
else if (routed?.mcp('claude', server)) {
|
|
1497
|
+
add('mcp wiring spawn', 'PASS', 'Registered Claude dispatcher verified; handshake is checked separately');
|
|
1498
|
+
}
|
|
1312
1499
|
else if (launchBaseOf(target, (() => { try {
|
|
1313
1500
|
return fs.realpathSync.native(target);
|
|
1314
1501
|
}
|
|
@@ -1383,12 +1570,12 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1383
1570
|
// @implements A-SPEC-193 — for each wired harness, check that harness's wiring. A harness that is
|
|
1384
1571
|
// not wired is not diagnosed (calling an absence a defect turns doctor into noise).
|
|
1385
1572
|
const agyHooks = path.join(target, '.agents', 'hooks.json');
|
|
1386
|
-
if (fs.existsSync(agyHooks)) {
|
|
1573
|
+
if (fs.existsSync(agyHooks) || routed) {
|
|
1387
1574
|
try {
|
|
1388
1575
|
// Round 47: not read past 2 MiB (a 400 MiB file ended doctor out of memory — measured).
|
|
1389
|
-
if (fs.statSync(agyHooks).size > agents_1.AGY_HOOKS_MAX_BYTES)
|
|
1576
|
+
if (fs.existsSync(agyHooks) && fs.statSync(agyHooks).size > agents_1.AGY_HOOKS_MAX_BYTES)
|
|
1390
1577
|
throw new RangeError('large');
|
|
1391
|
-
const agyRaw = fs.readFileSync(agyHooks, 'utf8');
|
|
1578
|
+
const agyRaw = fs.existsSync(agyHooks) ? fs.readFileSync(agyHooks, 'utf8') : '{}';
|
|
1392
1579
|
const h = JSON.parse(agyRaw);
|
|
1393
1580
|
const entry = h['holmes-kit'];
|
|
1394
1581
|
// @implements A-SPEC-251.2 (round 46) — agy loads nothing from a file one named hook of which fails its parser, reads field
|
|
@@ -1430,7 +1617,48 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1430
1617
|
const rel = scripts.filter(relativeScript);
|
|
1431
1618
|
const unknownAgy = scripts.filter((p2) => !relativeScript(p2) && judge(p2) === 'unknown');
|
|
1432
1619
|
const enabled = entry?.enabled;
|
|
1433
|
-
if (
|
|
1620
|
+
if (routed) {
|
|
1621
|
+
const issues = [];
|
|
1622
|
+
let pres = 0;
|
|
1623
|
+
let stops = 0;
|
|
1624
|
+
let emptyStop = false;
|
|
1625
|
+
for (const file of [userHooks, agyHooks]) {
|
|
1626
|
+
if (!fs.existsSync(file))
|
|
1627
|
+
continue;
|
|
1628
|
+
if (fs.statSync(file).size > agents_1.AGY_HOOKS_MAX_BYTES) {
|
|
1629
|
+
issues.push(`${file} exceeds the native size limit`);
|
|
1630
|
+
continue;
|
|
1631
|
+
}
|
|
1632
|
+
const raw = fs.readFileSync(file, 'utf8');
|
|
1633
|
+
const doc = JSON.parse(raw);
|
|
1634
|
+
const problem = (0, agents_1.agyHooksFileProblem)(raw, doc);
|
|
1635
|
+
if (problem)
|
|
1636
|
+
issues.push(`${file}: ${problem}`);
|
|
1637
|
+
const ours = doc['holmes-kit'];
|
|
1638
|
+
if (!ours)
|
|
1639
|
+
continue;
|
|
1640
|
+
emptyStop ||= Array.isArray(ours.Stop) && ours.Stop.length === 0;
|
|
1641
|
+
if (ours.enabled === false)
|
|
1642
|
+
issues.push(`${file}: hooks are disabled`);
|
|
1643
|
+
for (const g of ours.PreToolUse ?? [])
|
|
1644
|
+
for (const hook of g.hooks ?? []) {
|
|
1645
|
+
if (hook.command === routed.command('antigravity', 'pre-tool-use')) {
|
|
1646
|
+
pres++;
|
|
1647
|
+
if (g.matcher !== '*')
|
|
1648
|
+
issues.push(`${file}: PreToolUse matcher must be *`);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
stops += (ours.Stop ?? []).filter((h2) => h2.command === routed.command('antigravity', 'stop')).length;
|
|
1652
|
+
}
|
|
1653
|
+
if (pres !== 1 || (stops !== 1 && !(emptyStop && stops === 0)))
|
|
1654
|
+
issues.push('expected exactly one registered PreToolUse and Stop across Antigravity sources');
|
|
1655
|
+
if (switches.offIn)
|
|
1656
|
+
issues.push(`hooks switched off by ${switches.offIn}`);
|
|
1657
|
+
if (switches.unconfirmed)
|
|
1658
|
+
issues.push(switches.unconfirmed);
|
|
1659
|
+
add('antigravity wiring', issues.length ? 'FAIL' : 'WARN', issues.length ? issues.join('; ') : `Registered Antigravity dispatcher commands verified; ${emptyStop && stops === 0 ? 'Stop remains explicitly empty; ' : ''}native activation unverified`, RUNTIME_REPAIR);
|
|
1660
|
+
}
|
|
1661
|
+
else if (entry === undefined) {
|
|
1434
1662
|
add('antigravity wiring', 'WARN', `${agyHooks} has no holmes-kit entry`, 'holmes-kit init --target <dir> --agent antigravity');
|
|
1435
1663
|
}
|
|
1436
1664
|
else if (enabled === false) {
|
|
@@ -1581,7 +1809,7 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1581
1809
|
}
|
|
1582
1810
|
// @implements A-SPEC-738 (round 16) — every layer node launch is checked against this install (shared cap).
|
|
1583
1811
|
// Round 18: and every layer npx launch against this install's version.
|
|
1584
|
-
const install = { bin: (() => { try {
|
|
1812
|
+
const install = { bin: routed?.mcp('codex', v.holmesTable) ? routed.script('codex', 'mcp') : (() => { try {
|
|
1585
1813
|
return fs.realpathSync.native(path.join(packageRoot, 'bin', 'holmes-mcp.js'));
|
|
1586
1814
|
}
|
|
1587
1815
|
catch {
|
|
@@ -1703,6 +1931,9 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1703
1931
|
// @implements A-SPEC-727 (round 10) — Codex loads the table but starts nothing (measured PASS).
|
|
1704
1932
|
add('codex wiring', 'FAIL', `${cdxToml} sets enabled = false in [mcp_servers.${init_1.SERVER_NAME}] — Codex does not start the Holmes MCP server`, `Remove the enabled = false line (or set it true) in ${cdxToml}, then restart Codex.`);
|
|
1705
1933
|
}
|
|
1934
|
+
else if (routed?.mcp('codex', entry)) {
|
|
1935
|
+
add('codex wiring', 'PASS', `MCP wiring selects the registered runtime through ${routed.script('codex', 'mcp')}; live activation unverified`);
|
|
1936
|
+
}
|
|
1706
1937
|
else if ((0, codex_oracle_1.launcherBase)(entry.command) === 'node') {
|
|
1707
1938
|
// @implements A-SPEC-266 — "resolves to this install" is not enough on existence alone: a
|
|
1708
1939
|
// node wiring must point at holmes-mcp.js. Passing any existing file (e.g. /etc/hosts) makes
|
|
@@ -1794,7 +2025,10 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1794
2025
|
if (installedPlugin) {
|
|
1795
2026
|
add('codex plugin install', 'PASS', 'The Holmes-Kit plugin snapshot is installed and enabled for this workspace. This proves new Codex sessions can load the plugin, not that the current live session already loaded its hooks.');
|
|
1796
2027
|
}
|
|
1797
|
-
if (
|
|
2028
|
+
if (routed && Array.isArray(h.hooks?.PreToolUse) && h.hooks.PreToolUse.length === 0 && Array.isArray(h.hooks?.Stop) && h.hooks.Stop.length === 0) {
|
|
2029
|
+
add('codex gate', 'WARN', 'The legacy plugin artifact has explicitly empty hooks; native user and project sources are diagnosed separately. Installed snapshots and live activation remain unverified.');
|
|
2030
|
+
}
|
|
2031
|
+
else if (stale.length > 0) {
|
|
1798
2032
|
add('codex gate', 'FAIL', `hook command(s) not pointing at this install: ${stale.map((c) => (0, codex_oracle_1.clipText)(c)).join(' | ')}`, 'Run holmes-kit init --target <dir> --agent codex --force to refresh the absolute paths.');
|
|
1799
2033
|
}
|
|
1800
2034
|
else if (manifest.hooks !== './hooks.json') {
|
|
@@ -1824,7 +2058,7 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1824
2058
|
}
|
|
1825
2059
|
}
|
|
1826
2060
|
else {
|
|
1827
|
-
add('codex gate', 'WARN', `The codex plugin wiring (.claude-plugin/marketplace.json, ${agents_1.CODEX_PLUGIN_DIR}) is missing — only the MCP tools work; the gate is not enforced`, `Wire it with holmes-kit init --target <dir> --agent codex, then install with ${installCmds}.`);
|
|
2061
|
+
add('codex gate', 'WARN', routed ? `The codex plugin wiring (.claude-plugin/marketplace.json, ${agents_1.CODEX_PLUGIN_DIR}) is missing; native user and project sources are diagnosed separately.` : `The codex plugin wiring (.claude-plugin/marketplace.json, ${agents_1.CODEX_PLUGIN_DIR}) is missing — only the MCP tools work; the gate is not enforced`, routed ? RUNTIME_REPAIR : `Wire it with holmes-kit init --target <dir> --agent codex, then install with ${installCmds}.`);
|
|
1828
2062
|
}
|
|
1829
2063
|
}
|
|
1830
2064
|
}
|
|
@@ -1857,25 +2091,22 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1857
2091
|
const hooksPath = cdxHooksPath;
|
|
1858
2092
|
let hooksRaw = null;
|
|
1859
2093
|
let unreadable = false;
|
|
1860
|
-
let
|
|
2094
|
+
let readFailure;
|
|
1861
2095
|
try {
|
|
1862
2096
|
if (fs.existsSync(hooksPath)) {
|
|
1863
2097
|
// @implements A-SPEC-727 (round 6) — strict UTF-8, as Codex reads it.
|
|
1864
|
-
|
|
1865
|
-
if (d.ok)
|
|
1866
|
-
hooksRaw = d.text;
|
|
1867
|
-
else
|
|
1868
|
-
undecodable = true;
|
|
2098
|
+
hooksRaw = readCodexNativeSource(hooksPath);
|
|
1869
2099
|
}
|
|
1870
2100
|
}
|
|
1871
|
-
catch {
|
|
2101
|
+
catch (error) {
|
|
1872
2102
|
unreadable = true;
|
|
2103
|
+
readFailure = (0, codex_oracle_1.clipText)(String(error));
|
|
1873
2104
|
}
|
|
1874
|
-
const state =
|
|
1875
|
-
: hooksRaw === null ? null : (0, codex_hooks_1.inspectCodexUserHooks)(hooksRaw);
|
|
2105
|
+
const state = hooksRaw === null ? null : (0, codex_hooks_1.inspectCodexUserHooks)(hooksRaw);
|
|
1876
2106
|
// @implements A-SPEC-738 — Codex drops a hooks file it cannot parse whole (and lists no hook when it
|
|
1877
2107
|
// refuses config.toml): its own message decides, before any reading of ours.
|
|
1878
|
-
const
|
|
2108
|
+
const routedSources = routed && (hooksRaw !== null || fs.existsSync(path.join(target, '.codex/hooks.json')));
|
|
2109
|
+
const hookVerdict = routedSources || hooksRaw !== null || targetWantsCodex || unreadable ? codexVerdict() : undefined;
|
|
1879
2110
|
if (hookVerdict?.available && (hookVerdict.otherHookProblems ?? []).length > 0) {
|
|
1880
2111
|
add('codex other hooks', 'WARN', `Codex could not load another hooks source (not the Holmes gate): ${(0, codex_oracle_1.cappedList)((hookVerdict.otherHookProblems ?? []).map((e) => e.trim()))}`, 'Fix that file by hand; the Holmes gate in the user hooks file is judged separately.');
|
|
1881
2112
|
}
|
|
@@ -1894,7 +2125,37 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1894
2125
|
add('codex user hooks', 'FAIL', `Codex does not load the Holmes gate: ${(0, codex_oracle_1.cappedList)(hookVerdict.hookErrors.map((e) => e.trim()))}`, `Fix ${hookVerdict.hookErrors.some((e) => /config\.toml/i.test(e)) ? (opts?.codexConfigPath ?? (0, codex_toml_1.defaultCodexConfigPath)()) : hooksPath} by hand (or run holmes-kit init --target <dir> --agent codex), then trust the hooks once with /hooks in codex.`);
|
|
1895
2126
|
}
|
|
1896
2127
|
else if (unreadable || state?.state === 'invalid') {
|
|
1897
|
-
add('codex user hooks', 'FAIL', `${hooksPath} cannot be read${state?.state === 'invalid' ? ` (${state.reason})` : ''} — Codex cannot load the Holmes gate from it`, 'Fix or remove the file, then run holmes-kit init --target <dir> --agent codex.');
|
|
2128
|
+
add('codex user hooks', 'FAIL', `${hooksPath} cannot be read${state?.state === 'invalid' ? ` (${state.reason})` : readFailure ? ` (${readFailure})` : ''} — Codex cannot load the Holmes gate from it`, 'Fix or remove the file, then run holmes-kit init --target <dir> --agent codex.');
|
|
2129
|
+
}
|
|
2130
|
+
else if (routed && routedSources) {
|
|
2131
|
+
try {
|
|
2132
|
+
const sources = routedCodexSources(target, hooksPath, hooksRaw, typeof cdxRaw === 'string' ? cdxRaw : null, routed);
|
|
2133
|
+
const aggregate = [];
|
|
2134
|
+
for (const event of ['PreToolUse', 'Stop']) {
|
|
2135
|
+
const count = sources.reduce((n, s) => n + s.active.filter((e) => e === event).length, 0);
|
|
2136
|
+
if (count > 1)
|
|
2137
|
+
aggregate.push(`${event} has multiple active Holmes entries across native sources`);
|
|
2138
|
+
if (count === 0 && !(event === 'Stop' && sources.some((s) => s.emptyStop)))
|
|
2139
|
+
aggregate.push(`${event} is missing or disabled across native sources`);
|
|
2140
|
+
if (hookVerdict?.available) {
|
|
2141
|
+
const expected = routed.command('codex', event === 'PreToolUse' ? 'pre-tool-use' : 'stop');
|
|
2142
|
+
const enabled = hookVerdict.hooks.filter((h) => h.enabled && h.event.replace(/_/g, '').toLowerCase() === event.toLowerCase());
|
|
2143
|
+
const listed = enabled.filter((h) => h.command === expected);
|
|
2144
|
+
if (enabled.some((h) => typeof h.command === 'string' && h.command !== expected && possibleCodexGate(h.command)))
|
|
2145
|
+
aggregate.push(`Codex lists an enabled potentially conflicting Holmes ${event} command from another source; inspect its native source before changing trust`);
|
|
2146
|
+
if (count > 0 && (listed.length !== 1 || (event === 'PreToolUse' && listed[0]?.matcher !== '.*')))
|
|
2147
|
+
aggregate.push(`Codex does not list exactly one enabled ${event} with the expected command and matcher; native hooks may be disabled or switched off`);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
for (const [i, source] of sources.entries()) {
|
|
2151
|
+
const issues = [...source.issues, ...(i === 0 ? aggregate : [])];
|
|
2152
|
+
add(source.name, issues.length ? 'FAIL' : 'WARN', issues.length ? issues.join('; ') :
|
|
2153
|
+
`${source.active.length ? 'Registered gate hooks are wired' : 'This source is empty or disabled'}; ${source.disabled ? `${source.disabled} disabled hook(s) preserved; ` : ''}${source.emptyStop ? 'Stop remains explicitly empty; ' : ''}native trust and live activation remain unverified`, RUNTIME_REPAIR);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
catch (error) {
|
|
2157
|
+
add('codex project hooks', 'FAIL', `Cannot diagnose native sources: ${(0, codex_oracle_1.clipText)(String(error))}`, RUNTIME_REPAIR);
|
|
2158
|
+
}
|
|
1898
2159
|
}
|
|
1899
2160
|
else if (state?.state === 'wired') {
|
|
1900
2161
|
// The file is user-level: whichever install last ran init owns every workspace's gate, so a
|
|
@@ -1957,7 +2218,7 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1957
2218
|
}
|
|
1958
2219
|
// @implements A-SPEC-738 — every Codex load verdict says whose it is.
|
|
1959
2220
|
{
|
|
1960
|
-
const lines = checks.slice(codexChecksFrom).filter((c) => c.name === 'codex wiring' || c.name === 'codex user hooks');
|
|
2221
|
+
const lines = checks.slice(codexChecksFrom).filter((c) => c.name === 'codex wiring' || c.name === 'codex user hooks' || c.name === 'codex project hooks');
|
|
1961
2222
|
if (lines.length > 0) {
|
|
1962
2223
|
const v = codexVerdict();
|
|
1963
2224
|
const label = v.available ? ' (judged by Codex)' : ` (approximate — holmes-kit's own reading: ${v.reason})`;
|
|
@@ -2920,7 +3181,7 @@ function argInWorkspace(target, realTarget, w) {
|
|
|
2920
3181
|
return false;
|
|
2921
3182
|
return (0, workspace_scope_1.inWorkspace)(realTarget, walked.path);
|
|
2922
3183
|
}
|
|
2923
|
-
async function wiringHandshakeChecks(target, codexConfigPath = (0, codex_toml_1.defaultCodexConfigPath)(), packageRoot = path.resolve(__dirname, '..', '..', '..')) {
|
|
3184
|
+
async function wiringHandshakeChecks(target, codexConfigPath = (0, codex_toml_1.defaultCodexConfigPath)(), packageRoot = path.resolve(__dirname, '..', '..', '..'), routed) {
|
|
2924
3185
|
const out = [];
|
|
2925
3186
|
const ownBin = (() => { try {
|
|
2926
3187
|
return fs.realpathSync.native(path.join(packageRoot, 'bin', 'holmes-mcp.js'));
|
|
@@ -2954,7 +3215,10 @@ async function wiringHandshakeChecks(target, codexConfigPath = (0, codex_toml_1.
|
|
|
2954
3215
|
// relative `bin/holmes-mcp.js` ran the workspace's wrapper — measured).
|
|
2955
3216
|
const place = commandPlace(target, realTarget, entry.command);
|
|
2956
3217
|
const base = launchBaseOf(target, realTarget, entry.command);
|
|
2957
|
-
if (
|
|
3218
|
+
if (routed?.mcp(wiring.label, entry)) {
|
|
3219
|
+
out.push({ name: `${wiring.label} wiring identity`, level: 'PASS', detail: 'Exact operator dispatcher and installation receipt verified; handshake is checked separately' });
|
|
3220
|
+
}
|
|
3221
|
+
else if (ownBin !== null && base !== 'npx') {
|
|
2958
3222
|
const bin = entry.args[0] ?? '';
|
|
2959
3223
|
// Round 35: a network path is never looked up — it is judged (and refused) below, not called missing.
|
|
2960
3224
|
// Round 36: walked, not only read as text (a committed link `link -> /net/…` was looked up — measured).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Commands:
|
|
5
5
|
* init [--mode guardrail|governed] [--target dir] [--dry-run] [--remove] [--force] ...
|
|
6
|
-
* doctor [--target dir] [--json]
|
|
6
|
+
* doctor [--target dir] [--registry file] [--json]
|
|
7
7
|
* attest [--target dir] [--exclude a,b] [--json] [--badge] [--readme]
|
|
8
8
|
*/
|
|
9
9
|
/**
|