@holmes-lab/holmes-kit 0.30.0 → 0.31.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 +505 -0
- package/README.md +10 -1
- package/bin/holmes-hook-antigravity.js +4 -0
- package/bin/holmes-kit.js +4 -0
- package/bin/holmes-pre-push.js +3 -0
- package/bin/holmes-stop-antigravity.js +4 -0
- package/dist/.build-id +1 -1
- package/dist/holmes/cli/agents.d.ts +41 -0
- package/dist/holmes/cli/agents.js +382 -2
- package/dist/holmes/cli/attest.d.ts +2 -0
- package/dist/holmes/cli/attest.js +66 -15
- package/dist/holmes/cli/ci-gate.js +16 -1
- package/dist/holmes/cli/claude-switches.d.ts +95 -0
- package/dist/holmes/cli/claude-switches.js +967 -0
- package/dist/holmes/cli/codex-hooks.d.ts +77 -0
- package/dist/holmes/cli/codex-hooks.js +802 -0
- package/dist/holmes/cli/codex-oracle.d.ts +194 -0
- package/dist/holmes/cli/codex-oracle.js +1245 -0
- package/dist/holmes/cli/codex-toml.d.ts +35 -0
- package/dist/holmes/cli/codex-toml.js +321 -52
- package/dist/holmes/cli/doctor.d.ts +98 -8
- package/dist/holmes/cli/doctor.js +1328 -94
- package/dist/holmes/cli/index.js +26 -11
- package/dist/holmes/cli/init.d.ts +11 -0
- package/dist/holmes/cli/init.js +736 -44
- package/dist/holmes/cli/mcp-launcher.d.ts +64 -6
- package/dist/holmes/cli/mcp-launcher.js +189 -6
- package/dist/holmes/cli/mcp-version.js +13 -2
- package/dist/holmes/cli/settings-merge.js +8 -2
- package/dist/holmes/cli/upgrade.d.ts +18 -0
- package/dist/holmes/cli/upgrade.js +129 -24
- package/dist/holmes/cli/workspace-scope.d.ts +22 -0
- package/dist/holmes/cli/workspace-scope.js +375 -0
- package/dist/holmes/cpg/cpg-scanner.d.ts +29 -0
- package/dist/holmes/cpg/cpg-scanner.js +403 -3
- package/dist/holmes/cpg/cycle-detect.js +2 -1
- package/dist/holmes/cpg/forbidden-edges.js +9 -2
- package/dist/holmes/cpg/required-calls.js +8 -1
- package/dist/holmes/governance/constitution-debt.js +3 -2
- package/dist/holmes/governance/constitution.js +15 -3
- package/dist/holmes/governance/provenance-chain.js +3 -2
- package/dist/holmes/governance/push-gate-runner.js +4 -3
- package/dist/holmes/guardrail/dependency-delta.js +4 -3
- package/dist/holmes/guardrail/linear-match.d.ts +57 -0
- package/dist/holmes/guardrail/linear-match.js +256 -0
- package/dist/holmes/guardrail/risk-classifier.d.ts +6 -7
- package/dist/holmes/guardrail/risk-classifier.js +931 -44
- package/dist/holmes/guardrail/risk-types.d.ts +6 -0
- package/dist/holmes/guardrail/scope-judgment.d.ts +4 -24
- package/dist/holmes/guardrail/scope-judgment.js +100 -23
- package/dist/holmes/guardrail/shell-words.d.ts +42 -0
- package/dist/holmes/guardrail/shell-words.js +1720 -0
- package/dist/holmes/guardrail/write-target.d.ts +168 -3
- package/dist/holmes/guardrail/write-target.js +2379 -87
- package/dist/holmes/hooks/adapters/antigravity.d.ts +3 -1
- package/dist/holmes/hooks/adapters/antigravity.js +115 -11
- package/dist/holmes/hooks/pre-tool-use.d.ts +32 -6
- package/dist/holmes/hooks/pre-tool-use.js +923 -87
- package/dist/holmes/hooks/rtm-refresh-child.js +3 -1
- package/dist/holmes/hooks/rtm-refresh.js +8 -4
- package/dist/holmes/hooks/session-start.d.ts +10 -0
- package/dist/holmes/hooks/session-start.js +31 -7
- package/dist/holmes/hooks/stop.d.ts +2 -1
- package/dist/holmes/hooks/stop.js +197 -91
- package/dist/holmes/mcp/approval-commit.d.ts +5 -6
- package/dist/holmes/mcp/approval-commit.js +18 -2
- package/dist/holmes/mcp/elicit-approval.js +4 -2
- package/dist/holmes/mcp/handlers/graph-operations.js +3 -2
- package/dist/holmes/mcp/handlers/maintenance-analysis.js +11 -5
- package/dist/holmes/mcp/handlers/maintenance-evidence.js +3 -2
- package/dist/holmes/mcp/handlers/phase-queries.d.ts +22 -7
- package/dist/holmes/mcp/handlers/phase-queries.js +81 -2
- package/dist/holmes/mcp/handlers/requirement-triage.js +5 -3
- package/dist/holmes/mcp/handlers/review-evidence.js +8 -2
- package/dist/holmes/mcp/handlers/slice-orchestration.d.ts +11 -0
- package/dist/holmes/mcp/handlers/slice-orchestration.js +115 -16
- package/dist/holmes/mcp/handlers/spec-approval.d.ts +9 -0
- package/dist/holmes/mcp/handlers/spec-approval.js +110 -17
- package/dist/holmes/mcp/handlers/spec-authoring.js +17 -2
- package/dist/holmes/mcp/handlers/spec-queries.d.ts +39 -3
- package/dist/holmes/mcp/handlers/spec-queries.js +114 -7
- package/dist/holmes/mcp/handlers/test-execution.js +9 -3
- package/dist/holmes/mcp/handlers.d.ts +81 -9
- package/dist/holmes/mcp/handlers.js +70 -23
- package/dist/holmes/mcp/harness-attestation.d.ts +20 -0
- package/dist/holmes/mcp/harness-attestation.js +179 -0
- package/dist/holmes/mcp/requirement-triage-evidence.d.ts +36 -0
- package/dist/holmes/mcp/requirement-triage-evidence.js +160 -4
- package/dist/holmes/mcp/server.js +20 -1
- package/dist/holmes/mcp/tool-schemas.js +26 -9
- package/dist/holmes/mcp/validate-args.js +12 -0
- package/dist/holmes/project/bounded-io.d.ts +102 -0
- package/dist/holmes/project/bounded-io.js +212 -0
- package/dist/holmes/project/change-source.js +3 -1
- package/dist/holmes/project/ci-runs.js +3 -2
- package/dist/holmes/project/ignore.d.ts +31 -2
- package/dist/holmes/project/ignore.js +409 -50
- package/dist/holmes/project/regular-file-guard.d.ts +13 -0
- package/dist/holmes/project/regular-file-guard.js +149 -0
- package/dist/holmes/project/root.js +12 -3
- package/dist/holmes/reverse/anchor.js +4 -3
- package/dist/holmes/reverse/scan.js +6 -2
- package/dist/holmes/review/commit-text.js +3 -2
- package/dist/holmes/review/condition-hunk-replay.js +3 -2
- package/dist/holmes/review/failed-test-names.js +13 -10
- package/dist/holmes/review/findings.js +3 -1
- package/dist/holmes/review/kills-check.js +6 -1
- package/dist/holmes/review/point-in-time-replay.js +5 -4
- package/dist/holmes/review/replay-corpus.js +5 -4
- package/dist/holmes/review/run-replay.js +3 -2
- package/dist/holmes/review/temporal-prior.js +3 -2
- package/dist/holmes/review/test-evidence.js +3 -2
- package/dist/holmes/review/test-outcomes.js +3 -2
- package/dist/holmes/review/test-runner.d.ts +6 -0
- package/dist/holmes/review/test-runner.js +36 -15
- package/dist/holmes/rtm/advisory-outcomes.js +3 -2
- package/dist/holmes/rtm/anchor-ids.js +42 -2
- package/dist/holmes/rtm/file-anchors.js +4 -1
- package/dist/holmes/rtm/ftt-fulfilment.js +8 -3
- package/dist/holmes/rtm/git-changes.js +3 -1
- package/dist/holmes/rtm/graph-store.js +3 -2
- package/dist/holmes/rtm/test-scope.js +9 -4
- package/dist/holmes/spec/compat-impact.d.ts +25 -4
- package/dist/holmes/spec/compat-impact.js +682 -11
- package/dist/holmes/spec/entity-git-snapshot.js +3 -2
- package/dist/holmes/spec/entity-integration.js +3 -2
- package/dist/holmes/spec/entity-renumber-transaction.d.ts +19 -0
- package/dist/holmes/spec/entity-renumber-transaction.js +79 -6
- package/dist/holmes/spec/remote-spec-refs.js +3 -2
- package/dist/holmes/spec/renumber.js +25 -10
- package/dist/holmes/spec/spec-parser.js +9 -3
- package/dist/holmes/spec/yaml-scalar.js +2 -2
- package/dist/holmes/update/refresh.d.ts +5 -0
- package/dist/holmes/update/refresh.js +26 -1
- package/dist/holmes/update/update-notice.d.ts +6 -0
- package/dist/holmes/update/update-notice.js +18 -1
- package/dist/holmes/update/upgrade-plan.d.ts +28 -0
- package/dist/holmes/update/upgrade-plan.js +31 -2
- package/package.json +11 -4
package/dist/holmes/cli/index.js
CHANGED
|
@@ -37,7 +37,7 @@ exports.isBrokenPipe = void 0;
|
|
|
37
37
|
exports.packageRoot = packageRoot;
|
|
38
38
|
exports.main = main;
|
|
39
39
|
exports.installPipeGuard = installPipeGuard;
|
|
40
|
-
// @implements A-SPEC-704, A-SPEC-709
|
|
40
|
+
// @implements A-SPEC-704, A-SPEC-709, A-SPEC-734
|
|
41
41
|
// @implements A-SPEC-549.2
|
|
42
42
|
// @implements A-SPEC-591, A-SPEC-626
|
|
43
43
|
const cli_execution_1 = require("./cli-execution");
|
|
@@ -50,6 +50,7 @@ const path = __importStar(require("node:path"));
|
|
|
50
50
|
const init_1 = require("./init");
|
|
51
51
|
const doctor_1 = require("./doctor");
|
|
52
52
|
const colophon_1 = require("./colophon");
|
|
53
|
+
const bounded_io_1 = require("../project/bounded-io");
|
|
53
54
|
/**
|
|
54
55
|
* `holmes-kit` CLI entry — argv dispatch, hand-rolled (no new dependency).
|
|
55
56
|
*
|
|
@@ -124,7 +125,9 @@ class UnknownFlagError extends Error {
|
|
|
124
125
|
* what you'd do" spelling performed a REAL write (round-3 HIGH; same class inverted --remove and
|
|
125
126
|
* --force). A boolean flag must never consume a token.
|
|
126
127
|
*/
|
|
127
|
-
|
|
128
|
+
// A-SPEC-251.1 (round 26): `yes` — `upgrade --yes` was refused as "--yes requires a value", so the non-interactive
|
|
129
|
+
// upgrade its own guidance names could not run (measured).
|
|
130
|
+
const BOOLEAN_FLAGS = new Set(['badge', 'readme', 'help', 'dry-run', 'no-mcp', 'remove', 'force', 'json', 'list', 'status', 'watch', 'autonomy', 'no-autonomy', 'yes']); // A-SPEC-650: --status
|
|
128
131
|
function parseFlags(argv, known) {
|
|
129
132
|
const flags = {};
|
|
130
133
|
const positionals = [];
|
|
@@ -434,7 +437,7 @@ async function main(argv) {
|
|
|
434
437
|
return 2;
|
|
435
438
|
}
|
|
436
439
|
const checks = await (0, doctor_1.runDoctor)(packageRoot(), typeof flags.target === 'string' ? path.resolve(flags.target) : undefined, { agent: flags.agent });
|
|
437
|
-
process.stdout.write(flags.json ?
|
|
440
|
+
process.stdout.write(flags.json ? (0, doctor_1.checksJson)(checks) + '\n' : (0, doctor_1.formatChecks)(checks) + '\n');
|
|
438
441
|
return checks.some((c) => c.level === 'FAIL') ? 1 : 0;
|
|
439
442
|
}
|
|
440
443
|
if (cmd === 'skills') {
|
|
@@ -545,7 +548,7 @@ async function main(argv) {
|
|
|
545
548
|
return 2;
|
|
546
549
|
}
|
|
547
550
|
try {
|
|
548
|
-
execFileSync('git', ['-C', root, 'rev-parse', '--git-dir'], { stdio: 'pipe', env: gitEnv });
|
|
551
|
+
execFileSync('git', ['-C', root, 'rev-parse', '--git-dir'], { timeout: bounded_io_1.GIT_TIMEOUT_MS, maxBuffer: bounded_io_1.GIT_MAX_BUFFER, stdio: 'pipe', env: gitEnv });
|
|
549
552
|
}
|
|
550
553
|
catch {
|
|
551
554
|
process.stderr.write('not a git repository — without a canonical ref there is no rechaining: a rechain is a wholesale re-signing, and only the committed history can say what is canonical.\n');
|
|
@@ -556,7 +559,7 @@ async function main(argv) {
|
|
|
556
559
|
// call site uses.
|
|
557
560
|
try {
|
|
558
561
|
assertSafeRev(ref);
|
|
559
|
-
execFileSync('git', ['-C', root, 'rev-parse', '--verify', '--quiet', `${ref}^{commit}`], { stdio: 'pipe', env: gitEnv });
|
|
562
|
+
execFileSync('git', ['-C', root, 'rev-parse', '--verify', '--quiet', `${ref}^{commit}`], { timeout: bounded_io_1.GIT_TIMEOUT_MS, maxBuffer: bounded_io_1.GIT_MAX_BUFFER, stdio: 'pipe', env: gitEnv });
|
|
560
563
|
}
|
|
561
564
|
catch {
|
|
562
565
|
process.stderr.write(`--ref ${ref} cannot be resolved to a commit — without a canonical ref there is no rechaining.\n`);
|
|
@@ -583,7 +586,7 @@ async function main(argv) {
|
|
|
583
586
|
const WALK_LIMIT = 64;
|
|
584
587
|
let walkCommits = [];
|
|
585
588
|
try {
|
|
586
|
-
walkCommits = execFileSync('git', ['-C', root, 'rev-list', '--first-parent', '-n', String(WALK_LIMIT), ref], { encoding: 'utf8', env: gitEnv, stdio: ['ignore', 'pipe', 'pipe'] })
|
|
589
|
+
walkCommits = execFileSync('git', ['-C', root, 'rev-list', '--first-parent', '-n', String(WALK_LIMIT), ref], { timeout: bounded_io_1.GIT_TIMEOUT_MS, maxBuffer: bounded_io_1.GIT_MAX_BUFFER, encoding: 'utf8', env: gitEnv, stdio: ['ignore', 'pipe', 'pipe'] })
|
|
587
590
|
.split('\n').map((l) => l.trim()).filter(Boolean);
|
|
588
591
|
}
|
|
589
592
|
catch (e) {
|
|
@@ -597,7 +600,7 @@ async function main(argv) {
|
|
|
597
600
|
// branch name too, making the trail self-describing later. Falls back to the raw ref.
|
|
598
601
|
let refLabel = ref;
|
|
599
602
|
try {
|
|
600
|
-
refLabel = execFileSync('git', ['-C', root, 'rev-parse', '--abbrev-ref', ref], { encoding: 'utf8', env: gitEnv, stdio: ['ignore', 'pipe', 'pipe'] }).trim() || ref;
|
|
603
|
+
refLabel = execFileSync('git', ['-C', root, 'rev-parse', '--abbrev-ref', ref], { timeout: bounded_io_1.GIT_TIMEOUT_MS, maxBuffer: bounded_io_1.GIT_MAX_BUFFER, encoding: 'utf8', env: gitEnv, stdio: ['ignore', 'pipe', 'pipe'] }).trim() || ref;
|
|
601
604
|
}
|
|
602
605
|
catch { /* keep raw ref */ }
|
|
603
606
|
const planRechain = (mainline, input, mainlineAt) => {
|
|
@@ -662,7 +665,7 @@ async function main(argv) {
|
|
|
662
665
|
// committed candidate that is CORRUPT (strict-parse throws) is skipped like an absent one.
|
|
663
666
|
let raw;
|
|
664
667
|
try {
|
|
665
|
-
raw = execFileSync('git', ['-C', root, 'show', `${at}:./${rel}`], { encoding: 'utf8', maxBuffer: 1 << 28, env: gitEnv, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
668
|
+
raw = execFileSync('git', ['-C', root, 'show', `${at}:./${rel}`], { timeout: bounded_io_1.GIT_TIMEOUT_MS, encoding: 'utf8', maxBuffer: 1 << 28, env: gitEnv, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
666
669
|
}
|
|
667
670
|
catch {
|
|
668
671
|
continue;
|
|
@@ -1238,17 +1241,24 @@ async function main(argv) {
|
|
|
1238
1241
|
mcpLauncher,
|
|
1239
1242
|
};
|
|
1240
1243
|
const res = (0, init_1.runInit)(opts);
|
|
1244
|
+
// @implements A-SPEC-251.2 (round 44) — a message quoting a workspace file is escaped (an entry named with ESC and BEL
|
|
1245
|
+
// retitled the terminal through init — measured).
|
|
1241
1246
|
for (const m of res.messages)
|
|
1242
|
-
process[res.ok ? 'stdout' : 'stderr'].write(`${m}\n`);
|
|
1247
|
+
process[res.ok ? 'stdout' : 'stderr'].write(`${(0, doctor_1.terminalSafe)(m)}\n`);
|
|
1243
1248
|
if (res.ok) {
|
|
1244
1249
|
// round-8: a planned DELETION printed under 'would write' contradicted the line above it.
|
|
1245
1250
|
for (const p of res.removals ?? [])
|
|
1246
1251
|
process.stdout.write(` would remove ${p}\n`);
|
|
1247
1252
|
for (const c of res.changes) {
|
|
1253
|
+
// A-SPEC-251.1 (round 26): a change with nothing to write is not written (`--remove` said "wrote" for a settings
|
|
1254
|
+
// file that did not exist — measured).
|
|
1255
|
+
if (c.after === null)
|
|
1256
|
+
continue;
|
|
1248
1257
|
const verb = opts.dryRun ? 'would write' : 'wrote';
|
|
1249
|
-
process.stdout.write(` ${verb} ${c.path}\n`);
|
|
1258
|
+
process.stdout.write(` ${verb} ${(0, doctor_1.terminalSafe)(c.path)}\n`);
|
|
1250
1259
|
if (opts.dryRun && c.after) {
|
|
1251
|
-
|
|
1260
|
+
// A-SPEC-251.2 (round 45): a preview line quoting a workspace file is escaped too (AGENTS.md's ESC and BEL reached it).
|
|
1261
|
+
process.stdout.write(c.after.split('\n').map((l) => ` | ${(0, doctor_1.terminalSafe)(l)}`).join('\n') + '\n');
|
|
1252
1262
|
}
|
|
1253
1263
|
}
|
|
1254
1264
|
// @implements A-SPEC-543.1 — zero-config upgrade PREPARATION: a successful real wiring records
|
|
@@ -1293,7 +1303,10 @@ async function main(argv) {
|
|
|
1293
1303
|
// non-TTY passes --yes), never a silent auto-install of a gate-enforcing engine.
|
|
1294
1304
|
if (cmd === 'upgrade') {
|
|
1295
1305
|
const { runUpgrade } = require('./upgrade');
|
|
1306
|
+
const { queryRegistryLatest } = require('../update/refresh');
|
|
1296
1307
|
return await runUpgrade({
|
|
1308
|
+
// A-SPEC-543.2 (amendment 2026-09-29): the explicit command asks the registry for latest.
|
|
1309
|
+
queryLatest: () => queryRegistryLatest(),
|
|
1297
1310
|
dryRun: flags['dry-run'] === true,
|
|
1298
1311
|
yes: flags.yes === true,
|
|
1299
1312
|
stdout: (s) => process.stdout.write(s),
|
|
@@ -1354,6 +1367,8 @@ function installPipeGuard() {
|
|
|
1354
1367
|
});
|
|
1355
1368
|
}
|
|
1356
1369
|
if (require.main === module) {
|
|
1370
|
+
// @implements A-SPEC-734 (round 13) — this process never blocks on a file that is not a regular file.
|
|
1371
|
+
require('../project/regular-file-guard').installProcessGuards();
|
|
1357
1372
|
main(process.argv.slice(2))
|
|
1358
1373
|
.then((code) => process.exit(code))
|
|
1359
1374
|
.catch((err) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HookPlan } from './settings-merge';
|
|
2
2
|
import { Agent } from './agents';
|
|
3
3
|
import { LauncherMode } from './mcp-launcher';
|
|
4
|
+
import { type CodexVerdict } from './codex-oracle';
|
|
4
5
|
import { Approval } from '../guardrail/risk-gate';
|
|
5
6
|
/**
|
|
6
7
|
* `holmes-kit init` — wire holmes-kit into a TARGET project (the I/O half; all merge logic is pure
|
|
@@ -33,6 +34,16 @@ export interface InitOptions {
|
|
|
33
34
|
mcpLauncher?: LauncherMode;
|
|
34
35
|
/** Test/integration override for Codex's default user configuration path. */
|
|
35
36
|
codexConfigPath?: string;
|
|
37
|
+
/** @implements A-SPEC-727 — test/integration override for Codex's user-level hooks file. */
|
|
38
|
+
codexHooksPath?: string;
|
|
39
|
+
/** A-SPEC-738: how to ask Codex whether its files load (tests inject; default: the installed codex). */
|
|
40
|
+
codexOracle?: (input: {
|
|
41
|
+
configBytes: Buffer | null;
|
|
42
|
+
hooksBytes: Buffer | null;
|
|
43
|
+
cwd: string;
|
|
44
|
+
realConfigPath?: string;
|
|
45
|
+
realHooksPath?: string;
|
|
46
|
+
}) => CodexVerdict;
|
|
36
47
|
autonomy?: boolean;
|
|
37
48
|
autonomyInteractive?: boolean;
|
|
38
49
|
}
|