# scripts/ Standalone scripts that don't fit elsewhere in the build. Each script's own header documents inputs, outputs, exit codes, and failure modes. ## Disposable local ATProto / HappyView polyfill The worktree pins the inline-bytes SDK artifact `0.0.0-sustainable.3`, using the `ink.reams.automerge` lexicon family with no wire profile tag. Library publication and independent fresh-reader reconstruction have passed against unmodified HappyView v2.14.2 with an ordinary PDS account. Whole-backup browser durability is still a separate gate; this launcher is for local development. From the Reams worktree, start the services with the SDK and provider checkouts explicitly selected. Use the SDK's service shell, which includes `sqlite3` and `pds`: ```bash nix develop /home/anish/usr/automerge-atproto --command env \ AUTOMERGE_ATPROTO_ROOT=/home/anish/usr/try-reams/.worktrees/automerge-uniform-batch-sync \ CARGO_TARGET_DIR=/home/anish/usr/try-reams/.worktrees/happyview-blob-sync/target \ HAPPYVIEW_SOURCE=/home/anish/usr/try-reams/.worktrees/happyview-polyfill-baseline \ npm run dev:atproto-local ``` The launcher starts disposable local PLC, PDS, HappyView, and Reams/Vite services, prints the generated test-account login, and streams service output. Use only the generated account: its password is intentionally printed for interactive testing, and its PDS data is removed when the launcher exits. `KEEP_ATPROTO_DATA=1` preserves that disposable data for debugging. The stack binds services to loopback; use the printed SSH forwarding command if the browser runs on another machine. Run the largest real document's library durability/transport test from the SDK worktree: ```bash nix develop /home/anish/usr/automerge-atproto --command env \ AUTOMERGE_ATPROTO_SERVICE_ROOT=/home/anish/usr/automerge-atproto \ CARGO_TARGET_DIR=/home/anish/usr/try-reams/.worktrees/happyview-blob-sync/target \ HAPPYVIEW_SOURCE=/home/anish/usr/try-reams/.worktrees/happyview-polyfill-baseline \ npm run test:inline-largest ``` ## check-mutation-baseline.mjs Deterministic regression check for the audit-flow mutation gate. Reads a `floor-map.json` baseline + a Stryker JSON report and verifies neither floor compliance nor absolute survivor counts have regressed. **Used by:** the `audit-flow` skill (`.agents/skills/audit-flow/SKILL.md`) at the mutation-gate step. The script is the single source of truth for the regression verdict; the orchestrator invokes it and reports the exit code. **Quick usage:** ```bash # Per-issue audit verification (run from the worktree): nix develop --command node ../../scripts/check-mutation-baseline.mjs \ --baseline ../../.audit-flow/floor-map.json \ --post reports/mutation/mutation.json \ --scope-files 'src/path/to/file.ts' # Sanity check the floor-map baseline against itself: nix develop --command node scripts/check-mutation-baseline.mjs \ --baseline .audit-flow/floor-map.json \ --post .audit-flow/floor-map.json ``` **Exit codes:** 0 PASS, 1 FAIL, 2 usage / IO / parse error. **Why this exists:** percentage-only floor gates allow regression to hide behind code shrinkage. This script enforces absolute survivor counts as a separate gate from percentage. See the script header for the full rationale, accepted JSON shapes, and edge cases (exempted files, planned deletions, new files).