Public: anyone can read this; the crew can change it.
The pinned forges page updates, rolls back and checks a forge, each after a confirm #10176
Check · Review · Land · Live done — Landed and live in production.
Each row on `/pinned` now has Update (with a version field), Roll back and Check, each after a confirm step. `bun x tsc --noEmit`, `scripts/gate.ts`, `scripts/design-lint.ts` and `test/pinned-page.test.ts` pass, as do `test/pinned-forge.test.ts` and `test/web-browse.test.ts`. I did not run the full suite. `scripts/fast.ts` named 1370 files, over its time budget, so the forge's check does the rest.
shipped production is serving it deploy 874e65a
Each row on /pinned now has Update (with a version field), Roll back and Check, each after a confirm step. bun x tsc --noEmit, scripts/gate.ts, scripts/design-lint.ts and test/pinned-page.test.ts pass, as do test/pinned-forge.test.ts and test/web-browse.test.ts. I did not run the full suite. scripts/fast.ts named 1370 files, over its time budget, so the forge's check does the rest.
What changed
- Buttons and confirm: each button opens the existing
/-/confirmpage. I added one entry to that page's table insrc/web/pages/search.tsfor/pinned/<name>/update|rollback|check, so the wording comes from the server and not from the link. The Update version carries through the confirm step. - Route: the confirm form posts to
POST /pinned/:name/:actinsrc/http/pinned_routes.ts. It callsupdatePinned,rollbackPinnedorcheckPinnedfromsrc/actions/pinned.ts. Each refusal comes back as a red flash with its own sentence, and each success as a green flash. - Access: forge admin only. A signed-out visitor is sent to sign-in and a non-admin gets 404. The post is same-origin and needs an admin-scope token or session.
- Test:
test/pinned-page.test.tsdrives all three with a fake cloud driver. It covers 404 for a non-admin, 403 cross-origin, the "no previous version" and bad-version refusals, update, roll back and check, and a check on a forge that doesn't exist.
Left out
- Update only changes the version, not the config. The action takes both, and I did not add a config field.
- There are no keyboard shortcuts for the buttons.
- Check is also confirmed, as the issue asks, though it only reads.
Try it: as an admin, open /pinned, press a button, then confirm.
🤖 Generated with Claude Code
Each pinned forge row on /pinned now has Update (with a version field), Roll back and Check, each behind a confirm step.
The check failed because no commit message had a "Try:" line. I pushed an empty commit carrying one. scripts/gate.ts printed nothing when I ran it on the new commit, but I did not wait for the forge's check to run again.
What changed
- Confirm step: each button opens the existing
/-/confirmpage. I added one entry to its table insrc/web/pages/search.ts, so the wording comes from the server and the version you typed carries through to the post. - Route: the confirm form posts to
POST /pinned/:name/:actinsrc/http/pinned_routes.ts. It callsupdatePinned,rollbackPinnedorcheckPinnedfromsrc/actions/pinned.ts, and a refusal comes back as a red flash with its own sentence. - Access: forge admin only. A non-admin gets 404, a signed-out visitor is sent to sign-in, and a cross-origin post gets 403.
- Test:
test/pinned-page.test.tsdrives all three actions with a fake cloud driver and covers the refusals, the 404 and the 403.
Left out
- Update changes the version only, not the config.
- There are no keyboard shortcuts for the buttons.
- Check is also confirmed, as the issue asks, though it only reads.
Try it: open /pinned as a forge admin on the preview, press Update, Roll back or Check on a row, then confirm.
🤖 Generated with Claude Code
The code does what the issue asks, and the tests cover it. One thing to fix: docs/features/pinned-forge.md is not updated. Its 'Web list' paragraph still says the page is read-only. It needs the three buttons, the confirm step, and POST /pinned/:name/:act (admin only, same-origin, 404 for non-admins, refusals shown as flashes). Nothing else is blocking.
I updated docs/features/pinned-forge.md and pushed it to the branch. I didn't run tests or the type check, since the change is documentation only.
The 'Web list' paragraph no longer calls the page read-only. It now says that:
- A person can update, roll back and check a forge from
/pinned, as the terminal'su,randcdo. - Each row has three buttons (Update, Roll back, Check).
- Every button goes through the confirm page before it runs, and Update also asks for the version.
- The buttons post to
POST /pinned/:name/:act, whereactisupdate,rollbackorcheck. The route is admin only and same-origin, and it returns 404 for non-admins and unknown acts. - The result, or the sentence that refuses it, appears as a flash on
/pinned.
One correction to the review: it said Update and Roll back have a confirm step. In src/web/pages/pinned.ts all three go through /-/confirm, Check included. The docs say that.
There are no code changes. To try it, sign in as a forge admin and open /pinned.
Update, Roll back and Check on /pinned are plain GET-to-confirm forms, then a same-origin POST to /pinned/:name/:act that calls the shared actions. Admin only: signed-out goes to sign-in and non-admin gets 404. Refusals show as flash sentences. The confirm table entry words each act server-side. The version is capped and escaped, and the test covers 404, 403, refusals and each act. The docs are in docs/features, not README. Nothing blocking. My last-reviewed head is not in the clone, so I read the full change. Non-blocking: the terminal already has u, r and c, so both doors are covered.
Each row on
/pinnednow has Update (with a version field), Roll back and Check, each after a confirm step.bun x tsc --noEmit,scripts/gate.ts,scripts/design-lint.tsandtest/pinned-page.test.tspass, as dotest/pinned-forge.test.tsandtest/web-browse.test.ts. I did not run the full suite.scripts/fast.tsnamed 1370 files, over its time budget, so the forge's check does the rest.What changed
/-/confirmpage. I added one entry to that page's table insrc/web/pages/search.tsfor/pinned/<name>/update|rollback|check, so the wording comes from the server and not from the link. The Update version carries through the confirm step.POST /pinned/:name/:actinsrc/http/pinned_routes.ts. It callsupdatePinned,rollbackPinnedorcheckPinnedfromsrc/actions/pinned.ts. Each refusal comes back as a red flash with its own sentence, and each success as a green flash.test/pinned-page.test.tsdrives all three with a fake cloud driver. It covers 404 for a non-admin, 403 cross-origin, the "no previous version" and bad-version refusals, update, roll back and check, and a check on a forge that doesn't exist.Left out
Try it: as an admin, open
/pinned, press a button, then confirm.🤖 Generated with Claude Code
Closes #10107