@holmes-lab/holmes-kit 0.28.0 β 0.29.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 +38 -0
- package/README.md +19 -17
- package/dist/.build-id +1 -1
- package/dist/holmes/cli/doctor.js +25 -1
- package/dist/holmes/cpg/ast-mutation.d.ts +2 -0
- package/dist/holmes/cpg/ast-mutation.js +4 -2
- package/dist/holmes/cpg/foundation/cfg.d.ts +10 -0
- package/dist/holmes/cpg/foundation/cfg.js +27 -1
- package/dist/holmes/mcp/handlers/graph-operations.d.ts +7 -0
- package/dist/holmes/mcp/handlers/graph-operations.js +25 -1
- package/dist/holmes/mcp/handlers/requirement-triage.d.ts +116 -0
- package/dist/holmes/mcp/handlers/requirement-triage.js +185 -0
- package/dist/holmes/mcp/handlers.d.ts +107 -0
- package/dist/holmes/mcp/handlers.js +11 -1
- package/dist/holmes/mcp/requirement-triage-evidence.d.ts +11 -0
- package/dist/holmes/mcp/requirement-triage-evidence.js +79 -0
- package/dist/holmes/mcp/tool-schemas.js +14 -1
- package/dist/holmes/review/condition-hunk-replay.d.ts +33 -0
- package/dist/holmes/review/condition-hunk-replay.js +112 -0
- package/dist/holmes/review/condition-hunk-resolution.d.ts +65 -0
- package/dist/holmes/review/condition-hunk-resolution.js +207 -0
- package/dist/holmes/review/requirement-triage-benchmark.d.ts +45 -0
- package/dist/holmes/review/requirement-triage-benchmark.js +72 -0
- package/dist/holmes/review/requirement-triage.d.ts +61 -0
- package/dist/holmes/review/requirement-triage.js +143 -0
- package/dist/holmes/semantic/local-model.d.ts +3 -3
- package/dist/holmes/semantic/local-model.js +10 -12
- package/dist/holmes/semantic/model-cache.d.ts +15 -6
- package/dist/holmes/semantic/model-cache.js +77 -21
- package/dist/holmes/semantic/tier.d.ts +5 -1
- package/dist/holmes/semantic/tier.js +7 -6
- package/dist/holmes/semantic/vector-coverage.d.ts +17 -0
- package/dist/holmes/semantic/vector-coverage.js +37 -0
- package/docs/install-guide.md +19 -24
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,44 @@ 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.29.0] - 2026-09-22
|
|
9
|
+
|
|
10
|
+
Holmes-Kit now prepares a local semantic layer by default and can compare a
|
|
11
|
+
new prompt with governed requirement lineage before an agent starts a new spec.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **Verified local BGE-M3 semantic preparation** (A-SPEC-712). Normal package
|
|
16
|
+
installation prepares the pinned public local model in the shared user cache
|
|
17
|
+
and activates it only after offline inference verification. The explicit
|
|
18
|
+
HOLMES_SKIP_MODEL_INSTALL=1 opt-out remains available. A blocked install
|
|
19
|
+
script, offline download, corrupt cache, or failed inference keeps the
|
|
20
|
+
package usable and reports a precise unavailable or degraded recovery path;
|
|
21
|
+
repository text never leaves the machine through this tier.
|
|
22
|
+
- **Read-only requirement lifecycle triage** (A-SPEC-713). The new
|
|
23
|
+
requirement_triage MCP tool ranks governed REQ/H-SPEC/A-SPEC/T-SPEC
|
|
24
|
+
lineages with deterministic BM25 and additive cached semantic candidates,
|
|
25
|
+
then uses content, approval, implementation-anchor, exact-HEAD execution,
|
|
26
|
+
and published-graph evidence to recommend fulfilled, existing-change, new,
|
|
27
|
+
or ambiguous. It can persist a content-addressed evidence artifact but
|
|
28
|
+
cannot create, edit, approve, unseal, retire, or open a source-edit gate.
|
|
29
|
+
- **Condition hunk advisory evidence** (A-SPEC-661). A separate, opt-in
|
|
30
|
+
advisory resolver maps a zero-context diff hunk through a symbol to CFG
|
|
31
|
+
predicate provenance and reports only locally demonstrable relaxed,
|
|
32
|
+
narrowed, or unknown direction. It does not change changedFiles, scanner
|
|
33
|
+
output, hooks, or gates. The recorded 20-commit replay found 21 resolved
|
|
34
|
+
predicate records from 102 symbol candidates; its measured heavy-path cost
|
|
35
|
+
stays outside the synchronous scanner.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **Requirement-triage measurement is preregistered, not overstated.** A
|
|
40
|
+
12-case frozen prompt corpus and analyst protocol record retrieval coverage,
|
|
41
|
+
human-choice agreement, false reuse/new, evidence completeness, ambiguity
|
|
42
|
+
preservation, and elapsed time as comparison/gap metrics only. No
|
|
43
|
+
human-superiority or release-gate claim is made before an independent blind
|
|
44
|
+
run supplies analyst records.
|
|
45
|
+
|
|
8
46
|
## [0.28.0] - 2026-09-21
|
|
9
47
|
|
|
10
48
|
Holmes-Kit can now keep its governed operating discipline consistent while a
|
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
|
+
- π§Ύ **A new prompt is checked against governed intent before it becomes a new spec** *(new in 0.29.0)*: `requirement_triage` reads the approved REQ/H-SPEC/A-SPEC/T-SPEC lineage, its current RTM graph, code anchors, and exact-HEAD execution evidence before recommending `fulfilled`, `existing-change`, `new`, or `ambiguous`. BM25 is always present; a verified local BGE-M3 cache and explicit Gemini opt-in only add candidates and never decide the outcome alone. A cold, stale, unreadable, or absent evidence lane remains visible as ambiguity. `rtm_reindex` is the only operation that warms versioned requirement-document vectors; optional persistence writes one content-addressed advisory artifact and never changes a spec or opens an edit gate.
|
|
26
27
|
- π§ **One governed operating contract survives every harness** *(new in 0.28.0)*: the common managed block in `AGENTS.md` carries the same No Spec, No Code rules to Claude Code, Codex CLI, and Antigravity while leaving the repository's own rules outside the block intact. `holmes-kit guidance check` names a stale or locally conflicted managed block, `guidance refresh` first plans the change and then replaces only the Holmes-owned region, and `doctor` runs the same check. An installer or upgrader cannot silently discard local guidance.
|
|
27
28
|
- π§· **A worktree can prove which workspace the MCP server serves before an edit** *(new in 0.28.0)*: `workspace_preflight` returns the bound root/store identity and reports a foreign caller as a mismatch without registering, rebinding, or writing anything. `holmes-kit doctor --agent claude|codex|antigravity` checks each harness's local wiring prerequisites and states that preparation is not evidence of live hook enforcement. This is paired with a packaged Superpowers compatibility playbook that preserves Holmes specifications, RED/GREEN evidence, review closure, and finish/reconciliation requirements through the corresponding Superpowers workflow. Fixture and subprocess coverage preserve neighboring configuration and foreign-root isolation; live linked-worktree and paid-harness acceptance remain explicitly unverified until observed.
|
|
28
29
|
- π **Say how much of the repository is governed β as a number, not a label** *(new in 0.27.0)*: `holmes-kit attest` reports how many scanned source files are anchored to an **approved** spec, beside how many approved A-SPECs are anchored from code, and says where that is true (commit, plus a digest of the approved specs) so anyone can reproduce it. No new judgement: the scanner's files, the anchors, the existing link census. A per-file "generated under holmes-kit" header was declined β it is a claim that survives an ungoverned edit, and line 1 already carries the anchor a gate verifies. `--exclude a,b` names vendored trees at a path boundary and is echoed in every output; what cannot be measured is `n/a`, never `0%`; `100` appears only when every file is traced. `--badge` writes a self-contained local SVG, and `--readme` rewrites **only** the region between the `holmes-kit:attest` markers β a README without them is never touched, and a half marker is refused. A statement, not a gate: the numbers never change the exit code.
|
|
@@ -73,7 +74,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) β reproduce with `hol
|
|
|
73
74
|
- π€ **Autonomous approval β three layers, always bounded** *(0.8.0, reworked 0.13.0)*: a project default (`init --autonomy`) and an expiring per-session envelope let the agent seal **low-risk** specs itself under an `autonomous:<client>` actor; every governance-critical, high-risk or irreversible decision is refused and routed to the out-of-band `holmes-kit approve` queue. The agent can never grant it to itself, the posture is surfaced at every session start, and off is byte-identical to a fully human-gated project.
|
|
74
75
|
- π§ **Compatibility and evolution gates** *(0.14.0, 0.15.0)*: a new A-SPEC seals only with `harness_impact:` and `os_impact:` declared and machine-cross-checked against Files-to-Touch; separately, a changed in-scope source that **newly introduces an external dependency** raises a spec-reappraisal β a warning when manual, a queued item under autonomy, never a blocked turn.
|
|
75
76
|
- π’ **Release autonomy + docs-currency gate** *(0.13.0, machine-checked in 0.23.2)*: `npm publish` stays **human-approved by default** while a deterministic classifier lets a low-risk release self-publish under the ledger; a major bump or any gate-behavior/security/architecture spec forces HITL. The publish gate refuses a release whose docs never caught up β a stale doc is a false claim.
|
|
76
|
-
- π§ **3-tier semantic layer** *(0.
|
|
77
|
+
- π§ **3-tier semantic layer** *(local preparation default in 0.29.0)*: BGE-M3 is prepared and verified locally during a normal npm installation (zero repository-text egress); `HOLMES_SKIP_MODEL_INSTALL=1` is the explicit opt-out. `cloud` remains the opt-in `gemini-embedding-001` tier. Measured on 305 traceability cases: recall 0.486 β 0.667 β **0.887**; on lexical-zero requests 0% β 52% β **92%**. Surfaced additively, never as a hard filter.
|
|
77
78
|
- π― **Graded impact surface** *(0.3.0)*: `rankedImpact` (personalized PageRank over the spec/code graph) beat its pre-registered naive baseline on **both** recall and precision across 3 corpora (Γ1.6βΓ17) β measured before claimed.
|
|
78
79
|
- π **Causal defect localization & CPG** *(equalized in 0.5β0.7)*: AST code property graph (CFG/DDG/CDG) and dataflow taint reachability across 7 languages β **42 languageΓlayer cells graded on measured evidence** (11 corpora, 39,344 functions, zero invariant violations; C++ conditional on 67.9% parse coverage, disclosed in the matrix).
|
|
79
80
|
- π **Measured, not claimed** *(0.3.x)*: performance is judged against a pre-registered modeled-human band (R 0.67β0.78 / P β0.9Β±). Current official grade: **band entry on recall; division-of-labor precision 0.727 = 81% of the modeled human**, reproduced by an independent context-free judge on a fresh blind window. No superhuman claims until both metrics exceed the band.
|
|
@@ -180,28 +181,29 @@ npx holmes-kit doctor
|
|
|
180
181
|
```
|
|
181
182
|
*If everything is green, your project is governed and ready for AI pair-programming!*
|
|
182
183
|
|
|
183
|
-
### 4.
|
|
184
|
+
### 4. Local semantic layer by default; cloud remains optional
|
|
184
185
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
During a normal npm installation, Holmes-Kit prepares the public pinned BGE-M3 assets in a shared
|
|
187
|
+
user cache and enables tier **`local`** only after a real offline inference check succeeds. Local
|
|
188
|
+
inference has **zero repository-text egress**. BM25, citation, and graph search remain available
|
|
189
|
+
whether preparation succeeds or not. The optional cloud tier raises recall further on requests
|
|
190
|
+
your vocabulary cannot reach (measured on 305 traceability cases β see the feature list above):
|
|
188
191
|
|
|
189
|
-
**Tier `local` β no egress, no account.** The embedding runtime ships with holmes-kit
|
|
190
|
-
|
|
191
|
-
`init` downloads it, because a large download nobody asked for is not a default. One command:
|
|
192
|
+
**Tier `local` β no egress, no account.** The embedding runtime ships with holmes-kit. Package
|
|
193
|
+
installation attempts setup once by default; run these commands later to retry or prove readiness:
|
|
192
194
|
```bash
|
|
193
195
|
npx holmes-kit semantic-setup # downloads the public bge-m3 assets once, shared across projects
|
|
194
196
|
npx holmes-kit semantic-check # verifies OFFLINE inference β a real 1024-dim normalized vector
|
|
195
197
|
npx holmes-kit doctor # β semantic tier: local (no egress)
|
|
196
198
|
```
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
`HOLMES_SKIP_MODEL_INSTALL=1` explicitly declines automatic preparation. It never blocks an
|
|
200
|
+
explicit `semantic-setup` or `semantic-check`. Models live in `~/.holmes/models`
|
|
201
|
+
(`%USERPROFILE%\.holmes\models` on Windows); `HOLMES_MODEL_CACHE` overrides that, including for a
|
|
202
|
+
prepopulated offline cache. A cache activates the local tier only after successful offline inference
|
|
203
|
+
writes a current readiness receipt. If lifecycle scripts are blocked, the download fails, or the
|
|
204
|
+
cache is unverified or changed, the package remains usable: `doctor` reports **unavailable** or
|
|
205
|
+
**degraded** and names `semantic-setup` as the recovery command. A runtime or nonempty directory is
|
|
206
|
+
never treated as a working embedding tier.
|
|
205
207
|
|
|
206
208
|
> **Security note.** This package's dependency chain pulls `protobufjs@6.x` through
|
|
207
209
|
> `@xenova/transformers β onnxruntime-web β onnx-proto`, which carries a critical advisory. npm's
|
|
@@ -275,7 +277,7 @@ flowchart LR
|
|
|
275
277
|
| `holmes-kit autonomy status` | Show the current autonomous-approval posture (project default + session envelope) |
|
|
276
278
|
| `holmes-kit autonomy on --for 2h` | Self-drive low-risk specs for this session only (expiring; needs a TTY or `HOLMES_APPROVAL`) |
|
|
277
279
|
| `holmes-kit autonomy off` | End session autonomy immediately |
|
|
278
|
-
| `holmes-kit semantic-setup` | Download and verify the local `bge-m3` model (
|
|
280
|
+
| `holmes-kit semantic-setup` | Download and verify the local `bge-m3` model (retry/recovery; shared across projects) |
|
|
279
281
|
| `holmes-kit semantic-check` | Verify local inference **offline**, without downloading anything |
|
|
280
282
|
| `holmes-kit semantic-key set` | Store the cloud-tier key outside the tree (stdin only, never argv) |
|
|
281
283
|
| `holmes-kit approve --status` | The whole approval picture: workspace, delegation, per-request risk/run/subject/grant preview, recent outcomes |
|
package/dist/.build-id
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5fc87d4f-mubu528k
|
|
@@ -53,7 +53,7 @@ exports.wiringHandshakeChecks = wiringHandshakeChecks;
|
|
|
53
53
|
exports.semanticCoverageCheck = semanticCoverageCheck;
|
|
54
54
|
exports.semanticTierVerdict = semanticTierVerdict;
|
|
55
55
|
exports.detectTreeKeyTemporary = detectTreeKeyTemporary;
|
|
56
|
-
// @implements A-SPEC-704, A-SPEC-710
|
|
56
|
+
// @implements A-SPEC-704, A-SPEC-710, A-SPEC-712
|
|
57
57
|
const doctor_guidance_1 = require("./doctor-guidance");
|
|
58
58
|
// @implements A-SPEC-264, A-SPEC-423, A-SPEC-549.1, A-SPEC-590
|
|
59
59
|
// @implements A-SPEC-594
|
|
@@ -1812,6 +1812,30 @@ function semanticTierVerdict(t) {
|
|
|
1812
1812
|
fix: 'Run holmes-kit semantic-check for actual offline inference; if unavailable, run holmes-kit semantic-setup.',
|
|
1813
1813
|
};
|
|
1814
1814
|
}
|
|
1815
|
+
// @implements A-SPEC-712 β a cache directory is only a candidate. The receipt is written after
|
|
1816
|
+
// successful offline inference, so its absence or a fingerprint mismatch is degraded rather than
|
|
1817
|
+
// a normal first-install state. Tell the user whether setup will verify existing assets or must
|
|
1818
|
+
// fetch them, without pretending the local tier can answer meanwhile.
|
|
1819
|
+
if (t.localRuntimePresent && t.localState) {
|
|
1820
|
+
const changed = t.localState === 'stale-receipt';
|
|
1821
|
+
const invalid = t.localState === 'invalid-receipt';
|
|
1822
|
+
const missing = t.localState === 'missing-cache';
|
|
1823
|
+
const detail = missing
|
|
1824
|
+
? 'Semantic search tier: unavailable β the local runtime is installed but the BGE-M3 cache is absent.'
|
|
1825
|
+
: changed
|
|
1826
|
+
? 'Semantic search tier: degraded β the changed BGE-M3 cache no longer matches its verified-inference receipt.'
|
|
1827
|
+
: invalid
|
|
1828
|
+
? 'Semantic search tier: degraded β the BGE-M3 readiness receipt is invalid, so cached assets are not trusted.'
|
|
1829
|
+
: 'Semantic search tier: degraded β an existing BGE-M3 cache has not completed verified offline inference.';
|
|
1830
|
+
const fix = missing
|
|
1831
|
+
? 'Run `holmes-kit semantic-setup` to download and verify BGE-M3 offline.'
|
|
1832
|
+
: changed
|
|
1833
|
+
? 'Run `holmes-kit semantic-setup` to re-verify the changed BGE-M3 cache offline.'
|
|
1834
|
+
: invalid
|
|
1835
|
+
? 'Run `holmes-kit semantic-setup` to replace the invalid BGE-M3 readiness receipt.'
|
|
1836
|
+
: 'Run `holmes-kit semantic-setup` to verify the existing BGE-M3 cache offline.';
|
|
1837
|
+
return { level: 'WARN', detail, fix };
|
|
1838
|
+
}
|
|
1815
1839
|
// @implements A-SPEC-594 β two different 'none' states need two different sentences. When the
|
|
1816
1840
|
// runtime is already installed, telling the user to install it is noise; the missing piece is
|
|
1817
1841
|
// the model, and the command that fetches it is the whole fix. Both stay PASS: a user who never
|
|
@@ -17,6 +17,8 @@ export interface MutationResult {
|
|
|
17
17
|
mutationScorePct: number;
|
|
18
18
|
mutants: AstMutant[];
|
|
19
19
|
}
|
|
20
|
+
/** Shared mutation vocabulary used by mutation scoring and condition-direction advisories. */
|
|
21
|
+
export declare const MUTATION_MAP: Readonly<Record<MutationOperator, Readonly<Record<string, readonly string[]>>>>;
|
|
20
22
|
/**
|
|
21
23
|
* Generate AST mutants for static CPG scanned files.
|
|
22
24
|
*
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MUTATION_MAP = void 0;
|
|
3
4
|
exports.generateAstMutants = generateAstMutants;
|
|
4
5
|
exports.evaluateMutationScore = evaluateMutationScore;
|
|
5
|
-
|
|
6
|
+
/** Shared mutation vocabulary used by mutation scoring and condition-direction advisories. */
|
|
7
|
+
exports.MUTATION_MAP = {
|
|
6
8
|
relational: {
|
|
7
9
|
'>': ['<', '>='],
|
|
8
10
|
'<': ['>', '<='],
|
|
@@ -47,7 +49,7 @@ function generateAstMutants(scannedFiles, operators) {
|
|
|
47
49
|
for (const sym of symbols) {
|
|
48
50
|
let mutIndex = 0;
|
|
49
51
|
for (const opType of targetOps) {
|
|
50
|
-
const opRules = MUTATION_MAP[opType];
|
|
52
|
+
const opRules = exports.MUTATION_MAP[opType];
|
|
51
53
|
if (!opRules)
|
|
52
54
|
continue;
|
|
53
55
|
for (const [origToken, replacements] of Object.entries(opRules)) {
|
|
@@ -23,6 +23,14 @@ export interface CfgEdge {
|
|
|
23
23
|
to: number;
|
|
24
24
|
kind: EdgeKind;
|
|
25
25
|
}
|
|
26
|
+
/** Source provenance for a TS/JS predicate-bearing branch; absent where the language/source cannot prove it. */
|
|
27
|
+
export interface CfgConditionBranch {
|
|
28
|
+
conditionText?: string;
|
|
29
|
+
startOffset?: number;
|
|
30
|
+
endOffset?: number;
|
|
31
|
+
astKind?: string;
|
|
32
|
+
branchLabel: 'true' | 'false' | 'case' | 'default';
|
|
33
|
+
}
|
|
26
34
|
export interface Cfg {
|
|
27
35
|
blocks: CfgBlock[];
|
|
28
36
|
edges: CfgEdge[];
|
|
@@ -34,6 +42,8 @@ export interface Cfg {
|
|
|
34
42
|
ipostdom: Int32Array;
|
|
35
43
|
/** Blocks not reachable from ENTRY (dead code after return etc.) β lint material, not an error. */
|
|
36
44
|
unreachable: number[];
|
|
45
|
+
/** Additive condition facts. Existing blocks and edge labels retain their original contract. */
|
|
46
|
+
conditionBranches?: CfgConditionBranch[];
|
|
37
47
|
}
|
|
38
48
|
export interface FunctionRef {
|
|
39
49
|
nodeIndex: number;
|
|
@@ -1085,7 +1085,33 @@ function cfgOf(ast, fn, source) {
|
|
|
1085
1085
|
link(e.from, EXIT, e.kind === 'seq' ? 'seq' : e.kind);
|
|
1086
1086
|
if (pendingBreaks.length > 0)
|
|
1087
1087
|
throw new Unsupported('unresolved break label');
|
|
1088
|
-
|
|
1088
|
+
const cfg = finalize(stmtsOf, edges, ENTRY, EXIT);
|
|
1089
|
+
// Predicate provenance is deliberately narrower than CFG support: this slice has verified the
|
|
1090
|
+
// tree shapes only for TS/JS, and an absent fact is safer than a guessed condition in another
|
|
1091
|
+
// language. It is attached beside edges, never changes their labels or connectivity.
|
|
1092
|
+
if (source !== undefined && (ast.lang === 'typescript' || ast.lang === 'tsx')) {
|
|
1093
|
+
const conditions = [];
|
|
1094
|
+
const bodyTypes = new Set(['statement_block', 'else_clause', 'switch_body']);
|
|
1095
|
+
for (const edge of cfg.edges) {
|
|
1096
|
+
if (!['true', 'false', 'case', 'default'].includes(edge.kind))
|
|
1097
|
+
continue;
|
|
1098
|
+
const stmt = cfg.blocks[edge.from]?.stmts[0];
|
|
1099
|
+
if (stmt === undefined)
|
|
1100
|
+
continue;
|
|
1101
|
+
const type = ast.nodes[stmt]?.type;
|
|
1102
|
+
if (!['if_statement', 'while_statement', 'do_statement', 'for_statement', 'for_in_statement', 'switch_statement'].includes(type))
|
|
1103
|
+
continue;
|
|
1104
|
+
const condition = kids.of(stmt).find((child) => ast.nodes[child].named && !bodyTypes.has(ast.nodes[child].type));
|
|
1105
|
+
if (condition === undefined)
|
|
1106
|
+
continue;
|
|
1107
|
+
conditions.push({ conditionText: source.slice(ast.nodes[condition].start, ast.nodes[condition].end),
|
|
1108
|
+
startOffset: ast.nodes[condition].start, endOffset: ast.nodes[condition].end,
|
|
1109
|
+
astKind: ast.nodes[condition].type, branchLabel: edge.kind });
|
|
1110
|
+
}
|
|
1111
|
+
if (conditions.length > 0)
|
|
1112
|
+
cfg.conditionBranches = conditions;
|
|
1113
|
+
}
|
|
1114
|
+
return cfg;
|
|
1089
1115
|
}
|
|
1090
1116
|
catch (e) {
|
|
1091
1117
|
if (e instanceof Unsupported)
|
|
@@ -49,6 +49,8 @@ export type SemanticWarmOutcome = {
|
|
|
49
49
|
* could not embed β a discharge must not record the last one as done.
|
|
50
50
|
*/
|
|
51
51
|
export declare function warmSemanticCache(root: string, scanned: readonly ScannedFile[]): Promise<SemanticWarmOutcome>;
|
|
52
|
+
/** Requirement prose is warmed only by the explicit reindex operation. */
|
|
53
|
+
export declare function warmRequirementSemanticCache(root: string, specs: readonly Spec[]): Promise<SemanticWarmOutcome>;
|
|
52
54
|
/**
|
|
53
55
|
* @implements A-SPEC-683 β vectors refresh on the channel that keeps the graph fresh.
|
|
54
56
|
*
|
|
@@ -93,6 +95,11 @@ export declare function createGraphOperationsHandlers(context: GraphOperationsCo
|
|
|
93
95
|
head?: string;
|
|
94
96
|
since?: string;
|
|
95
97
|
}): Promise<{
|
|
98
|
+
requirementSemanticWarm?: {
|
|
99
|
+
tier: string;
|
|
100
|
+
computed: number;
|
|
101
|
+
cached: number;
|
|
102
|
+
} | undefined;
|
|
96
103
|
semanticWarm?: {
|
|
97
104
|
tier: string;
|
|
98
105
|
computed: number;
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.publishCurrentGraph = publishCurrentGraph;
|
|
37
37
|
exports.warmSemanticCache = warmSemanticCache;
|
|
38
|
+
exports.warmRequirementSemanticCache = warmRequirementSemanticCache;
|
|
38
39
|
exports.refreshSemanticVectors = refreshSemanticVectors;
|
|
39
40
|
exports.createGraphOperationsHandlers = createGraphOperationsHandlers;
|
|
40
41
|
// @implements A-SPEC-614, A-SPEC-613, A-SPEC-100.2, A-SPEC-121.2, A-SPEC-128, A-SPEC-139, A-SPEC-189, A-SPEC-280, A-SPEC-282, A-SPEC-283, A-SPEC-419, A-SPEC-433, A-SPEC-469, A-SPEC-478, A-SPEC-568.1, A-SPEC-568.2, A-SPEC-569.1, A-SPEC-569.2, A-SPEC-569.3, A-SPEC-589
|
|
@@ -106,6 +107,21 @@ async function warmSemanticCache(root, scanned) {
|
|
|
106
107
|
// breaking change this slice never declared. The suite refused the first attempt and was right.
|
|
107
108
|
return { status: 'discharged', tier: rt.label, computed: w.computed, cached: w.cached };
|
|
108
109
|
}
|
|
110
|
+
/** Requirement prose is warmed only by the explicit reindex operation. */
|
|
111
|
+
async function warmRequirementSemanticCache(root, specs) {
|
|
112
|
+
const tier = (0, tier_1.resolveSemanticTier)();
|
|
113
|
+
if (tier.tier === 'none')
|
|
114
|
+
return { status: 'not-applicable', tier: 'none' };
|
|
115
|
+
const configured = tier.model ? `${tier.tier}:${tier.model}` : tier.tier;
|
|
116
|
+
const rt = (0, embedder_1.makeTierEmbedder)(tier, new vector_cache_1.VectorCache(root));
|
|
117
|
+
if (rt === null)
|
|
118
|
+
return { status: 'unavailable', tier: configured };
|
|
119
|
+
const texts = (0, vector_coverage_1.requirementDocumentTexts)(specs).map((item) => item.text);
|
|
120
|
+
const w = await rt.warm(texts);
|
|
121
|
+
if (texts.length > 0 && w.computed + w.cached === 0)
|
|
122
|
+
return { status: 'unavailable', tier: rt.label };
|
|
123
|
+
return { status: 'discharged', tier: rt.label, computed: w.computed, cached: w.cached };
|
|
124
|
+
}
|
|
109
125
|
/** The commit the verdict describes. null when this is not a Git tree β never a fabricated value. */
|
|
110
126
|
function headOf(root) {
|
|
111
127
|
try {
|
|
@@ -338,8 +354,16 @@ function createGraphOperationsHandlers(context) {
|
|
|
338
354
|
semanticWarm = { tier: w.tier, computed: w.computed, cached: w.cached };
|
|
339
355
|
}
|
|
340
356
|
catch { /* warming is best-effort; reindex's own result is unaffected */ }
|
|
357
|
+
let requirementSemanticWarm;
|
|
358
|
+
try {
|
|
359
|
+
const w = await warmRequirementSemanticCache(root, specs);
|
|
360
|
+
if (w.status === 'discharged')
|
|
361
|
+
requirementSemanticWarm = { tier: w.tier, computed: w.computed, cached: w.cached };
|
|
362
|
+
}
|
|
363
|
+
catch { /* requirement warming is advisory and cannot invalidate reindex */ }
|
|
341
364
|
return { changed, nodes: published.nodes, edges: published.edges, changeSource,
|
|
342
|
-
...(semanticWarm !== undefined ? { semanticWarm } : {})
|
|
365
|
+
...(semanticWarm !== undefined ? { semanticWarm } : {}),
|
|
366
|
+
...(requirementSemanticWarm !== undefined ? { requirementSemanticWarm } : {}) };
|
|
343
367
|
},
|
|
344
368
|
};
|
|
345
369
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Spec } from '../../spec/spec-parser';
|
|
2
|
+
import type { ScannedFile } from '../../cpg/cpg-scanner';
|
|
3
|
+
export interface RequirementTriageHandlerContext {
|
|
4
|
+
listSpecs(): Promise<Spec[]>;
|
|
5
|
+
foreignRootReason(root?: string): string | null;
|
|
6
|
+
projectRootOf(root: string): string;
|
|
7
|
+
cachedScan(root: string, repoRoot?: string): ScannedFile[];
|
|
8
|
+
assertStoreReachable(tool: string, root: unknown): void;
|
|
9
|
+
refusal(reason: string): Error;
|
|
10
|
+
}
|
|
11
|
+
type GraphStatus = 'current' | 'stale' | 'unverified' | 'absent' | 'unreadable' | 'empty';
|
|
12
|
+
export declare function createRequirementTriageHandlers(context: RequirementTriageHandlerContext): {
|
|
13
|
+
requirement_triage(a: {
|
|
14
|
+
root: string;
|
|
15
|
+
prompt: string;
|
|
16
|
+
topK?: number;
|
|
17
|
+
persist?: boolean;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
promptDigest: string;
|
|
20
|
+
semantic: {
|
|
21
|
+
localState?: import("../../semantic/model-cache").LocalModelState | undefined;
|
|
22
|
+
recovery?: string | undefined;
|
|
23
|
+
tier: "local" | "none" | "cloud";
|
|
24
|
+
covered: number;
|
|
25
|
+
total: number;
|
|
26
|
+
state: "covered" | "unavailable" | "not-adopted" | "cold";
|
|
27
|
+
availability: string;
|
|
28
|
+
};
|
|
29
|
+
provenance: {
|
|
30
|
+
reqId: string;
|
|
31
|
+
documents: {
|
|
32
|
+
id: string;
|
|
33
|
+
type: import("../../review/requirement-triage").RequirementDocumentKind;
|
|
34
|
+
status: string;
|
|
35
|
+
dependsOn: readonly string[];
|
|
36
|
+
}[];
|
|
37
|
+
implementationAnchors: string[];
|
|
38
|
+
graphProvenance: {
|
|
39
|
+
[k: string]: {} | null;
|
|
40
|
+
};
|
|
41
|
+
executionEvidence: {
|
|
42
|
+
state: string;
|
|
43
|
+
recordedHead: string | null;
|
|
44
|
+
currentHead: string;
|
|
45
|
+
};
|
|
46
|
+
}[];
|
|
47
|
+
graph: {
|
|
48
|
+
status: GraphStatus;
|
|
49
|
+
sourceCommit: string | null;
|
|
50
|
+
graphAsOf: string | null;
|
|
51
|
+
resolutionLimits: string[];
|
|
52
|
+
};
|
|
53
|
+
graphBasis: {
|
|
54
|
+
head: string;
|
|
55
|
+
governedDocumentCount: number;
|
|
56
|
+
scannedSourceCount: number;
|
|
57
|
+
};
|
|
58
|
+
verdict: import("../../review/requirement-triage").RequirementVerdict;
|
|
59
|
+
candidates: import("../../review/requirement-triage").RequirementTriageCandidate[];
|
|
60
|
+
reasons: string[];
|
|
61
|
+
uncertainty: string[];
|
|
62
|
+
schema: "requirement-triage/1";
|
|
63
|
+
} | {
|
|
64
|
+
evidenceDigest: string;
|
|
65
|
+
persistedTo: string;
|
|
66
|
+
artifact: {
|
|
67
|
+
digest: string;
|
|
68
|
+
path: string;
|
|
69
|
+
};
|
|
70
|
+
promptDigest: string;
|
|
71
|
+
semantic: {
|
|
72
|
+
localState?: import("../../semantic/model-cache").LocalModelState | undefined;
|
|
73
|
+
recovery?: string | undefined;
|
|
74
|
+
tier: "local" | "none" | "cloud";
|
|
75
|
+
covered: number;
|
|
76
|
+
total: number;
|
|
77
|
+
state: "covered" | "unavailable" | "not-adopted" | "cold";
|
|
78
|
+
availability: string;
|
|
79
|
+
};
|
|
80
|
+
provenance: {
|
|
81
|
+
reqId: string;
|
|
82
|
+
documents: {
|
|
83
|
+
id: string;
|
|
84
|
+
type: import("../../review/requirement-triage").RequirementDocumentKind;
|
|
85
|
+
status: string;
|
|
86
|
+
dependsOn: readonly string[];
|
|
87
|
+
}[];
|
|
88
|
+
implementationAnchors: string[];
|
|
89
|
+
graphProvenance: {
|
|
90
|
+
[k: string]: {} | null;
|
|
91
|
+
};
|
|
92
|
+
executionEvidence: {
|
|
93
|
+
state: string;
|
|
94
|
+
recordedHead: string | null;
|
|
95
|
+
currentHead: string;
|
|
96
|
+
};
|
|
97
|
+
}[];
|
|
98
|
+
graph: {
|
|
99
|
+
status: GraphStatus;
|
|
100
|
+
sourceCommit: string | null;
|
|
101
|
+
graphAsOf: string | null;
|
|
102
|
+
resolutionLimits: string[];
|
|
103
|
+
};
|
|
104
|
+
graphBasis: {
|
|
105
|
+
head: string;
|
|
106
|
+
governedDocumentCount: number;
|
|
107
|
+
scannedSourceCount: number;
|
|
108
|
+
};
|
|
109
|
+
verdict: import("../../review/requirement-triage").RequirementVerdict;
|
|
110
|
+
candidates: import("../../review/requirement-triage").RequirementTriageCandidate[];
|
|
111
|
+
reasons: string[];
|
|
112
|
+
uncertainty: string[];
|
|
113
|
+
schema: "requirement-triage/1";
|
|
114
|
+
}>;
|
|
115
|
+
};
|
|
116
|
+
export {};
|
|
@@ -0,0 +1,185 @@
|
|
|
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.createRequirementTriageHandlers = createRequirementTriageHandlers;
|
|
37
|
+
// @implements A-SPEC-713
|
|
38
|
+
/** Read-only MCP projection of the pure requirement lifecycle triage model. */
|
|
39
|
+
const node_child_process_1 = require("node:child_process");
|
|
40
|
+
const crypto = __importStar(require("node:crypto"));
|
|
41
|
+
const path = __importStar(require("node:path"));
|
|
42
|
+
const test_evidence_1 = require("../../review/test-evidence");
|
|
43
|
+
const requirement_triage_1 = require("../../review/requirement-triage");
|
|
44
|
+
const embedder_1 = require("../../semantic/embedder");
|
|
45
|
+
const tier_1 = require("../../semantic/tier");
|
|
46
|
+
const vector_cache_1 = require("../../semantic/vector-cache");
|
|
47
|
+
const requirement_triage_evidence_1 = require("../requirement-triage-evidence");
|
|
48
|
+
const model_cache_1 = require("../../semantic/model-cache");
|
|
49
|
+
const graph_store_1 = require("../../rtm/graph-store");
|
|
50
|
+
const requirementKinds = new Set(['REQ', 'H-SPEC', 'A-SPEC', 'T-SPEC']);
|
|
51
|
+
const cosine = (a, b) => {
|
|
52
|
+
if (a.length === 0 || a.length !== b.length)
|
|
53
|
+
return 0;
|
|
54
|
+
let dot = 0, an = 0, bn = 0;
|
|
55
|
+
for (let i = 0; i < a.length; i++) {
|
|
56
|
+
dot += a[i] * b[i];
|
|
57
|
+
an += a[i] * a[i];
|
|
58
|
+
bn += b[i] * b[i];
|
|
59
|
+
}
|
|
60
|
+
return an === 0 || bn === 0 ? 0 : dot / Math.sqrt(an * bn);
|
|
61
|
+
};
|
|
62
|
+
function lineageOf(id, byId) {
|
|
63
|
+
const seen = new Set();
|
|
64
|
+
let current = byId.get(id);
|
|
65
|
+
while (current) {
|
|
66
|
+
if (seen.has(current.id))
|
|
67
|
+
return null;
|
|
68
|
+
seen.add(current.id);
|
|
69
|
+
if (current.type === 'REQ')
|
|
70
|
+
return current.id;
|
|
71
|
+
current = (current.dependsOn ?? []).map((parent) => byId.get(parent)).find((parent) => parent !== undefined);
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function headOf(root) {
|
|
76
|
+
try {
|
|
77
|
+
return (0, node_child_process_1.execFileSync)('git', ['-C', root, 'rev-parse', 'HEAD'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }).trim();
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Reads a published graph without rebuilding, repairing, or otherwise changing it. */
|
|
84
|
+
function readGraphEvidence(root, currentHead, documents) {
|
|
85
|
+
const opened = (0, graph_store_1.openPublishedGraph)(path.join(root, '.ax', 'rtm.sqlite'), currentHead || null);
|
|
86
|
+
const base = {
|
|
87
|
+
status: opened.status,
|
|
88
|
+
sourceCommit: 'sourceCommit' in opened ? opened.sourceCommit : null,
|
|
89
|
+
graphAsOf: opened.graphAsOf ?? null,
|
|
90
|
+
resolutionLimits: opened.status === 'current' ? [] : [`rtm-graph-${opened.status}`],
|
|
91
|
+
provenanceBySpec: {},
|
|
92
|
+
};
|
|
93
|
+
if (opened.graph === null)
|
|
94
|
+
return base;
|
|
95
|
+
try {
|
|
96
|
+
for (const document of documents)
|
|
97
|
+
base.provenanceBySpec[document.id] = opened.graph.provenanceOfNode(`SPEC:${document.id}`);
|
|
98
|
+
return base;
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
opened.graph.close();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function createRequirementTriageHandlers(context) {
|
|
105
|
+
return {
|
|
106
|
+
async requirement_triage(a) {
|
|
107
|
+
context.assertStoreReachable('requirement_triage', a.root);
|
|
108
|
+
if (typeof a.prompt !== 'string' || a.prompt.trim() === '')
|
|
109
|
+
throw context.refusal('requirement_triage requires a non-empty prompt');
|
|
110
|
+
const foreign = context.foreignRootReason(a.root);
|
|
111
|
+
if (foreign)
|
|
112
|
+
throw context.refusal(foreign);
|
|
113
|
+
const root = context.projectRootOf(a.root);
|
|
114
|
+
const documents = (await context.listSpecs()).filter((s) => requirementKinds.has(s.type));
|
|
115
|
+
const byId = new Map(documents.map((doc) => [doc.id, doc]));
|
|
116
|
+
const scanned = context.cachedScan(root, root);
|
|
117
|
+
const evidence = (0, test_evidence_1.readTestEvidence)(root);
|
|
118
|
+
const currentHead = headOf(root);
|
|
119
|
+
const graph = readGraphEvidence(root, currentHead, documents);
|
|
120
|
+
const fresh = (0, test_evidence_1.isFresh)(evidence, currentHead) && evidence?.passed === true;
|
|
121
|
+
const lineageEvidence = {};
|
|
122
|
+
for (const doc of documents) {
|
|
123
|
+
const reqId = lineageOf(doc.id, byId);
|
|
124
|
+
if (!reqId)
|
|
125
|
+
continue;
|
|
126
|
+
const record = lineageEvidence[reqId] ??= { implementationAnchors: [], freshGreenTests: false };
|
|
127
|
+
if (doc.type !== 'A-SPEC')
|
|
128
|
+
continue;
|
|
129
|
+
for (const file of scanned)
|
|
130
|
+
if (file.implementsSpecs.includes(doc.id))
|
|
131
|
+
record.implementationAnchors.push(file.sourcePath);
|
|
132
|
+
if (fresh && (evidence?.executedByAspec[doc.id] ?? 0) > 0)
|
|
133
|
+
record.freshGreenTests = true;
|
|
134
|
+
}
|
|
135
|
+
for (const value of Object.values(lineageEvidence))
|
|
136
|
+
value.implementationAnchors.sort();
|
|
137
|
+
const tier = (0, tier_1.resolveSemanticTier)();
|
|
138
|
+
const runtime = (0, embedder_1.makeTierEmbedder)(tier, new vector_cache_1.VectorCache(root));
|
|
139
|
+
const query = runtime ? await runtime.embedQuery(a.prompt) : null;
|
|
140
|
+
const semanticCandidates = [];
|
|
141
|
+
let covered = 0;
|
|
142
|
+
if (runtime && query)
|
|
143
|
+
for (const doc of documents) {
|
|
144
|
+
const reqId = lineageOf(doc.id, byId);
|
|
145
|
+
if (!reqId)
|
|
146
|
+
continue;
|
|
147
|
+
const vector = runtime.cachedDocVector((0, requirement_triage_1.canonicalRequirementDocument)(doc, reqId));
|
|
148
|
+
if (vector) {
|
|
149
|
+
covered++;
|
|
150
|
+
semanticCandidates.push({ id: doc.id, score: cosine(query, vector) });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const semanticState = runtime === null || query === null
|
|
154
|
+
? (tier.tier === 'none' && !tier.localRuntimePresent ? 'not-adopted' : 'unavailable')
|
|
155
|
+
: covered === documents.length ? 'covered' : 'cold';
|
|
156
|
+
const readiness = tier.tier === 'none' && tier.localRuntimePresent ? (0, model_cache_1.readLocalModelReadiness)() : null;
|
|
157
|
+
const availability = semanticState === 'covered' ? 'available'
|
|
158
|
+
: semanticState === 'cold' || tier.tier === 'none' && tier.localRuntimePresent ? 'degraded'
|
|
159
|
+
: 'unavailable';
|
|
160
|
+
const semantic = { tier: tier.tier, covered, total: documents.length, state: semanticState,
|
|
161
|
+
availability,
|
|
162
|
+
...(readiness ? { localState: readiness.state, recovery: readiness.recovery } : {}) };
|
|
163
|
+
const result = (0, requirement_triage_1.triageRequirements)({ prompt: a.prompt, documents, evidence: lineageEvidence,
|
|
164
|
+
semanticCandidates, semantic, graph: { state: graph.status }, topK: a.topK });
|
|
165
|
+
const promptDigest = `sha256:${crypto.createHash('sha256').update(a.prompt).digest('hex')}`;
|
|
166
|
+
const executionState = evidence === undefined ? 'absent'
|
|
167
|
+
: !(0, test_evidence_1.isFresh)(evidence, currentHead) ? 'stale'
|
|
168
|
+
: evidence.passed ? 'fresh-green' : 'fresh-failed';
|
|
169
|
+
const provenance = result.candidates.map((candidate) => ({
|
|
170
|
+
reqId: candidate.reqId,
|
|
171
|
+
documents: candidate.documents.map((document) => ({ id: document.id, type: document.type, status: document.status, dependsOn: document.dependsOn ?? [] })),
|
|
172
|
+
implementationAnchors: candidate.implementationAnchors,
|
|
173
|
+
graphProvenance: Object.fromEntries(candidate.documents.map((document) => [document.id, graph.provenanceBySpec[document.id] ?? null])),
|
|
174
|
+
executionEvidence: { state: executionState, recordedHead: evidence?.head ?? null, currentHead },
|
|
175
|
+
}));
|
|
176
|
+
const answer = { schema: 'requirement-triage/1', ...result, promptDigest, semantic, provenance,
|
|
177
|
+
graph: { status: graph.status, sourceCommit: graph.sourceCommit, graphAsOf: graph.graphAsOf, resolutionLimits: graph.resolutionLimits },
|
|
178
|
+
graphBasis: { head: currentHead, governedDocumentCount: documents.length, scannedSourceCount: scanned.length } };
|
|
179
|
+
if (!a.persist)
|
|
180
|
+
return answer;
|
|
181
|
+
const artifact = (0, requirement_triage_evidence_1.writeRequirementTriageEvidence)(root, { schema: 'requirement-triage-evidence/1', promptDigest, result: answer });
|
|
182
|
+
return { ...answer, evidenceDigest: artifact.digest, persistedTo: artifact.path, artifact };
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|