Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

fix(dx): test:e2e filter + stale portless takeover + uuid-v7 doc sync - #56

Merged
pascal-klesse merged 3 commits into
mainfrom
fix/fix-llm-dx-cluster
May 2, 2026
Merged

fix(dx): test:e2e filter + stale portless takeover + uuid-v7 doc sync#56
pascal-klesse merged 3 commits into
mainfrom
fix/fix-llm-dx-cluster

Conversation

@pascal-klesse

Copy link
Copy Markdown
Member

Fixes three small DX findings from the LLM-test in one PR.

Summary

1. test:e2e accepts a path filter (medium · DX)

vitest run e2e-spec stories --passWithNoTests baked positional
filename patterns into the script, so bun run test:e2e tests/stories/foo.story.test.ts
unioned the bake-in patterns with the user path and ran the whole
suite (~70s) instead of the requested file (~20s). QUICKSTART.md's
"TDD cycle template" promised the filter worked.

Drop the patterns; vitest's configured include glob already picks up
tests/**/*.{spec,test,e2e-spec,story.test}.ts. A user-supplied path
now narrows the run as documented. Story test pins the script
content.

2. Stale portless registration takeover (medium · DX)

Hard-killing bun --watch (SIGKILL, OOM, terminal closed) leaves a
stale entry in ~/.portless/routes.json. The next bun run dev then
aborts with RouteConflictError even though the holder is gone.

Add a defence-in-depth pass before portless run: read the routes
file, probe the existing PID with process.kill(pid, 0), and let the
new pure planner decideRegistrationAction decide between
take-over, block-with-error, and no-existing. Only take-over
emits --force, and only when the existing PID is dead AND not the
current process — same-PID self-conflict would otherwise SIGTERM us.

Pure planner in src/core/dev/portless.ts, thin I/O runner in
src/core/dev/portless-routes-runner.ts. 5 planner stories + 13 unit
tests of the I/O glue + 1 structural story over scripts/dev.ts.

3. UUID-default doc sync (low · doc-gap)

prisma/CLAUDE.md claimed every model uses uuid_generate_v7() but
the entire core schema and Better-Auth tables use @default(uuid())
(v4); only prisma/features/geo.prisma uses v7. Rewrite the section
to reflect reality, recommend v7 for new feature-gated schemas, leave
existing models on v4 for backwards compatibility, and note a TBD
migration path.

Test plan

  • bun run lint
  • bun run format
  • bun run test:types
  • bun run test:unit
  • bun run test:e2e (2598 tests pass)
  • bun run test:coverage (Lines 92.97%, threshold 70%)
  • bun run build
  • Manual: bun run test:e2e tests/stories/test-e2e-script.story.test.ts runs only the requested file

🤖 Generated with Claude Code

Ralph Loop and others added 3 commits May 2, 2026 23:07
The previous script `vitest run e2e-spec stories --passWithNoTests`
baked positional filename patterns into the command. When a user
passed `bun run test:e2e tests/stories/foo.story.test.ts`, vitest
unioned the bake-in patterns with the user-supplied path, running the
whole suite instead of just the requested file. QUICKSTART.md's "TDD
cycle template" promised the filter worked.

Drop the patterns; vitest's configured include glob in
vitest.config.ts already picks up `tests/**/*.{spec,test,e2e-spec,story.test}.ts`.
A user-supplied path now narrows the run as documented. Doc updates
clarify the new behaviour in QUICKSTART.md and writing-story-tests.

Story test pins the script content so a future regression to the
old form fails fast.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When a previous `bun --watch` is hard-killed (SIGKILL, OOM, terminal
closed), its entry in `~/.portless/routes.json` outlives the process
and the next `bun run dev` aborts with `RouteConflictError` even
though the holder is gone.

Add a defence-in-depth pass before `portless run`: read the routes
file, probe the existing PID with `process.kill(pid, 0)`, and let the
new pure-planner `decideRegistrationAction` choose between
`take-over`, `block-with-error`, and `no-existing`. Only `take-over`
sets `--force`, and only when the existing PID is dead AND not the
current process (same-PID self-conflict would otherwise SIGTERM us).

The planner is fully covered (5 stories + 2 unit tests of the
emit-`--force` path); the I/O glue (route file lookup, PID liveness)
is exercised via PORTLESS_STATE_DIR override; the runner-level
contract is pinned by a structural story over scripts/dev.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
prisma/CLAUDE.md claimed "ID columns use the project's UUID v7
generator" with `@default(dbgenerated("uuid_generate_v7()"))`, but
every model in `prisma/schema.prisma` (including all Better-Auth
managed tables and the Example reference model) uses
`@default(uuid())` — only `prisma/features/geo.prisma` uses v7.

Rewrite the section to reflect reality: existing models stay on v4
for backwards compatibility; new feature-gated schemas SHOULD use v7
for B-tree friendliness; new always-loaded models prefer v7 once the
extension is verified. Add a TBD migration note for flipping an
existing model so future readers know the path is unfinished, not
forbidden.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pascal-klesse
pascal-klesse force-pushed the fix/fix-llm-dx-cluster branch from 63014fb to 44c0e5c Compare May 2, 2026 21:07
@pascal-klesse
pascal-klesse merged commit b870754 into main May 2, 2026
10 checks passed
@pascal-klesse
pascal-klesse deleted the fix/fix-llm-dx-cluster branch May 4, 2026 12:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant