physical.Storetypeno test imports ittype Store = { readonly records: readonly Evidence[]; readonly problems: readonly string[] };What a folder holds: its valid records and what is wrong with the files that are not.
The store of records on disk (0002-objective-evidence FR-007): the records of a folder read in the order of their paths, with a problem for each file that is not a valid record, and a record written to its place without replacing one that is there (evidence is added, never changed).
import { readStore } from "./store.ts";
(await readStore("/nonexistent")).records.length; // 0physical.Storetypeno test imports ittype Store = { readonly records: readonly Evidence[]; readonly problems: readonly string[] };What a folder holds: its valid records and what is wrong with the files that are not.
physical.readStorefunctionno test imports itfunction readStore(dir: string): Promise<Store>The records under a folder.
physical.addRecordfunctionno test imports itfunction addRecord(dir: string, e: Evidence): Promise<{ readonly kind: "ok"; readonly path: string; } | { readonly kind: "err"; readonly error: string; }>Writes a record to its place under a folder; where a file is there already it refuses, naming the path.
Storetypeno test imports ittype Store = { readonly records: readonly Evidence[]; readonly problems: readonly string[] };What a folder holds: its valid records and what is wrong with the files that are not.
readStorefunctionfunction readStore(dir: string): Promise<Store>The records under a folder.
addRecordfunctionfunction addRecord(dir: string, e: Evidence): Promise<{ readonly kind: "ok"; readonly path: string; } | { readonly kind: "err"; readonly error: string; }>Writes a record to its place under a folder; where a file is there already it refuses, naming the path.