@holmes-lab/holmes-kit 0.35.15 → 0.35.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +4 -2
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/guardrail/write-target.d.ts +18 -0
  5. package/dist/holmes/guardrail/write-target.js +136 -35
  6. package/dist/holmes/hooks/pre-tool-use.js +15 -10
  7. package/dist/holmes/hooks/rtm-refresh-child.d.ts +12 -2
  8. package/dist/holmes/hooks/rtm-refresh-child.js +26 -4
  9. package/dist/holmes/mcp/handlers/graph-operations.d.ts +1 -0
  10. package/dist/holmes/mcp/handlers/graph-operations.js +4 -4
  11. package/dist/holmes/mcp/handlers/maintenance-analysis.js +39 -17
  12. package/dist/holmes/mcp/handlers/operator-inspection.d.ts +25 -0
  13. package/dist/holmes/mcp/handlers/operator-inspection.js +60 -1
  14. package/dist/holmes/mcp/handlers/test-execution.d.ts +7 -0
  15. package/dist/holmes/mcp/handlers/test-execution.js +9 -2
  16. package/dist/holmes/mcp/handlers.d.ts +9 -0
  17. package/dist/holmes/mcp/maintenance-analyze.d.ts +21 -0
  18. package/dist/holmes/mcp/maintenance-analyze.js +1 -0
  19. package/dist/holmes/mcp/operator-recovery.js +5 -2
  20. package/dist/holmes/refresh/freshness-coordinator.d.ts +9 -0
  21. package/dist/holmes/refresh/freshness-coordinator.js +14 -4
  22. package/dist/holmes/review/missing-imports.d.ts +2 -0
  23. package/dist/holmes/review/missing-imports.js +2 -0
  24. package/dist/holmes/review/removed-names.d.ts +32 -0
  25. package/dist/holmes/review/removed-names.js +110 -0
  26. package/dist/holmes/rtm/anchor-ids.d.ts +15 -0
  27. package/dist/holmes/rtm/anchor-ids.js +45 -0
  28. package/dist/holmes/rtm/test-scope.d.ts +12 -0
  29. package/dist/holmes/rtm/test-scope.js +29 -4
  30. package/package.json +1 -1
  31. package/playbooks/publish/PLAYBOOK.md +29 -6
  32. package/dist/holmes/guardrail/write-verb-word.d.ts +0 -13
  33. package/dist/holmes/guardrail/write-verb-word.js +0 -55
@@ -40,8 +40,9 @@ exports.stripCode = stripCode;
40
40
  exports.countTestCases = countTestCases;
41
41
  exports.extractAnchors = extractAnchors;
42
42
  exports.scanTestAnchors = scanTestAnchors;
43
+ exports.scanTestAnchorDiagnostics = scanTestAnchorDiagnostics;
43
44
  exports.computeTestScope = computeTestScope;
44
- // @implements A-SPEC-121.2, A-SPEC-734, A-SPEC-750, A-SPEC-750.1
45
+ // @implements A-SPEC-121.2, A-SPEC-734, A-SPEC-750, A-SPEC-750.1, A-SPEC-768.1
45
46
  const anchor_ids_1 = require("./anchor-ids");
46
47
  const fs = __importStar(require("node:fs"));
47
48
  const path = __importStar(require("node:path"));
@@ -618,6 +619,15 @@ function describeUnresolved(entries) {
618
619
  */
619
620
  function scanTestAnchors(root) {
620
621
  const out = {};
622
+ forEachTestFile(root, (rel, text) => {
623
+ const ids = extractAnchors(text);
624
+ if (ids.length)
625
+ out[rel] = ids;
626
+ });
627
+ return out;
628
+ }
629
+ /** The one walk `scanTestAnchors` and `scanTestAnchorDiagnostics` share: every readable regular test file under `root`. */
630
+ function forEachTestFile(root, visit) {
621
631
  const walk = (dir) => {
622
632
  let entries;
623
633
  try {
@@ -647,12 +657,27 @@ function scanTestAnchors(root) {
647
657
  catch {
648
658
  continue;
649
659
  }
650
- const ids = extractAnchors(text);
651
- if (ids.length)
652
- out[rel] = ids;
660
+ visit(rel, text);
653
661
  }
654
662
  };
655
663
  walk(root);
664
+ }
665
+ /**
666
+ * @implements A-SPEC-768.1
667
+ * The anchor lists in test files that the comma grammar does not read (`A; B`, `A | B`, `A and B`): the same files
668
+ * `scanTestAnchors` attributes, the same string stripping, and only lines that are anchor lines (a comment with the
669
+ * marker) — so a diagnostic names exactly an attribution the scan above could not make.
670
+ */
671
+ function scanTestAnchorDiagnostics(root) {
672
+ const out = [];
673
+ forEachTestFile(root, (rel, text) => {
674
+ const lines = (0, anchor_ids_1.stripStringLiterals)(text).split('\n');
675
+ for (const d of (0, anchor_ids_1.anchorListDiagnostics)(text)) {
676
+ IMPL_LINE_RE.lastIndex = 0;
677
+ if (IMPL_LINE_RE.test(lines[d.line - 1] ?? ''))
678
+ out.push({ file: rel, ...d });
679
+ }
680
+ });
656
681
  return out;
657
682
  }
658
683
  function computeTestScope(impactedSpecsRaw, testAnchors, specs, coverageGaps = [], cfg, extras) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "@implements A-SPEC-209",
3
3
  "name": "@holmes-lab/holmes-kit",
4
- "version": "0.35.15",
4
+ "version": "0.35.17",
5
5
  "description": "Holmes-Kit — deterministic Agentic Software Engineering (ASE) harness with causal traceability (spec chain + D-CPG + RTM + phase guardrail)",
6
6
  "main": "dist/holmes/mcp/server.js",
7
7
  "types": "dist/holmes/mcp/server.d.ts",
@@ -137,12 +137,33 @@ npm publish --access public
137
137
 
138
138
  ### 6단계: 외부 문서 표면 (External Docs Reach) — 발행이 닿는 곳까지 정직하게
139
139
 
140
- npm 만 갱신하고 끝나면, 사람들이 실제로 읽는 문서는 낡은 채로 남는다. **사고 이력**: 이 저장소에는
140
+ npm 만 갱신하고 끝나면, 사람들이 실제로 읽는 문서는 낡은 채로 남는다. **사고 이력 1**: 이 저장소에는
141
141
  GitHub 리모트가 없어(origin 이 로컬 gitea) 0.16.0·0.17.0·0.18.0 **세 릴리스 동안** GitHub README 가
142
- 한 번도 갱신되지 않았고, `package.json` 의 `homepage` 가 바로 그 문서를 가리킨다.
142
+ 한 번도 갱신되지 않았고, `package.json` 의 `homepage` 가 바로 그 문서를 가리킨다. **사고 이력 2
143
+ (2026-10-11 측정)**: 아래 4a 가 0.35.13 에 쓰인 뒤에도 GitHub 의 `.ax/badges/traced.svg` 는 **v0.27.0
144
+ (2026-09-20) 의 숫자 그대로**였고, GitHub README 는 v0.35.10 에서 멈춰 0.35.11–0.35.16 **여섯 릴리스**가
145
+ 올라가지 않았다 — 문장은 있었지만 **한 것을 증명하라는 요구가 없어서** 매번 조용히 건너뛰어졌다.
143
146
 
144
147
  **발행이 성공한 뒤에만** 실행한다 — 실패한 릴리스의 문서를 최신이라고 주장하지 않는다.
145
148
 
149
+ > [!IMPORTANT]
150
+ > **이 단계는 릴리스의 일부이고, 보고로 증명한다.** 릴리스 완료 보고(5단계 뒤)에는 다음 세 줄이 **반드시**
151
+ > 있어야 하며, 하나라도 비어 있으면 그 릴리스는 끝나지 않은 것이다:
152
+ > `README: 원격 sha <전> → <후>, 재조회 일치 yes/no` · `badge: 원격 sha <전> → <후>, 재조회 일치 yes/no` ·
153
+ > `SKIP 사유: <없음 | 정확한 사유>`. "동기화했다"는 문장은 이 세 줄이 아니다.
154
+
155
+ 가장 짧은 실행 경로(두 파일을 같은 방식으로; `<owner>/<repo>` 는 1 에서 파생한 값):
156
+
157
+ ```bash
158
+ for f in README.md .ax/badges/traced.svg; do
159
+ before=$(gh api "repos/<owner>/<repo>/contents/$f" --jq .sha)
160
+ gh api --method PUT "repos/<owner>/<repo>/contents/$f" \
161
+ -f message="docs: sync $f with vX.Y.Z" -f sha="$before" \
162
+ -f content="$(base64 < "$f" | tr -d '\n')" --jq .content.sha
163
+ gh api "repos/<owner>/<repo>/contents/$f" --jq .content | tr -d '\n' | base64 -d | cmp - "$f" && echo "$f: 재조회 일치"
164
+ done
165
+ ```
166
+
146
167
  1. **대상 파생 (하드코딩 금지)**: `package.json` 의 `repository` 에서 `<owner>/<repo>` 를 얻는다
147
168
  (`repoTargetFrom`). 이 플레이북은 **소비 프로젝트에도 설치**되므로 특정 저장소를 박아 두면 남의
148
169
  릴리스가 그 저장소를 덮어쓴다. 파생 실패 → **SKIP(사유: `repository` 필드 없음/비-GitHub)**.
@@ -152,10 +173,12 @@ GitHub 리모트가 없어(origin 이 로컬 gitea) 0.16.0·0.17.0·0.18.0 **세
152
173
  3. **동기화**: 로컬 `README.md` 를 `gh api --method PUT` 으로 올린다(`sha` 는 2 에서 읽은 값).
153
174
  4. **재조회 검증**: 다시 읽어 로컬과 일치하는지 확인한다. **쓴 것과 남은 것은 다를 수 있다** —
154
175
  검증 없는 "갱신했다"는 주장이지 사실이 아니다.
155
- 4a. **추적 배지도 같은 표면이다**: 로컬에 `.ax/badges/traced.svg` 가 있으면 README 와 **같은 대상
156
- `<owner>/<repo>`** 의 같은 경로를 2~4 와 똑같이 다룬다 — 원격을 먼저 읽어 차이를 보고하고, 올리고,
157
- **배지도 다시 읽어** 로컬과 일치하는지 확인한다. README 만 올리면 원격 README 는 새 숫자를 말하고
158
- 그림은 옛 숫자를 보여 준다. 배지 파일이 없으면 **SKIP(사유: 배지를 쓰지 않는 프로젝트)**.
176
+ 4a. **추적 배지도 같은 표면이다 — README 와 한 쌍으로, 같은 루프 안에서**: 로컬에 `.ax/badges/traced.svg` 가
177
+ 있으면 README 와 **같은 대상 `<owner>/<repo>`** 의 같은 경로를 2~4 와 똑같이 다룬다 — 원격을 먼저 읽어
178
+ 차이를 보고하고, 올리고, **배지도 다시 읽어** 로컬과 일치하는지 확인한다. README 만 올리면 원격 README 는
179
+ 새 숫자를 말하고 그림은 옛 숫자를 보여 준다(사고 이력 2: 그림이 **스물한 릴리스** 전 숫자였다). 배지
180
+ 파일이 없으면 **SKIP(사유: 배지를 쓰지 않는 프로젝트)**. 2.55단계의 재측정은 **로컬** 배지를 고치는
181
+ 것이고, 이 항목은 **원격** 배지를 고치는 것이다 — 둘은 서로를 대신하지 않는다.
159
182
  5. **profile README drift 감지 (자동 수정 금지)**: `<owner>/.github` 의 `profile/README.md` 를 읽어
160
183
  `profileDriftFindings` 로 주장-현실 불일치를 **보고만** 한다. 포지셔닝 문안은 오너 결정이며
161
184
  릴리스 절차가 정할 것이 아니다.
@@ -1,13 +0,0 @@
1
- /**
2
- * Whether `text` names one of `verbs` as a shell word, rather than as letters inside another word.
3
- *
4
- * Measured 2026-10-04: `\bverb\b` matched `install` in `docs/install-guide.md` and `ln` in `grep -ln`, so read-only
5
- * commands were refused as file writes. A verb occurrence still counts in every spelling a shell runs it under
6
- * (`cp`, `/usr/bin/install`, `'cp'`, `cp.exe`, `--to-command=tee`, `rsync-ssl`); only two shapes do not:
7
- * a. the word is a single-dash option cluster of letters and digits (`-ln`, `-rm1`);
8
- * b. inside the word the verb is followed by `/`, or the word ends in a file extension other than `.exe`.
9
- * Callers keep their own matching for what the verb targets — this answers only "is there such a verb at all", so a
10
- * caller's verdict is removed only when the whole text holds no counting occurrence. One pass: a word's shape is read
11
- * once however many occurrences it holds.
12
- */
13
- export declare function namesWriteVerb(text: string, verbs: RegExp): boolean;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namesWriteVerb = namesWriteVerb;
4
- // @implements A-SPEC-747.1
5
- /** A shell word ends at white space or at one of `;|&()<>`. */
6
- function isBreak(code) {
7
- return code === 32 || code === 9 || code === 10 || code === 13 || code === 11 || code === 12
8
- || code === 59 || code === 124 || code === 38 || code === 40 || code === 41 || code === 60 || code === 62;
9
- }
10
- /**
11
- * Whether `text` names one of `verbs` as a shell word, rather than as letters inside another word.
12
- *
13
- * Measured 2026-10-04: `\bverb\b` matched `install` in `docs/install-guide.md` and `ln` in `grep -ln`, so read-only
14
- * commands were refused as file writes. A verb occurrence still counts in every spelling a shell runs it under
15
- * (`cp`, `/usr/bin/install`, `'cp'`, `cp.exe`, `--to-command=tee`, `rsync-ssl`); only two shapes do not:
16
- * a. the word is a single-dash option cluster of letters and digits (`-ln`, `-rm1`);
17
- * b. inside the word the verb is followed by `/`, or the word ends in a file extension other than `.exe`.
18
- * Callers keep their own matching for what the verb targets — this answers only "is there such a verb at all", so a
19
- * caller's verdict is removed only when the whole text holds no counting occurrence. One pass: a word's shape is read
20
- * once however many occurrences it holds.
21
- */
22
- function namesWriteVerb(text, verbs) {
23
- const re = new RegExp(verbs.source, verbs.flags.includes('g') ? verbs.flags : `${verbs.flags}g`);
24
- let wordStart = -1;
25
- let wordEnd = -1;
26
- let cluster = false;
27
- let extension = false;
28
- for (let m = re.exec(text); m !== null; m = re.exec(text)) {
29
- if (m[0].length === 0) {
30
- re.lastIndex++;
31
- continue;
32
- }
33
- const at = m.index;
34
- if (at < wordStart || at >= wordEnd) {
35
- let s = at;
36
- while (s > 0 && !isBreak(text.charCodeAt(s - 1)))
37
- s--;
38
- let e = at;
39
- while (e < text.length && !isBreak(text.charCodeAt(e)))
40
- e++;
41
- wordStart = s;
42
- wordEnd = e;
43
- const raw = text.slice(s, e);
44
- cluster = /^-[A-Za-z0-9]+$/.test(raw);
45
- const ext = /\.([A-Za-z0-9]{1,8})$/.exec(raw.replace(/["'\\]/g, ''));
46
- extension = ext !== null && ext[1].toLowerCase() !== 'exe';
47
- }
48
- if (cluster || extension)
49
- continue;
50
- if (text.charCodeAt(at + m[0].length) === 47)
51
- continue; // the verb is a directory name inside a path
52
- return true;
53
- }
54
- return false;
55
- }