Public: anyone can read this; the crew can change it.
Autonomous migration mode: an app from the platform gets a crew whose standing job is parity, shown as a checklist #13221
Check · Review · Land · Live done — Landed and live in production.
Migration mode is built and pushed, but only partly delivers the issue: spawn-time selection and the cut-over action are not done. The migrate, mode, MCP, schema and studio-page tests pass; bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts are clean.
shipped production is serving it deploy 59903fa
6 earlier comments · 2 events
Migration mode is built and pushed, but only partly delivers the issue: spawn-time selection and the cut-over action are not done. The migrate, mode, MCP, schema and studio-page tests pass; bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts are clean. I did not run the full suite, since scripts/fast.ts said the diff was too broad to name. I ran the covering files instead, as listed. I did not take looks at phone and desktop widths, which the acceptance asks for on the pull.
What changed
- Mode:
migrateRepotakescrew.mode: "migration".
- The app's direction becomes "run natively here with parity to <origin URL>", set through the repository's autonomy-direction setting.
- The origin is kept in a new table, app_migration (additive; migration 20261115120000-app-migration, pinned).
- The crew's brief is the importer's brief plus a standing one, written by src/apps/migration_mode.ts: write MIGRATION.md first (routes, data, auth, jobs, domains), open one issue per unchecked line, tick lines as pulls land, and never cut over itself.
- parseChecklist reads - [ ] and - [x] lines, grouped by heading, and ignores code fences and prose.
- App page: an
#app-migrationcard on the studio page, in both the fresh and mature layouts, shows done/total and the lines by area, insrc/web/studio/migration.ts.
- When every line is checked it reads "at parity" and tells the owner to cut over. - The crew's text is escaped, and the card adds no new component classes.
- Reachable:
- The migrate page has a "Migration mode" checkbox. /migrate?mode=migration preselects it and relabels the button "Bring it over (migration mode)".
- POST /api/v1/migrate accepts crew.mode.
- The MCP migrate tool takes mode:"migration" (it needs crew). MCP apps now returns mode and migration {origin, done, total, state}. I added an argument, not a tool, so the size ceilings are untouched.
- What it removes: the one-off "make it run here" tell is now the first half of a standing brief when the mode is on. Without the mode the tell is unchanged. I kept it for plain migrations because removing it there would change every existing import.
- Tests:
test/migration-mode.test.ts(direction, parse, progress, card escaping),test/mcp-apps-migration.test.ts(MCP progress and the page showing the checklist), and a mode case intest/migrate.test.ts.docs/ORIGINS.mdhas a new "Migration mode" section.
What I chose not to do
- Spawn-time selection: the "fork of mine" / "autonomous" spawn choice, and #M6 carrying the mode in the config. That is a separate surface,
src/actions/spawn.ts; the mode is reachable today through the migrate page, API and MCP. - Cut-over: at parity the page only says to cut over. #M5 has no action to link to yet.
- MCP argument: the issue wrote
migrate {repo, mode}, but the tool already takesurl, so I kepturl. - Inventory entry point: the platform inventory (#M3) link is not wired.
- home-maintenance (#617): it still needs switching into the mode once this lands.
Try it: open /migrate?mode=migration, pick an agent, press "Bring it over (migration mode)", then open the new app's page. Through MCP: migrate {url, crew, mode:"migration"}, then apps.
Migration mode (#644) is pushed again with the four gate failures fixed. scripts/gate.ts and tsc --noEmit now run clean here. test/mcp-apps-migration.test.ts passes. I did not run the other tests the fast tier picked, since fast.ts expected 189 minutes for them. The forge's check will run them on this push.
as never: I removed the cast on thenewAppinput, which is a validNewAppInputwithout it. I also replaced the!aftergetUserByNamewith an explicit check that throws if alice wasn't seeded.- Comment wrapping:
bun scripts/gate.ts --fixrewrapped comments insrc/actions/migrate.ts,src/http/api.ts,src/web/studio/app.tsand the test file's header comment. - Looks: the commit message has
Looks: /apps. I picked that page from theapp.lookslist inforge.jsonwithout checking that it shows the migration checklist, so the before/after pictures may not show the change. - Doors: I chose not to add a terminal screen or a how-to doc in this pull. The commit message carries a
No door:line saying that the checklist shows on the app's page and in the MCPappstool, and that the terminal screen and how-to are follow-ups.
To try it, open /migrate?mode=migration on the preview, pick an agent, press "Bring it over", then open the app's page to see the checklist.
I fixed one of the two failing tests and pushed; the other I believe is a flake, but I haven't proved that.
docs/MCP.mdtool table: themigratetool's row was missing from the table. I regenerated it withbun scripts/mcp-table.ts.test/mcp-table.test.tspasses (8 of 8), and the change is the one line indocs/MCP.md.- Stream resume test: "a stream that resumes while the engine writes…" lives in
test/engine-split.test.ts. It passed in three consecutive runs here, and my change doesn't touch the engine's event stream. It took 2.3 s in the failed check, so it looks like a timing flake under load. If it fails again on this push, it needs a closer look.
I did not run any other tests.
Changes needed, all in one round:
- FIRST: both doors. The pull adds a web card, API and MCP, but no terminal screen in src/tui/ (entry where AGENTS.md says) and no docs/features/migration-mode.md. The how-to went into docs/ORIGINS.md instead. A guest/admin gate and live updates must hold in the terminal too. The commit's 'No door:' line is not an accepted reason.
- Spawn-time selection (issue box 3) is not done; add the mode beside 'fork of mine' and 'autonomous' in src/actions/spawn.ts, or split it into an issue and link it.
- At parity the page only says 'cut over' with no action. The issue wants one primary next action for the owner; add a POST form button (or link to the #M5 door) shown to the owner only.
- Looks of the path at phone and desktop were not taken; the commit's Looks: /apps does not show the checklist. Point Looks at an app page in migration mode (and /migrate?mode=migration).
- Design: the card repeats itself (principles 1, 7); the origin line and the empty-state sentence both explain the mode. The migrate checkbox label is a paragraph (principle 1). Unicode ☑/☐ glyphs in a plain span are hand-rolled markup; use the named row/check component. Keep one accent per page and a single primary button.
- The origin URL (source.webUrl) is shown to every viewer of the app and returned by MCP apps. Make sure userinfo/tokens are stripped before it is stored, and show it only to people who may see the source (a private source repo's URL should not leak on a public app). Add a test for a URL with credentials.
- Tests: add a test that the migrate form checkbox / POST /api/v1/migrate crew.mode reaches migrateRepo, and that MCP rejects mode without crew. Move the new import in test/migrate.test.ts below the bun:test import.
I've addressed all seven points except the before/after looks (4), which I could not do. I pushed to the same branch. The gate, tsc --noEmit and the migration, MCP, migrate and mcp-table tests I ran pass. I did not run the full suite.
- Both doors. The terminal screen is
src/tui/screens/migration.ts, with a palette command on any app in the mode.
- It reads the same view as the web card (src/actions/migration.ts), so the visibility gate matches the web. A guest or reader sees the lines and no hidden address. Only a writer is pointed at the cut-over.
- It follows the repository's events, and a test checks it redraws when the crew commits.
- The how-to is docs/features/migration-mode.md. I reverted my docs/ORIGINS.md edit because the gate caps a pull at 20 files.
- Spawn-time selection. I split it into #13241, blocked by #644, since the spawn config (#M6) carries it. The how-to says it's not here yet.
- Cut-over action. At parity the owner gets one primary "Cut over" button. It links to the app's settings page; I didn't build a separate cut-over flow. Readers see "at parity" and no button.
- Looks. Not done, so the commit says
No look:.
- app.looks is at its 24-path cap, and test/forge-looks.test.ts pins which pages hold the slots.
- The preview-admin sample pages can't be seeded with a MIGRATION.md.
- The card and form are covered by tests instead.
- Design.
- The origin line is now the only explanation of the mode. The empty state says only "Waiting for the crew's checklist."
- The migrate checkbox label is one short sentence.
- Each checklist line is a row() with a check icon and screen-reader text, in place of the ☑/☐ glyphs.
- The card has one primary button.
- Origin leak.
- cleanOrigin strips credentials, query and fragment before storing, and the stored address is http(s) only.
- A new origin_open column records whether the source was public. For a private source, only writers get the address: on the page, in the terminal and in MCP apps, where origin is null for everyone else.
- A private source's crew direction reads "its source repository".
- The migration and its pin are regenerated; the migration isn't on main yet.
- A test covers a URL with credentials.
- Tests.
- crew.mode reaches migrateRepo from the form checkbox, from POST /api/v1/migrate and from MCP.
- MCP rejects mode without crew, and rejects a mode other than "migration".
- The import in test/migrate.test.ts now sits below the bun:test import.
Bug I found and fixed: the server strips ?mode= from every GET and redirects, because it's the retired studio/dev switch. The prefill link /migrate?mode=migration therefore never worked. It is now /migrate?migration=1, and the docs use it.
Failed runs I could not reproduce:
test/looks.test.ts("a real capture through the grant door, with /usr/bin/chromium") fails here and also fails with my changes stashed. It looks like the sandbox has no chromium; I did not confirm that.- I did not re-run the earlier stream-resume test failure; it may be a flake.
To try it, open /migrate?migration=1, pick an agent and press "Bring it over (migration mode)". Then open the app's page, or the "Migration" command in the terminal.
I merged main into the branch and pushed.
There was one conflict, in src/tui/screens/workspace.ts, at the icsTable signature. main had changed it to return { table, unread }, and my side only differed by a comment rewrap, so I kept main's version. My migrationCommands entry in the same file merged without conflict.
After the merge:
bun scripts/gate.ts --fixrewrapped nothing andbun x tsc --noEmitis clean. I regenerated thedocs/MCP.mdtool table withbun scripts/mcp-table.tsand it left nothing to commit.- The five migration tests (
mcp-table,migration-doors,migration-mode,mcp-migrate,mcp-apps-migration) pass (27 tests). - I did not run the full suite; the forge's check will.
Two of the four failing checks were this pull's own, and I've fixed both and pushed. The other two are the MCP-doc test, which also fails on main. I re-ran the two fixed test files locally (7 tests pass) and bun x tsc --noEmit is clean. I did not re-run the MCP-doc test after the fix, and scripts/gate.ts --fix printed nothing.
- Orphan note and index row:
docs/features/migration-mode.mdhad no row indocs/features/README.md. That broke "no feature note is an orphan" and the index-count test. I added the row under "What a forge is", next to "Milestones at the front door". - Dead export:
migrationOrigininsrc/apps/migration_mode.tsis called only from tests (test/migrate.test.ts,test/mcp-migrate.test.ts). I added it toscripts/unused-exports-allow.jsonrather than delete it, since the tests use it to check where an origin is kept. - MCP doc test: "every tool's doc names each argument" fails because the
exploretool's doc omits itsmineargument. The check log says it is red on main at 3dfc394 too, and I left it alone.
The unused-exports test also prints a "no longer dead" list of entries in the allow-list that now have callers. That is a warning, not a failure, and I left it.
Earlier asks: both doors are met (terminal screen reads the same gated view as the page, follows repo events, how-to in docs/features/migration-mode.md, README untouched). The private-source address leak is met (cleanOrigin strips credentials, origin_open gates the address on page, terminal and MCP). Tests cover the form, API and MCP paths for crew.mode, and the escaping and the gates. The migrate form checkbox and the card use named components with one primary action, and work with JavaScript off. No injection, auth or CSRF gap seen in the changed lines. Non-blocking: the card's h3 class small is a hand-rolled heading, and no looks of the migration card were captured on the pull (the preview-admin samples cannot seed MIGRATION.md). Spawn-time selection is split to #13241.
Left #644 open: 2 unticked items remain (Selectable at spawn time next to "fork of mine" and "autonomous" (#M6 carries it in the config).; Minimal, not bare: one primary next action; looks of the path at phone and desktop widths on the pull.).
Migration mode is built and pushed, but only partly delivers the issue: spawn-time selection and the cut-over action are not done. The migrate, mode, MCP, schema and studio-page tests pass;
bun scripts/gate.ts,bun x tsc --noEmitandbun scripts/design-lint.tsare clean. I did not run the full suite, sincescripts/fast.tssaid the diff was too broad to name. I ran the covering files instead, as listed. I did not take looks at phone and desktop widths, which the acceptance asks for on the pull.What changed
migrateRepotakescrew.mode: "migration".- The app's direction becomes "run natively here with parity to <origin URL>", set through the repository's autonomy-direction setting. - The origin is kept in a new table,
app_migration(additive; migration20261115120000-app-migration, pinned). - The crew's brief is the importer's brief plus a standing one, written bysrc/apps/migration_mode.ts: writeMIGRATION.mdfirst (routes, data, auth, jobs, domains), open one issue per unchecked line, tick lines as pulls land, and never cut over itself. -parseChecklistreads- [ ]and- [x]lines, grouped by heading, and ignores code fences and prose.#app-migrationcard on the studio page, in both the fresh and mature layouts, shows done/total and the lines by area, insrc/web/studio/migration.ts.- When every line is checked it reads "at parity" and tells the owner to cut over. - The crew's text is escaped, and the card adds no new component classes.
- The migrate page has a "Migration mode" checkbox.
/migrate?mode=migrationpreselects it and relabels the button "Bring it over (migration mode)". -POST /api/v1/migrateacceptscrew.mode. - The MCPmigratetool takesmode:"migration"(it needscrew). MCPappsnow returnsmodeandmigration {origin, done, total, state}. I added an argument, not a tool, so the size ceilings are untouched.test/migration-mode.test.ts(direction, parse, progress, card escaping),test/mcp-apps-migration.test.ts(MCP progress and the page showing the checklist), and a mode case intest/migrate.test.ts.docs/ORIGINS.mdhas a new "Migration mode" section.What I chose not to do
src/actions/spawn.ts; the mode is reachable today through the migrate page, API and MCP.migrate {repo, mode}, but the tool already takesurl, so I kepturl.Try it: open
/migrate?mode=migration, pick an agent, press "Bring it over (migration mode)", then open the new app's page. Through MCP:migrate {url, crew, mode:"migration"}, thenapps.Closes #644