🤖
AI Session Handoff — Castle Checkers (Caretaker Portal)

Read this before making any code changes. The FUSE-safe commit pattern is mandatory — deviating from it causes silent corruption.

Critical Rules

RuleWhy
Write files to /tmp first — never directly to FUSE pathFUSE mount silently truncates large file writes — both disk and git blob end up identically truncated so verification passes on a corrupted blob
Use /tmp/cc-git git env — never git -C <FUSE_path>FUSE git config is unreadable — git commands fail or return empty silently
Strip null bytes before hashing: raw.rstrip(b'\x00')Edit/Write tools append null bytes to files on FUSE mounts
TypeScript strict: remove ALL unused vars before commitTS6133 = Cloudflare Pages build failure — not caught locally
App.tsx at src/App.tsx — NOT src/components/App.tsxmain.tsx imports ./App from src root — wrong path = TS2307
Parent commit = last PUSHED SHA — hardcode itUnpushed intermediate commit as parent pulls bad trees into push pack — GitHub rejects

Where Things Live

ItemPath
Project rootE:\Claude_Projects\sonan-trackers\caretaker-portal-Claude\caretaker-portal\
Workerworker/index.ts
Frontend entrysrc/main.tsxsrc/App.tsx
Global statesrc/context/AppContext.tsx
Admin shellsrc/components/AdminApp.tsx
API layersrc/api.ts
D1 migrationsmigrations/0001_init.sql, migrations/0002_settings_seed.sql

Likely Next Tasks

If picking up from here: complete the Cloudflare Pages deployment (custom domain, env var VITE_API_URL), set JWT_SECRET Worker secret, and run D1 migrations. See the Deployment page for exact commands.

To add email notifications for new service requests: integrate Resend in Worker's POST /api/requests handler. Add RESEND_API_KEY as Worker secret.