Lines 243-283typescript
251 repairs: Record<string, number>;
252 accepted_findings: FindingRef[];
255function statePath(runId: string): string {
256 return join(getRunDir(runId), "pipeline-submit.json");
259function readState(runId: string): SubmitState {
260 const p = statePath(runId);
261 if (!existsSync(p)) return { repairs: {}, accepted_findings: [] };
262 assertSafeStateDirectory(projectRoot(), [".scratchpad", basename(dirname(p))]);
263 assertSafeRegularFile(p, "Pipeline state");
264 const raw = JSON.parse(
265 readSafeFile(p, "Pipeline state").toString("utf8"),
LowWeak Crypto
Package source references weak cryptographic algorithms.
packages/pi-casefile/src/pipeline-submit.tsView on unpkg · L263 266 ) as Partial<SubmitState>;
267 if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
268 throw new Error(`Corrupt pipeline-submit state for ${runId}: root must be an object`);
270 const repairs = raw.repairs ?? {};
271 if (typeof repairs !== "object" || repairs === null || Array.isArray(repairs)) {
272 throw new Error(`Corrupt pipeline-submit state for ${runId}: repairs must be an object`);
274 for (const [k, v] of Object.entries(repairs)) {
275 if (typeof k !== "string" || typeof v !== "number" || !Number.isInteger(v) || v < 0) {
276 throw new Error(`Corrupt pipeline-submit state for ${runId}: invalid repair counter`);
279 const accepted = raw.accepted_findings ?? [];
280 if (!Array.isArray(accepted)) {
282 `Corrupt pipeline-submit state for ${runId}: accepted_findings must be an array`,