(paths: DecisionPaths, active: ActiveDecision[])
| 224 | * O(active), not O(history). |
| 225 | */ |
| 226 | export function writeSnapshot(paths: DecisionPaths, active: ActiveDecision[]): void { |
| 227 | const tmp = `${paths.snapshot}.tmp.${process.pid}`; |
| 228 | writeFileSync(tmp, JSON.stringify(active), "utf-8"); |
| 229 | renameSync(tmp, paths.snapshot); |
| 230 | } |
| 231 | |
| 232 | /** Read the bounded active snapshot. Returns [] if missing/corrupt (caller may rebuild). */ |
| 233 | export function readSnapshot(paths: DecisionPaths): ActiveDecision[] { |
no outgoing calls
no test coverage detected