🤖
AI Session Handoff — Bernie's Backyard Lawncare Portal

Read before making any code changes. FUSE-safe commit rules are mandatory.

Critical Rules

RuleWhy
Write files to /tmp first — never to FUSE path directlyFUSE silently truncates large writes — both disk and blob end up identically wrong
Use /tmp/lc-git — never git -C <FUSE_path>FUSE git config is unreadable
Strip null bytes: raw.rstrip(b'\x00') before hashingEdit/Write tools append null bytes on FUSE mounts
Remove ALL unused TypeScript vars before commitTS6133 = Cloudflare Pages build failure
App.tsx at src/App.tsx — not src/components/App.tsxmain.tsx imports ./App from src root
Parent = last PUSHED commit SHA — hardcode itUnpushed intermediate commit = GitHub push rejection

Where Things Live

ItemPath
Project rootE:\Claude_Projects\sonan-trackers\lawncare-portal\
Workerworker/index.ts
Frontend entrysrc/main.tsxsrc/App.tsx
State + configsrc/context/AppContext.tsx
Admin shellsrc/components/AdminApp.tsx
D1 migrationsmigrations/0001_init.sql, migrations/0002_settings_seed.sql
D1 IDf029e545-6c71-4762-8776-fd4f930264df (lawncare_db)

FUSE-Safe Commit (Summary)

# 1. Write file to /tmp/MyFile.tsx (Python, not FUSE path)
# 2. Rsync FUSE .git/objects/ → /tmp/lc-git/.git/objects/
# 3. Hash: data = open('/tmp/MyFile.tsx','rb').read().rstrip(b'\x00')
#    sha = subprocess.run(['git','hash-object','-w','--stdin'], input=data, cwd='/tmp/lc-git')
# 4. Build trees with Python ls_tree/mktree (never shell printf/grep)
# 5. git commit-tree <tree> -p <LAST_PUSHED_SHA> -m "..."
# 6. Rsync objects back to FUSE; write ref to .git/refs/heads/main
# 7. Provide: git push origin <sha>:refs/heads/main

Next Steps

Portal is code-complete. Remaining: run D1 migrations on remote DB, set JWT_SECRET, deploy Worker, set Pages env var, fix Pages output dir to dist (no trailing space), add custom domain.