Commit Graph
12 Commits
Author SHA1 Message Date
Theo BrowneandClaude 6800ee32ea Address dev utility review findings
Co-Authored-By: Claude <[email protected]>
2026-07-27 00:44:44 -07:00
Theo BrowneandClaude Opus 5 e7ac40404f Match the base branch's bun run docs, correct the state-dir rule
Rebasing onto the updated #4556 turned up two doc drifts: the base moved
the script list from `vp run` to `bun run`, and the state-directory
paragraph still described the fixed `userdata` preference that the mtime
tiebreak replaced.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 20:38:49 -07:00
Theo BrowneandClaude Opus 5 c92ad95fe3 Delete pending turn starts, and follow the real state directory
Three findings from Macroscope review:

- Settling `pending` rows to `interrupted` was the wrong verb. The server
  deletes them (`clearPendingProjectionTurnsByThread`) once the turn
  starts or the thread stops, and never settles one in place. They also
  cannot be settled coherently: `turn_id` is NULL, so an "interrupted"
  pending row is a terminal turn with no id, a shape no real turn has.
  Now deleted, matching the server's predicate exactly so a checkpoint
  row is never caught by it.
- `COALESCE(completed_at, requested_at)` preserved a stale completion on
  a running turn. One can carry a completion from an earlier settle that
  a later checkpoint reverted to "running" — the `...existingTurn` spread
  in ProjectionPipeline keeps the old value — and dating the interruption
  to that checkpoint gives a wrong duration. Overwritten unconditionally.
- The CLI hard-coded `<base>/userdata/state.sqlite` while a dev server
  under an implicit dev home stores state in `<base>/dev`. A main-checkout
  `bun run dev` was therefore unseedable, and said so by claiming no
  database existed and suggesting the user start the server that was
  already running. Source and target now follow whichever directory holds
  a database, `userdata` breaking the tie; attachments follow the same
  directory. Verified both a dev-only target and the precedence order.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 20:38:49 -07:00
Theo BrowneandClaude Opus 5 373e7919d1 Harden dev:seed against state it cannot settle
Review of the seeding path found five ways a seeded database could
describe something the copy cannot back up:

- Nothing stopped `dev:seed` from running against a live server. SQLite
  locking lets the seed take the write lock between the server's own
  writes and commit cleanly; what it cannot do is tell that server its
  projections and event log were replaced underneath it. Refuse instead,
  via a pid probe over both state directories.
- A thread copied mid-turn kept `state = 'running'`. The session override
  did not cover it — the turn is read independently, and an unsettled one
  leaves the thread spinning and its timeline unfoldable forever. Settle
  those to "interrupted", matching what the server does when a session
  leaves "running". Streaming messages are finished for the same reason.
- Attachment metadata was copied without the files behind it, so a seeded
  thread rendered an image whose request 404s. Report the referenced ids
  and copy the matching files alongside the rows.
- Orphaned `provider_session_runtime` rows survived the seed naming
  threads it had just deleted, which the session reaper then tried to
  stop against a provider instance the worktree may not define.
- `--threads` had no upper bound, so a large enough value died with "too
  many SQL variables" after the target was already emptied.

Also corrects the projector-cursor comment: `orchestration_events.sequence`
is AUTOINCREMENT, so emptying the log does not reset its high-water mark
and sequence does not restart at 1. Zero remains the right cursor, for the
reason now stated.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 20:38:48 -07:00
Theo Browne 180070865e Add dev pairing and seed utilities 2026-07-26 20:38:23 -07:00
Theo Browne 89c5a192f4 fix(dev): skip browser-blocked ports (#4608) 2026-07-26 20:26:21 -07:00
Theo BrowneandClaude Opus 5 23b5502217 feat(dev): Make t3 code dev instances shareable over Tailscale (#4556)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 19:48:09 -07:00
Theo BrowneandClaude Opus 5 a17cbc3b40 feat(dev): keep worktree dev state isolated on T3 Code dev servers (#4555)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 15:26:59 -07:00
Julius Marmingeandcodex 4f11740510 Add isolated app testing workflow (#4121)
Co-authored-by: codex <[email protected]>
2026-07-19 11:57:58 +02:00
Kriday DaveandJulius Marminge f9a4f59930 Fix documented task-runner commands (bun run -> vp) (#3965)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 20:35:24 +02:00
Julius Marmingeandcodex 3e01c4bc57 Migrate desktop auth to Clerk bridge (#3092)
Co-authored-by: codex <[email protected]>
2026-06-19 10:28:28 -07:00
Julius Marminge ec18938bf9 Restructure documentation into topical folders (#2963) 2026-06-04 20:03:12 -07:00