@neurcode-ai/cli 0.20.7 → 0.20.8
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/dist/commands/pilot.d.ts.map +1 -1
- package/dist/commands/pilot.js +81 -0
- package/dist/commands/pilot.js.map +1 -1
- package/dist/runtime-build.json +4 -4
- package/dist/utils/pilot-evidence-io.d.ts +52 -0
- package/dist/utils/pilot-evidence-io.d.ts.map +1 -0
- package/dist/utils/pilot-evidence-io.js +251 -0
- package/dist/utils/pilot-evidence-io.js.map +1 -0
- package/dist/utils/pilot-evidence-pack.d.ts +280 -0
- package/dist/utils/pilot-evidence-pack.d.ts.map +1 -0
- package/dist/utils/pilot-evidence-pack.js +630 -0
- package/dist/utils/pilot-evidence-pack.js.map +1 -0
- package/package.json +8 -7
- package/LICENSE +0 -201
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilot.d.ts","sourceRoot":"","sources":["../../src/commands/pilot.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"pilot.d.ts","sourceRoot":"","sources":["../../src/commands/pilot.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmL5D"}
|
package/dist/commands/pilot.js
CHANGED
|
@@ -8,6 +8,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.registerPilotCommands = registerPilotCommands;
|
|
10
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const node_fs_1 = require("node:fs");
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
11
13
|
const v0_governance_1 = require("../utils/v0-governance");
|
|
12
14
|
const brain_lifecycle_1 = require("../utils/brain-lifecycle");
|
|
13
15
|
const contracts_1 = require("@neurcode-ai/contracts");
|
|
@@ -15,6 +17,8 @@ const pilot_setup_contract_1 = require("../utils/pilot-setup-contract");
|
|
|
15
17
|
const agent_adapter_setup_1 = require("../utils/agent-adapter-setup");
|
|
16
18
|
const runtime_connection_1 = require("../utils/runtime-connection");
|
|
17
19
|
const eval_demo_command_1 = require("../utils/eval-demo-command");
|
|
20
|
+
const pilot_evidence_io_1 = require("../utils/pilot-evidence-io");
|
|
21
|
+
const pilot_evidence_pack_1 = require("../utils/pilot-evidence-pack");
|
|
18
22
|
function emitJson(value) {
|
|
19
23
|
console.log(JSON.stringify(value, null, 2));
|
|
20
24
|
}
|
|
@@ -106,5 +110,82 @@ function registerPilotCommands(program) {
|
|
|
106
110
|
console.log(`Recovery: ${contract.recoveryCommand}`);
|
|
107
111
|
}
|
|
108
112
|
});
|
|
113
|
+
// ── export (Iteration 10 — Pilot Evidence Pack) ──────────────────────────────
|
|
114
|
+
// After a pilot, generate a source-free executive packet (summary + sessions +
|
|
115
|
+
// blocked risk families + approvals + plan drift + dependency changes +
|
|
116
|
+
// evidence hashes + what-stayed-local + limitations) that can be shared with
|
|
117
|
+
// an engineering manager, principal engineer, security reviewer, or
|
|
118
|
+
// procurement/IT without a live founder walkthrough. Repo-local only.
|
|
119
|
+
pilot
|
|
120
|
+
.command('export')
|
|
121
|
+
.description('Generate a source-free executive pilot evidence pack (JSON manifest + markdown/HTML)')
|
|
122
|
+
.option('--dir <path>', 'Repository root (default: current directory)')
|
|
123
|
+
.option('--out <dir>', 'Output directory (default: .neurcode/pilot-evidence)')
|
|
124
|
+
.option('--format <format>', 'Human-readable format: markdown | html | both', 'both')
|
|
125
|
+
.option('--days <n>', 'Metrics window in days (default: 7)')
|
|
126
|
+
.option('--json', 'Print the pack JSON to stdout instead of writing files')
|
|
127
|
+
.action(async (options) => {
|
|
128
|
+
const repoRoot = (0, v0_governance_1.resolveRepoRoot)(options.dir || process.cwd());
|
|
129
|
+
// Optional, best-effort, read-only repository brain readiness.
|
|
130
|
+
let brainReadiness = null;
|
|
131
|
+
try {
|
|
132
|
+
const brain = await (0, brain_lifecycle_1.inspectBrainLifecycle)(repoRoot);
|
|
133
|
+
brainReadiness = {
|
|
134
|
+
state: brain.state ?? null,
|
|
135
|
+
filesIndexed: brain.progress?.filesIndexed ?? null,
|
|
136
|
+
filesScanned: brain.progress?.filesScanned ?? null,
|
|
137
|
+
percent: brain.progress?.percent ?? null,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
brainReadiness = null;
|
|
142
|
+
}
|
|
143
|
+
const parsedDays = Number.parseInt(options.days ?? '', 10);
|
|
144
|
+
const days = Number.isFinite(parsedDays) && parsedDays > 0 ? parsedDays : 7;
|
|
145
|
+
const inputs = (0, pilot_evidence_io_1.gatherPilotEvidenceInputs)(repoRoot, {
|
|
146
|
+
generatedAt: new Date().toISOString(),
|
|
147
|
+
days,
|
|
148
|
+
brainReadiness,
|
|
149
|
+
});
|
|
150
|
+
const pack = (0, pilot_evidence_pack_1.buildPilotEvidencePack)(inputs);
|
|
151
|
+
const markdown = (0, pilot_evidence_pack_1.renderPilotEvidencePackMarkdown)(pack);
|
|
152
|
+
const html = (0, pilot_evidence_pack_1.renderPilotEvidencePackHtml)(pack);
|
|
153
|
+
// Source-free backstop before anything is written or printed.
|
|
154
|
+
(0, pilot_evidence_pack_1.assertPilotEvidencePackSourceFree)(pack, 'pilot evidence pack (json)');
|
|
155
|
+
(0, pilot_evidence_pack_1.assertPilotEvidencePackSourceFree)(markdown, 'pilot evidence pack (markdown)');
|
|
156
|
+
(0, pilot_evidence_pack_1.assertPilotEvidencePackSourceFree)(html, 'pilot evidence pack (html)');
|
|
157
|
+
if (options.json) {
|
|
158
|
+
emitJson(pack);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const outDir = options.out ? (0, node_path_1.resolve)(repoRoot, options.out) : (0, node_path_1.join)(repoRoot, '.neurcode', 'pilot-evidence');
|
|
162
|
+
if (!(0, node_fs_1.existsSync)(outDir))
|
|
163
|
+
(0, node_fs_1.mkdirSync)(outDir, { recursive: true });
|
|
164
|
+
const jsonPath = (0, node_path_1.join)(outDir, 'pilot-evidence-pack.json');
|
|
165
|
+
(0, node_fs_1.writeFileSync)(jsonPath, JSON.stringify(pack, null, 2) + '\n', 'utf8');
|
|
166
|
+
const written = [jsonPath];
|
|
167
|
+
const fmt = (options.format || 'both').toLowerCase();
|
|
168
|
+
if (fmt === 'markdown' || fmt === 'md' || fmt === 'both') {
|
|
169
|
+
const mdPath = (0, node_path_1.join)(outDir, 'pilot-evidence-pack.md');
|
|
170
|
+
(0, node_fs_1.writeFileSync)(mdPath, markdown, 'utf8');
|
|
171
|
+
written.push(mdPath);
|
|
172
|
+
}
|
|
173
|
+
if (fmt === 'html' || fmt === 'both') {
|
|
174
|
+
const htmlPath = (0, node_path_1.join)(outDir, 'pilot-evidence-pack.html');
|
|
175
|
+
(0, node_fs_1.writeFileSync)(htmlPath, html, 'utf8');
|
|
176
|
+
written.push(htmlPath);
|
|
177
|
+
}
|
|
178
|
+
console.log('');
|
|
179
|
+
console.log(chalk_1.default.green(`Pilot evidence pack written (source-free · ${pack.completeness.status}).`));
|
|
180
|
+
for (const p of written)
|
|
181
|
+
console.log(` ${chalk_1.default.cyan(p)}`);
|
|
182
|
+
console.log(chalk_1.default.dim(` ${pack.summary.headline}`));
|
|
183
|
+
console.log(chalk_1.default.dim(` Content hash: ${pack.contentHash}`));
|
|
184
|
+
if (pack.completeness.status !== 'complete') {
|
|
185
|
+
console.log(chalk_1.default.yellow(` Incomplete pilot: missing ${pack.completeness.missingArtifacts.join('; ') || 'n/a'}`));
|
|
186
|
+
}
|
|
187
|
+
console.log(chalk_1.default.dim(' Contains paths, owners, counts, verdicts, and hashes only — no source, diffs, or prompts.'));
|
|
188
|
+
console.log('');
|
|
189
|
+
});
|
|
109
190
|
}
|
|
110
191
|
//# sourceMappingURL=pilot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilot.js","sourceRoot":"","sources":["../../src/commands/pilot.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;
|
|
1
|
+
{"version":3,"file":"pilot.js","sourceRoot":"","sources":["../../src/commands/pilot.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AA6BH,sDAmLC;AA7MD,kDAA0B;AAC1B,qCAA+D;AAC/D,yCAA0C;AAC1C,0DAAyD;AACzD,8DAAiE;AACjE,sDAIgC;AAChC,wEAAwE;AACxE,sEAAyE;AACzE,oEAAoE;AACpE,kEAAsE;AACtE,kEAAuE;AACvE,sEAKsC;AAEtC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,6CAA6C,CAAC,CAAC;IAElG,gFAAgF;IAChF,sEAAsE;IACtE,2EAA2E;IAC3E,6EAA6E;IAC7E,4EAA4E;IAC5E,2EAA2E;IAC3E,KAAK;SACF,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,sHAAsH,CAAC;SACnI,MAAM,CAAC,cAAc,EAAE,8CAA8C,CAAC;SACtE,MAAM,CAAC,cAAc,EAAE,2DAA2D,EAAE,OAAO,CAAC;SAC5F,MAAM,CAAC,WAAW,EAAE,0DAA0D,CAAC;SAC/E,MAAM,CAAC,aAAa,EAAE,yDAAyD,CAAC;SAChF,MAAM,CAAC,QAAQ,EAAE,8BAA8B,CAAC;SAChD,MAAM,CAAC,CAAC,OAAiG,EAAE,EAAE;QAC5G,IAAA,4CAAwB,EAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEL,KAAK;S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,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,6FAA6F,CAAC,CAAC,CAAC;QACtH,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/runtime-build.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "neurcode.cli-build.v1",
|
|
3
|
-
"version": "0.20.
|
|
4
|
-
"gitCommit": "
|
|
5
|
-
"builtAt": "2026-06-
|
|
3
|
+
"version": "0.20.8",
|
|
4
|
+
"gitCommit": "107ac41df5738ae668c1c6fce32de03e5093dc74",
|
|
5
|
+
"builtAt": "2026-06-27T19:13:35.086Z",
|
|
6
6
|
"entryFile": "index.js",
|
|
7
7
|
"entrySize": 102622,
|
|
8
|
-
"entryMtimeMs":
|
|
8
|
+
"entryMtimeMs": 1782587614962.7444
|
|
9
9
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pilot Evidence Pack — repo-local I/O glue (Iteration 10).
|
|
3
|
+
*
|
|
4
|
+
* Reads the source-free runtime artifacts the Neurcode control plane already
|
|
5
|
+
* persists and projects them into the narrow, source-free inputs consumed by the
|
|
6
|
+
* pure builder in utils/pilot-evidence-pack.ts:
|
|
7
|
+
*
|
|
8
|
+
* - .neurcode/sessions/<id>.change-record.json (neurcode.governed-session-record.v1)
|
|
9
|
+
* - .neurcode/admission/<id>.json (neurcode.admission-record.v1)
|
|
10
|
+
* - .neurcode/pilot-metrics.json (rolling governance metrics)
|
|
11
|
+
*
|
|
12
|
+
* Hard rules:
|
|
13
|
+
* - NEVER read the raw `.neurcode/sessions/<id>.json` session log (large; may
|
|
14
|
+
* contain source-like trajectory data). Only the curated, source-free
|
|
15
|
+
* `.change-record.json` projection is read.
|
|
16
|
+
* - NEVER copy the admission record's natural-language `intentSummary` / goal
|
|
17
|
+
* prose. Intent is represented by its hash + categories only.
|
|
18
|
+
* - Every field is coerced defensively so a malformed artifact degrades to a
|
|
19
|
+
* count of zero / null rather than crashing the export.
|
|
20
|
+
*/
|
|
21
|
+
import type { BuildPilotEvidencePackInput, PilotAdmissionInput, PilotBrainReadinessInput, PilotMetricsInput, PilotSessionInput } from './pilot-evidence-pack';
|
|
22
|
+
/**
|
|
23
|
+
* Project `.neurcode/sessions/*.change-record.json` into source-free session
|
|
24
|
+
* inputs. The raw `<id>.json` session logs are intentionally never read.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readPilotChangeRecords(repoRoot: string): PilotSessionInput[];
|
|
27
|
+
/**
|
|
28
|
+
* Project `.neurcode/admission/*.json` into source-free admission inputs. The
|
|
29
|
+
* record's `runtimeContext.intentSummary` prose is intentionally never read.
|
|
30
|
+
*/
|
|
31
|
+
export declare function readPilotAdmissionRecords(repoRoot: string): PilotAdmissionInput[];
|
|
32
|
+
/**
|
|
33
|
+
* Project the local pilot-metrics rollup into source-free metric inputs. Returns
|
|
34
|
+
* null when no `.neurcode/pilot-metrics.json` exists (an incomplete-pilot signal).
|
|
35
|
+
*/
|
|
36
|
+
export declare function readPilotMetricsInput(repoRoot: string, days?: number): PilotMetricsInput | null;
|
|
37
|
+
/** Resolve the CLI's own package version without spawning a subprocess. */
|
|
38
|
+
export declare function resolveCliVersion(): string | null;
|
|
39
|
+
export interface GatherPilotEvidenceOptions {
|
|
40
|
+
generatedAt: string;
|
|
41
|
+
cliVersion?: string | null;
|
|
42
|
+
days?: number;
|
|
43
|
+
repoName?: string | null;
|
|
44
|
+
brainReadiness?: PilotBrainReadinessInput | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read every repo-local artifact and assemble the source-free builder input.
|
|
48
|
+
* Synchronous and side-effect-free apart from reads; the optional brain
|
|
49
|
+
* readiness is computed by the caller and threaded through.
|
|
50
|
+
*/
|
|
51
|
+
export declare function gatherPilotEvidenceInputs(repoRoot: string, options: GatherPilotEvidenceOptions): BuildPilotEvidencePackInput;
|
|
52
|
+
//# sourceMappingURL=pilot-evidence-io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pilot-evidence-io.d.ts","sourceRoot":"","sources":["../../src/utils/pilot-evidence-io.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAiD/B;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAsD5E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAiEjF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,iBAAiB,GAAG,IAAI,CAa1F;AAED,2EAA2E;AAC3E,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAQjD;AAED,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAClD;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,0BAA0B,GAClC,2BAA2B,CAW7B"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pilot Evidence Pack — repo-local I/O glue (Iteration 10).
|
|
4
|
+
*
|
|
5
|
+
* Reads the source-free runtime artifacts the Neurcode control plane already
|
|
6
|
+
* persists and projects them into the narrow, source-free inputs consumed by the
|
|
7
|
+
* pure builder in utils/pilot-evidence-pack.ts:
|
|
8
|
+
*
|
|
9
|
+
* - .neurcode/sessions/<id>.change-record.json (neurcode.governed-session-record.v1)
|
|
10
|
+
* - .neurcode/admission/<id>.json (neurcode.admission-record.v1)
|
|
11
|
+
* - .neurcode/pilot-metrics.json (rolling governance metrics)
|
|
12
|
+
*
|
|
13
|
+
* Hard rules:
|
|
14
|
+
* - NEVER read the raw `.neurcode/sessions/<id>.json` session log (large; may
|
|
15
|
+
* contain source-like trajectory data). Only the curated, source-free
|
|
16
|
+
* `.change-record.json` projection is read.
|
|
17
|
+
* - NEVER copy the admission record's natural-language `intentSummary` / goal
|
|
18
|
+
* prose. Intent is represented by its hash + categories only.
|
|
19
|
+
* - Every field is coerced defensively so a malformed artifact degrades to a
|
|
20
|
+
* count of zero / null rather than crashing the export.
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.readPilotChangeRecords = readPilotChangeRecords;
|
|
24
|
+
exports.readPilotAdmissionRecords = readPilotAdmissionRecords;
|
|
25
|
+
exports.readPilotMetricsInput = readPilotMetricsInput;
|
|
26
|
+
exports.resolveCliVersion = resolveCliVersion;
|
|
27
|
+
exports.gatherPilotEvidenceInputs = gatherPilotEvidenceInputs;
|
|
28
|
+
const node_fs_1 = require("node:fs");
|
|
29
|
+
const node_path_1 = require("node:path");
|
|
30
|
+
const guided_eval_1 = require("./guided-eval");
|
|
31
|
+
const pilot_metrics_1 = require("./pilot-metrics");
|
|
32
|
+
// ── Defensive coercion helpers ────────────────────────────────────────────────
|
|
33
|
+
function asString(value) {
|
|
34
|
+
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
35
|
+
}
|
|
36
|
+
function asNumber(value) {
|
|
37
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : 0;
|
|
38
|
+
}
|
|
39
|
+
function asStringArray(value) {
|
|
40
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === 'string') : [];
|
|
41
|
+
}
|
|
42
|
+
function arrayLength(value) {
|
|
43
|
+
return Array.isArray(value) ? value.length : 0;
|
|
44
|
+
}
|
|
45
|
+
function readJson(path) {
|
|
46
|
+
try {
|
|
47
|
+
const parsed = JSON.parse((0, node_fs_1.readFileSync)(path, 'utf8'));
|
|
48
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : null;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function listJsonFiles(dir, filter) {
|
|
55
|
+
try {
|
|
56
|
+
if (!(0, node_fs_1.existsSync)(dir))
|
|
57
|
+
return [];
|
|
58
|
+
return (0, node_fs_1.readdirSync)(dir)
|
|
59
|
+
.filter((name) => filter(name))
|
|
60
|
+
.sort()
|
|
61
|
+
.map((name) => (0, node_path_1.join)(dir, name));
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function get(obj, key) {
|
|
68
|
+
if (!obj)
|
|
69
|
+
return null;
|
|
70
|
+
const value = obj[key];
|
|
71
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
72
|
+
}
|
|
73
|
+
// ── Readers ───────────────────────────────────────────────────────────────────
|
|
74
|
+
/**
|
|
75
|
+
* Project `.neurcode/sessions/*.change-record.json` into source-free session
|
|
76
|
+
* inputs. The raw `<id>.json` session logs are intentionally never read.
|
|
77
|
+
*/
|
|
78
|
+
function readPilotChangeRecords(repoRoot) {
|
|
79
|
+
const dir = (0, node_path_1.join)(repoRoot, '.neurcode', 'sessions');
|
|
80
|
+
const files = listJsonFiles(dir, (name) => name.endsWith('.change-record.json'));
|
|
81
|
+
const out = [];
|
|
82
|
+
for (const file of files) {
|
|
83
|
+
const j = readJson(file);
|
|
84
|
+
if (!j)
|
|
85
|
+
continue;
|
|
86
|
+
const session = get(j, 'session');
|
|
87
|
+
const counts = get(session, 'counts');
|
|
88
|
+
const intentSummary = get(get(j, 'intent'), 'summary');
|
|
89
|
+
const integrity = get(j, 'integrity');
|
|
90
|
+
const facts = get(get(j, 'accountability'), 'facts');
|
|
91
|
+
const plan = get(j, 'plan');
|
|
92
|
+
const reviewBrief = get(j, 'reviewBrief');
|
|
93
|
+
const sessionId = asString(session?.['sessionId']) ?? (0, node_path_1.basename)(file).replace(/\.change-record\.json$/, '');
|
|
94
|
+
out.push({
|
|
95
|
+
sessionId,
|
|
96
|
+
status: asString(session?.['status']),
|
|
97
|
+
scopeMode: asString(session?.['scopeMode']),
|
|
98
|
+
trustLevel: asString(integrity?.['trustLevel']),
|
|
99
|
+
verdict: asString(reviewBrief?.['verdict']),
|
|
100
|
+
counts: {
|
|
101
|
+
ok: asNumber(counts?.['ok']),
|
|
102
|
+
warn: asNumber(counts?.['warn']),
|
|
103
|
+
block: asNumber(counts?.['block']),
|
|
104
|
+
approval: asNumber(counts?.['approval']),
|
|
105
|
+
planEvents: asNumber(counts?.['planEvents']),
|
|
106
|
+
events: asNumber(counts?.['events']),
|
|
107
|
+
},
|
|
108
|
+
intentHash: asString(intentSummary?.['intentHash']),
|
|
109
|
+
intentCategories: asStringArray(intentSummary?.['categories']),
|
|
110
|
+
approvals: {
|
|
111
|
+
approvalRequired: facts?.['approvalRequired'] === true,
|
|
112
|
+
exactPathApprovalOnly: facts?.['exactPathApprovalOnly'] === true,
|
|
113
|
+
approvedExactPathCount: arrayLength(facts?.['approvedExactPaths']),
|
|
114
|
+
neighborSensitiveBlocked: facts?.['neighboringSensitiveFilesBlocked'] === true,
|
|
115
|
+
blockedBoundaryCount: arrayLength(facts?.['blockedBoundaries']),
|
|
116
|
+
boundaryOwnerCount: arrayLength(facts?.['boundaryOwners']),
|
|
117
|
+
},
|
|
118
|
+
blockedBoundaries: asStringArray(facts?.['blockedBoundaries']),
|
|
119
|
+
plan: {
|
|
120
|
+
timelineCount: arrayLength(plan?.['timeline']),
|
|
121
|
+
pendingAmendmentCount: arrayLength(plan?.['pendingAmendments']),
|
|
122
|
+
},
|
|
123
|
+
reuseAdvisoryCount: asNumber(facts?.['reuseAdvisoryCount']),
|
|
124
|
+
evidenceReceipt: asString(facts?.['evidenceReceipt']),
|
|
125
|
+
hashes: {
|
|
126
|
+
recordHash: asString(integrity?.['recordHash']),
|
|
127
|
+
replayHash: asString(integrity?.['replayHash']),
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return out;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Project `.neurcode/admission/*.json` into source-free admission inputs. The
|
|
135
|
+
* record's `runtimeContext.intentSummary` prose is intentionally never read.
|
|
136
|
+
*/
|
|
137
|
+
function readPilotAdmissionRecords(repoRoot) {
|
|
138
|
+
const dir = (0, node_path_1.join)(repoRoot, '.neurcode', 'admission');
|
|
139
|
+
const files = listJsonFiles(dir, (name) => name.endsWith('.json'));
|
|
140
|
+
const out = [];
|
|
141
|
+
for (const file of files) {
|
|
142
|
+
const j = readJson(file);
|
|
143
|
+
if (!j)
|
|
144
|
+
continue;
|
|
145
|
+
const rc = get(j, 'runtimeContext');
|
|
146
|
+
const counts = get(rc, 'counts');
|
|
147
|
+
const paths = get(rc, 'paths');
|
|
148
|
+
const integrity = get(rc, 'integrity');
|
|
149
|
+
const receipt = get(integrity, 'receipt');
|
|
150
|
+
const manifest = get(j, 'manifest');
|
|
151
|
+
const deltaRaw = Array.isArray(manifest?.['delta']) ? manifest['delta'] : [];
|
|
152
|
+
const delta = deltaRaw
|
|
153
|
+
.map((entry) => {
|
|
154
|
+
const e = entry && typeof entry === 'object' ? entry : {};
|
|
155
|
+
return {
|
|
156
|
+
path: asString(e['path']) ?? '',
|
|
157
|
+
changeType: asString(e['changeType']) ?? 'unknown',
|
|
158
|
+
oldObjectId: asString(e['oldObjectId']),
|
|
159
|
+
newObjectId: asString(e['newObjectId']),
|
|
160
|
+
};
|
|
161
|
+
})
|
|
162
|
+
.filter((e) => e.path.length > 0);
|
|
163
|
+
const sessionId = asString(j['sessionId']) ?? (0, node_path_1.basename)(file).replace(/\.json$/, '');
|
|
164
|
+
out.push({
|
|
165
|
+
sessionId,
|
|
166
|
+
attestationKind: asString(j['attestationKind']),
|
|
167
|
+
trustLevel: asString(rc?.['trustLevel']),
|
|
168
|
+
sessionStatus: asString(rc?.['sessionStatus']),
|
|
169
|
+
counts: {
|
|
170
|
+
changedPaths: asNumber(counts?.['changedPaths']),
|
|
171
|
+
blockedPaths: asNumber(counts?.['blockedPaths']),
|
|
172
|
+
suggestedApprovalPaths: asNumber(counts?.['suggestedApprovalPaths']),
|
|
173
|
+
approvedExactPaths: asNumber(counts?.['approvedExactPaths']),
|
|
174
|
+
deniedPaths: asNumber(counts?.['deniedPaths']),
|
|
175
|
+
approvalRequiredSurfaces: asNumber(counts?.['approvalRequiredSurfaces']),
|
|
176
|
+
owners: asNumber(counts?.['owners']),
|
|
177
|
+
preWriteChecks: asNumber(counts?.['preWriteChecks']),
|
|
178
|
+
allowedChecks: asNumber(counts?.['allowedChecks']),
|
|
179
|
+
warningChecks: asNumber(counts?.['warningChecks']),
|
|
180
|
+
},
|
|
181
|
+
paths: {
|
|
182
|
+
blocked: asStringArray(paths?.['blocked']),
|
|
183
|
+
denied: asStringArray(paths?.['denied']),
|
|
184
|
+
approvalRequiredSurfaces: asStringArray(paths?.['approvalRequiredSurfaces']),
|
|
185
|
+
approvedExact: asStringArray(paths?.['approvedExact']),
|
|
186
|
+
changed: asStringArray(paths?.['changed']),
|
|
187
|
+
},
|
|
188
|
+
manifest: {
|
|
189
|
+
entryCount: asNumber(manifest?.['entryCount']),
|
|
190
|
+
deltaHash: asString(manifest?.['deltaHash']),
|
|
191
|
+
coverageSetHash: asString(manifest?.['coverageSetHash']),
|
|
192
|
+
delta,
|
|
193
|
+
},
|
|
194
|
+
integrity: {
|
|
195
|
+
sourceFree: integrity?.['sourceFree'] === true,
|
|
196
|
+
replayHash: asString(integrity?.['replayHash']),
|
|
197
|
+
evidenceIntegrityStatus: asString(integrity?.['evidenceIntegrityStatus']),
|
|
198
|
+
receiptPresent: receipt?.['present'] === true,
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Project the local pilot-metrics rollup into source-free metric inputs. Returns
|
|
206
|
+
* null when no `.neurcode/pilot-metrics.json` exists (an incomplete-pilot signal).
|
|
207
|
+
*/
|
|
208
|
+
function readPilotMetricsInput(repoRoot, days = 7) {
|
|
209
|
+
const path = (0, node_path_1.join)(repoRoot, '.neurcode', 'pilot-metrics.json');
|
|
210
|
+
if (!(0, node_fs_1.existsSync)(path))
|
|
211
|
+
return null;
|
|
212
|
+
const summary = (0, pilot_metrics_1.generatePilotSummary)(repoRoot, days);
|
|
213
|
+
return {
|
|
214
|
+
periodDays: summary.periodDays,
|
|
215
|
+
totalVerifyRuns: summary.totalVerifyRuns,
|
|
216
|
+
totalBlockingCaught: summary.totalBlockingCaught,
|
|
217
|
+
totalStructuralCaught: summary.totalStructuralCaught,
|
|
218
|
+
averagePassRate: summary.averagePassRate,
|
|
219
|
+
suppressionRate: summary.suppressionRate,
|
|
220
|
+
aiDebtTrend: summary.aiDebtTrend,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/** Resolve the CLI's own package version without spawning a subprocess. */
|
|
224
|
+
function resolveCliVersion() {
|
|
225
|
+
try {
|
|
226
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
227
|
+
const pkg = require('../../package.json');
|
|
228
|
+
return typeof pkg?.version === 'string' ? pkg.version : null;
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Read every repo-local artifact and assemble the source-free builder input.
|
|
236
|
+
* Synchronous and side-effect-free apart from reads; the optional brain
|
|
237
|
+
* readiness is computed by the caller and threaded through.
|
|
238
|
+
*/
|
|
239
|
+
function gatherPilotEvidenceInputs(repoRoot, options) {
|
|
240
|
+
return {
|
|
241
|
+
generatedAt: options.generatedAt,
|
|
242
|
+
cliVersion: options.cliVersion ?? resolveCliVersion(),
|
|
243
|
+
repoRootHash: (0, guided_eval_1.hashRepoIdentity)(repoRoot),
|
|
244
|
+
repoName: options.repoName ?? (0, node_path_1.basename)(repoRoot),
|
|
245
|
+
sessions: readPilotChangeRecords(repoRoot),
|
|
246
|
+
admissions: readPilotAdmissionRecords(repoRoot),
|
|
247
|
+
metrics: readPilotMetricsInput(repoRoot, options.days ?? 7),
|
|
248
|
+
brainReadiness: options.brainReadiness ?? null,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=pilot-evidence-io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pilot-evidence-io.js","sourceRoot":"","sources":["../../src/utils/pilot-evidence-io.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAiEH,wDAsDC;AAMD,8DAiEC;AAMD,sDAaC;AAGD,8CAQC;AAeD,8DAcC;AAvPD,qCAAgE;AAChE,yCAA2C;AAC3C,+CAAiD;AACjD,mDAAuD;AASvD,iFAAiF;AAEjF,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACtE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,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