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

A deployed forge runs its own forge repository, which follows the forge it wa… #16361

open held opened this has it

Stalled: nothing picked it up in 10 minutes

opened this

A deployed forge runs its own forge repository, which follows the forge it was deployed from

Owner's direction, 2026-11-24, after the first sold forge (test1) opened with the selling forge's own production alarm: "the forge should deploy with a forge repo in the users account that is configured to follow forge.open-platform.sh/trevato/forge. it should be nested tho … i could deploy a new forge from within the test1 forge and that forge should deploy with a copy of test1's forge and configured to listen upstream that way. recursive … the admin user in the forge should be able to assign work to the crew on their forge which works on it and when they merge to main it updates the forge they use … following should be default on. the user could then turn off following the upstream … choose if the crew automatically handles merge conflicts or not. default to not but it should be clear to the user and briefly describe the consequences."

Today a pinned forge's boot (src/cloud/machine.ts bootConfig) clones the seller's repository into /opt/forge at one commit and runs it, and only the seller can change its version. Replace that model.

What done looks like (reusing what exists; map in the comments of this issue):

  1. Its own repo. At first boot, before the claim, the forge creates <org>/forge under its spawned org (the hosted child's pattern, forkForgeCode / adoptForgeCode in src/spawn/forge_code.ts) by importing the history and tags of the checkout it booted from, and adopts it as forgeRepo. At claim (redeemFirstAdmin, src/actions/first_admin.ts), the repository moves to the new admin's own account (transferRepo), so it is "a forge repo in the user's account".
  2. It follows its deployer. A follow (src/core/upstream_follow.ts) on that repo with url = the deploying forge's own forge repo over HTTPS (<deployer origin>/<deployer forgeRepo>.git) and mode take-updates. The deployer passes that URL and the commit it runs in the boot env; source is no longer typed by anyone. Recursive by construction: a forge deployed from test1 copies and follows test1's repo.
  3. Merge to main updates the forge it runs on. The boot sets FORGE_REPO, FORGE_RELEASE_KEEPER=swap and FORGE_SELF_SWAP=1 (src/keeper/wire.ts), so the keeper releases main on that machine, verifies and rolls back as it does elsewhere. The seller's Update and Rollback for a claimed forge stay refused; for an unclaimed one they remain the deployer's.
  4. Settings on the owner's forge, on its forge repository's page and in Settings:
    • Follow updates from <upstream>: on by default; the owner can turn it off.
    • Let the crew resolve conflicts with <upstream>: off by default; a new per-repo setting read by convergeConflict instead of the repo's autonomy. Its words, beside the control: "When an update from <upstream> and a change made here touch the same lines, the crew merges them for you. Off: the update waits, and an issue names the files for you to decide in the code."
  5. The crew is installed on the machine (Claude Code), so the owner's crew can work on the repo; a machine without it says so on the owner's home, not silently.
  6. The seller-only checks stop meaning someone else's production: the daily proof and sentinel name this forge's own forge repo (they read forgeRepo), which now exists.

Proof: a deploy from a forge whose own repo is o/forge boots a forge holding <org>/forge with o/forge's history at the deployer's commit, following <deployer>/o/forge.git take-updates; claim moves it to the admin; a commit merged to its main is released by the keeper on that forge; a forge deployed from that one follows it, not the original. Then the real journey on DigitalOcean.

Files: src/cloud/machine.ts, src/spawn/forge_code.ts, src/actions/first_admin.ts, src/core/upstream_follow.ts, src/actions/upstream_follow.ts, src/keeper/wire.ts, src/main.ts

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs