Commit Graph

10 Commits

Author SHA1 Message Date
amianthus
579d7b3132 feat: 🎸 empty drizzle for dw 2026-05-17 15:49:55 +01:00
John Yeo
1d35a6180b cleanup 2026-05-17 10:26:49 +01:00
amianthus
fe222b9945 fix(dw): 🐛 run bun install at start of setup so fresh worktrees have tsx
Conductor/Superset clone a bare worktree with no node_modules. The
legacy .superset/setup.sh ran bun install; cmdSetup did not, so
drizzle-kit generate (which executes the temp .ts drizzle config via
NODE_OPTIONS=--import tsx) failed with ERR_MODULE_NOT_FOUND for tsx. Now
cmdSetup runs bun install at the very top — Bun no-ops when lockfile
matches, so the cost on repeat runs is negligible.
2026-05-16 15:13:51 +01:00
amianthus
8274cc7510 feat(dw): 🎸 split provisioning from dev server for orchestrator setup/run/teardown
Conductor and Superset distinguish setup (one-shot provisioning on
workspace creation), run (restartable dev server bound to the Run
button's pane), and teardown (cleanup on deletion). The single 'bun dw'
entrypoint conflated all three. Splits cmdDefault into cmdSetup
(provision only, returns the registry entry) and cmdRun (load entry,
kill ports, startDev inline). Adds startDev opts.allowTmux so cmdRun
forces inline regardless of TTY — the Run pane owns the process. Direct
CLI 'bun dw' still works byte-for-byte via the default.ts shim. Replaces
.superset/setup.sh and .conductor/config.json with the three-field {
setup, run, teardown } shape pointing at the new subcommands. Adds
scripts/dw/README.md as the agent-facing guide.
2026-05-16 15:10:14 +01:00
amianthus
a065c37649 feat(dw): 🎸 add identify subcommand for current worktree stack info
Prints the current worktree's server URL, vite URL, tmux session, and
ports in both a human-readable block and a KEY=value block for shell
eval. Canonical worktree gracefully shows direct localhost ports with no
tmux. Useful for agents landing in a Conductor/Superset-spawned worktree
to discover their stack.
2026-05-16 15:09:38 +01:00
amianthus
9d4b1c0321 fix(dw): 🐛 rewrite env.local files after reset reprovisions
cmdReset deleted all managed .env.local files and reprovisioned the Neon
branch but never re-wrote the env files. Subsequent commands had no
DATABASE_URL / AUTUMN_TEST_BASE_URL and silently ran against default
localhost targets. Now calls writeEnvLocalFiles with the
freshly-provisioned entry. Also adds BRANCH_NAME_RE guard before rmSync
on the drizzle-local directory.
2026-05-16 15:08:02 +01:00
amianthus
93e4b8fe28 fix(dw): 🐛 guard rmSync against malformed branch names in reconcile
The deleteBranch call was correctly gated by BRANCH_NAME_RE, but the
subsequent rmSync of drizzle-local/<branchName> was not. A crafted
branchName like '../../etc' could trigger recursive deletion of
unintended paths. Restructured the orphan loop so a single regex guard
covers both deletion paths.
2026-05-16 15:07:53 +01:00
amianthus
47f4dfbda6 fix(dw): 🐛 use readdirSync instead of shelling out to ls
Bun.spawnSync([ls, dir]) was fragile on Windows and mishandled filenames
with spaces. Switched to readdirSync from node:fs, which is already in
scope.
2026-05-16 15:07:44 +01:00
amianthus
7027470fb2 fix(dw): 🐛 fail fast when portless alias registration fails
Previously logged to stderr and continued, leaving dev startup
proceeding with broken wtN.localhost URLs. Now calls fatal() so the
caller halts before downstream code uses the invalid alias.
2026-05-16 15:07:12 +01:00
amianthus
25e920bbd3 feat(dw): 🎸 parallel agent worktrees with isolated infra + test harness
bun dw spins up a fully isolated per-worktree dev stack: Neon DB branch,
Dragonfly + ElasticMQ via docker compose, portless aliases, tmux
session, and emulate.dev Google OAuth. Workers, dev server, vite,
checkout, and stripe-listen run as concurrently siblings. bun setup-test
auto-runs on first dw and seeds unit-test-org via
clearOrg+setupOrg+ensureDefaultStripeAccount with 13 features + team
invites for all 5 useautumn.com members. Hardcoded localhost URLs in
test scenarios now read AUTUMN_TEST_BASE_URL/AUTUMN_TEST_VITE_URL.
preload-env.ts loads .env.local so bun t/cm/setup-test route to the
worktree server. 1265-line scripts/dw.ts split into scripts/dw/ module
(index + commands + helpers). server/src/db/initDrizzle.ts reverted to
upstream (search_path concerns solved by per-branch Neon isolation).
Workers enabled in agent worktrees now that SQS is per-worktree via
ElasticMQ.
2026-05-16 02:02:43 +01:00