beadboard/package.json

72 lines
6.4 KiB
JSON
Raw Permalink Normal View History

2026-02-11 17:42:51 -08:00
{
"name": "beadboard",
"version": "0.1.0",
"private": true,
"license": "MIT",
"bin": {
"beadboard": "bin/beadboard.js",
"bb": "bin/beadboard.js"
},
2026-02-11 17:42:51 -08:00
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint .",
2026-02-11 17:42:51 -08:00
"typecheck": "tsc --noEmit",
[beadboard] Add agent-dispatch and agent-status API routes ## Context The Dispatch-to-Agent button in the right-panel (previous commit) calls two endpoints that did not yet exist server-side: - `POST /api/agent-dispatch` — resolve the bead via the same Dolt pool the existing `/api/beads/read` route uses, build a prompt from it, and forward to `claude-agent-service`'s `/execute` endpoint with a bearer token. This is the server-side trust boundary: the bearer token lives in env (never in the browser), and the bead is re-read from Dolt (never trusted from the client payload) so a malicious client cannot inject a prompt. - `GET /api/agent-status` — proxy `claude-agent-service`'s `/health` endpoint (which already returns `{status, busy}`), with a 2 s in- memory cache so 5 s UI polls across multiple open tabs don't hammer the service. The claude-agent-service serialises jobs behind an `asyncio.Lock` — a second `/execute` while one is running returns HTTP 409 "Agent is busy". We surface that 409 through to the browser unchanged so the UI can show the right toast/status line without re-mapping status codes. ``` client ──► /api/agent-dispatch ──► claude-agent-service /execute │ (asyncio.Lock guards) └─► reads bead from Dolt pool (same path as /api/beads/read) └─► buildDispatchPrompt(bead) └─► POST {prompt, agent, budget, timeout} + Bearer token client ──► /api/agent-status (2s cache) ──► /health ──► {busy: bool} ``` ## This change ### `src/app/api/agent-dispatch/route.ts` - `POST {taskId: string}` handler. - Validates JSON body and non-empty taskId (→ 400). - Early 500 if `CLAUDE_AGENT_SERVICE_URL` or `CLAUDE_AGENT_BEARER_TOKEN` is missing — fail fast, fail loud. - Resolves the bead via `readIssuesFromDisk({preferBd: true})`, which uses the existing Dolt client (and falls back to `issues.jsonl`). Filtering by id after is acceptable at BeadBoard's scale (~hundreds of beads) and avoids introducing a new single-bead query path. - 400 when the bead is missing, or when `acceptance_criteria?.trim()` is empty — defense in depth alongside the UI disable. The button should already hide in these cases, but a curl'd POST must still be rejected. - Forwards to `${CLAUDE_AGENT_SERVICE_URL}/execute` with agent `beads-task-runner`, max_budget_usd 5, timeout_seconds 900 (matches the values in the task spec). - Passes through 409 verbatim. Other upstream errors collapse to 502. ### `src/app/api/agent-status/route.ts` - `GET` handler, module-level snapshot cache with 2 s TTL to avoid hammering `/health`. - In-flight de-dup: a single pending `fetchRemoteStatus()` is shared across concurrent requests so we only hit the upstream once per window even under bursty load. - When `CLAUDE_AGENT_SERVICE_URL` is unset, returns `{busy: false}` and skips the fetch entirely — this is how the dev server boots before the service env is configured. - HTTP 503 from upstream is interpreted as `busy: true` (future-proofing in case the service swaps 409 for 503 on overload). - Any network error degrades gracefully to `{busy: false}` — the 409 path on `/api/agent-dispatch` is the authoritative gate. ### Test coverage - `tests/api/agent-dispatch-route.test.ts` (3 cases): invalid JSON body, missing taskId, missing env returns 500. - `tests/api/agent-status-route.test.ts` (3 cases): unset service URL returns `{busy: false}` without a fetch, `/health busy:true` proxies through, HTTP 503 maps to busy=true. Uses a `globalThis.fetch` stub and cache-busting query params on dynamic import so each case starts from a fresh module snapshot. ## What is NOT in this change - End-to-end happy-path coverage (bead loads, fetch returns 200, route yields job_id) would require mocking `readIssuesFromDisk` — that's a bigger refactor than this commit warrants. Live integration happens once the pipeline is wired. - No retry/backoff on upstream failures. 502 passes through; the client decides whether to retry. - No auth on the routes themselves — they inherit the Next.js app's session model (same as all other `/api/*` routes today). ## Test Plan ### Automated ``` $ node --import tsx --test tests/api/agent-dispatch-route.test.ts \ tests/api/agent-status-route.test.ts # tests 6 pass 6 fail 0 duration_ms 1560 ``` All six route cases pass. Typecheck output shows only the pre-existing `OrchestratorChatMessage` gap in `left-panel.tsx`. Lint output is unchanged from `main` (1 pre-existing `no-require-imports` error in `src/lib/bb-pi-bootstrap.ts`). ### Manual Verification 1. Export env: ``` export CLAUDE_AGENT_SERVICE_URL=http://claude-agent-service.claude-agent.svc.cluster.local:8080 export CLAUDE_AGENT_BEARER_TOKEN=$(vault kv get -field=api_bearer_token secret/claude-agent-service) ``` 2. `npm run dev` 3. `curl -s http://localhost:3000/api/agent-status` → `{"busy":false}` (if the service is reachable; `{"busy":true}` if a job is running). 4. `curl -X POST http://localhost:3000/api/agent-dispatch \ -H 'content-type: application/json' \ -d '{"taskId":"beadboard-xyz"}'` - 400 if bead does not exist or lacks acceptance criteria. - 200 `{"job_id":"..."}` on success. - 409 `{"error":"Agent is busy"}` when an agent is already running. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 14:07:21 +00:00
"test": "node --test tests/bootstrap.test.mjs && node --import tsx --test tests/pr14-critical-bugs.test.ts && node --import tsx --test tests/components/shared/base-card.test.tsx && node --import tsx --test tests/components/shared/agent-avatar.test.tsx && node --import tsx --test tests/components/sessions/sessions-header.test.ts && node --import tsx --test tests/components/sessions/agent-station-logic.test.ts && node --import tsx --test tests/lib/parser.test.ts && node --import tsx --test tests/lib/pathing.test.ts && node --import tsx --test tests/components/shared/left-panel.test.tsx && node --import tsx --test tests/components/shared/top-bar.test.tsx && node --import tsx --test tests/components/shared/mobile-nav.test.tsx && node --import tsx --test tests/components/swarm/swarm-card.test.tsx && node --import tsx --test tests/hooks/url-state-integration.test.ts && node --import tsx --test tests/hooks/use-graph-analysis.test.ts && node --import tsx --test tests/components/graph/smart-dag.test.tsx && node --import tsx --test tests/components/unified-shell.test.tsx && node --import tsx --test tests/components/blocked-triage-modal.test.tsx && node --import tsx --test tests/components/graph/graph-node-labels.test.tsx && node --import tsx --test tests/components/graph/graph-node-assign.test.tsx && node --import tsx --test tests/components/graph/graph-node-conversation.test.tsx && node --import tsx --test tests/lib/coord-schema.test.ts && node --import tsx --test tests/lib/install-manifest.test.ts && node --import tsx --test tests/lib/runtime-manager.test.ts && node --import tsx --test tests/lib/coord-events.test.ts && node --import tsx --test tests/api/coord-events-route.test.ts && node --import tsx --test tests/lib/coord-projections-inbox.test.ts && node --import tsx --test tests/lib/coord-projections-reservations.test.ts && node --import tsx --test tests/components/sessions/conversation-drawer-coord.test.tsx && node --import tsx --test tests/scripts/beadboard-launcher.test.ts && node --import tsx --test tests/scripts/beadboard-launcher-runtime.test.ts && node --import tsx --test tests/scripts/beadboard-launcher-status-text.test.ts && node --import tsx --test tests/scripts/install-wrappers-contract.test.ts && node --import tsx --test tests/scripts/install-sh-smoke.test.ts && node --import tsx --test tests/scripts/install-legacy-migration.test.ts && node --import tsx --test tests/scripts/installer-ci-contract.test.ts && node --import tsx --test tests/docs/installer-quickstart-contract.test.ts && node --import tsx --test tests/docs/runtime-manager-adr-contract.test.ts && node --import tsx --test tests/cli/beadboard-cli.test.ts && node --import tsx --test tests/cli/beadboard-bin-routing.test.ts && node --import tsx --test tests/cli/beadboard-help-output.test.ts && node --import tsx --test tests/skills/beadboard-driver/resolve-bb.test.ts && node --import tsx --test tests/skills/beadboard-driver/session-preflight.test.ts && node --import tsx --test tests/skills/beadboard-driver/generate-agent-name.test.ts && node --import tsx --test tests/skills/beadboard-driver/readiness-report.test.ts && node --import tsx --test tests/skills/beadboard-driver/skill-local-runner.test.ts && node --import tsx --test tests/skills/beadboard-driver/diagnose-env.test.ts && node --import tsx --test tests/skills/beadboard-driver/heal-common-issues.test.ts && node --import tsx --test tests/lib/epic-graph.test.ts && node --import tsx --test tests/components/shared/left-panel-filtering.test.ts && node --import tsx --test tests/hooks/use-beads-subscription-contract.test.ts && node --import tsx --test tests/components/graph/dependency-graph-hide-closed-contract.test.ts && node --import tsx --test tests/components/shared/unified-shell-hide-closed-contract.test.ts && node --import tsx --test tests/lib/agent-registry.test.ts && node --import tsx --test tests/api/agents-mail.test.ts && node --import tsx --test tests/skills/beadboard-driver/bb-mail-shim.test.ts && node --import tsx --test tests/skills/beadboard-driver/ensure-bb-mail-configured.test.ts && node -
"video": "remotion preview src/video/index.ts",
"video:render": "remotion render src/video/index.ts Main out/video.mp4",
"video:thumbnail": "remotion still src/video/index.ts Main out/thumbnail.png --frame=60"
2026-02-11 17:42:51 -08:00
},
"dependencies": {
"@mariozechner/pi-agent-core": "^0.57.1",
"@mariozechner/pi-ai": "^0.57.1",
"@mariozechner/pi-coding-agent": "^0.57.1",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"@radix-ui/react-avatar": "^1.1.11",
"@radix-ui/react-dialog": "^1.1.15",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-label": "^2.1.8",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"@radix-ui/react-scroll-area": "^1.2.10",
"@radix-ui/react-select": "^2.2.6",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"@radix-ui/react-separator": "^1.1.8",
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-tabs": "^1.1.13",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"@radix-ui/react-tooltip": "^1.2.8",
"@remotion/google-fonts": "^4.0.422",
"@remotion/tailwind": "^4.0.422",
"@remotion/zod-types": "^4.0.422",
"@sinclair/typebox": "^0.34.48",
"@xyflow/react": "^12.10.0",
"chokidar": "^5.0.0",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"dagre": "^0.8.5",
"framer-motion": "^11.18.2",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"lucide-react": "^0.564.0",
"mysql2": "^3.18.2",
2026-02-11 17:42:51 -08:00
"next": "15.5.7",
"react": "19.2.1",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"react-dom": "19.2.1",
"remotion": "^4.0.422",
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
"tailwind-merge": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"tsx": "^4.21.0",
"zod": "3.22.3"
2026-02-11 17:42:51 -08:00
},
"devDependencies": {
"@playwright/test": "^1.58.2",
"@remotion/cli": "^4.0.422",
"@types/dagre": "^0.7.53",
2026-02-11 17:42:51 -08:00
"@types/node": "^22.10.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"autoprefixer": "^10.4.24",
"eslint": "9.39.2",
"eslint-config-next": "^15.5.7",
"playwright": "^1.58.2",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
2026-02-11 17:42:51 -08:00
"typescript": "^5.7.2"
}
fix: recover from mass file corruption incident (2026-02-15) INCIDENT SUMMARY: A catastrophic corruption event affected the working directory, with null bytes (0x00) overwriting content in dozens of files including: - package.json (corrupted) - tailwind.config.ts (corrupted) - All modified tracked files - Untracked directories (components/ui/, node_modules/, .next/) ROOT CAUSE: Unknown - files were filled with null bytes, destroying their content. RECOVERY PROCESS: 1. Discovered corruption when npm run dev failed with EJSONPARSE 2. Checked git diff --stat - showed many files as "binary" 3. Found dangling stash commits (0d80ad9, a1a33cf) containing our work 4. Restored tracked files from stash: git checkout a1a33cf -- . 5. Removed corrupted untracked directories (node_modules, .next, components/ui) 6. Reinstalled dependencies: npm install 7. Reinitialized shadcn/ui: npx shadcn@latest init 8. Reinstalled shadcn components: npx shadcn@latest add button card ... 9. Recreated earthy-dark tokens (bb-ui2.1) - lost in shadcn init overwrite 10. Verified all closed bb-ui2 beads still had their deliverables DATA PRESERVED: - All tracked source code (recovered from git stash) - .beads/issues.jsonl (recovered from stash) - All bead history and metadata DATA LOST: - Uncommitted changes to untracked files - Earthy-dark tokens (recreated from bead spec) - components/ui/ (regenerated from shadcn) LESSONS LEARNED: 1. Commit work frequently - untracked changes are not protected 2. Git stash captures tracked files only 3. shadcn init overwrites globals.css - preserve tokens separately 4. Dangling commits can save the day VERIFICATION POST-RECOVERY: - npm run typecheck: PASS - npm run lint: PASS - npm run test: PASS - All bb-ui2 closed bead deliverables present CLOSES: bb-silver-castle (triage bead for this incident)
2026-02-15 21:19:58 -08:00
}