Skip to content

fix(api): Windows isMain check + file 4 bugs from Chrome walkthrough - #81

Merged
khoks merged 1 commit into
mainfrom
chore/windows-fix-and-bug-stories
May 12, 2026
Merged

khoks merged 1 commit into
mainfrom
chore/windows-fix-and-bug-stories

Conversation

@khoks

@khoks khoks commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

First real Chrome walkthrough of the dev stack exposed 5 issues that unit tests + typecheck + format-check missed because the entrypoints only fire under a running server. One is fixed inline; four are filed.

# Story Pri Status Description
1 STORY-064 P0 fixed in this PR API silently doesn't start on Windows — isMain string-compares import.meta.url against a hand-built file://${path} URL with the wrong number of slashes. Fixed via pathToFileURL.
2 STORY-065 P1 filed Piston requires writable cgroup v2 — broken on Docker Desktop / Windows. Every Run/Submit hangs.
3 STORY-066 P0 filed /dashboard ↔ /recommended infinite redirect for any free-text target_role. Hits every self-hoster using the deterministic onboarding fallback (no API key).
4 STORY-067 P1 filed getRecommendation matches slug only — label-form input fails. Compounds STORY-066.
5 STORY-068 P0 filed No CLI to seed real tracks + problems. Fresh self-host gets demo data only — tutor has nothing to assign.

Walkthrough log

Page Result
/ landing ✓ renders
/playground ✓ renders, Monaco loads, file tree visible. Run hangs (STORY-065).
/auth/signin ✓ renders. Magic-link form works; link logged to stdout.
Magic-link callback ✓ session created, redirected to /onboarding.
/onboarding (deterministic fallback) ✓ 3-question state machine works end-to-end. Profile fields written to DB.
/dashboard ✗ ERR_TOO_MANY_REDIRECTS (STORY-066).
/recommended ✗ Same loop endpoint.
All sandbox-dependent flows ✗ blocked by STORY-065.

Test plan

  • pnpm format:check clean.
  • apps/api dev server now starts on Windows (manually verified — GET /health returns 200).
  • CI typecheck + tests pass.

🤖 Generated with Claude Code

…alkthrough

The first real /option 1/ Chrome walkthrough of the app exposed 5 issues that
CI never caught — they were all in code paths that only fire when the dev
stack is actually running end-to-end:

1. **STORY-064 (this commit, P0)**: `apps/api/src/index.ts` isMain check was
   string-comparing `import.meta.url` against a hand-built `file://${path}`
   URL. On Windows this never matches (three slashes vs two), so the server
   silently failed to start. Fixed by using `pathToFileURL().href`.

2. **STORY-065 (filed, P1)**: Piston sandbox requires writable cgroup v2;
   Docker Desktop on Windows doesn't expose it. Container restart-loops with
   `mkdir: cannot create directory 'isolate/': Read-only file system`. Every
   Run/Submit hangs for Windows self-hosters.

3. **STORY-066 (filed, P0)**: `/dashboard` ↔ `/recommended` infinite 307 loop
   for any `target_role` value not recognized by the role library — which is
   every free-text answer from the deterministic onboarding fallback. New
   self-hosters (no ANTHROPIC_API_KEY) hit this on first sign-in.

4. **STORY-067 (filed, P1)**: `getRecommendation` only matches against slug,
   not label. Onboarding's fallback writes label-form. Compounds STORY-066.

5. **STORY-068 (filed, P0)**: No `db:seed:tracks` / `db:seed:problems` CLI
   exists. Fresh self-host gets demo data only, no real tracks or problems.
   `/api/recommendation` returns empty arrays; tutor cannot assign anything.

Only #1 is fixed in this commit. The other four are filed for follow-up;
STORY-066 + STORY-068 + STORY-065 are P0/P1 release blockers for the
self-host story.
@khoks
khoks force-pushed the chore/windows-fix-and-bug-stories branch from 4453933 to c14610c Compare May 12, 2026 06:54
@khoks
khoks merged commit 59893a1 into main May 12, 2026
1 check passed
@khoks
khoks deleted the chore/windows-fix-and-bug-stories branch May 12, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant