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

A child's parent.json cannot name an upstream or a minting identity the child was not given #14942

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A child's parent.json can no longer make its parent read a repository it was not given, or mint a token as anyone other than the child's spawner. Closes the #14915 finding from #14770; I could not tick it there because no issue-editing tool was available in this run.

Notes

shipped production is serving it deploy 9504585

opened this

A child's parent.json can no longer make its parent read a repository it was not given, or mint a token as anyone other than the child's spawner. Closes the #14915 finding from #14770; I could not tick it there because no issue-editing tool was available in this run.

  • Heartbeat tips (appTipsFor): the heartbeat tip lookup now resolves only upstreams listed in the parent's ledger (child.apps). Any other upstream the child writes into parent.json is ignored. Before this, a child could add an applied entry for any owner/name and the heartbeat reply would hand it that repository's tip commit.
  • Follow tokens (mintingUser): a token for a private parent repository is minted only as the spawner, and only while the spawner can still read that repository. There is no longer a fallback to the repository's owner.
  • Risk raised in the issue: a child whose spawner is gone, or lost access, stops being offered its private apps; public apps are still offered. The fork page says why: "<repo> is private and the person who spawned this child is gone or can no longer read it, so no read credential is minted".

Tests (in test/spawn-app-links.test.ts, both fail without the fix):

  • Spawner gone or without access: one child's ledger has no spawner, another names a user without access. Only the public app is offered to each, no token is minted for the private one, and the page shows the reason.
  • Forged entry: a child whose parent.json carries a forged applied entry for alice/other gets tips only for the two apps it was given.

Checks run: bun scripts/gate.ts --fix (it rewrapped one comment, committed), bun x tsc --noEmit, and the five test files that use app_links (61 pass, 0 fail): spawn-app-links, spawn, spawn-fresh-forks, boundary-tokens-follow, boundary-tenancy-files. scripts/fast.ts named 2279 test files for this change, so I picked those five myself.

Left out: tokens already minted as the owner before this change are not revoked here; they end through the existing revoke and expiry paths. The keep_plan and estimate tools were not available in this run, so no plan or estimate was recorded on the issue.

To try it: bun test test/spawn-app-links.test.ts

🤖 Generated with Claude Code

Closes #14915

commented

A child's parent.json can no longer make its parent read a repository it was not given, or mint a token as anyone other than the child's spawner. Closes the #14915 finding from #14770; I could not tick it there because no issue-editing tool was available in this run.

  • Heartbeat tips (appTipsFor): the heartbeat tip lookup now resolves only upstreams listed in the parent's ledger (child.apps). Any other upstream the child writes into parent.json is ignored. Before this, a child could add an applied entry for any owner/name and the heartbeat reply would hand it that repository's tip commit.
  • Follow tokens (mintingUser): a token for a private parent repository is minted only as the spawner, and only while the spawner can still read that repository. There is no longer a fallback to the repository's owner.
  • Risk raised in the issue: a child whose spawner is gone, or lost access, stops being offered its private apps; public apps are still offered. The fork page says why: "<repo> is private and the person who spawned this child is gone or can no longer read it, so no read credential is minted".

Tests (in test/spawn-app-links.test.ts, both fail without the fix):

  • Spawner gone or without access: one child's ledger has no spawner, another names a user without access. Only the public app is offered to each, no token is minted for the private one, and the page shows the reason.
  • Forged entry: a child whose parent.json carries a forged applied entry for alice/other gets tips only for the two apps it was given.

Checks run: bun scripts/gate.ts --fix (it rewrapped one comment, committed), bun x tsc --noEmit, and the five test files that use app_links (61 pass, 0 fail): spawn-app-links, spawn, spawn-fresh-forks, boundary-tokens-follow, boundary-tenancy-files. scripts/fast.ts named 2279 test files for this change, so I picked those five myself.

Left out: tokens already minted as the owner before this change are not revoked here; they end through the existing revoke and expiry paths. The keep_plan and estimate tools were not available in this run, so no plan or estimate was recorded on the issue.

To try it: bun test test/spawn-app-links.test.ts

🤖 Generated with Claude Code

Approved

Small, single-purpose, matches the issue. appTipsFor now resolves only upstreams in child.apps (the other parent.json readers are parent-side lookups by ledger ref or child-side). mintingUser no longer falls back to the owner and requires canRead. Both tests are meaningful. Not exercised on the preview: it is heartbeat/ledger internals with no page change beyond the reason wording. Next: (1) revoke or expire follow tokens already minted as the owner, since they outlive this change; (2) one-line docs note (docs/features) that a private app needs its spawner to keep read access.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs