@neurcode-ai/cli 0.20.6 → 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/api-client.d.ts +37 -4
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js.map +1 -1
- package/dist/commands/ops.d.ts +38 -0
- package/dist/commands/ops.d.ts.map +1 -1
- package/dist/commands/ops.js +120 -3
- package/dist/commands/ops.js.map +1 -1
- 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
|
@@ -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,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7F,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IA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,OAAO,OAAO,GAAG,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAUD;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,QAAgB,EAChB,OAAmC;IAEnC,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,iBAAiB,EAAE;QACrD,YAAY,EAAE,IAAA,8BAAgB,EAAC,QAAQ,CAAC;QACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAA,oBAAQ,EAAC,QAAQ,CAAC;QAChD,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,CAAC;QAC1C,UAAU,EAAE,yBAAyB,CAAC,QAAQ,CAAC;QAC/C,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;QAC3D,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,IAAI;KAC/C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pilot Evidence Pack — pure builders (Iteration 10).
|
|
3
|
+
*
|
|
4
|
+
* After a pilot, a founder needs to hand engineering managers, principal
|
|
5
|
+
* engineers, security reviewers, and procurement/IT a single, shareable packet
|
|
6
|
+
* that explains what the Neurcode runtime control plane actually did — without a
|
|
7
|
+
* live walkthrough and without leaking a single line of source.
|
|
8
|
+
*
|
|
9
|
+
* This module is the source-free, deterministic core. It takes already-parsed,
|
|
10
|
+
* source-free inputs (extracted by the thin `neurcode pilot export` command from
|
|
11
|
+
* `.neurcode/sessions/*.change-record.json`, `.neurcode/admission/*.json`, and
|
|
12
|
+
* `.neurcode/pilot-metrics.json`) and turns them into:
|
|
13
|
+
*
|
|
14
|
+
* 1. {@link buildPilotEvidencePack} — a machine-readable manifest
|
|
15
|
+
* (`neurcode.pilot-evidence-pack.v1`).
|
|
16
|
+
* 2. {@link renderPilotEvidencePackMarkdown} / {@link renderPilotEvidencePackHtml}
|
|
17
|
+
* — the human-readable executive packet.
|
|
18
|
+
*
|
|
19
|
+
* Hard rules (shared with utils/enterprise-eval-report.ts + utils/guided-eval.ts):
|
|
20
|
+
* - Source-free. Only paths, owners, symbol names, counts, verdicts, hashes,
|
|
21
|
+
* and tier labels are read or emitted. We NEVER copy source, diffs, patch
|
|
22
|
+
* bodies, raw prompts, secrets, or the admission record's natural-language
|
|
23
|
+
* `intentSummary` / `goal` prose — intent is represented by its hash and
|
|
24
|
+
* categories only. {@link assertPilotEvidencePackSourceFree} is the backstop.
|
|
25
|
+
* - Honest tiers. Deterministic path/approval/hash facts are separated from
|
|
26
|
+
* advisory inference; trust posture is reported truthfully (self-attested vs
|
|
27
|
+
* backend-signed) and never overclaims enforcement.
|
|
28
|
+
* - Deterministic. {@link computePilotEvidencePackHash} excludes wall-clock
|
|
29
|
+
* timestamps so the same input yields the same `contentHash`.
|
|
30
|
+
*
|
|
31
|
+
* Everything here is pure (no filesystem or network I/O).
|
|
32
|
+
*/
|
|
33
|
+
export declare const PILOT_EVIDENCE_PACK_SCHEMA_VERSION: "neurcode.pilot-evidence-pack.v1";
|
|
34
|
+
/**
|
|
35
|
+
* Keys that would carry intent/prompt/task prose. The pilot evidence pack is
|
|
36
|
+
* stricter than the admission record: even though the admission record's
|
|
37
|
+
* `intentSummary` passes the project's source-free gate (it is intent, not
|
|
38
|
+
* source), an executive packet for a security reviewer must not echo task text.
|
|
39
|
+
* Mirror this set in scripts/source-free-leak-scan.mjs (SOURCE_LIKE_KEYS).
|
|
40
|
+
*/
|
|
41
|
+
export declare const FORBIDDEN_PROSE_KEYS: ReadonlySet<string>;
|
|
42
|
+
/** Source-free projection of one `.neurcode/sessions/<id>.change-record.json`. */
|
|
43
|
+
export interface PilotSessionInput {
|
|
44
|
+
sessionId: string;
|
|
45
|
+
status: string | null;
|
|
46
|
+
scopeMode: string | null;
|
|
47
|
+
trustLevel: string | null;
|
|
48
|
+
verdict: string | null;
|
|
49
|
+
counts: {
|
|
50
|
+
ok: number;
|
|
51
|
+
warn: number;
|
|
52
|
+
block: number;
|
|
53
|
+
approval: number;
|
|
54
|
+
planEvents: number;
|
|
55
|
+
events: number;
|
|
56
|
+
};
|
|
57
|
+
/** Intent is represented by hash + categories only — never the prose summary. */
|
|
58
|
+
intentHash: string | null;
|
|
59
|
+
intentCategories: string[];
|
|
60
|
+
approvals: {
|
|
61
|
+
approvalRequired: boolean;
|
|
62
|
+
exactPathApprovalOnly: boolean;
|
|
63
|
+
approvedExactPathCount: number;
|
|
64
|
+
neighborSensitiveBlocked: boolean;
|
|
65
|
+
blockedBoundaryCount: number;
|
|
66
|
+
boundaryOwnerCount: number;
|
|
67
|
+
};
|
|
68
|
+
/** Deterministic blocked-boundary globs (repo-relative; coarse patterns). */
|
|
69
|
+
blockedBoundaries: string[];
|
|
70
|
+
plan: {
|
|
71
|
+
timelineCount: number;
|
|
72
|
+
pendingAmendmentCount: number;
|
|
73
|
+
};
|
|
74
|
+
reuseAdvisoryCount: number;
|
|
75
|
+
evidenceReceipt: string | null;
|
|
76
|
+
hashes: {
|
|
77
|
+
recordHash: string | null;
|
|
78
|
+
replayHash: string | null;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** Source-free projection of one `.neurcode/admission/<id>.json`. */
|
|
82
|
+
export interface PilotAdmissionInput {
|
|
83
|
+
sessionId: string;
|
|
84
|
+
attestationKind: string | null;
|
|
85
|
+
trustLevel: string | null;
|
|
86
|
+
sessionStatus: string | null;
|
|
87
|
+
counts: {
|
|
88
|
+
changedPaths: number;
|
|
89
|
+
blockedPaths: number;
|
|
90
|
+
suggestedApprovalPaths: number;
|
|
91
|
+
approvedExactPaths: number;
|
|
92
|
+
deniedPaths: number;
|
|
93
|
+
approvalRequiredSurfaces: number;
|
|
94
|
+
owners: number;
|
|
95
|
+
preWriteChecks: number;
|
|
96
|
+
allowedChecks: number;
|
|
97
|
+
warningChecks: number;
|
|
98
|
+
};
|
|
99
|
+
/** Repo-relative globs / paths — coarse risk surfaces, never source. */
|
|
100
|
+
paths: {
|
|
101
|
+
blocked: string[];
|
|
102
|
+
denied: string[];
|
|
103
|
+
approvalRequiredSurfaces: string[];
|
|
104
|
+
approvedExact: string[];
|
|
105
|
+
changed: string[];
|
|
106
|
+
};
|
|
107
|
+
manifest: {
|
|
108
|
+
entryCount: number;
|
|
109
|
+
deltaHash: string | null;
|
|
110
|
+
coverageSetHash: string | null;
|
|
111
|
+
/** Per-path git object metadata: path + change type + blob object ids (hashes, not contents). */
|
|
112
|
+
delta: Array<{
|
|
113
|
+
path: string;
|
|
114
|
+
changeType: string;
|
|
115
|
+
oldObjectId: string | null;
|
|
116
|
+
newObjectId: string | null;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
integrity: {
|
|
120
|
+
sourceFree: boolean;
|
|
121
|
+
replayHash: string | null;
|
|
122
|
+
evidenceIntegrityStatus: string | null;
|
|
123
|
+
receiptPresent: boolean;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Source-free projection of the local pilot-metrics rollup (optional). */
|
|
127
|
+
export interface PilotMetricsInput {
|
|
128
|
+
periodDays: number;
|
|
129
|
+
totalVerifyRuns: number;
|
|
130
|
+
totalBlockingCaught: number;
|
|
131
|
+
totalStructuralCaught: number;
|
|
132
|
+
averagePassRate: number;
|
|
133
|
+
suppressionRate: number;
|
|
134
|
+
aiDebtTrend: string;
|
|
135
|
+
}
|
|
136
|
+
/** Source-free projection of `neurcode brain readiness` (optional). */
|
|
137
|
+
export interface PilotBrainReadinessInput {
|
|
138
|
+
state: string | null;
|
|
139
|
+
filesIndexed: number | null;
|
|
140
|
+
filesScanned: number | null;
|
|
141
|
+
percent: number | null;
|
|
142
|
+
}
|
|
143
|
+
export interface BuildPilotEvidencePackInput {
|
|
144
|
+
generatedAt: string;
|
|
145
|
+
cliVersion: string | null;
|
|
146
|
+
repoRootHash: string | null;
|
|
147
|
+
repoName: string | null;
|
|
148
|
+
sessions: PilotSessionInput[];
|
|
149
|
+
admissions: PilotAdmissionInput[];
|
|
150
|
+
metrics: PilotMetricsInput | null;
|
|
151
|
+
brainReadiness?: PilotBrainReadinessInput | null;
|
|
152
|
+
}
|
|
153
|
+
export type PilotCompletenessStatus = 'complete' | 'partial' | 'empty';
|
|
154
|
+
export interface PilotEvidencePack {
|
|
155
|
+
schemaVersion: typeof PILOT_EVIDENCE_PACK_SCHEMA_VERSION;
|
|
156
|
+
/** Wall-clock generation time — EXCLUDED from {@link contentHash}. */
|
|
157
|
+
generatedAt: string;
|
|
158
|
+
/** sha256 of the stable serialization of this pack with `generatedAt` removed. */
|
|
159
|
+
contentHash: string;
|
|
160
|
+
cli: {
|
|
161
|
+
version: string | null;
|
|
162
|
+
};
|
|
163
|
+
repo: {
|
|
164
|
+
rootHash: string | null;
|
|
165
|
+
name: string | null;
|
|
166
|
+
};
|
|
167
|
+
completeness: {
|
|
168
|
+
status: PilotCompletenessStatus;
|
|
169
|
+
missingArtifacts: string[];
|
|
170
|
+
notes: string[];
|
|
171
|
+
};
|
|
172
|
+
summary: {
|
|
173
|
+
sessionCount: number;
|
|
174
|
+
admissionRecordCount: number;
|
|
175
|
+
verdictCounts: Record<string, number>;
|
|
176
|
+
governedEditChecks: number;
|
|
177
|
+
blockedPathTotal: number;
|
|
178
|
+
deniedPathTotal: number;
|
|
179
|
+
approvedExactPathTotal: number;
|
|
180
|
+
riskFamilyCount: number;
|
|
181
|
+
dependencyChangeCount: number;
|
|
182
|
+
trustPosture: {
|
|
183
|
+
selfAttested: number;
|
|
184
|
+
backendSigned: number;
|
|
185
|
+
other: number;
|
|
186
|
+
};
|
|
187
|
+
headline: string;
|
|
188
|
+
};
|
|
189
|
+
sessions: Array<{
|
|
190
|
+
sessionId: string;
|
|
191
|
+
status: string | null;
|
|
192
|
+
verdict: string | null;
|
|
193
|
+
scopeMode: string | null;
|
|
194
|
+
trustLevel: string | null;
|
|
195
|
+
intentHash: string | null;
|
|
196
|
+
intentCategories: string[];
|
|
197
|
+
counts: PilotSessionInput['counts'];
|
|
198
|
+
approvedExactPathCount: number;
|
|
199
|
+
neighborSensitiveBlocked: boolean;
|
|
200
|
+
planEvents: number;
|
|
201
|
+
pendingAmendments: number;
|
|
202
|
+
reuseAdvisoryCount: number;
|
|
203
|
+
}>;
|
|
204
|
+
blockedRiskFamilies: Array<{
|
|
205
|
+
family: string;
|
|
206
|
+
surfaceCount: number;
|
|
207
|
+
sampleSurfaces: string[];
|
|
208
|
+
}>;
|
|
209
|
+
approvals: {
|
|
210
|
+
sessionsRequiringApproval: number;
|
|
211
|
+
exactPathOnlySessions: number;
|
|
212
|
+
approvedExactPathTotal: number;
|
|
213
|
+
neighborDenyObservedSessions: number;
|
|
214
|
+
blockedPathTotal: number;
|
|
215
|
+
deniedPathTotal: number;
|
|
216
|
+
};
|
|
217
|
+
planDrift: {
|
|
218
|
+
planEventTotal: number;
|
|
219
|
+
pendingAmendmentTotal: number;
|
|
220
|
+
planTimelineTotal: number;
|
|
221
|
+
sessionsWithPlanActivity: number;
|
|
222
|
+
note: string;
|
|
223
|
+
};
|
|
224
|
+
dependencyChanges: {
|
|
225
|
+
governedChangeCount: number;
|
|
226
|
+
files: Array<{
|
|
227
|
+
path: string;
|
|
228
|
+
changeType: string;
|
|
229
|
+
objectHash: string | null;
|
|
230
|
+
}>;
|
|
231
|
+
note: string;
|
|
232
|
+
};
|
|
233
|
+
evidenceHashes: Array<{
|
|
234
|
+
sessionId: string;
|
|
235
|
+
recordHash: string | null;
|
|
236
|
+
replayHash: string | null;
|
|
237
|
+
deltaHash: string | null;
|
|
238
|
+
coverageSetHash: string | null;
|
|
239
|
+
}>;
|
|
240
|
+
brainReadiness: PilotBrainReadinessInput | null;
|
|
241
|
+
metrics: PilotMetricsInput | null;
|
|
242
|
+
whatStayedLocal: {
|
|
243
|
+
statement: string;
|
|
244
|
+
facts: string[];
|
|
245
|
+
};
|
|
246
|
+
limitations: string[];
|
|
247
|
+
truthTiers: {
|
|
248
|
+
deterministic: string[];
|
|
249
|
+
advisory: string[];
|
|
250
|
+
};
|
|
251
|
+
privacy: {
|
|
252
|
+
sourceFree: true;
|
|
253
|
+
excludes: string[];
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/** Map a coarse glob / path to a stable risk-family bucket. Source-free. */
|
|
257
|
+
export declare function classifyRiskFamily(surface: string): string;
|
|
258
|
+
/** True when a repo-relative path is a recognized dependency manifest / lockfile. */
|
|
259
|
+
export declare function isDependencyManifest(path: string): boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Build the source-free pilot evidence pack from already-parsed inputs. The
|
|
262
|
+
* returned object carries a stable {@link PilotEvidencePack.contentHash}; the
|
|
263
|
+
* caller should still run {@link assertPilotEvidencePackSourceFree} before
|
|
264
|
+
* writing or printing (defense in depth — the harness asserts the same).
|
|
265
|
+
*/
|
|
266
|
+
export declare function buildPilotEvidencePack(input: BuildPilotEvidencePackInput): PilotEvidencePack;
|
|
267
|
+
/**
|
|
268
|
+
* Compute the stable content hash of a pack: sha256 over the sorted-key
|
|
269
|
+
* serialization with `generatedAt` (and the hash field itself) removed, so the
|
|
270
|
+
* same input always yields the same hash regardless of generation time.
|
|
271
|
+
*/
|
|
272
|
+
export declare function computePilotEvidencePackHash(pack: PilotEvidencePack): string;
|
|
273
|
+
/**
|
|
274
|
+
* Throw if a would-be pilot evidence artifact carries source/diff/secret shapes
|
|
275
|
+
* (delegated to the shared enterprise-eval scan) or any prose-intent key.
|
|
276
|
+
*/
|
|
277
|
+
export declare function assertPilotEvidencePackSourceFree(value: unknown, label?: string): void;
|
|
278
|
+
export declare function renderPilotEvidencePackMarkdown(pack: PilotEvidencePack): string;
|
|
279
|
+
export declare function renderPilotEvidencePackHtml(pack: PilotEvidencePack): string;
|
|
280
|
+
//# sourceMapping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