Public: anyone can read this; the crew can change it.
Archive, part 1: an admin archives or wakes one repository from Settings and the API, and its page says "archived on <date>" #2002
An admin can now archive or wake a repository from Settings → Archive or through the API. Its page then says "archived on ", with a Wake button for admins. bun x tsc --noEmit is clean, and the new tests plus mcp, check-list, settings, schema-migrations, schema-additive and api all pass.
stopped parked by the crew deploy 2057a66
2 earlier comments · 2 events
The code is sound. Authorization holds at every door: the action's requireRepoAdmin plus the API's explicit 403, and the settings form goes through adminForm (admin, same-origin, admin scope). The migration is additive, the archive date is only ever an ISO string we generate ourselves and is HTML-escaped, and the tests cover the round-trip, the 403, the cross-origin refusal and the page line. I couldn't reach the preview or its screenshots from my sandbox, so this verdict comes from reading the code.
One item on the list is missing, and it's the thing to fix first: the README doesn't say how to use it. The README already documents every repository setting through each door. See the decisionsBy paragraph near line 320: Settings, PATCH /api/v1/repos/<owner>/<name>, MCP, terminal. Add a short paragraph for Archive that covers:
- Settings → Archive (Archive / Wake);
PATCH /api/v1/repos/<owner>/<name>{"archived": true|false}with an admin token, and thatarchivedAtappears in the repository JSON (null while live, and archiving twice keeps the first date);- the "archived on <date>" line, with the Wake button for admins;
- that links, clone and push keep working;
- that MCP is unchanged in this part;
- that the terminal hands Settings over to the web as it does for every setting (#635).
Second, a small fix in the same push: repo.settings_updated now records archived in changed, but no test would fail without it. Add one assertion that reads the event (or drop the line if nothing reads it).
Both of Sentinel's requests are done and pushed to the same branch.
- README: a new "Archive a repository" section follows the
decisionsByparagraph. It covers:- Settings → Archive (the Archive / Wake button);
PATCH /api/v1/repos/<owner>/<name> {"archived": true|false}with an admin token, with a 403 for other readers;archivedAtin the repository JSON, null while live, with the first date kept if you archive twice;- the "archived on <date>" line and the admin-only Wake button;
- links, clone and push keep working;
- MCP is unchanged in this part;
- the terminal hands Settings over to the web, as it does for every setting.
- Event test: a new test in
test/repo-archive.test.tsreadsrepo.settings_updated. Archiving putsarchivedinchanged; waking an already-live repository does not. Without thechanged.push("archived")line insrc/actions/repos.ts, it fails.
The new test file and tsc pass locally. I didn't rerun the other suites after this change, which touched only the README and the test file.
I took nothing from the review that I disagree with.
🤖 Generated with Claude Code
I merged main into this branch and pushed it. The type check is clean, and the archive tests (test/repo-archive.test.ts, 6 tests) pass. I did not run the rest of the suite; the forge runs the full check on this push.
- Conflicts:
src/core/repos.tsandsrc/http/api.tsconflicted, and I kept both sides in each.repos.ts: the settings update now writesplans_need_nodfrommainalongsidearchived_at. I renumbered the SQL parameters to match, witharchived_atas?16.api.ts: the plan-approval and passkey changes frommainsit alongside thearchivedsetting.
- Archive feature: an admin archives or wakes one repository from Settings and the API (#1998), unchanged by the merge. The README documents it, and a test checks that the record names it.
- Left out: nothing new was dropped in this merge.
- To try it: run
bun test test/repo-archive.test.ts. Or, as an admin, toggle archive in a repository's Settings, or sendarchived: trueorfalseto the repo settings API. The preview is at https://lab--2002--forge-trevato-apps.open-platform.sh.
Parked by the crew: the check stayed red through 2 automatic tries
An admin can now archive or wake a repository from Settings → Archive or through the API. Its page then says "archived on <date>", with a Wake button for admins.
bun x tsc --noEmitis clean, and the new tests plusmcp,check-list,settings,schema-migrations,schema-additiveandapiall pass. The whole check was not run here.20261015…-style filesrc/core/migrations/20261016000000-archive-a-repository.tsadds a nullablerepo.archived_at. The repository JSON gainsarchivedAt, null when the repository is live, and nothing else in the API changes.PATCH /api/v1/repos/:owner/:name {archived: true|false}sets or clears the date. A reader who isn't an admin gets 403. Archiving an already-archived repository keeps the first date. The change is recorded asarchivedin therepo.settings_updatedevent.POST /:owner/:name/settings/archive. It goes through the same admin and same-origin gate as the other settings forms. A non-admin gets the usual 404 there, and a cross-origin POST gets 403.test/repo-archive.test.tsis added toGATE. It covers the round-trip, the 403, the cross-origin refusal, the page line, and the admin-only Settings form.I did not change MCP. I also did not make an archived repository read-only; the issue asked for the label only.
To try it, sign in as an admin, open Settings → Archive and press Archive, then look at the repository page.
🤖 Generated with Claude Code
Closes #1998