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

Family tree across forges: a forge shows its parent and its children #1780

Closed opened this
Closed without merging

This adds a forge-level family page at /family, and spawned children now report their standing to their parent with a signed heartbeat. Type check is clean. I ran test/family-heartbeat.test.ts (7 pass) and the spawn tests (spawn, spawn-keys, spawn-first-boot, client-list, spawn-api).

Notes

stopped closed without shipping deploy 4db9197

opened this

This adds a forge-level family page at /family, and spawned children now report their standing to their parent with a signed heartbeat. Type check is clean. I ran test/family-heartbeat.test.ts (7 pass) and the spawn tests (spawn, spawn-keys, spawn-first-boot, client-list, spawn-api). One failure showed up in test/spawn.test.ts and one in test/spawn-keys.test.ts. Both pin the exact keys of parent.json, so they were out of date, and I updated them. I did not re-run the client-list and spawn-api suites after that fix, and I did not run the full suite; the forge's check does that on push.

Heartbeat

  • A spawned child POSTs /api/v1/heartbeat every 10 minutes (src/spawn/heartbeat.ts).
  • The body is only {name, at, version, openProposals, children}. Any extra field, bad type or oversized body is refused.
  • It is signed with HMAC-SHA256 in x-forge-signature. Spawn now gives each child a beatKey, kept in the parent's ledger and in the child's parent.json.
  • An unknown name, bad signature, a time more than 10 minutes off, or a replay all get the same 404 and change nothing.
  • The parent keeps the last beat per child in <data>/beats/<name>.json.

Page

  • /family is server-rendered nested lists: the parent (from FORGE_PARENT_URL or the child's parent.json), this forge, then its children.
  • Each child shows last seen, version, releases behind this forge, open proposals and how many forges it has of its own.
  • It is capped at 100 children and 4 levels, and every name is escaped.
  • A child silent for 30 minutes reads "quiet". One never heard from reads "has not reported yet". Neither is styled as an error.
  • Anyone can see the parent. Only a site admin of the parent sees children.
  • Admins also get a "Family of forges" entry in the palette.

Left out

  • Children spawned before this change have no key, so they stay "has not reported yet" until respawned.
  • Grandchildren appear only as a count; the tree goes no deeper than that.
  • "Behind" counts against this forge's own release list and is blank when the child's version isn't in it.
  • There is no JSON read endpoint for the page and no link to it from the nav bar.

To try it, spawn a child, then open /family as an admin. docs/SPAWN.md describes the design.

🤖 Generated with Claude Code

Closes #425

commented

I added test/family-heartbeat.test.ts to GATE in scripts/gate.ts, which is what the failed check asked for, and pushed. I did not run the gate audit or the forge's test-shards step here. My attempt to call auditGate directly errored because I passed it no arguments, so the push is the only check of that part. The type check is clean and test/family-heartbeat.test.ts passes (7 tests).

The pull description from my earlier message still applies.

commented

Parked by the crew: the check failed ("reserved names > every top-level page of the forge is a reserved name") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs