Lines 186-226typescript
186// ── Persistence ─────────────────────────────────────────────────────
196 repairs: Record<string, number>;
197 accepted_findings: FindingRef[];
200function statePath(runId: string): string {
201 return join(getRunDir(runId), "pipeline-submit.json");
204function readState(runId: string): SubmitState {
205 const p = statePath(runId);
206 if (!existsSync(p)) return { repairs: {}, accepted_findings: [] };
207 const raw = JSON.parse(readFileSync(p, "utf8")) as Partial<SubmitState>;
208 if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
LowWeak Crypto
Package source references weak cryptographic algorithms.
packages/pi-casefile/src/pipeline-submit.tsView on unpkg · L206 209 throw new Error(`Corrupt pipeline-submit state for ${runId}: root must be an object`);
211 const repairs = raw.repairs ?? {};
212 if (typeof repairs !== "object" || repairs === null || Array.isArray(repairs)) {
213 throw new Error(`Corrupt pipeline-submit state for ${runId}: repairs must be an object`);
215 for (const [k, v] of Object.entries(repairs)) {
216 if (typeof k !== "string" || typeof v !== "number" || !Number.isInteger(v) || v < 0) {
217 throw new Error(`Corrupt pipeline-submit state for ${runId}: invalid repair counter`);
220 const accepted = raw.accepted_findings ?? [];
221 if (!Array.isArray(accepted)) {
223 `Corrupt pipeline-submit state for ${runId}: accepted_findings must be an array`,
226 for (const [i, item] of accepted.entries()) {