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

Foundry reads more of the forge through a read-only view, and the forge links to it #9193

opened this

Merged 30d 17h ago, live in production

I merged main into the branch and pushed it. I didn't run the whole suite; the forge's check does that on the push. Before pushing, I ran the three test files that cover the conflicts (test/palette-roster.test.ts, test/repo-head-quiet.test.ts, test/tui-backups.test.ts), the gate and tsc --noEmit.

Notes

opened this

I merged main into the branch and pushed it. I didn't run the whole suite; the forge's check does that on the push.

Before pushing, I ran the three test files that cover the conflicts (test/palette-roster.test.ts, test/repo-head-quiet.test.ts, test/tui-backups.test.ts), the gate and tsc --noEmit. All were green.

  • test/palette-roster.test.ts: I kept both palette entries, "Forge view" from this pull and "New commits upstream" (origin-ahead) from main. I swapped their order in the site-admin agent roster, because the code puts origin-ahead before forge-view there.
  • test/repo-head-quiet.test.ts: I took main's version. It now weighs only the repository head, so the palette entry this pull added doesn't count against the byte budget. This drops the earlier whole-page budgets with their +100 bytes for the forge view's palette entry.

Continues #9193

3 earlier comments
commented

I merged main into the branch and pushed it. I didn't run the whole suite; the forge's check does that on the push.

Before pushing, I ran the three test files that cover the conflicts (test/palette-roster.test.ts, test/repo-head-quiet.test.ts, test/tui-backups.test.ts), the gate and tsc --noEmit. All were green.

  • test/palette-roster.test.ts: I kept both palette entries, "Forge view" from this pull and "New commits upstream" (origin-ahead) from main. I swapped their order in the site-admin agent roster, because the code puts origin-ahead before forge-view there.
  • test/repo-head-quiet.test.ts: I took main's version. It now weighs only the repository head, so the palette entry this pull added doesn't count against the byte budget. This drops the earlier whole-page budgets with their +100 bytes for the forge view's palette entry.
commented

The forge view is back on the branch and pushed. I merged current main (which includes the fix for the unrelated tui-backups failure) and fixed two merge conflicts in tests.

Run here: tsc, the gate script, and the four test files below pass (31 tests). scripts/fast.ts said the diff reaches 1,442 of 2,083 test files, so I did not run the full suite. I left that to the forge's check.

  • test/palette-roster.test.ts
  • test/api-forge-view.test.ts
  • test/tui-backups.test.ts
  • test/repo-head-quiet.test.ts

What changed this round:

  • The merge conflicted in test/palette-roster.test.ts and test/repo-head-quiet.test.ts.
  • In test/palette-roster.test.ts, the roster now lists both the forge view's palette entry and main's new "New commits upstream" entry, in the order the palette produces.
  • In test/repo-head-quiet.test.ts, I took main's version, which weighs only the repository head. The per-page +100 byte allowance I had added is no longer needed.
  • The forge had also merged main into the remote branch while I worked, so I merged that too before pushing.

What the pull does: it adds a read-only forge view (src/http/api/forge_view.ts) and a terminal screen for it (src/tui/screens/forgeview.ts, palette entry "Forge view"). The view shows the forge's counts, plus Foundry's when it is installed. Foundry's door needs an admin's or trevato's app. The view is capped and has a cost test, and the OpenAPI route index is regenerated.

Try it: open the palette in the terminal and choose "Forge view". The API side is covered by bun test test/api-forge-view.test.ts.

commented

I've pushed fixes for points 2–6 of the review. Point 1, whether this belongs ahead of the pipeline list, still needs a person. tsc, the gate, the design lint and the tests that cover the change pass. Before pushing I ran four test files, plus five touching crew-now and home, and all passed. I did not run the full suite or the fast-selected set, which covered 1,459 files and was estimated at over two hours. The forge's check runs the full suite on push.

1. Direction. I have not changed anything for this point. Foundry's read view and its door in the forge are the point of #8955, and I can't tell from the repo which pipeline item they serve. If you want this parked behind the pipeline list, a person should say so.

2. Cost on every page.

  • foundryHref(app, user) now stops after one indexed read when no app has the slug. When an app does, the answer is held for 5 seconds per reader.
  • A test asserts that a repeated call makes no database queries.
  • I did not invalidate the held answer when an app is installed or removed, so a change can take up to 5 seconds to show. Tests call forgetFoundryDoor(app).

3. Terminal screen.

  • The fake HttpCtx cast is gone. The screen reads the forge view once, when it opens, so a render frame or key press no longer rebuilds it.
  • forgeView and crewNow now take Pick<Ctx, "app">, and the app-listing helpers behind them in src/web/studio/asks.ts do the same.
  • The screen now lists up to 12 running runs and 12 apps below the counts, and says how many more there are. It is a snapshot from the moment it opened, not a live board.

4. Tests.

  • Enter on the screen is tested both ways: with a door it opens Foundry, and without one it does nothing.
  • A new test covers the trevato org-owner branch with a reader who isn't an admin.
  • The palette assertion now matches the exact Foundry item.
  • The duplicate DELETE is gone.
  • The cost bound went from 2*APPS+30 to 2*APPS+20. The measured count is 258 against a bound of 260. I left it that tight on purpose, so a read per app or per run still fails.
  • I found no selects.length < 80 in the repo and left it alone.

5. Design. The Foundry button now uses the eye icon instead of globe, and the foundry! assertion is gone. I found no limit on how many actions the apps card may carry in docs/DESIGN.md.

6. tui-backups. I kept the settlePalette line. The new palette entry changes when the palette settles in that test, and without the line the test flakes in this pull. It has no effect outside that test.

commented

bun scripts/hollow.ts fails on main: src/actions/forge_view.ts#viewBuilds and src/actions/foundry_door.ts#forgetFoundryDoor are exported, and only test/api-forge-view.test.ts calls them. To keep #9217's check green, that pull lists both in scripts/hollow-allow.ts against this issue. The fix belongs here: stop exporting them, for example by moving the counter and the reset behind something a route reaches, then delete both entries.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs