Versions 148 to 149
new file, 177 lines
4+
20+
22+const checksum = (value: unknown): string => createHash("sha256").update(JSON.stringify(value)).digest("hex");
24+ checksum([header.format, header.id, header.seq, header.digest, fields.map((field) => header.counts[field])]);
25+
26+function shape(value: unknown, keys: readonly string[]): asserts value is Record<string, unknown> {
36+const integer = (value: unknown): value is number => Number.isSafeInteger(value) && Number(value) >= 0;
38+ typeof value === "string" && /^a(0|[1-9][0-9]*)$/.test(value) && integer(Number(value.slice(1)));
43+const parent = (value: unknown) => typeof value === "string" && (value.startsWith("^") || lineId(value));
46+ if (!(field === "deps" ? atomId(value) : field === "deletes" ? lineId(value) : typeof value === "string"))
66+
76+ if (!/^[a-f0-9]{64}$/.test(digest) || !Number.isSafeInteger(atom.seq) || atom.seq < 0 || atom.id !== `a${atom.seq}`)
80+ if (this.storage.read(name, "header") !== undefined) throw Error("projection atom index already exists");
88+ ? { file: atom.inserts[i]!.file, parent: atom.inserts[i]!.parent, lines: atom.inserts[i]!.lines.length }
98+ this.storage.write(name, "header", { ...header, checksum: headerChecksum(header) } satisfies Header);
109+
128+ fields.some((field) => !Number.isSafeInteger(header.counts[field]) || header.counts[field] < 0)
152+
172+
174+export function indexAcceptedProjectionAtom(atom: Atom, files: readonly string[], storage: GraphStateStorage): void {
- MCP
- compare on this site's /mcp
- CLI
- abso diff 148 149 src/engine/experimental/projection-atom-index.ts --json
- JSON
- /christopher/abso-core/compare/148..149?file=src%2Fengine%2Fexperimental%2Fprojection-atom-index.ts&format=json