proofscan 0.10.21 → 0.10.23
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/cli-shell.d.ts +7 -0
- package/dist/cli-shell.d.ts.map +1 -0
- package/dist/cli-shell.js +34 -0
- package/dist/cli-shell.js.map +1 -0
- package/dist/cli.js +7 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +12 -11
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +112 -57
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/i18n.d.ts +10 -0
- package/dist/commands/i18n.d.ts.map +1 -0
- package/dist/commands/i18n.js +49 -0
- package/dist/commands/i18n.js.map +1 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/plans.d.ts +7 -0
- package/dist/commands/plans.d.ts.map +1 -0
- package/dist/commands/plans.js +486 -0
- package/dist/commands/plans.js.map +1 -0
- package/dist/commands/record.d.ts.map +1 -1
- package/dist/commands/record.js +21 -18
- package/dist/commands/record.js.map +1 -1
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +7 -2
- package/dist/commands/scan.js.map +1 -1
- package/dist/commands/summary.d.ts.map +1 -1
- package/dist/commands/summary.js +19 -29
- package/dist/commands/summary.js.map +1 -1
- package/dist/db/connection.d.ts +22 -0
- package/dist/db/connection.d.ts.map +1 -1
- package/dist/db/connection.js +141 -8
- package/dist/db/connection.js.map +1 -1
- package/dist/db/schema.d.ts +10 -5
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +85 -6
- package/dist/db/schema.js.map +1 -1
- package/dist/db/tool-analysis.d.ts +5 -2
- package/dist/db/tool-analysis.d.ts.map +1 -1
- package/dist/db/tool-analysis.js +8 -8
- package/dist/db/tool-analysis.js.map +1 -1
- package/dist/db/types.d.ts +1 -1
- package/dist/db/types.d.ts.map +1 -1
- package/dist/help/categories.d.ts.map +1 -1
- package/dist/help/categories.js +15 -0
- package/dist/help/categories.js.map +1 -1
- package/dist/i18n/index.d.ts +52 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +165 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales/en.d.ts +269 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +277 -0
- package/dist/i18n/locales/en.js.map +1 -0
- package/dist/i18n/locales/ja.d.ts +8 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -0
- package/dist/i18n/locales/ja.js +275 -0
- package/dist/i18n/locales/ja.js.map +1 -0
- package/dist/plans/artifacts.d.ts +53 -0
- package/dist/plans/artifacts.d.ts.map +1 -0
- package/dist/plans/artifacts.js +186 -0
- package/dist/plans/artifacts.js.map +1 -0
- package/dist/plans/builtin.d.ts +40 -0
- package/dist/plans/builtin.d.ts.map +1 -0
- package/dist/plans/builtin.js +75 -0
- package/dist/plans/builtin.js.map +1 -0
- package/dist/plans/digest.d.ts +24 -0
- package/dist/plans/digest.d.ts.map +1 -0
- package/dist/plans/digest.js +49 -0
- package/dist/plans/digest.js.map +1 -0
- package/dist/plans/index.d.ts +11 -0
- package/dist/plans/index.d.ts.map +1 -0
- package/dist/plans/index.js +11 -0
- package/dist/plans/index.js.map +1 -0
- package/dist/plans/runner.d.ts +47 -0
- package/dist/plans/runner.d.ts.map +1 -0
- package/dist/plans/runner.js +360 -0
- package/dist/plans/runner.js.map +1 -0
- package/dist/plans/schema.d.ts +192 -0
- package/dist/plans/schema.d.ts.map +1 -0
- package/dist/plans/schema.js +81 -0
- package/dist/plans/schema.js.map +1 -0
- package/dist/plans/store.d.ts +111 -0
- package/dist/plans/store.d.ts.map +1 -0
- package/dist/plans/store.js +350 -0
- package/dist/plans/store.js.map +1 -0
- package/dist/popl/index.d.ts +1 -1
- package/dist/popl/index.d.ts.map +1 -1
- package/dist/popl/index.js +1 -1
- package/dist/popl/index.js.map +1 -1
- package/dist/popl/service.d.ts +12 -0
- package/dist/popl/service.d.ts.map +1 -1
- package/dist/popl/service.js +213 -0
- package/dist/popl/service.js.map +1 -1
- package/dist/popl/types.d.ts +5 -1
- package/dist/popl/types.d.ts.map +1 -1
- package/dist/shell/context-applicator.d.ts.map +1 -1
- package/dist/shell/context-applicator.js +7 -0
- package/dist/shell/context-applicator.js.map +1 -1
- package/dist/shell/ref-resolver.d.ts +34 -3
- package/dist/shell/ref-resolver.d.ts.map +1 -1
- package/dist/shell/ref-resolver.js +128 -1
- package/dist/shell/ref-resolver.js.map +1 -1
- package/dist/shell/router-commands.d.ts.map +1 -1
- package/dist/shell/router-commands.js +108 -25
- package/dist/shell/router-commands.js.map +1 -1
- package/dist/shell/types.d.ts.map +1 -1
- package/dist/shell/types.js +12 -0
- package/dist/shell/types.js.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plans store - manages plans and runs in proofs.db
|
|
3
|
+
* Phase 5.2: CRUD operations for validation plans
|
|
4
|
+
*/
|
|
5
|
+
import { parse as parseYaml } from 'yaml';
|
|
6
|
+
import { getProofsDb } from '../db/connection.js';
|
|
7
|
+
import { calculatePlanDigest, normalizePlanForDigest } from './digest.js';
|
|
8
|
+
import { validatePlanDefinition, isValidPlanName } from './schema.js';
|
|
9
|
+
import { BUILTIN_PLANS, isBuiltinPlan } from './builtin.js';
|
|
10
|
+
export class PlansStore {
|
|
11
|
+
configDir;
|
|
12
|
+
builtinInitialized = false;
|
|
13
|
+
constructor(configDir) {
|
|
14
|
+
this.configDir = configDir;
|
|
15
|
+
}
|
|
16
|
+
get db() {
|
|
17
|
+
return getProofsDb(this.configDir);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Ensure built-in plans are installed
|
|
21
|
+
* Called lazily on first access
|
|
22
|
+
*/
|
|
23
|
+
ensureBuiltinPlans() {
|
|
24
|
+
if (this.builtinInitialized)
|
|
25
|
+
return;
|
|
26
|
+
this.builtinInitialized = true;
|
|
27
|
+
for (const builtin of BUILTIN_PLANS) {
|
|
28
|
+
if (!this.planExists(builtin.name)) {
|
|
29
|
+
this.addPlan(builtin.name, builtin.yaml, 'builtin');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// ============================================================
|
|
34
|
+
// Plans CRUD
|
|
35
|
+
// ============================================================
|
|
36
|
+
/**
|
|
37
|
+
* List all plans
|
|
38
|
+
*/
|
|
39
|
+
listPlans() {
|
|
40
|
+
this.ensureBuiltinPlans();
|
|
41
|
+
const stmt = this.db.prepare(`
|
|
42
|
+
SELECT * FROM plans ORDER BY created_at DESC
|
|
43
|
+
`);
|
|
44
|
+
return stmt.all();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get plan by name
|
|
48
|
+
*/
|
|
49
|
+
getPlan(name) {
|
|
50
|
+
this.ensureBuiltinPlans();
|
|
51
|
+
const stmt = this.db.prepare(`SELECT * FROM plans WHERE name = ?`);
|
|
52
|
+
const result = stmt.get(name);
|
|
53
|
+
return result ?? null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check if plan exists
|
|
57
|
+
*/
|
|
58
|
+
planExists(name) {
|
|
59
|
+
const stmt = this.db.prepare(`SELECT 1 FROM plans WHERE name = ?`);
|
|
60
|
+
return stmt.get(name) !== undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Add a new plan from YAML content
|
|
64
|
+
*/
|
|
65
|
+
addPlan(name, yamlContent, source = 'manual') {
|
|
66
|
+
// Validate name
|
|
67
|
+
if (!isValidPlanName(name)) {
|
|
68
|
+
return { success: false, error: `Invalid plan name: must match [a-z0-9_-]+` };
|
|
69
|
+
}
|
|
70
|
+
// Check if exists
|
|
71
|
+
if (this.planExists(name)) {
|
|
72
|
+
return { success: false, error: `Plan '${name}' already exists` };
|
|
73
|
+
}
|
|
74
|
+
// Parse YAML
|
|
75
|
+
let def;
|
|
76
|
+
try {
|
|
77
|
+
def = parseYaml(yamlContent);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
return { success: false, error: `Invalid YAML: ${err instanceof Error ? err.message : String(err)}` };
|
|
81
|
+
}
|
|
82
|
+
// Validate definition
|
|
83
|
+
const validation = validatePlanDefinition(def);
|
|
84
|
+
if (!validation.valid) {
|
|
85
|
+
return { success: false, error: `Invalid plan: ${validation.errors.join('; ')}` };
|
|
86
|
+
}
|
|
87
|
+
// Calculate normalized content and digest
|
|
88
|
+
const contentNormalized = normalizePlanForDigest(def);
|
|
89
|
+
const digestSha256 = calculatePlanDigest(def);
|
|
90
|
+
const now = new Date().toISOString();
|
|
91
|
+
const plan = {
|
|
92
|
+
name,
|
|
93
|
+
schema_version: def.version,
|
|
94
|
+
content_yaml: yamlContent,
|
|
95
|
+
content_normalized: contentNormalized,
|
|
96
|
+
digest_sha256: digestSha256,
|
|
97
|
+
description: def.description || null,
|
|
98
|
+
default_connector: null,
|
|
99
|
+
source,
|
|
100
|
+
created_at: now,
|
|
101
|
+
updated_at: now,
|
|
102
|
+
};
|
|
103
|
+
try {
|
|
104
|
+
const stmt = this.db.prepare(`
|
|
105
|
+
INSERT INTO plans (
|
|
106
|
+
name, schema_version, content_yaml, content_normalized, digest_sha256,
|
|
107
|
+
description, default_connector, source, created_at, updated_at
|
|
108
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
109
|
+
`);
|
|
110
|
+
stmt.run(plan.name, plan.schema_version, plan.content_yaml, plan.content_normalized, plan.digest_sha256, plan.description, plan.default_connector, plan.source, plan.created_at, plan.updated_at);
|
|
111
|
+
return { success: true, plan };
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Update an existing plan
|
|
119
|
+
*/
|
|
120
|
+
updatePlan(name, yamlContent) {
|
|
121
|
+
// Check if exists
|
|
122
|
+
if (!this.planExists(name)) {
|
|
123
|
+
return { success: false, error: `Plan '${name}' not found` };
|
|
124
|
+
}
|
|
125
|
+
// Parse YAML
|
|
126
|
+
let def;
|
|
127
|
+
try {
|
|
128
|
+
def = parseYaml(yamlContent);
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
return { success: false, error: `Invalid YAML: ${err instanceof Error ? err.message : String(err)}` };
|
|
132
|
+
}
|
|
133
|
+
// Validate definition
|
|
134
|
+
const validation = validatePlanDefinition(def);
|
|
135
|
+
if (!validation.valid) {
|
|
136
|
+
return { success: false, error: `Invalid plan: ${validation.errors.join('; ')}` };
|
|
137
|
+
}
|
|
138
|
+
// Calculate normalized content and digest
|
|
139
|
+
const contentNormalized = normalizePlanForDigest(def);
|
|
140
|
+
const digestSha256 = calculatePlanDigest(def);
|
|
141
|
+
const now = new Date().toISOString();
|
|
142
|
+
try {
|
|
143
|
+
const stmt = this.db.prepare(`
|
|
144
|
+
UPDATE plans SET
|
|
145
|
+
schema_version = ?,
|
|
146
|
+
content_yaml = ?,
|
|
147
|
+
content_normalized = ?,
|
|
148
|
+
digest_sha256 = ?,
|
|
149
|
+
description = ?,
|
|
150
|
+
updated_at = ?
|
|
151
|
+
WHERE name = ?
|
|
152
|
+
`);
|
|
153
|
+
stmt.run(def.version, yamlContent, contentNormalized, digestSha256, def.description || null, now, name);
|
|
154
|
+
return { success: true, plan: this.getPlan(name) };
|
|
155
|
+
}
|
|
156
|
+
catch (err) {
|
|
157
|
+
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Delete a plan
|
|
162
|
+
* @param force If true, also delete associated runs
|
|
163
|
+
* Note: Built-in plans cannot be deleted
|
|
164
|
+
*/
|
|
165
|
+
deletePlan(name, force = false) {
|
|
166
|
+
if (!this.planExists(name)) {
|
|
167
|
+
return { success: false, error: `Plan '${name}' not found` };
|
|
168
|
+
}
|
|
169
|
+
// Prevent deletion of built-in plans
|
|
170
|
+
if (isBuiltinPlan(name)) {
|
|
171
|
+
return { success: false, error: `Cannot delete built-in plan '${name}'` };
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
if (force) {
|
|
175
|
+
// Delete associated runs first
|
|
176
|
+
const deleteRuns = this.db.prepare(`DELETE FROM runs WHERE plan_name = ?`);
|
|
177
|
+
deleteRuns.run(name);
|
|
178
|
+
}
|
|
179
|
+
const stmt = this.db.prepare(`DELETE FROM plans WHERE name = ?`);
|
|
180
|
+
stmt.run(name);
|
|
181
|
+
return { success: true };
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get plan definition (parsed YAML)
|
|
189
|
+
*/
|
|
190
|
+
getPlanDefinition(name) {
|
|
191
|
+
const plan = this.getPlan(name);
|
|
192
|
+
if (!plan)
|
|
193
|
+
return null;
|
|
194
|
+
try {
|
|
195
|
+
return parseYaml(plan.content_yaml);
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Export plan as YAML
|
|
203
|
+
*/
|
|
204
|
+
exportPlanYaml(name) {
|
|
205
|
+
const plan = this.getPlan(name);
|
|
206
|
+
if (!plan)
|
|
207
|
+
return null;
|
|
208
|
+
return plan.content_yaml;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Import multiple plans from multi-document YAML
|
|
212
|
+
*/
|
|
213
|
+
importPlans(yamlContent, source = 'import') {
|
|
214
|
+
const imported = [];
|
|
215
|
+
const errors = [];
|
|
216
|
+
// Split multi-document YAML
|
|
217
|
+
const docs = yamlContent.split(/^---$/m).filter(s => s.trim());
|
|
218
|
+
for (const doc of docs) {
|
|
219
|
+
try {
|
|
220
|
+
const def = parseYaml(doc);
|
|
221
|
+
const name = def.name;
|
|
222
|
+
if (!name) {
|
|
223
|
+
errors.push({ error: 'Plan missing name field' });
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const result = this.addPlan(name, doc.trim(), source);
|
|
227
|
+
if (result.success) {
|
|
228
|
+
imported.push(name);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
errors.push({ name, error: result.error });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
catch (err) {
|
|
235
|
+
errors.push({ error: `YAML parse error: ${err instanceof Error ? err.message : String(err)}` });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return { imported, errors };
|
|
239
|
+
}
|
|
240
|
+
// ============================================================
|
|
241
|
+
// Runs CRUD
|
|
242
|
+
// ============================================================
|
|
243
|
+
/**
|
|
244
|
+
* Create a new run record (status = 'running')
|
|
245
|
+
*/
|
|
246
|
+
createRun(params) {
|
|
247
|
+
const now = new Date().toISOString();
|
|
248
|
+
const run = {
|
|
249
|
+
run_id: params.runId,
|
|
250
|
+
plan_name: params.planName,
|
|
251
|
+
plan_digest: params.planDigest,
|
|
252
|
+
connector_id: params.connectorId,
|
|
253
|
+
status: 'running',
|
|
254
|
+
artifact_path: params.artifactPath,
|
|
255
|
+
started_at: now,
|
|
256
|
+
ended_at: null,
|
|
257
|
+
created_at: now,
|
|
258
|
+
};
|
|
259
|
+
const stmt = this.db.prepare(`
|
|
260
|
+
INSERT INTO runs (
|
|
261
|
+
run_id, plan_name, plan_digest, connector_id, status,
|
|
262
|
+
artifact_path, started_at, ended_at, created_at
|
|
263
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
264
|
+
`);
|
|
265
|
+
stmt.run(run.run_id, run.plan_name, run.plan_digest, run.connector_id, run.status, run.artifact_path, run.started_at, run.ended_at, run.created_at);
|
|
266
|
+
return run;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Update run status and end time
|
|
270
|
+
*/
|
|
271
|
+
completeRun(runId, status) {
|
|
272
|
+
const stmt = this.db.prepare(`
|
|
273
|
+
UPDATE runs SET status = ?, ended_at = ? WHERE run_id = ?
|
|
274
|
+
`);
|
|
275
|
+
stmt.run(status, new Date().toISOString(), runId);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Get run by ID
|
|
279
|
+
*/
|
|
280
|
+
getRun(runId) {
|
|
281
|
+
const stmt = this.db.prepare(`SELECT * FROM runs WHERE run_id = ?`);
|
|
282
|
+
const result = stmt.get(runId);
|
|
283
|
+
return result ?? null;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Get latest run
|
|
287
|
+
*/
|
|
288
|
+
getLatestRun() {
|
|
289
|
+
const stmt = this.db.prepare(`
|
|
290
|
+
SELECT * FROM runs ORDER BY started_at DESC LIMIT 1
|
|
291
|
+
`);
|
|
292
|
+
const result = stmt.get();
|
|
293
|
+
return result ?? null;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* List runs, optionally filtered by plan
|
|
297
|
+
*/
|
|
298
|
+
listRuns(planName, limit = 50) {
|
|
299
|
+
if (planName) {
|
|
300
|
+
const stmt = this.db.prepare(`
|
|
301
|
+
SELECT * FROM runs WHERE plan_name = ? ORDER BY started_at DESC LIMIT ?
|
|
302
|
+
`);
|
|
303
|
+
return stmt.all(planName, limit);
|
|
304
|
+
}
|
|
305
|
+
const stmt = this.db.prepare(`
|
|
306
|
+
SELECT * FROM runs ORDER BY started_at DESC LIMIT ?
|
|
307
|
+
`);
|
|
308
|
+
return stmt.all(limit);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Delete a run
|
|
312
|
+
*/
|
|
313
|
+
deleteRun(runId) {
|
|
314
|
+
const stmt = this.db.prepare(`DELETE FROM runs WHERE run_id = ?`);
|
|
315
|
+
const result = stmt.run(runId);
|
|
316
|
+
return result.changes > 0;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Recover crashed runs (status = 'running' at startup)
|
|
320
|
+
* Marks them as 'crashed'
|
|
321
|
+
*/
|
|
322
|
+
recoverCrashedRuns() {
|
|
323
|
+
const stmt = this.db.prepare(`
|
|
324
|
+
UPDATE runs SET status = 'crashed', ended_at = ? WHERE status = 'running'
|
|
325
|
+
`);
|
|
326
|
+
const result = stmt.run(new Date().toISOString());
|
|
327
|
+
return result.changes;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Count runs by status
|
|
331
|
+
*/
|
|
332
|
+
countRunsByStatus() {
|
|
333
|
+
const stmt = this.db.prepare(`
|
|
334
|
+
SELECT status, COUNT(*) as count FROM runs GROUP BY status
|
|
335
|
+
`);
|
|
336
|
+
const rows = stmt.all();
|
|
337
|
+
const result = {
|
|
338
|
+
running: 0,
|
|
339
|
+
completed: 0,
|
|
340
|
+
failed: 0,
|
|
341
|
+
partial: 0,
|
|
342
|
+
crashed: 0,
|
|
343
|
+
};
|
|
344
|
+
for (const row of rows) {
|
|
345
|
+
result[row.status] = row.count;
|
|
346
|
+
}
|
|
347
|
+
return result;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/plans/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,IAAI,SAAS,EAA8B,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,a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,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,kBAAkB;QAChB,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;KAE5B,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;KAE5B,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAiD,CAAC;QAEvE,MAAM,MAAM,GAA8B;YACxC,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;SACX,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC;QACjC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/dist/popl/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
export { POPL_VERSION, TRUST_LABELS, type TrustLevel, type TargetKind, type RedactionPolicy, type PoplAuthor, type PoplTrust, type PoplTargetIds, type PoplTarget, type PoplCaptureSummary, type PoplMcpClient, type PoplMcpServer, type PoplMcp, type PoplCaptureWindow, type PoplCapture, type PoplArtifact, type PoplEvidencePolicy, type PoplEvidence, type PoplEntry, type PoplDocument, type CreatePoplOptions, type CreatePoplResult, type PoplConfig, } from './types.js';
|
|
7
7
|
export { SANITIZER_RULESET_VERSION, sanitize, sanitizeRpcPayload, sanitizeLogLine, sanitizeRpcEvent, hashValue, hashFileContent, type SanitizeResult, } from './sanitizer.js';
|
|
8
8
|
export { generateStatusArtifact, generateRpcArtifact, generateLogsArtifact, generateValidationArtifact, generateSessionArtifacts, type SessionStatus, type StatusJson, type ArtifactResult, type GeneratedArtifacts, } from './artifacts.js';
|
|
9
|
-
export { hasPoplDir, getPoplDir, getPoplEntriesDir, initPoplDir, loadPoplConfig, createSessionPoplEntry, listPoplEntries, readPoplEntry, } from './service.js';
|
|
9
|
+
export { hasPoplDir, getPoplDir, getPoplEntriesDir, initPoplDir, loadPoplConfig, createSessionPoplEntry, createPlanPoplEntry, createRunPoplEntry, listPoplEntries, readPoplEntry, } from './service.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/popl/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popl/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popl/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAC"}
|
package/dist/popl/index.js
CHANGED
|
@@ -10,5 +10,5 @@ export { SANITIZER_RULESET_VERSION, sanitize, sanitizeRpcPayload, sanitizeLogLin
|
|
|
10
10
|
// Artifacts
|
|
11
11
|
export { generateStatusArtifact, generateRpcArtifact, generateLogsArtifact, generateValidationArtifact, generateSessionArtifacts, } from './artifacts.js';
|
|
12
12
|
// Service
|
|
13
|
-
export { hasPoplDir, getPoplDir, getPoplEntriesDir, initPoplDir, loadPoplConfig, createSessionPoplEntry, listPoplEntries, readPoplEntry, } from './service.js';
|
|
13
|
+
export { hasPoplDir, getPoplDir, getPoplEntriesDir, initPoplDir, loadPoplConfig, createSessionPoplEntry, createPlanPoplEntry, createRunPoplEntry, listPoplEntries, readPoplEntry, } from './service.js';
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/dist/popl/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/popl/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,OAAO,EACL,YAAY,EACZ,YAAY,GAsBb,MAAM,YAAY,CAAC;AAEpB,YAAY;AACZ,OAAO,EACL,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,eAAe,GAEhB,MAAM,gBAAgB,CAAC;AAExB,YAAY;AACZ,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,GAKzB,MAAM,gBAAgB,CAAC;AAExB,UAAU;AACV,OAAO,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/popl/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,OAAO,EACL,YAAY,EACZ,YAAY,GAsBb,MAAM,YAAY,CAAC;AAEpB,YAAY;AACZ,OAAO,EACL,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,eAAe,GAEhB,MAAM,gBAAgB,CAAC;AAExB,YAAY;AACZ,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,GAKzB,MAAM,gBAAgB,CAAC;AAExB,UAAU;AACV,OAAO,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAC"}
|
package/dist/popl/service.d.ts
CHANGED
|
@@ -32,6 +32,18 @@ export declare function loadPoplConfig(root: string): Promise<PoplConfig>;
|
|
|
32
32
|
* This is the core service function called by both CLI and shell.
|
|
33
33
|
*/
|
|
34
34
|
export declare function createSessionPoplEntry(sessionId: string, configDir: string, options: Omit<CreatePoplOptions, 'kind' | 'ids'>): Promise<CreatePoplResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a POPL entry for a validation plan
|
|
37
|
+
*
|
|
38
|
+
* Plans are static definitions, so POPL entries contain the plan YAML and metadata.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createPlanPoplEntry(planName: string, planDigest: string, planYaml: string, planDescription: string | undefined, options: Omit<CreatePoplOptions, 'kind' | 'ids'>): Promise<CreatePoplResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a POPL entry for a plan run
|
|
43
|
+
*
|
|
44
|
+
* Run entries contain the execution results, inventory, and plan used.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createRunPoplEntry(runId: string, planName: string | null, planDigest: string, connectorId: string, status: string, resultsJson: string, inventoryJson: string, planYaml: string, startedAt: string, endedAt: string, options: Omit<CreatePoplOptions, 'kind' | 'ids'>): Promise<CreatePoplResult>;
|
|
35
47
|
/**
|
|
36
48
|
* List existing POPL entries
|
|
37
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/popl/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAGL,KAAK,YAAY,EAEjB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,YAAY,CAAC;AAapB;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB7D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBtE;AA8BD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,KAAK,CAAC,GAC/C,OAAO,CAAC,gBAAgB,CAAC,CA2G3B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAgBzC;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAA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ClB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,KAAK,CAAC,GAC/C,OAAO,CAAC,gBAAgB,CAAC,CA2H3B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAgBzC;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAanF"}
|
package/dist/popl/service.js
CHANGED
|
@@ -195,6 +195,219 @@ export async function createSessionPoplEntry(sessionId, configDir, options) {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Create a POPL entry for a validation plan
|
|
200
|
+
*
|
|
201
|
+
* Plans are static definitions, so POPL entries contain the plan YAML and metadata.
|
|
202
|
+
*/
|
|
203
|
+
export async function createPlanPoplEntry(planName, planDigest, planYaml, planDescription, options) {
|
|
204
|
+
const { outputRoot, title, author } = options;
|
|
205
|
+
// Validate .popl exists
|
|
206
|
+
if (!hasPoplDir(outputRoot)) {
|
|
207
|
+
return {
|
|
208
|
+
success: false,
|
|
209
|
+
error: '.popl directory not found. Run "pfscan popl init" first.',
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
// Generate entry ID
|
|
214
|
+
const entryId = ulid();
|
|
215
|
+
// Create entry directory
|
|
216
|
+
const entryPath = join(getPoplEntriesDir(outputRoot), entryId);
|
|
217
|
+
await mkdir(entryPath, { recursive: true });
|
|
218
|
+
// Write plan.yaml artifact
|
|
219
|
+
const planArtifactPath = join(entryPath, 'plan.yaml');
|
|
220
|
+
await writeFile(planArtifactPath, planYaml, 'utf-8');
|
|
221
|
+
// Calculate hash
|
|
222
|
+
const crypto = await import('crypto');
|
|
223
|
+
const planHash = crypto.createHash('sha256').update(planYaml).digest('hex');
|
|
224
|
+
// Load config for author
|
|
225
|
+
const config = await loadPoplConfig(outputRoot);
|
|
226
|
+
const effectiveAuthor = author || config.author || { name: 'Unknown' };
|
|
227
|
+
// Generate title
|
|
228
|
+
const createdAt = new Date();
|
|
229
|
+
const effectiveTitle = title || `Validation Plan: ${planName}`;
|
|
230
|
+
// Build POPL document
|
|
231
|
+
const poplDoc = {
|
|
232
|
+
popl: POPL_VERSION,
|
|
233
|
+
entry: {
|
|
234
|
+
id: entryId,
|
|
235
|
+
created_at: createdAt.toISOString(),
|
|
236
|
+
title: effectiveTitle,
|
|
237
|
+
author: effectiveAuthor,
|
|
238
|
+
trust: {
|
|
239
|
+
level: 0,
|
|
240
|
+
label: TRUST_LABELS[0],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
target: {
|
|
244
|
+
kind: 'plan',
|
|
245
|
+
name: planName,
|
|
246
|
+
ids: {
|
|
247
|
+
plan_name: planName,
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
capture: {
|
|
251
|
+
window: {
|
|
252
|
+
started_at: createdAt.toISOString(),
|
|
253
|
+
ended_at: createdAt.toISOString(),
|
|
254
|
+
},
|
|
255
|
+
summary: {
|
|
256
|
+
rpc_total: 0,
|
|
257
|
+
errors: 0,
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
evidence: {
|
|
261
|
+
policy: {
|
|
262
|
+
redaction: 'none',
|
|
263
|
+
ruleset_version: SANITIZER_RULESET_VERSION,
|
|
264
|
+
},
|
|
265
|
+
artifacts: [
|
|
266
|
+
{
|
|
267
|
+
name: 'Plan Definition',
|
|
268
|
+
path: 'plan.yaml',
|
|
269
|
+
sha256: planHash,
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
// Write POPL.yml
|
|
275
|
+
const poplYmlPath = join(entryPath, 'POPL.yml');
|
|
276
|
+
const poplYmlContent = yaml.stringify(poplDoc);
|
|
277
|
+
await writeFile(poplYmlPath, poplYmlContent, 'utf-8');
|
|
278
|
+
return {
|
|
279
|
+
success: true,
|
|
280
|
+
entryId,
|
|
281
|
+
entryPath: toRelativePath(entryPath, outputRoot),
|
|
282
|
+
poplYmlPath: toRelativePath(poplYmlPath, outputRoot),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
return {
|
|
287
|
+
success: false,
|
|
288
|
+
error: error instanceof Error ? error.message : String(error),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Create a POPL entry for a plan run
|
|
294
|
+
*
|
|
295
|
+
* Run entries contain the execution results, inventory, and plan used.
|
|
296
|
+
*/
|
|
297
|
+
export async function createRunPoplEntry(runId, planName, planDigest, connectorId, status, resultsJson, inventoryJson, planYaml, startedAt, endedAt, options) {
|
|
298
|
+
const { outputRoot, title, author } = options;
|
|
299
|
+
// Validate .popl exists
|
|
300
|
+
if (!hasPoplDir(outputRoot)) {
|
|
301
|
+
return {
|
|
302
|
+
success: false,
|
|
303
|
+
error: '.popl directory not found. Run "pfscan popl init" first.',
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
// Generate entry ID
|
|
308
|
+
const entryId = ulid();
|
|
309
|
+
// Create entry directory
|
|
310
|
+
const entryPath = join(getPoplEntriesDir(outputRoot), entryId);
|
|
311
|
+
await mkdir(entryPath, { recursive: true });
|
|
312
|
+
// Write artifacts
|
|
313
|
+
const artifacts = [
|
|
314
|
+
{ name: 'results.json', content: resultsJson },
|
|
315
|
+
{ name: 'inventory.json', content: inventoryJson },
|
|
316
|
+
{ name: 'plan.yaml', content: planYaml },
|
|
317
|
+
];
|
|
318
|
+
const crypto = await import('crypto');
|
|
319
|
+
const artifactList = [];
|
|
320
|
+
for (const artifact of artifacts) {
|
|
321
|
+
const artifactPath = join(entryPath, artifact.name);
|
|
322
|
+
await writeFile(artifactPath, artifact.content, 'utf-8');
|
|
323
|
+
const hash = crypto.createHash('sha256').update(artifact.content).digest('hex');
|
|
324
|
+
artifactList.push({
|
|
325
|
+
name: artifact.name,
|
|
326
|
+
path: artifact.name,
|
|
327
|
+
sha256: hash,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
// Calculate stats from results
|
|
331
|
+
let rpcTotal = 0;
|
|
332
|
+
let errors = 0;
|
|
333
|
+
try {
|
|
334
|
+
const results = JSON.parse(resultsJson);
|
|
335
|
+
if (Array.isArray(results)) {
|
|
336
|
+
rpcTotal = results.filter((r) => !r.skipped).length;
|
|
337
|
+
errors = results.filter((r) => r.response?.error).length;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
catch {
|
|
341
|
+
// Ignore parse errors
|
|
342
|
+
}
|
|
343
|
+
// Load config for author
|
|
344
|
+
const config = await loadPoplConfig(outputRoot);
|
|
345
|
+
const effectiveAuthor = author || config.author || { name: 'Unknown' };
|
|
346
|
+
// Generate title
|
|
347
|
+
const createdAt = new Date();
|
|
348
|
+
const planLabel = planName || `digest:${planDigest.slice(0, 8)}`;
|
|
349
|
+
const effectiveTitle = title || `Plan Run: ${planLabel} on ${connectorId}`;
|
|
350
|
+
// Build POPL document
|
|
351
|
+
const poplDoc = {
|
|
352
|
+
popl: POPL_VERSION,
|
|
353
|
+
entry: {
|
|
354
|
+
id: entryId,
|
|
355
|
+
created_at: createdAt.toISOString(),
|
|
356
|
+
title: effectiveTitle,
|
|
357
|
+
author: effectiveAuthor,
|
|
358
|
+
trust: {
|
|
359
|
+
level: 0,
|
|
360
|
+
label: TRUST_LABELS[0],
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
target: {
|
|
364
|
+
kind: 'run',
|
|
365
|
+
name: `run:${runId.slice(0, 8)}`,
|
|
366
|
+
ids: {
|
|
367
|
+
run_id: runId,
|
|
368
|
+
connector_id: connectorId,
|
|
369
|
+
...(planName && { plan_name: planName }),
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
capture: {
|
|
373
|
+
window: {
|
|
374
|
+
started_at: startedAt,
|
|
375
|
+
ended_at: endedAt,
|
|
376
|
+
},
|
|
377
|
+
summary: {
|
|
378
|
+
rpc_total: rpcTotal,
|
|
379
|
+
errors,
|
|
380
|
+
},
|
|
381
|
+
mcp: {
|
|
382
|
+
servers: [{ name: connectorId }],
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
evidence: {
|
|
386
|
+
policy: {
|
|
387
|
+
redaction: 'default',
|
|
388
|
+
ruleset_version: SANITIZER_RULESET_VERSION,
|
|
389
|
+
},
|
|
390
|
+
artifacts: artifactList,
|
|
391
|
+
},
|
|
392
|
+
};
|
|
393
|
+
// Write POPL.yml
|
|
394
|
+
const poplYmlPath = join(entryPath, 'POPL.yml');
|
|
395
|
+
const poplYmlContent = yaml.stringify(poplDoc);
|
|
396
|
+
await writeFile(poplYmlPath, poplYmlContent, 'utf-8');
|
|
397
|
+
return {
|
|
398
|
+
success: true,
|
|
399
|
+
entryId,
|
|
400
|
+
entryPath: toRelativePath(entryPath, outputRoot),
|
|
401
|
+
poplYmlPath: toRelativePath(poplYmlPath, outputRoot),
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
return {
|
|
406
|
+
success: false,
|
|
407
|
+
error: error instanceof Error ? error.message : String(error),
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
}
|
|
198
411
|
/**
|
|
199
412
|
* List existing POPL entries
|
|
200
413
|
*/
|