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

/forges/new gives a client's forge the owner's chosen apps as forks, in one form and one link #1769

opened this

Merged 48d 22h ago, live in production

/forges/new now makes a client's forge from forked apps, optionally one fresh app, and an optional domain, and it ends in one claim link. The spawn and new-forge tests pass and tsc is clean. I did not run the full bun test or the forge's check.

Notes

opened this

/forges/new now makes a client's forge from forked apps, optionally one fresh app, and an optional domain, and it ends in one claim link. The spawn and new-forge tests pass and tsc is clean. I did not run the full bun test or the forge's check.

What changed

  • Forked apps: the form already copied the owner's picked apps with full history. Each fork now also records where it came from in the child's parent.json as apps: [{repo, upstream}].
  • Fresh app: a new "Or a fresh app" field takes a one-line description, up to 200 characters. The child gets a private repo named from the description, holding a README, a forge.json and a small index.ts that serves / with the line escaped. A retry does not commit twice.
  • Domain: a new optional "Its domain" field is validated as a hostname, shown in the plan, and recorded in parent.json.
  • API and plan: POST /api/v1/forges takes the same fresh and domain fields, and the plan lists both. Both are left out of the plan when not given, so existing plan hashes are unchanged.
  • Docs and tests: docs/SPAWN.md has a new section on this. The new test/spawn-fresh-forks.test.ts is named in GATE in scripts/gate.ts. It makes a child with two forked apps and a fresh one, checks the plan, rejects a bad domain or a two-line description, and checks the single claim link.

Existing tests I changed

  • test/spawn.test.ts and test/spawn-keys.test.ts pin the exact keys of parent.json. I added apps to both, because the new key is intended.

Left out

  • Domain routing: the domain is recorded and shown in the plan, but nothing routes it. Its DNS has to be pointed at this forge, and the claim link keeps the default <name>--<host> address, which always works.
  • Forks: these are cross-forge git copies, as the forge's own code already is. A fork gets no live link to its source and no "follow" button in the child.
  • Fresh app: it is only the minimal scaffold, one fresh app per child, with no templates.

To try it Sign in, open /forges/new, pick two apps, type a sentence under "Or a fresh app", press "See the plan", then "Spawn".

Closes #1608

2 earlier comments
commented

I dropped the domain and addressed the other points. The spawn, new-forge, MCP, check-list and check-tiers tests pass and tsc is clean; I did not run the full bun test or the forge's check. I could not open the preview, so the 360px layout is still unchecked.

  • Domain removed. It is gone from plan.ts, door.ts, the form, parent.json, the plan card and the docs. The plan card now shows only the real address, <name>--<host>. docs/SPAWN.md says a custom domain is not part of this.
  • Both doors tested. test/spawn-api.test.ts now covers fresh through POST /api/v1/forges and the MCP spawn tool. It checks the plan, a two-line sentence, and one over 200 characters. I also added fresh to the MCP tool's input schema, where it was missing.
  • README. It now has a line on the new field.
  • Markdown in the fresh app's README. The sentence goes in its own paragraph under a fixed # A fresh app heading, with markdown marks escaped. A test spawns an app whose sentence contains *, <b> and x and checks they come out escaped.
  • Gate order. test/spawn-fresh-forks.test.ts now sits between spawn-first-boot and spawn-keys.
  • 360px layout. I added no CSS. The "fresh app" field uses the same formField component as every other single-line field on the page, which I expect to wrap like them. Please check it on a phone-width preview.
commented

A fresh app can no longer take the name forge, so the forge-code fork can't overwrite it.

  • The fix: forge is now in the taken set that freshName checks in src/spawn/plan.ts. A sentence like "Forge" or "forge!" plans forge-2. The fork still reuses the fixed name forge, but nothing else can claim it first. The order in src/actions/spawn.ts (fresh app first, then the fork) is safe now, so I left it alone.
  • The test: test/spawn-fresh-forks.test.ts has a new case where fresh set to "Forge" and to "forge!" both plan forge-2. I also fixed the stray indent on the last line of that file.
  • Checks: tsc --noEmit is clean. The test/spawn* suites pass (72 tests). I did not run the full bun test.

I left out two of your smaller points. The terminal door for spawn still needs its own issue under pillar 3, and I didn't open it. The 360px layout is still not verified by anyone.

commented

The full gate on land was red and named no test; the pull is open again.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs