Public: anyone can read this; the crew can change it.

One palette across the forge and its apps — restarted from the parked branch, forge side first #16779

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pull 1 of #11926 is pushed. The palette (Cmd-K) now acts on apps as well as finding them. Pull 2 (an app answering palette queries for itself through a declared endpoint in forge.json) is not started.

Notes

opened this

Pull 1 of #11926 is pushed. The palette (Cmd-K) now acts on apps as well as finding them. Pull 2 (an app answering palette queries for itself through a declared endpoint in forge.json) is not started.

What changed

  • The palette now has "Redeploy owner/name" for each app the viewer may write. While the app runs it also has "Stop owner/name". Both ask once before they run.
  • Each row posts the app's own /app/production/redeploy or /stop route, so the server's write check and same-origin check still decide. The palette adds no new way in.
  • The rows come from data the palette already reads (appActionRows in src/web/palette_rows.ts, used in paletteIndex in src/web/layout.ts). At most 8 apps get rows. Readers who can only open an app, and signed-out visitors, get none.
  • Search across apps was already there: the palette lists up to 30 visible repositories, and the search behind it adds more. Apps already carry their "App · state" label and Cmd+Enter to open them. I did not rebuild that.

What I reused: writableRepoIds, enterableApps, and the palette's existing action and POST mechanism (a, p).

Tests: I added two tests to test/palette-rows.test.ts: a unit test of appActionRows, and one that reads the page's palette index as the owner, a non-writing peer and a signed-out visitor.

  • The palette, search and snappy suites pass.
  • tsc, the design lint and gate.ts are clean.
  • The browser palette tests are skipped here because no Chromium starts in this sandbox.

Left out

  • The earlier parked branches torque/11665- and scout/11665- are not on the forge, so I could not read why those tries went red.
  • No terminal door: the commit says No door, because the palette is a web surface and the terminal's own palette already lists per-app commands.
  • No look page: the commit says No look, since only rows in an existing list change.

Try it: sign in on the preview, press Cmd-K and type "redeploy". You should see one row per app you may write. Pressing Enter twice posts it.

🤖 Generated with Claude Code

Closes #11926

3 earlier comments
commented

Pull 1 of #11926 is pushed. The palette (Cmd-K) now acts on apps as well as finding them. Pull 2 (an app answering palette queries for itself through a declared endpoint in forge.json) is not started.

What changed

  • The palette now has "Redeploy owner/name" for each app the viewer may write. While the app runs it also has "Stop owner/name". Both ask once before they run.
  • Each row posts the app's own /app/production/redeploy or /stop route, so the server's write check and same-origin check still decide. The palette adds no new way in.
  • The rows come from data the palette already reads (appActionRows in src/web/palette_rows.ts, used in paletteIndex in src/web/layout.ts). At most 8 apps get rows. Readers who can only open an app, and signed-out visitors, get none.
  • Search across apps was already there: the palette lists up to 30 visible repositories, and the search behind it adds more. Apps already carry their "App · state" label and Cmd+Enter to open them. I did not rebuild that.

What I reused: writableRepoIds, enterableApps, and the palette's existing action and POST mechanism (a, p).

Tests: I added two tests to test/palette-rows.test.ts: a unit test of appActionRows, and one that reads the page's palette index as the owner, a non-writing peer and a signed-out visitor.

  • The palette, search and snappy suites pass.
  • tsc, the design lint and gate.ts are clean.
  • The browser palette tests are skipped here because no Chromium starts in this sandbox.

Left out

  • The earlier parked branches torque/11665- and scout/11665- are not on the forge, so I could not read why those tries went red.
  • No terminal door: the commit says No door, because the palette is a web surface and the terminal's own palette already lists per-app commands.
  • No look page: the commit says No look, since only rows in an existing list change.

Try it: sign in on the preview, press Cmd-K and type "redeploy". You should see one row per app you may write. Pressing Enter twice posts it.

🤖 Generated with Claude Code

commented

The palette now offers Redeploy and Stop rows for the apps you may write, from any page, and no page runs an extra SQL statement for them. I pushed the fix, and the forge's check has to confirm it.

What was wrong: the palette's app-action rows made their own writableRepoIds query on every page. Six of the page-budget tests failed on that one extra statement (app page, /talk, /settings/crew, the pull page, the 150-repository page, the 404 suggestion). The releases-timing test failed on the extra repository read.

The fix: src/web/layout.ts now reads the writable repositories once and uses that one read twice. enterableApps in src/core/repos.ts takes it through a new optional writable argument and no longer asks for its own. The palette's app-action rows use the same set. The "who may enter this app" rule is unchanged.

Tests: tsc is clean. All six of the budget and timing tests above now pass, plus the palette-rows test. I did not touch any pinned budget.

Not fixed:

  • /llms.txt byte budget: test/llms-budget.test.ts is red on main too, so I left it.
  • Fork-pull test (#9932): the "kept fork's pull is checked on its combined commit" test didn't come up in the failure details I worked from, and I didn't run it.
  • Over-long comments: the gate noted two comment lines over 100 columns in src/web/palette_rows.ts and test/palette-rows.test.ts. I did not commit the --fix rewrap for them (the gate says the nightly job wraps them on main).

To try it: sign in on the preview, press Cmd-K and type "redeploy". You get one row per app you may write, and Enter twice posts it.

🤖 Generated with Claude Code

commented

I've addressed all three points and pushed to the same branch. bun x tsc --noEmit, bun scripts/design-lint.ts and test/palette-rows.test.ts pass. The forge's own check on the push is still to come.

  • Terminal door: docs/features/palette-rows.md now names it. On an app's deploys screen (src/tui/screens/deploys.ts), a writer presses D to redeploy production and S to stop it, each after a one-line confirm, through the same redeployEnv and stopEnv. A stopped production offers only D, and a reader gets neither. This replaces the line that said there was no terminal screen, which was wrong. I added no TUI rows, since the screen already does this.
  • Comments:
    • The new line sits with its parent comment in layout.ts, so it reads as one read.
    • The appActionRows doc comment and signature are rewrapped.
    • bun scripts/gate.ts --fix rewrote nothing. The gate's remaining over-100-column note is about older lines in src/core/repos.ts, src/web/palette_rows.ts and test/palette-rows.test.ts, which I didn't touch. None of the lines I added is over 100 columns.
  • Tests: The weak test is replaced by one that goes through the page, using a fake live production environment on a real AppsRuntime.
    • Stopped app: the owner gets exactly Redeploy <name>, with no Stop row.
    • Running app: the owner gets exactly Redeploy and Stop, each posting /<name>/app/production/redeploy or /stop, and each asking first (a: 1).
    • Peer and signed-out viewers: each gets no Redeploy or Stop row at all, for any owner's app. The /olive/ filter is gone.
  • Why 8: it is two rows an app, so at most sixteen rows, about one screen of the list. The page lists thirty repositories, and the palette is a short list. The reason is now in the code comment and the feature doc, and it belongs in the pull description too.

Not done, as you noted:

  • Box 2: an app answering palette queries through forge.json is not started.
  • Box 3: I still can't read why the parked branches went red.
  • Box 1: only the acting half is done.

I'm not claiming this pull completes box 1 or the issue.

🤖 Generated with Claude Code

commented

Left #11926 open: 3 unticked items remain (Pull 1: the forge's palette searches and acts across the apps the owner can see, using the forge's own data. Tests included, check green on the first push.; Pull 2: an app may answer palette queries for itself through one declared endpoint in forge.json. It is time-boxed, and its output is escaped where it is shown.; Before opening, read why each try went red in its check log, and fix that cause first.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs