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

Archive one repository: its app spins down with data kept, it leaves the home, explorer and inbox, and one button wakes it #1742

Closed opened this
Closed without merging

An admin can now archive a repository and wake it again. I ran tsc and 12 test files covering the change plus the cross files, and all 312 tests pass. I did not run the full gate.

Notes

stopped closed without shipping deploy 3fe4ba0

opened this

An admin can now archive a repository and wake it again. I ran tsc and 12 test files covering the change plus the cross files, and all 312 tests pass. I did not run the full gate. The new tests exercise a real app process here, but not the cell-isolation suites that are skipped in this sandbox.

What changed

  • API and MCP: PATCH /api/v1/repos/:owner/:name {archived: true|false} goes through the existing admin-scope and same-origin checks. There is a new archive MCP tool, which plans by default and needs an admin token to act. The repository JSON now carries archivedAt, stored in a new repo.archived_at column (migration 84).
  • Web: Settings → Danger zone has an Archive card. An archived repository's header says "archived on <date>" and shows a Wake button to admins. Both post to /:owner/:name/settings/archive.
  • Archiving: the repository's agent, check and deploy runs are cancelled and its app's environments stop. Their data stays on disk.
  • Refused after archive: deploys, including on a push or at boot, and new agent or check runs. The autonomy loop skips archived repositories.
  • Waking: production restarts from the same data. Previews come back with their pull's next push or approval.
  • Where it disappears: listReposVisibleTo and listReposWritableTo now exclude archived repositories unless includeArchived is set. That covers the home's apps, the explorer and the inbox. I also filtered the home feed's candidates and the "On you" card.
  • Still works: the page, links, the API and git.
  • Docs and gate: docs/APPS.md has a section on archiving. Both new test files are in GATE.

Tests

  • test/archive.test.ts covers the three lists with and without the archive, a non-admin and a cross-origin request being refused, the page and git still answering, and the crew refusing a run.
  • test/archive-app.test.ts covers production stopping with its data surviving, a push while archived deploying nothing, and waking restoring production over the same data.

Left out

  • Search and the owner's profile list still show archived repositories.
  • Archived repositories are not marked in other lists.
  • Waking does not redeploy previews on its own.
  • No separate "archive" event audience: repo.archived and repo.woken are visible to readers like other repository events.

Try it

  1. Run bun test test/archive.test.ts test/archive-app.test.ts.
  2. In the app, open Settings → Danger zone and use Archive, then the Wake button on the repository page.

Closes #1619

commented

Parked by the crew: the check failed ("the forge over MCP > it speaks the protocol: initialize, a notification, ping, tools/list") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs