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

Packs come from the forge: each app is a forge mirror, each pack is a forge repo #10455

Parked opened this in answer to
Closed without merging

Packs now come from the forge, but only part of the issue is done. The live forge has no packs/ mirrors or marked packs yet, so /packs will be empty until the owner sets those up. bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and the new and changed pack tests pass.

Notes

stopped parked by the crew

opened this

Packs now come from the forge, but only part of the issue is done. The live forge has no packs/* mirrors or marked packs yet, so /packs will be empty until the owner sets those up. bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and the new and changed pack tests pass. I did not run the full suite or pack-compat, which fetches the live packs forge. A scaffolded-app typecheck test failed in this sandbox, and it fails the same way on the base branch.

Done

  • Pack format. pack.json apps now give source: "packs/2048", a forge repo. A URL is refused.
  • /packs and marking. /packs, the home presses and the terminal screen read the repos the admin marked, from a new pack_repo table. The migration is pinned.

- Marking. PUT and DELETE /api/v1/repos/:owner/:name/pack mark and unmark, admin only (everyone else gets 404), for public repos whose pack.json name matches the repo name. A refresh job re-reads each marked pack hourly. If the file breaks, the pack keeps its last good text. - Reading. GET /api/v1/packs and /api/v1/packs/:name list them.

  • Source tree. packs/ and the Dockerfile COPY packs are gone. The two old packs are kept as fixtures in test/fixtures/packs/; those are the texts to commit into packs/games and packs/business.
  • Deploy. deployPack forks each app from its forge mirror into the person's account with lineage, then absorbs it if the pack asks. Re-running keeps what exists.

- No mirrors on the target. If the target forge has no mirror, as with pack up on a new machine, it makes the app and clones history from the packs forge (FORGE_PACKS_URL, default https://forge.open-platform.sh), never from GitHub. - Test. test/packs-forge.test.ts deploys with github.com refused and checks that no request leaves for GitHub. It also checks that the fork's parent is the mirror.

  • /packs/<name> path clash. packs is also the owner of the mirrors, so /packs/<name> is the pack page when that pack is listed and the repo page otherwise.
  • Docs. docs/features/packs.md is updated.

Not done

  • Bringing in the five upstreams as packs/* mirrors and marking packs/games and packs/business on the live forge. This is an owner step using the existing origin mirrors, which already re-sync on their schedule. packs is a reserved username, so the account has to be made by an admin.
  • Showing licence and original authors on a mirror's repo page.
  • A new account is blocked from forking by the forge's existing new-account cooldown, so a brand-new person's deploy hits a 403 until it passes. I left that rule alone.

How to try it

  1. As an admin, make a public repo packs/games with a pack.json whose name is games.
  2. PUT /api/v1/repos/packs/games/pack with an admin token.
  3. Open /packs, then /api/v1/packs.
  4. Deploy from a signed-in account with FORGE_URL=… FORGE_TOKEN=… bun scripts/pack.ts deploy games.

🤖 Generated with Claude Code

Closes #10447

3 earlier comments
commented

Packs now come from the forge, but only part of the issue is done. The live forge has no packs/* mirrors or marked packs yet, so /packs will be empty until the owner sets those up. bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and the new and changed pack tests pass. I did not run the full suite or pack-compat, which fetches the live packs forge. A scaffolded-app typecheck test failed in this sandbox, and it fails the same way on the base branch.

Done

  • Pack format. pack.json apps now give source: "packs/2048", a forge repo. A URL is refused.
  • /packs and marking. /packs, the home presses and the terminal screen read the repos the admin marked, from a new pack_repo table. The migration is pinned.

- Marking. PUT and DELETE /api/v1/repos/:owner/:name/pack mark and unmark, admin only (everyone else gets 404), for public repos whose pack.json name matches the repo name. A refresh job re-reads each marked pack hourly. If the file breaks, the pack keeps its last good text. - Reading. GET /api/v1/packs and /api/v1/packs/:name list them.

  • Source tree. packs/ and the Dockerfile COPY packs are gone. The two old packs are kept as fixtures in test/fixtures/packs/; those are the texts to commit into packs/games and packs/business.
  • Deploy. deployPack forks each app from its forge mirror into the person's account with lineage, then absorbs it if the pack asks. Re-running keeps what exists.

- No mirrors on the target. If the target forge has no mirror, as with pack up on a new machine, it makes the app and clones history from the packs forge (FORGE_PACKS_URL, default https://forge.open-platform.sh), never from GitHub. - Test. test/packs-forge.test.ts deploys with github.com refused and checks that no request leaves for GitHub. It also checks that the fork's parent is the mirror.

  • /packs/<name> path clash. packs is also the owner of the mirrors, so /packs/<name> is the pack page when that pack is listed and the repo page otherwise.
  • Docs. docs/features/packs.md is updated.

Not done

  • Bringing in the five upstreams as packs/* mirrors and marking packs/games and packs/business on the live forge. This is an owner step using the existing origin mirrors, which already re-sync on their schedule. packs is a reserved username, so the account has to be made by an admin.
  • Showing licence and original authors on a mirror's repo page.
  • A new account is blocked from forking by the forge's existing new-account cooldown, so a brand-new person's deploy hits a 403 until it passes. I left that rule alone.

How to try it

  1. As an admin, make a public repo packs/games with a pack.json whose name is games.
  2. PUT /api/v1/repos/packs/games/pack with an admin token.
  3. Open /packs, then /api/v1/packs.
  4. Deploy from a signed-in account with FORGE_URL=… FORGE_TOKEN=… bun scripts/pack.ts deploy games.

🤖 Generated with Claude Code

commented

I added an empty commit with the missing line and pushed it. The gate check failed because the pull adds src/http/api/packs.ts and no commit message gave a reason for it. The commit carries this line:

Why now: apps fork from forge mirrors, so the pack list must be readable before any app can be created from a pack.

I ran bun scripts/gate.ts before pushing and it printed no error. The code is unchanged, so I did not re-run the type check or the tests.

The pull still needs the forge's check to pass again on the new push.

commented

I fixed two of the three failing checks and pushed. I couldn't reproduce the third (the unreached-modules test), and I haven't seen the forge's check on this push yet.

  • OpenAPI coverage: I added OpenAPI rows for the four pack routes: GET /api/v1/packs, GET /api/v1/packs/{name}, PUT /api/v1/repos/{owner}/{name}/pack and DELETE /api/v1/repos/{owner}/{name}/pack. I regenerated src/contract/openapi/routes/index.ts with bun scripts/openapi-routes.ts.
  • Session phase: GET /api/v1/packs answers 200 without a session phase, so I added it to UNTIMED in test/route-timing-coverage.test.ts. It is a public list read by one indexed query with no page to phase. The reason is written beside the entry.
  • Unreached modules: test/unreached.test.ts passes here, and every unreached file is already on the allowlist. A cause I haven't found would show up in the forge's check log.

Locally the OpenAPI, route-timing and unreached tests, scripts/gate.ts and tsc --noEmit pass. I did not run the full suite.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs