@holmes-lab/holmes-kit 0.31.1 → 0.32.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.
- package/CHANGELOG.md +69 -0
- package/README.md +1 -0
- package/dist/.build-id +1 -1
- package/dist/holmes/cli/codex-legacy.d.ts +16 -0
- package/dist/holmes/cli/codex-legacy.js +129 -0
- package/dist/holmes/cli/doctor.js +32 -1
- package/dist/holmes/cli/index.js +21 -0
- package/dist/holmes/mcp/handlers/maintenance-analysis.js +16 -3
- package/dist/holmes/mcp/handlers/maintenance-evidence.d.ts +6 -0
- package/dist/holmes/mcp/handlers/requirement-triage.d.ts +163 -4
- package/dist/holmes/mcp/handlers/requirement-triage.js +26 -18
- package/dist/holmes/mcp/handlers.d.ts +169 -4
- package/dist/holmes/mcp/maintenance-analyze.d.ts +19 -0
- package/dist/holmes/mcp/maintenance-analyze.js +113 -7
- package/dist/holmes/mcp/maintenance-evidence.d.ts +25 -0
- package/dist/holmes/mcp/maintenance-evidence.js +52 -1
- package/dist/holmes/mcp/tool-schemas.js +3 -1
- package/dist/holmes/review/requirement-triage.d.ts +19 -1
- package/dist/holmes/review/requirement-triage.js +113 -12
- package/dist/holmes/rtm/localize.d.ts +7 -0
- package/dist/holmes/rtm/localize.js +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,75 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
<!-- @implements A-SPEC-209 -->
|
|
8
|
+
## [0.32.0] - 2026-09-30
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **`maintenance_analyze` says its confidence is uncalibrated where the number is read** (A-SPEC-740). Every result
|
|
13
|
+
carries `confidenceCalibrated: false` and a `confidenceNote` (the value counts which kinds of evidence were present,
|
|
14
|
+
does not predict accuracy, and must not weight answers or narrow a test scope); every persisted evidence artifact
|
|
15
|
+
carries `confidenceCalibrated: false`. The value and formula are unchanged and the artifact schema stays
|
|
16
|
+
`maintenance-evidence/1.4`, so recorded artifacts still feed calibration. It ships before the classification gates
|
|
17
|
+
are relaxed: with them lifted, 120 of 120 replay cases would report 0.95 at 0.467/0.383 top-1 accuracy.
|
|
18
|
+
- **`requirement_triage` answers in summaries by default** (A-SPEC-743). Each candidate document is
|
|
19
|
+
`{ id, type, title, status, dependsOn }`; `detail: "full"` adds frontmatter and sections. The bodies were 72% of a
|
|
20
|
+
201 KB median answer (holmes; 107 KB on a second corpus) — past the tool-result limit, so the mandated intake step
|
|
21
|
+
was read back from a file in slices. Verdict, reasons, candidate order and scores are identical either way.
|
|
22
|
+
- **`maintenance_analyze` lists candidate specs in relevance order** (A-SPEC-745): specs the request cites, then the
|
|
23
|
+
specs anchored by the top-ranked candidate files, then the rest. The response keeps ten, and id order made those
|
|
24
|
+
ten A-SPEC-100 and its neighbours for every request. The set and every computation over it are unchanged.
|
|
25
|
+
- **`requirement_triage` gives a confident verdict only when its channels agree** (A-SPEC-713.1). A lineage the
|
|
26
|
+
request cites ranks first; lineages with a requirement vector are ordered by semantic score before BM25 (the old
|
|
27
|
+
`max(BM25, cosine)` let cosine count only when BM25 was zero); `existing-change`/`fulfilled` need the lexical and
|
|
28
|
+
semantic top lineages to agree — each top unique, the lexical one above zero — and that lineage to be the first
|
|
29
|
+
ranked, otherwise `ambiguous` (`channels-disagree` / `citation-unbacked`). A citation only orders and never counts
|
|
30
|
+
toward agreement: "(unrelated to REQ-1)" or an id inside a URL is a mention, not evidence. BM25 now scores each
|
|
31
|
+
lineage's titles and sections only — id spellings are removed from the prompt, and the `id:`/`lineage:`/`status:`
|
|
32
|
+
header is not scored — so "REQ 742", "the 742 rows" or the word "spec" no longer pick a lineage. Ties are judged on
|
|
33
|
+
scores alone, and a lineage without a vector ties on the semantic side. On replay the
|
|
34
|
+
lexical top was the right lineage in 0.20–0.32 of cases and a second corpus already answered `existing-change`
|
|
35
|
+
wrongly four times in five; an `existing-change` answer also stops the intake from creating a new REQ.
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
|
|
39
|
+
- **Persisted maintenance evidence says why its test scope was full** (A-SPEC-744): `uncertainty.testScopeReason` and
|
|
40
|
+
structured `testScopeCauses` (unsupported-language, impact-truncated, coverage-gap, no-anchored-tests, …), and `maintenance_calibration`
|
|
41
|
+
reports `scopeCauses` — how often each cause occurred, older artifacts counted as `unrecorded`. 455 persisted
|
|
42
|
+
analyses here were all `full` and none said why.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- **`maintenance_analyze` is no longer `ambiguous` for every request** (A-SPEC-741). Since four CI `.sh` scripts
|
|
47
|
+
landed on 2026-09-03, every analysis in this repository (455 of 455) and every replay case on two corpora (120 of
|
|
48
|
+
120) was `ambiguous`, because a language the scanner cannot read anywhere in the tree counted against every request,
|
|
49
|
+
and a truncated impact walk decided the classification too. The classification now counts an unsupported language
|
|
50
|
+
only when the change touches it — a changed file with that extension, a path in the request (`ci.sh.` included), or
|
|
51
|
+
an unreadable file whose path — folders included — shares a word or a five-letter stem with the request
|
|
52
|
+
(`app/session/store.rb` for "the sessions", `lib/isolate.rb` for "isolation"), or a request that names the language
|
|
53
|
+
("the shell script", "Kotlin") — and leans to "about the change" wherever it cannot judge: a request in a non-Latin
|
|
54
|
+
script, or a list of unreadable files that hit its 5,000-path cap. Truncation no longer decides it. The **test scope is unchanged**: a first version also relaxed it, and on replay 10 of the 12
|
|
55
|
+
scopes that then narrowed missed a test the commit changed, so every language and every depth stop still widen it.
|
|
56
|
+
- **`requirement_triage` no longer discards its semantic layer in this repository** (A-SPEC-742). Coverage was compared
|
|
57
|
+
against every requirement document, including 24 legacy T-SPECs under C-SPECs that have no REQ lineage and can never
|
|
58
|
+
have a vector, so triage here was `ambiguous` on every call. Coverage now counts documents that can carry a vector
|
|
59
|
+
(`unlineaged` reported separately); a partially covered layer decides with `semantic-partial:<n>` and
|
|
60
|
+
`missingLineages` disclosed; a configured layer that covers nothing still forces `ambiguous`.
|
|
61
|
+
|
|
62
|
+
## [0.31.2] - 2026-09-30
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
|
|
66
|
+
- **A project `.codex/config.toml` left by a pre-0.30 init is named and offered for removal** (A-SPEC-721, amended).
|
|
67
|
+
Holmes wires Codex in the user configuration since 0.30, but in a trusted project Codex loads that old file over it:
|
|
68
|
+
a consumer workspace kept starting the 0.29.0 server through a committed `npx @holmes-lab/holmes-kit@0.29.0` pin
|
|
69
|
+
while init and doctor wired and judged the current release. doctor now says `codex legacy wiring` (WARN) with the
|
|
70
|
+
file, its launch and the command to remove it; `init --agent codex` (or `all`) asks before deleting it (default no),
|
|
71
|
+
and a non-interactive run — `upgrade`'s re-pin included — prints the command and deletes nothing. Only a file that is
|
|
72
|
+
exactly Holmes's own wiring is recognised; a comment, another table or key, or any other launch leaves it alone.
|
|
73
|
+
- **doctor names an expired approval** (A-SPEC-178, amended). An `HOLMES_APPROVAL` in `.mcp.json`'s server env whose
|
|
74
|
+
`expires` has passed read `approval channel` PASS ("spec_approve reaches it"); it is now WARN with the expiry (never
|
|
75
|
+
the value) and the fix to remove it.
|
|
76
|
+
|
|
8
77
|
## [0.31.1] - 2026-09-29
|
|
9
78
|
|
|
10
79
|
### Fixed
|
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) — reproduce with `hol
|
|
|
23
23
|
|
|
24
24
|
### 🛡️ Currently Supported Features (Production Features)
|
|
25
25
|
|
|
26
|
+
- 🔎 **The analysis tools decide on evidence about the request, and say what they could not decide** *(new in 0.32.0)*: measured on two repositories by point-in-time replay, `maintenance_analyze` had answered `ambiguous` for every request because a shell script anywhere in the tree counted against it — the classification now counts an unreadable language only when the change touches it, while the test scope stays as conservative as before (relaxing it too let narrowed scopes miss the commit's own tests). `confidence` carries `confidenceCalibrated: false`; persisted evidence records why a scope was `full` and `maintenance_calibration` reports how often each cause occurred; candidate specs come in relevance order. `requirement_triage` answers in summaries by default (`detail: "full"` for document text), counts semantic coverage over documents that can have a vector, and gives `existing-change`/`fulfilled` only when its lexical and semantic channels agree on the first-ranked lineage — a lineage the request cites is listed first but a citation is not evidence — otherwise `ambiguous`, which leaves a new requirement possible.
|
|
26
27
|
- 🚦 **The gate only ever denies** *(changed in 0.31.0)*: an action Holmes does not deny is left to your harness's own permission flow — Claude Code and Codex get no permission decision, Antigravity gets `ask` (or `allow` for a read inside the workspace that git does not ignore). Earlier versions answered `allow`, which Claude Code treats as "bypassing permission prompt", so anything the shell model missed ran unconfirmed. In Claude Code's default mode you now see its confirmations again, as without Holmes.
|
|
27
28
|
- 🪝 **The Codex gate loads again on codex-cli 0.155** *(new in 0.31.0)*: plugin hooks were removed upstream, so `init --agent codex` wires the Holmes PreToolUse and Stop kernels into the user-level `$CODEX_HOME/hooks.json`, keeps every hook it does not own, and `--remove` takes away only its own groups. Codex runs a user hook only after you trust it once with `/hooks`; Holmes never forges that trust, and `doctor` says so instead of claiming enforcement.
|
|
28
29
|
- 🧭 **The shell gate judges by identity, from where the command really runs** *(new in 0.31.0)*: wiring files, the whole `.ax` store and the files inside it are protected as shell WORDS resolved against each segment's real base — a `cd` moves the base only when it is certain to have run, an uncertain or expanded one (`cd .a?`, a link made in the same command, `cd "$X"`) leaves it unknown and the command is judged at every base it could have produced, and the base starts at the harness's own working directory (the payload `cwd`, a Codex `workdir`), not the project root. Every evaluation runs under a fail-closed deadline wall. The Codex oracle asks the installed Codex whether your config loads — locally, over copies, with plugins and every proxy closed, `sqlite_home`/`analytics`/`otel` isolated from the user copy alone, and a verdict it could not obtain labelled `approximate`. Source walkers skip nested git working trees only when git says the tree is not the project's, read regular files only, and ask git once per scan; every reader on a gate path is linear in its input.
|
package/dist/.build-id
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8f0f2af0-munbbu91
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function legacyCodexLayer(target: string): {
|
|
2
|
+
path: string;
|
|
3
|
+
launch: string;
|
|
4
|
+
} | null;
|
|
5
|
+
/**
|
|
6
|
+
* A-SPEC-721 (amendment 2026-09-29) — after init wires Codex: ask before deleting a Holmes-only legacy project file
|
|
7
|
+
* (default no); a non-interactive run (and so `upgrade`'s re-pin) only prints the command; a dry run asks nothing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function offerLegacyCodexRemoval(o: {
|
|
10
|
+
target: string;
|
|
11
|
+
interactive: boolean;
|
|
12
|
+
dryRun: boolean;
|
|
13
|
+
confirm: (question: string) => Promise<boolean>;
|
|
14
|
+
remove: (file: string) => void;
|
|
15
|
+
out: (line: string) => void;
|
|
16
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,129 @@
|
|
|
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.legacyCodexLayer = legacyCodexLayer;
|
|
37
|
+
exports.offerLegacyCodexRemoval = offerLegacyCodexRemoval;
|
|
38
|
+
// @implements A-SPEC-721
|
|
39
|
+
const fs = __importStar(require("node:fs"));
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const smol_toml_1 = require("smol-toml");
|
|
42
|
+
/**
|
|
43
|
+
* A-SPEC-721 (amendment 2026-09-29) — the project `.codex/config.toml` a pre-0.30 init wrote. Holmes now wires Codex in
|
|
44
|
+
* the user configuration, but in a trusted project Codex loads this file OVER it: measured in a consumer workspace, a
|
|
45
|
+
* committed file pinning `npx @holmes-lab/holmes-kit@0.29.0` kept Codex on the 0.29.0 server while init and doctor
|
|
46
|
+
* wired and judged the current one. Only a file that is exactly Holmes's own legacy wiring is recognised — anything
|
|
47
|
+
* the user wrote or added is left alone.
|
|
48
|
+
*/
|
|
49
|
+
const LEGACY_MAX_BYTES = 64 * 1024;
|
|
50
|
+
const TABLE_KEYS = new Set(['command', 'args', 'env']);
|
|
51
|
+
const ENV_KEYS = new Set(['HOLMES_SPECS', 'HOLMES_MCP_AUTORELOAD']);
|
|
52
|
+
function legacyCodexLayer(target) {
|
|
53
|
+
const file = path.join(target, '.codex', 'config.toml');
|
|
54
|
+
let text;
|
|
55
|
+
try {
|
|
56
|
+
const st = fs.lstatSync(file);
|
|
57
|
+
if (!st.isFile() || st.size > LEGACY_MAX_BYTES)
|
|
58
|
+
return null; // a link or a large file is not what init wrote
|
|
59
|
+
text = fs.readFileSync(file, 'utf8');
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (text.split(/\r?\n/).some((l) => l.trim().startsWith('#')))
|
|
65
|
+
return null; // a comment is the user's
|
|
66
|
+
let doc;
|
|
67
|
+
try {
|
|
68
|
+
doc = (0, smol_toml_1.parse)(text);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const keys = Object.keys(doc);
|
|
74
|
+
if (keys.length !== 1 || keys[0] !== 'mcp_servers')
|
|
75
|
+
return null;
|
|
76
|
+
const servers = doc.mcp_servers;
|
|
77
|
+
if (servers === null || typeof servers !== 'object' || Array.isArray(servers))
|
|
78
|
+
return null;
|
|
79
|
+
if (Object.keys(servers).length !== 1 || !('holmes-kit' in servers))
|
|
80
|
+
return null;
|
|
81
|
+
const table = servers['holmes-kit'];
|
|
82
|
+
if (table === null || typeof table !== 'object' || Array.isArray(table))
|
|
83
|
+
return null;
|
|
84
|
+
if (!Object.keys(table).every((k) => TABLE_KEYS.has(k)))
|
|
85
|
+
return null;
|
|
86
|
+
const { command, args, env } = table;
|
|
87
|
+
if (typeof command !== 'string' || !Array.isArray(args) || !args.every((a) => typeof a === 'string'))
|
|
88
|
+
return null;
|
|
89
|
+
const words = args;
|
|
90
|
+
const holmesLaunch = command === 'npx'
|
|
91
|
+
? words.some((a) => a.startsWith('@holmes-lab/holmes-kit')) && words[words.length - 1] === 'holmes-mcp'
|
|
92
|
+
: command === 'node' && typeof words[0] === 'string' && /holmes-mcp\.js$/.test(words[0]);
|
|
93
|
+
if (!holmesLaunch)
|
|
94
|
+
return null;
|
|
95
|
+
if (env !== undefined) {
|
|
96
|
+
if (env === null || typeof env !== 'object' || Array.isArray(env))
|
|
97
|
+
return null;
|
|
98
|
+
if (!Object.keys(env).every((k) => ENV_KEYS.has(k)))
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return { path: file, launch: [command, ...words].join(' ') };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A-SPEC-721 (amendment 2026-09-29) — after init wires Codex: ask before deleting a Holmes-only legacy project file
|
|
105
|
+
* (default no); a non-interactive run (and so `upgrade`'s re-pin) only prints the command; a dry run asks nothing.
|
|
106
|
+
*/
|
|
107
|
+
async function offerLegacyCodexRemoval(o) {
|
|
108
|
+
const legacy = legacyCodexLayer(o.target);
|
|
109
|
+
if (legacy === null)
|
|
110
|
+
return;
|
|
111
|
+
const rel = path.relative(o.target, legacy.path).split(path.sep).join('/');
|
|
112
|
+
const why = `${legacy.path} holds only the Holmes wiring an older init wrote (\`${legacy.launch}\`); in a trusted project Codex loads it instead of the user-level wiring.`;
|
|
113
|
+
if (o.dryRun) {
|
|
114
|
+
o.out(`${why} (dry run — nothing asked or removed)`);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (!o.interactive) {
|
|
118
|
+
o.out(`${why} Remove it: git rm ${rel} (or delete it), then commit.`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
o.out(why);
|
|
122
|
+
if (await o.confirm(`Remove the stale Holmes Codex wiring in ${legacy.path}? [y/N] `)) {
|
|
123
|
+
o.remove(legacy.path);
|
|
124
|
+
o.out(`Removed ${legacy.path} — commit the deletion (git add -A ${rel} && git commit).`);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
o.out(`Kept ${legacy.path}. Remove it later with: git rm ${rel}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -1202,7 +1202,28 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1202
1202
|
mcpApproval = false;
|
|
1203
1203
|
} // absent or unreadable is "not guaranteed", which is the point
|
|
1204
1204
|
const procApproval = !!process.env.HOLMES_APPROVAL;
|
|
1205
|
-
|
|
1205
|
+
// @implements A-SPEC-178 (amendment 2026-09-29) — an expired approval is not a channel (it read PASS twelve days after
|
|
1206
|
+
// it expired — measured). Only the expiry is printed, never the value.
|
|
1207
|
+
const mcpApprovalExpiry = (() => {
|
|
1208
|
+
try {
|
|
1209
|
+
const raw = fs.readFileSync(path.join(target, '.mcp.json'), 'utf8');
|
|
1210
|
+
const v = JSON.parse(raw).mcpServers?.[init_1.SERVER_NAME]?.env?.HOLMES_APPROVAL;
|
|
1211
|
+
if (typeof v !== 'string')
|
|
1212
|
+
return null;
|
|
1213
|
+
const expires = JSON.parse(v).expires;
|
|
1214
|
+
if (typeof expires !== 'string')
|
|
1215
|
+
return null;
|
|
1216
|
+
const at = Date.parse(expires);
|
|
1217
|
+
return Number.isFinite(at) && at < Date.now() ? expires : null;
|
|
1218
|
+
}
|
|
1219
|
+
catch {
|
|
1220
|
+
return null;
|
|
1221
|
+
}
|
|
1222
|
+
})();
|
|
1223
|
+
if (mcpApproval && mcpApprovalExpiry !== null) {
|
|
1224
|
+
add('approval channel', 'WARN', `The approval in .mcp.json's server env expired on ${(0, codex_oracle_1.clipText)(mcpApprovalExpiry, 40)} — spec_approve will refuse it`, 'Remove HOLMES_APPROVAL from the holmes-kit env in .mcp.json; set a fresh one only when an approval is needed.');
|
|
1225
|
+
}
|
|
1226
|
+
else if (mcpApproval) {
|
|
1206
1227
|
add('approval channel', 'PASS', 'The approval variable is in .mcp.json\'s server env — spec_approve reaches it');
|
|
1207
1228
|
}
|
|
1208
1229
|
else if (!procApproval) {
|
|
@@ -1505,6 +1526,16 @@ async function runDoctor(packageRoot, target, opts, extraChecks) {
|
|
|
1505
1526
|
// judged for THIS target only when it carries Holmes's table or the target is Codex-wired;
|
|
1506
1527
|
// otherwise a Claude- or Antigravity-only workspace would inherit another tool's diagnosis.
|
|
1507
1528
|
const targetWantsCodex = codexWiredTarget(target);
|
|
1529
|
+
// @implements A-SPEC-721 (amendment 2026-09-29) — a project file that is exactly Holmes's pre-0.30 wiring replaces the
|
|
1530
|
+
// user-level wiring in a trusted project (a consumer's Codex ran 0.29.0 — measured); named with its launch.
|
|
1531
|
+
{
|
|
1532
|
+
const { legacyCodexLayer } = require('./codex-legacy');
|
|
1533
|
+
const legacy = legacyCodexLayer(target);
|
|
1534
|
+
if (legacy !== null) {
|
|
1535
|
+
const rel = path.relative(target, legacy.path).split(path.sep).join('/');
|
|
1536
|
+
add('codex legacy wiring', 'WARN', `${(0, codex_oracle_1.clipText)(legacy.path)} holds only the Holmes wiring an older init wrote (\`${(0, codex_oracle_1.clipText)(legacy.launch)}\`); in a trusted project Codex loads it instead of the user-level wiring`, `Remove it: git rm ${(0, codex_oracle_1.clipText)(rel)} (or delete it), or run holmes-kit init --agent codex and confirm the removal.`);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1508
1539
|
let cdxRaw;
|
|
1509
1540
|
// @implements A-SPEC-731 (round 6) — decoded strictly: Codex refuses a config that is not UTF-8.
|
|
1510
1541
|
let cdxUndecodable = null;
|
package/dist/holmes/cli/index.js
CHANGED
|
@@ -1261,6 +1261,27 @@ async function main(argv) {
|
|
|
1261
1261
|
process.stdout.write(c.after.split('\n').map((l) => ` | ${(0, doctor_1.terminalSafe)(l)}`).join('\n') + '\n');
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
|
+
// @implements A-SPEC-721 (amendment 2026-09-29) — a Holmes-only project Codex file from a pre-0.30 init replaces the
|
|
1265
|
+
// user-level wiring in a trusted project: offered for removal after the user's yes (non-interactive: the command).
|
|
1266
|
+
if (!opts.remove && agents.includes('codex')) {
|
|
1267
|
+
const { offerLegacyCodexRemoval } = require('./codex-legacy');
|
|
1268
|
+
await offerLegacyCodexRemoval({
|
|
1269
|
+
target: opts.target, dryRun: opts.dryRun === true,
|
|
1270
|
+
interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,
|
|
1271
|
+
confirm: async (q) => {
|
|
1272
|
+
const rl = require('node:readline/promises').createInterface({ input: process.stdin, output: process.stdout });
|
|
1273
|
+
try {
|
|
1274
|
+
const ans = (await rl.question(q)).trim().toLowerCase();
|
|
1275
|
+
return ans === 'y' || ans === 'yes';
|
|
1276
|
+
}
|
|
1277
|
+
finally {
|
|
1278
|
+
rl.close();
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1281
|
+
remove: (f) => fs.rmSync(f),
|
|
1282
|
+
out: (l) => process.stdout.write(`${(0, doctor_1.terminalSafe)(l)}\n`),
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1264
1285
|
// @implements A-SPEC-543.1 — zero-config upgrade PREPARATION: a successful real wiring records
|
|
1265
1286
|
// WHERE holmes-kit is wired, so `upgrade` later knows every workspace to re-pin. Best-effort by
|
|
1266
1287
|
// contract: a registry problem must never change init's output or exit code.
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.createMaintenanceAnalysisHandlers = createMaintenanceAnalysisHandlers;
|
|
37
|
-
// @implements A-SPEC-612, A-SPEC-100.2, A-SPEC-128, A-SPEC-189, A-SPEC-267, A-SPEC-268, A-SPEC-269, A-SPEC-277, A-SPEC-283, A-SPEC-290, A-SPEC-292, A-SPEC-293, A-SPEC-378, A-SPEC-388, A-SPEC-418, A-SPEC-478, A-SPEC-571.2, A-SPEC-573.4, A-SPEC-578.5, A-SPEC-734
|
|
37
|
+
// @implements A-SPEC-745, A-SPEC-741, A-SPEC-612, A-SPEC-100.2, A-SPEC-128, A-SPEC-189, A-SPEC-267, A-SPEC-268, A-SPEC-269, A-SPEC-277, A-SPEC-283, A-SPEC-290, A-SPEC-292, A-SPEC-293, A-SPEC-378, A-SPEC-388, A-SPEC-418, A-SPEC-478, A-SPEC-571.2, A-SPEC-573.4, A-SPEC-578.5, A-SPEC-734
|
|
38
38
|
const fs = __importStar(require("node:fs"));
|
|
39
39
|
const path = __importStar(require("node:path"));
|
|
40
40
|
const node_child_process_1 = require("node:child_process");
|
|
@@ -78,6 +78,10 @@ function createMaintenanceAnalysisHandlers(context) {
|
|
|
78
78
|
const supportedExtensions = new Set(cpg_scanner_1.SCANNABLE_EXTENSIONS);
|
|
79
79
|
const knownCodeExtensions = new Set(['.rb', '.php', '.kt', '.kts', '.swift', '.scala', '.sh', '.ex', '.exs', '.lua', '.r']);
|
|
80
80
|
const unsupportedLanguages = new Set();
|
|
81
|
+
// @implements A-SPEC-741 — the paths too, so the analysis can tell an unreadable file that may
|
|
82
|
+
// be this request's target from one that is unrelated. Bounded: a vendored tree must not grow it.
|
|
83
|
+
const unsupportedFiles = [];
|
|
84
|
+
let unsupportedFilesTruncated = false;
|
|
81
85
|
try {
|
|
82
86
|
// A-SPEC-734 (round 12): a root whose git timed out is not asked again (the shared memory).
|
|
83
87
|
if ((0, bounded_io_1.gitRootBlocked)(root))
|
|
@@ -86,8 +90,13 @@ function createMaintenanceAnalysisHandlers(context) {
|
|
|
86
90
|
const files = (0, node_child_process_1.execFileSync)('git', ['-c', 'core.fsmonitor=false', '-C', root, 'ls-files', '-z', '--cached', '--others', '--exclude-standard'], { timeout: 5000, encoding: 'utf8', env: (0, root_1.cleanSubprocessEnv)(), maxBuffer: bounded_io_1.GIT_MAX_BUFFER }).split('\0'); // round 16: the shared bound
|
|
87
91
|
for (const file of files) {
|
|
88
92
|
const ext = path.extname(file).toLowerCase();
|
|
89
|
-
if (knownCodeExtensions.has(ext) && !supportedExtensions.has(ext))
|
|
93
|
+
if (knownCodeExtensions.has(ext) && !supportedExtensions.has(ext)) {
|
|
90
94
|
unsupportedLanguages.add(ext);
|
|
95
|
+
if (unsupportedFiles.length < 5000)
|
|
96
|
+
unsupportedFiles.push(file);
|
|
97
|
+
else
|
|
98
|
+
unsupportedFilesTruncated = true;
|
|
99
|
+
}
|
|
91
100
|
}
|
|
92
101
|
}
|
|
93
102
|
catch (e) {
|
|
@@ -125,6 +134,8 @@ function createMaintenanceAnalysisHandlers(context) {
|
|
|
125
134
|
scannedFiles: scanned.length,
|
|
126
135
|
skippedFiles: skipped.map((entry) => entry.file),
|
|
127
136
|
unsupportedLanguages: [...unsupportedLanguages],
|
|
137
|
+
unsupportedFiles,
|
|
138
|
+
...(unsupportedFilesTruncated ? { unsupportedFilesTruncated: true } : {}),
|
|
128
139
|
historyStatus: 'not-requested',
|
|
129
140
|
},
|
|
130
141
|
};
|
|
@@ -172,7 +183,9 @@ function createMaintenanceAnalysisHandlers(context) {
|
|
|
172
183
|
const directSeed = preliminary.candidates
|
|
173
184
|
.flatMap((candidate) => candidate.symbols)
|
|
174
185
|
.flatMap((qualifiedName) => graph.codeNodeIds(qualifiedName))[0];
|
|
175
|
-
|
|
186
|
+
// A-SPEC-745 keeps every computation over the candidate specs as it was: the emitted list is now
|
|
187
|
+
// in relevance order, so the seed is taken from the id-sorted set exactly as before.
|
|
188
|
+
const specSeed = [...preliminary.candidateSpecs].sort((a, b) => a.localeCompare(b)).find((id) => id.startsWith('A-SPEC-'));
|
|
176
189
|
const seedId = directSeed ?? (specSeed ? `SPEC:${specSeed}` : undefined);
|
|
177
190
|
const budget = Math.max(100, Math.min(10_000, Math.floor(a.contextBudget ?? 2_000)));
|
|
178
191
|
const contextBundle = seedId
|
|
@@ -39,6 +39,12 @@ export declare function createMaintenanceEvidenceHandlers(context: MaintenanceEv
|
|
|
39
39
|
falseNegatives: number;
|
|
40
40
|
minSamples: number;
|
|
41
41
|
status: "measured" | "insufficient-data";
|
|
42
|
+
scopeCauses: {
|
|
43
|
+
full: number;
|
|
44
|
+
narrow: number;
|
|
45
|
+
unrecorded: number;
|
|
46
|
+
causes: Record<string, number>;
|
|
47
|
+
};
|
|
42
48
|
}>;
|
|
43
49
|
};
|
|
44
50
|
export {};
|
|
@@ -19,17 +19,20 @@ export declare function createRequirementTriageHandlers(context: RequirementTria
|
|
|
19
19
|
prompt: string;
|
|
20
20
|
topK?: number;
|
|
21
21
|
persist?: boolean;
|
|
22
|
+
detail?: string;
|
|
22
23
|
}): Promise<{
|
|
23
24
|
promptDigest: string;
|
|
24
25
|
semantic: {
|
|
25
26
|
localState?: import("../../semantic/model-cache").LocalModelState | undefined;
|
|
26
27
|
recovery?: string | undefined;
|
|
27
28
|
suppressed?: true | undefined;
|
|
29
|
+
availability: string;
|
|
30
|
+
missingLineages?: string[] | undefined;
|
|
28
31
|
tier: "local" | "none" | "cloud";
|
|
29
32
|
covered: number;
|
|
30
33
|
total: number;
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
unlineaged: number;
|
|
35
|
+
state: "covered" | "partial" | "unavailable" | "not-adopted" | "cold";
|
|
33
36
|
};
|
|
34
37
|
provenance: {
|
|
35
38
|
reqId: string;
|
|
@@ -75,6 +78,80 @@ export declare function createRequirementTriageHandlers(context: RequirementTria
|
|
|
75
78
|
reasons: string[];
|
|
76
79
|
uncertainty: string[];
|
|
77
80
|
schema: "requirement-triage/1";
|
|
81
|
+
} | {
|
|
82
|
+
promptDigest: string;
|
|
83
|
+
semantic: {
|
|
84
|
+
localState?: import("../../semantic/model-cache").LocalModelState | undefined;
|
|
85
|
+
recovery?: string | undefined;
|
|
86
|
+
suppressed?: true | undefined;
|
|
87
|
+
availability: string;
|
|
88
|
+
missingLineages?: string[] | undefined;
|
|
89
|
+
tier: "local" | "none" | "cloud";
|
|
90
|
+
covered: number;
|
|
91
|
+
total: number;
|
|
92
|
+
unlineaged: number;
|
|
93
|
+
state: "covered" | "partial" | "unavailable" | "not-adopted" | "cold";
|
|
94
|
+
};
|
|
95
|
+
provenance: {
|
|
96
|
+
reqId: string;
|
|
97
|
+
documents: {
|
|
98
|
+
id: string;
|
|
99
|
+
type: import("../../review/requirement-triage").RequirementDocumentKind;
|
|
100
|
+
status: string;
|
|
101
|
+
dependsOn: readonly string[];
|
|
102
|
+
}[];
|
|
103
|
+
implementationAnchors: string[];
|
|
104
|
+
graphProvenance: {
|
|
105
|
+
[k: string]: {} | null;
|
|
106
|
+
};
|
|
107
|
+
executionEvidence: {
|
|
108
|
+
state: string;
|
|
109
|
+
recordedHead: string | null;
|
|
110
|
+
currentHead: string;
|
|
111
|
+
};
|
|
112
|
+
}[];
|
|
113
|
+
graph: {
|
|
114
|
+
status: GraphStatus;
|
|
115
|
+
sourceCommit: string | null;
|
|
116
|
+
graphAsOf: string | null;
|
|
117
|
+
resolutionLimits: string[];
|
|
118
|
+
};
|
|
119
|
+
graphBasis: {
|
|
120
|
+
head: string;
|
|
121
|
+
governedDocumentCount: number;
|
|
122
|
+
scannedSourceCount: number;
|
|
123
|
+
};
|
|
124
|
+
freshness: import("../../refresh/freshness-coordinator").FreshnessReceipt | {
|
|
125
|
+
state: string;
|
|
126
|
+
};
|
|
127
|
+
refresh: {
|
|
128
|
+
status: "spawned" | "coalesced" | "failed";
|
|
129
|
+
generation?: string;
|
|
130
|
+
} | {
|
|
131
|
+
status: "unavailable" | "not-needed";
|
|
132
|
+
};
|
|
133
|
+
lexicalOnly?: true | undefined;
|
|
134
|
+
candidates: {
|
|
135
|
+
documents: {
|
|
136
|
+
id: string;
|
|
137
|
+
type: import("../../review/requirement-triage").RequirementDocumentKind;
|
|
138
|
+
title: string;
|
|
139
|
+
status: string;
|
|
140
|
+
dependsOn: readonly string[];
|
|
141
|
+
}[];
|
|
142
|
+
reqId: string;
|
|
143
|
+
lexicalScore: number;
|
|
144
|
+
semanticScore?: number;
|
|
145
|
+
contentTerms: string[];
|
|
146
|
+
approved: boolean;
|
|
147
|
+
implementationAnchors: string[];
|
|
148
|
+
freshGreenTests: boolean;
|
|
149
|
+
reasons: string[];
|
|
150
|
+
}[];
|
|
151
|
+
verdict: import("../../review/requirement-triage").RequirementVerdict;
|
|
152
|
+
reasons: string[];
|
|
153
|
+
uncertainty: string[];
|
|
154
|
+
schema: "requirement-triage/1";
|
|
78
155
|
} | {
|
|
79
156
|
evidenceDigest: string;
|
|
80
157
|
persistedTo: string;
|
|
@@ -87,11 +164,13 @@ export declare function createRequirementTriageHandlers(context: RequirementTria
|
|
|
87
164
|
localState?: import("../../semantic/model-cache").LocalModelState | undefined;
|
|
88
165
|
recovery?: string | undefined;
|
|
89
166
|
suppressed?: true | undefined;
|
|
167
|
+
availability: string;
|
|
168
|
+
missingLineages?: string[] | undefined;
|
|
90
169
|
tier: "local" | "none" | "cloud";
|
|
91
170
|
covered: number;
|
|
92
171
|
total: number;
|
|
93
|
-
|
|
94
|
-
|
|
172
|
+
unlineaged: number;
|
|
173
|
+
state: "covered" | "partial" | "unavailable" | "not-adopted" | "cold";
|
|
95
174
|
};
|
|
96
175
|
provenance: {
|
|
97
176
|
reqId: string;
|
|
@@ -137,6 +216,86 @@ export declare function createRequirementTriageHandlers(context: RequirementTria
|
|
|
137
216
|
reasons: string[];
|
|
138
217
|
uncertainty: string[];
|
|
139
218
|
schema: "requirement-triage/1";
|
|
219
|
+
} | {
|
|
220
|
+
evidenceDigest: string;
|
|
221
|
+
persistedTo: string;
|
|
222
|
+
artifact: {
|
|
223
|
+
digest: string;
|
|
224
|
+
path: string;
|
|
225
|
+
};
|
|
226
|
+
promptDigest: string;
|
|
227
|
+
semantic: {
|
|
228
|
+
localState?: import("../../semantic/model-cache").LocalModelState | undefined;
|
|
229
|
+
recovery?: string | undefined;
|
|
230
|
+
suppressed?: true | undefined;
|
|
231
|
+
availability: string;
|
|
232
|
+
missingLineages?: string[] | undefined;
|
|
233
|
+
tier: "local" | "none" | "cloud";
|
|
234
|
+
covered: number;
|
|
235
|
+
total: number;
|
|
236
|
+
unlineaged: number;
|
|
237
|
+
state: "covered" | "partial" | "unavailable" | "not-adopted" | "cold";
|
|
238
|
+
};
|
|
239
|
+
provenance: {
|
|
240
|
+
reqId: string;
|
|
241
|
+
documents: {
|
|
242
|
+
id: string;
|
|
243
|
+
type: import("../../review/requirement-triage").RequirementDocumentKind;
|
|
244
|
+
status: string;
|
|
245
|
+
dependsOn: readonly string[];
|
|
246
|
+
}[];
|
|
247
|
+
implementationAnchors: string[];
|
|
248
|
+
graphProvenance: {
|
|
249
|
+
[k: string]: {} | null;
|
|
250
|
+
};
|
|
251
|
+
executionEvidence: {
|
|
252
|
+
state: string;
|
|
253
|
+
recordedHead: string | null;
|
|
254
|
+
currentHead: string;
|
|
255
|
+
};
|
|
256
|
+
}[];
|
|
257
|
+
graph: {
|
|
258
|
+
status: GraphStatus;
|
|
259
|
+
sourceCommit: string | null;
|
|
260
|
+
graphAsOf: string | null;
|
|
261
|
+
resolutionLimits: string[];
|
|
262
|
+
};
|
|
263
|
+
graphBasis: {
|
|
264
|
+
head: string;
|
|
265
|
+
governedDocumentCount: number;
|
|
266
|
+
scannedSourceCount: number;
|
|
267
|
+
};
|
|
268
|
+
freshness: import("../../refresh/freshness-coordinator").FreshnessReceipt | {
|
|
269
|
+
state: string;
|
|
270
|
+
};
|
|
271
|
+
refresh: {
|
|
272
|
+
status: "spawned" | "coalesced" | "failed";
|
|
273
|
+
generation?: string;
|
|
274
|
+
} | {
|
|
275
|
+
status: "unavailable" | "not-needed";
|
|
276
|
+
};
|
|
277
|
+
lexicalOnly?: true | undefined;
|
|
278
|
+
candidates: {
|
|
279
|
+
documents: {
|
|
280
|
+
id: string;
|
|
281
|
+
type: import("../../review/requirement-triage").RequirementDocumentKind;
|
|
282
|
+
title: string;
|
|
283
|
+
status: string;
|
|
284
|
+
dependsOn: readonly string[];
|
|
285
|
+
}[];
|
|
286
|
+
reqId: string;
|
|
287
|
+
lexicalScore: number;
|
|
288
|
+
semanticScore?: number;
|
|
289
|
+
contentTerms: string[];
|
|
290
|
+
approved: boolean;
|
|
291
|
+
implementationAnchors: string[];
|
|
292
|
+
freshGreenTests: boolean;
|
|
293
|
+
reasons: string[];
|
|
294
|
+
}[];
|
|
295
|
+
verdict: import("../../review/requirement-triage").RequirementVerdict;
|
|
296
|
+
reasons: string[];
|
|
297
|
+
uncertainty: string[];
|
|
298
|
+
schema: "requirement-triage/1";
|
|
140
299
|
}>;
|
|
141
300
|
};
|
|
142
301
|
export {};
|