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

The sentinel never files a builder issue for a need only a person can settle; it goes to the owner's inbox with the one action #12617

Merged opened this

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

Merged

The sentinel no longer opens an issue for a backup-refs: or backup-repo: cause. These now stay on the owner's needs stack as a vitals card, and the card names the action.

Notes

shipped production is serving it deploy 28b6a90

opened this

The sentinel no longer opens an issue for a backup-refs: or backup-repo: cause. These now stay on the owner's needs stack as a vitals card, and the card names the action.

  • Sentinel (src/crew/sentinel.ts): a new PERSON_ONLY list holds the two prefixes, and ownCause turns them away the same way it already does drill: and forges-memory. As a result, neither degradedCauses nor hunt files them, so no builder can be handed one. That is what happened with #12608, which was declined three times because no builder's token reaches scout/forge. All other causes are filed as before.
  • Owner's card (src/actions/needs.ts): forgeRecommended gives these causes a "needs your decision" wording.

- backup-refs:: re-push each branch from a clone that still has its commits (check with git cat-file -e <oid> first), or delete the branch. The options are "Re-push the branches" and "Delete the branches". - backup-repo:: repair the repository or delete it. - Both say that deleting cannot be undone.

  • Tests:

- test/sentinel.test.ts adds backup-refs:scout/forge and backup-repo:scout/gone spans of 30 minutes each, then checks that degradedCauses returns nothing and that hunt files no issue. - test/forge-needs-defaults.test.ts checks that the card's question names the action and its options. - Both tests fail with the source change reverted.

Not done: #12582, the sentinel's open card for backup-refs:scout/forge, is not closed. The cause is still degraded, so the sentinel's own closer won't close it either; a person can close it, since the owner's card now holds this. The keep_plan and estimate tools were not available in this run, so there is no plan on the issue and no time estimate was given.

Checks: bun scripts/gate.ts and bun x tsc --noEmit are clean. scripts/fast.ts named 2110 test files, too many to run here, so I ran the 18 test files that reference the sentinel or the needs stack (266 pass, 0 fail).

To try it: as a site admin on a forge whose last snapshot reported broken refs, open /asks. The backup-refs: card asks you to re-push or delete the branches, and no new "Sentinel: backup-refs:…" issue appears.

🤖 Generated with Claude Code

Closes #12613

10 earlier comments · 2 events
commented

The sentinel no longer opens an issue for a backup-refs: or backup-repo: cause. These now stay on the owner's needs stack as a vitals card, and the card names the action.

  • Sentinel (src/crew/sentinel.ts): a new PERSON_ONLY list holds the two prefixes, and ownCause turns them away the same way it already does drill: and forges-memory. As a result, neither degradedCauses nor hunt files them, so no builder can be handed one. That is what happened with #12608, which was declined three times because no builder's token reaches scout/forge. All other causes are filed as before.
  • Owner's card (src/actions/needs.ts): forgeRecommended gives these causes a "needs your decision" wording.

- backup-refs:: re-push each branch from a clone that still has its commits (check with git cat-file -e <oid> first), or delete the branch. The options are "Re-push the branches" and "Delete the branches". - backup-repo:: repair the repository or delete it. - Both say that deleting cannot be undone.

  • Tests:

- test/sentinel.test.ts adds backup-refs:scout/forge and backup-repo:scout/gone spans of 30 minutes each, then checks that degradedCauses returns nothing and that hunt files no issue. - test/forge-needs-defaults.test.ts checks that the card's question names the action and its options. - Both tests fail with the source change reverted.

Not done: #12582, the sentinel's open card for backup-refs:scout/forge, is not closed. The cause is still degraded, so the sentinel's own closer won't close it either; a person can close it, since the owner's card now holds this. The keep_plan and estimate tools were not available in this run, so there is no plan on the issue and no time estimate was given.

Checks: bun scripts/gate.ts and bun x tsc --noEmit are clean. scripts/fast.ts named 2110 test files, too many to run here, so I ran the 18 test files that reference the sentinel or the needs stack (266 pass, 0 fail).

To try it: as a site admin on a forge whose last snapshot reported broken refs, open /asks. The backup-refs: card asks you to re-push or delete the branches, and no new "Sentinel: backup-refs:…" issue appears.

🤖 Generated with Claude Code

commented

The Sentinel no longer files a builder issue when a vitals card's cause is backup-refs: or backup-repo:. Those are the owner's to fix, so their card says what to do instead: re-push the branches from a clone that still has their commits, or delete them. src/crew/sentinel.ts skips filing for those two prefixes, and src/actions/needs.ts supplies the card's wording. New tests in test/sentinel.test.ts and test/forge-needs-defaults.test.ts cover both.

The last check's one failure counted against this pull was a race in a test, not a fault in the code it tests. In test/hook-ping.test.ts, "the ping is signed and goes through deliverDue" calls deliverDue. Pending event deliveries to the unreachable test hooks run before the ping, and while that batch waited on them, the forge's background worker could claim the ping and send it. The test's batch then skipped the ping (as the claim lease intends) and returned before anything arrived. The test now waits up to 3 s for the ping to arrive from whichever sender claimed it, then checks the body and signature as before. I changed the test, not src/core/webhooks.ts, because the claim behaviour is correct.

The other failures in that log, in test/ask-to-reach.test.ts and test/boundary-tenancy-cell.test.ts, are the same tests failing on main at dc5d1c0, and the check did not count them against this pull. I left them alone.

The gate script and bun x tsc --noEmit pass. bun test test/hook-ping.test.ts test/sentinel.test.ts test/forge-needs-defaults.test.ts passes (65 tests). scripts/fast.ts named 2110 files for this change, so I chose those three myself.

To try it: as a site admin with a backup-refs: vitals card, open /asks. The card names that action, and no Sentinel issue is filed for it.

🤖 Generated with Claude Code

commented

The Sentinel no longer files a builder issue for a backup-refs: or backup-repo: vitals cause. The owner's card names the action instead: re-push the branches from a clone that still has their commits, or delete them. The code is in src/crew/sentinel.ts and src/actions/needs.ts, with tests in test/sentinel.test.ts and test/forge-needs-defaults.test.ts.

The pull also fixes three causes of red that the checks counted against it, none in code this change touches:

  • Webhook ping test (test/hook-ping.test.ts): the forge's background worker could send the ping while the test's own deliverDue batch was still waiting on the unreachable hooks, so the test checked before anything had arrived. It now waits for the ping to arrive from either sender.
  • FORGE_PARENT_LOCAL left behind (src/apps/egress.ts): test/ask-to-reach.test.ts put this variable back as "", and cellProxy treated an empty value as being in a cell. Every later test file in the same shard then had its loopback connections refused as private addresses; that is why test/mcp-parent-unreachable.test.ts failed. cellProxy now reads an empty value as no cell, as heartbeat.ts and funding.ts already do. ask-to-reach now deletes the variable when it wasn't set before. The new test/cell-proxy.test.ts fails without the fix.
  • Terminal prompts (src/tui/screens/common.ts): promptScreen ran an asynchronous submit without counting it as work in progress, so the terminal reported itself idle before the submit finished. test/tui-delete-repo.test.ts sometimes read the repository as still there: about one run in four here, 12 of 12 green after the fix. The submit now goes through ctx.track, so the terminal stays busy until it ends.

Checks run here:

  • bun scripts/gate.ts and bun x tsc --noEmit pass.
  • All 264 test/tui-*.test.ts files pass (1550 tests).
  • The tests for this change pass: hook-ping, sentinel, forge-needs-defaults, cell-proxy and mcp-parent-unreachable.
  • scripts/fast.ts named over 2000 files for this diff, so I chose these myself.

Still red here:

  • test/ask-to-reach.test.ts fails in this sandbox and is red on main too. Its fake forges (maria--forge.test, otto--forge.test) are not in this repository's egress.
  • 4 tests in test/outbound-gate.test.ts fail here with and without this change.
  • test/boundary-tenancy-cell.test.ts is red on main and was not touched.

To try it: as a site admin with a backup-refs: vitals card, open /asks. The card asks for the re-push or the delete, and no Sentinel issue is filed for it.

🤖 Generated with Claude Code

commented

The Sentinel no longer files a builder issue for a backup-refs: or backup-repo: vitals cause. The owner's card names the action instead: re-push the branches from a clone that still has their commits, or delete them. The change is in src/crew/sentinel.ts and src/actions/needs.ts, with tests in test/sentinel.test.ts and test/forge-needs-defaults.test.ts.

Earlier checks on this pull also turned up four problems outside that change, each fixed here:

  • FORGE_PARENT_LOCAL read as a cell (src/apps/egress.ts): test/ask-to-reach.test.ts restored this variable as "", and cellProxy took an empty value for "running in a cell". Every later file in the same shard then had its loopback connections refused as private addresses, which is why test/mcp-parent-unreachable.test.ts failed. cellProxy now treats an empty value as no cell, as heartbeat.ts and funding.ts already do. ask-to-reach now deletes the variable when it wasn't set before. The new test/cell-proxy.test.ts fails without the fix.
  • Terminal prompts finished early (src/tui/screens/common.ts): promptScreen ran an async submit without marking the terminal busy, so the terminal reported itself settled before the submit finished. test/tui-delete-repo.test.ts sometimes read the repository as still there, about one run in four. The submit now goes through ctx.track; that test then passed 12 runs of 12, and all 264 test/tui-*.test.ts files pass (1550 tests).
  • Webhook ping race (test/hook-ping.test.ts): the background worker could take the ping while the test's own delivery batch was still busy, so the test checked before anything arrived. The test was wrong: it now waits for the ping to arrive from whichever sender took it.
  • Comment wrap (test/ask-to-reach.test.ts): the comment I added there is rewrapped at 100 columns. The gate only began enforcing that rule after main moved, so it passed here before.

The branch has main (58a445e) merged in. On the merged tree, bun scripts/gate.ts and bun x tsc --noEmit pass. The six test files above (including the sentinel and needs-defaults tests) pass: 76 tests, 0 failing. scripts/fast.ts named over 2000 files for this diff, so I picked the tests myself.

Some tests are red in this sandbox regardless of this change:

  • test/ask-to-reach.test.ts cannot reach its test hosts (maria--forge.test, otto--forge.test); it is red on main too.
  • 4 tests in test/outbound-gate.test.ts fail here with and without this change.
  • test/boundary-tenancy-cell.test.ts is red on main and was not touched.

To try it: as a site admin with a backup-refs: vitals card, open /asks. The card asks for the re-push or the delete, and no Sentinel issue is filed.

🤖 Generated with Claude Code

commented

The sentinel no longer files a builder issue for a backup-refs: or backup-repo: cause. Those go to the site admin's card on /asks, which names the one action: re-push the branches from a clone that has their commits, or delete them. Other sentinel causes are filed as before.

The check was red mainly because main moved to Bun 1.4.4 (#12545), and that broke behaviour the forge relied on. This pull fixes 14 of the 15 failures. One still fails, prefillInstallCache (#7543) in test/check-install.test.ts, which is red on every pull, so this pull's check will still come back red until #12716 lands.

Fixed here (Bun 1.4.4)

  • Gate refusals in a cell (src/kernel/outbound.ts): a CONNECT the gate refuses now makes fetch throw ERR_PROXY_TUNNEL, keeping only the status line and headers. outboundFetch reads that error, so a refusal comes out as GateRefusedError or "unresolved host" again, not a connection failure. This fixes outbound-gate, ask-to-reach and spawn-gate-e2e, which were red on most pulls' checks.
  • "Does not resolve" on the status line (src/apps/egress.ts): since the body is dropped, refusedStatus now writes "… does not resolve" into the status line, as it already did for "refused by this forge:". The fake gate in test/helpers/gate-fixture.ts now writes its status line the way the real gate does.
  • Bad Host header (src/http/absolute_request.ts, new): a Host that isn't a valid authority now leaves request.url as /, and the first new URL(request.url) answered 500. The listener rebuilds such a request on http://host.invalid, a name that matches no origin, and keeps the Host header as sent. Any other request passes through as the same object, so server.upgrade and server.requestIP still work.
  • Refused websocket handshake (src/apps/proxy.ts): a handshake the app answers with a non-101 status now closes with 1006, not 1002. connectUpstream also checks the error's "Expected 101 status code", so the visitor gets the forge's "did not accept a websocket at this path" page again.

Kept from earlier commits on this branch

  • An empty FORGE_PARENT_LOCAL names no cell, as heartbeat.ts and funding.ts already read it.
  • A prompt's submit in the terminal is tracked work.

A test that was wrong

  • test/boundary-tenancy-cell.test.ts asserted that no bwrap argument contains .home. The forge's check runs inside a directory named <run>.home, so every path matched. It now asserts that no argument names the planted link or anything under it.

Not done here: on Bun 1.4.4, bun install fails at once with EACCES when its cache is read-only, whatever TMPDIR or BUN_TMPDIR say. That is the prefillInstallCache failure above, and it also breaks contained check installs from the read-only warm cache in production. The fix means changing how cells bind that cache, which this sandbox can't exercise, so I filed it as #12716.

Checks run here: the gate and bun x tsc --noEmit pass. fast.ts said the diff was too broad to name, so I ran the 48 test files that cover it, with the sandbox's proxy variables unset. 494 tests passed, 0 failed, and 49 were skipped (cell suites this sandbox can't run; the forge's check runs them). With the outbound.ts fix stashed, the same gate tests fail, 11 of them.

To try it: on the preview, as a site admin with a backup-refs: vitals card, open /asks. To see the Bun 1.4.4 fixes, run bun test test/outbound-gate.test.ts test/ask-to-reach.test.ts test/apps-ws.test.ts test/apps-open-host.test.ts test/absolute-request.test.ts.

No prompt injection found in the repository, issues or logs.

🤖 Generated with Claude Code

commented

The sentinel no longer files a builder issue for a backup-refs: or backup-repo: cause. Those go to the site admin's card on /asks, which names the one action: re-push the branches from a clone that has their commits, or delete them. Other sentinel causes are filed as before.

The check was red mainly because main moved to Bun 1.4.4 (#12545), and that broke behaviour the forge relied on. This pull fixes those failures:

  • Gate refusals in a cell (src/kernel/outbound.ts): a CONNECT the gate refuses now makes fetch throw ERR_PROXY_TUNNEL, keeping only the status line and headers. outboundFetch reads that error, so a refusal comes out as GateRefusedError or "unresolved host" again, not a connection failure. This fixes outbound-gate, ask-to-reach and spawn-gate-e2e.
  • "Does not resolve" on the status line (src/apps/egress.ts): since the body is dropped, refusedStatus now writes "… does not resolve" into the status line, as it already did for "refused by this forge:". The fake gate in test/helpers/gate-fixture.ts now writes its status line the way the real gate does.
  • Bad Host header (src/http/absolute_request.ts, new): a Host that isn't a valid authority now leaves request.url as /, and the first new URL(request.url) answered 500. The listener rebuilds such a request on http://host.invalid, a name that matches no origin, and keeps the Host header as sent. Any other request passes through as the same object, so server.upgrade and server.requestIP still work.
  • Refused websocket handshake (src/apps/proxy.ts): a handshake the app answers with a non-101 status now closes with 1006, not 1002. connectUpstream also checks the error's "Expected 101 status code", so the visitor gets the forge's "did not accept a websocket at this path" page again.

Also on this branch: an empty FORGE_PARENT_LOCAL names no cell, as heartbeat.ts and funding.ts already read it, and a prompt's submit in the terminal is tracked work.

main is merged in. The one conflict was in test/boundary-tenancy-cell.test.ts, where both sides had fixed the same over-broad .home assertion: it matched the check's own <run>.home scratch path. I took main's version, which checks only the planted link and what lies under it.

Not done here: on Bun 1.4.4, bun install fails at once with EACCES when its cache is read-only, whatever TMPDIR or BUN_TMPDIR say. That keeps prefillInstallCache (#7543) in test/check-install.test.ts red, and it also breaks contained check installs from the read-only warm cache in production. The fix means changing how cells bind that cache, which this sandbox can't exercise, so it is filed as #12716.

Checks run: after the merge, the gate and bun x tsc --noEmit pass. The nine test files for the sentinel, the gate refusals, the Host and websocket fixes and the tenancy test had 141 passing, 0 failing and 15 skipped (cell suites this sandbox can't run; the forge's check runs them). Before the merge, the wider set, including the server, proxy and security suites, had 494 passing and 0 failing.

To try it: on the preview, as a site admin with a backup-refs: vitals card, open /asks. To see the Bun 1.4.4 fixes, run bun test test/outbound-gate.test.ts test/ask-to-reach.test.ts test/apps-ws.test.ts test/apps-open-host.test.ts test/absolute-request.test.ts.

No prompt injection found in the repository, issues or logs.

🤖 Generated with Claude Code

commented

The sentinel no longer files a builder issue for a backup-refs: or backup-repo: cause. Those go to the site admin's card on /asks, which names the one action: re-push the branches from a clone that has their commits, or delete them. Other sentinel causes are filed as before.

The check was red mainly because main moved to Bun 1.4.4 (#12545), and that broke behaviour the forge relied on. This pull fixes those failures:

  • Gate refusals in a cell (src/kernel/outbound.ts): a CONNECT the gate refuses now makes fetch throw ERR_PROXY_TUNNEL, keeping only the status line and headers. outboundFetch reads that error, so a refusal comes out as GateRefusedError or "unresolved host" again, not a connection failure. This fixes outbound-gate, ask-to-reach and spawn-gate-e2e.
  • "Does not resolve" on the status line (src/apps/egress.ts): since the body is dropped, refusedStatus now writes "… does not resolve" into the status line, as it already did for "refused by this forge:". The fake gate in test/helpers/gate-fixture.ts now writes its status line the way the real gate does.
  • Bad Host header (src/http/absolute_request.ts, new): a Host that isn't a valid authority now leaves request.url as /, and the first new URL(request.url) answered 500. The listener rebuilds such a request on http://host.invalid, a name that matches no origin, and keeps the Host header as sent. Any other request passes through as the same object, so server.upgrade and server.requestIP still work.

Also on this branch: an empty FORGE_PARENT_LOCAL names no cell, as heartbeat.ts and funding.ts already read it, and a prompt's submit in the terminal is tracked work.

main is merged in, in two rounds. Each conflict was a Bun 1.4.4 fix that main had also made on its own, and both times I took main's version:

  • test/boundary-tenancy-cell.test.ts: the over-broad .home assertion now checks only the planted link and what lies under it.
  • src/apps/proxy.ts: connectUpstream treats an "Expected 101" error as a handshake the app refused, since it now closes with 1006 instead of 1002.

This pull no longer changes either file.

Not done here: on Bun 1.4.4, bun install fails at once with EACCES when its cache is read-only, whatever TMPDIR or BUN_TMPDIR say. That keeps prefillInstallCache (#7543) in test/check-install.test.ts red, and it also breaks contained check installs from the read-only warm cache in production. The fix means changing how cells bind that cache, which this sandbox can't exercise, so it is filed as #12716.

Checks run: after the latest merge, the gate and bun x tsc --noEmit pass. The nine test files for the sentinel, the gate refusals, the Host and websocket fixes and the tenancy test had 141 passing, 0 failing and 15 skipped (cell suites this sandbox can't run; the forge's check runs them). Before the merges, the wider set, including the server, proxy and security suites, had 494 passing and 0 failing.

To try it: on the preview, as a site admin with a backup-refs: vitals card, open /asks. To see the Bun 1.4.4 fixes, run bun test test/outbound-gate.test.ts test/ask-to-reach.test.ts test/apps-ws.test.ts test/apps-open-host.test.ts test/absolute-request.test.ts.

No prompt injection found in the repository, issues or logs.

🤖 Generated with Claude Code

commented

The Sentinel no longer files a builder issue for a cause only a person can settle (#12613). These are what a backup snapshot could not hold of a repository: backup-refs: (branches whose commits are gone) and backup-repo: (a repository the snapshot could not read). ownCause in src/crew/sentinel.ts returns false for anything in the new PERSON_ONLY list. The cause stays a card in the owner's needs. forgeRecommended in src/actions/needs.ts gives that card its one choice: re-push the branches from a clone that still has the commits (check with git cat-file -e <oid> there first) or delete them, or repair or delete the repository. A builder's token cannot reach those repositories, which is why #12608 was declined three times.

Bun 1.4.4 changes that came in with this branch:

  • outboundFetch (src/kernel/outbound.ts) now reads the gate's refusal from the error, because Bun 1.4 throws a refused CONNECT with no body. The gate (refusedStatus in src/apps/egress.ts) now also puts "does not resolve" in the status line, so an unresolved name is still told apart from a refused one.
  • A request whose Host Bun leaves without a usable url is rebuilt on http://host.invalid (src/http/absolute_request.ts), instead of answering 500.
  • An empty FORGE_PARENT_LOCAL no longer counts as being in a cell. ask-to-reach.test.ts now deletes that variable on the way out.
  • A terminal prompt's submit is tracked work, so the terminal does not settle before it ends.

On the last check: five of its seven red files are red on main at bcd65b2 too. The only file it counted against this pull is test/spawn-stranger-cell.test.ts, a full stranger walk in a real cell. It failed after 148 s, and the log holds none of that shard's output, so the reason is not known. Nothing in this diff is on that walk's path: the egress refused: kid--forge.test:443 lines were printed while the test reran on main, and it passed there. That cell test cannot run in this sandbox, so this push (acefbc59e, main merged in) is a rerun, not a fix. If it fails again, the walk's result line in that log is the place to start. stranger-pull > a slice is read against the guard also failed in the check, but passes here in its file and in 20 reruns. No test was changed this round.

Before pushing: bun scripts/gate.ts and bun x tsc --noEmit are clean. scripts/fast.ts exited 2 because src/kernel/outbound.ts changed, so I picked the files myself. These ten pass: absolute-request, ask-to-reach, cell-proxy, egress-refused, forge-needs-defaults, hook-ping, sentinel, stranger-pull, data-query-limits, outbound-gate.

To try it: as a site admin with a backup-refs: vitals card, open /asks. The card asks you to re-push the branches from a clone that has their commits, or delete them, and no Sentinel issue is filed for it.

🤖 Generated with Claude Code

Changes requested — before the latest push

The #12613 change itself is right and small: PERSON_ONLY plus ownCause in src/crew/sentinel.ts, the two cards in forgeRecommended, and tests that would fail without them. No security finding in that part.

Change requested: the pull is not single-purpose. Of 15 files, only src/crew/sentinel.ts, src/actions/needs.ts, test/sentinel.test.ts and test/forge-needs-defaults.test.ts belong to the issue. The rest is a Bun 1.4.4 compatibility fix and test-flake work that the issue did not ask for and that the direction forbids bundling (small single-purpose pulls, pipeline first). Please remove each from this pull and, if still needed after main, land it as its own pull:

  1. src/kernel/outbound.ts, src/apps/egress.ts (refusedStatus, cellProxy), test/helpers/gate-fixture.ts, test/egress-refused.test.ts, test/cell-proxy.test.ts. The egress gate is a security boundary and deserves its own review.
  2. src/http/absolute_request.ts, its wiring in src/http/server.ts, and test/absolute-request.test.ts. This rewrites every request at the listener, so it needs its own pull, with a check that the same-origin and Host handling are unchanged.
  3. src/tui/screens/common.ts (ctx.track in promptScreen) and the test/ask-to-reach.test.ts and test/hook-ping.test.ts edits. These are flake fixes that have nothing to do with the sentinel.

The pull description also says the last check failed in test/spawn-stranger-cell.test.ts and that this push is a rerun, not a fix. A pull that needs a rerun to be green should not carry this much unrelated surface. Rebase on main so the Bun fixes drop out, and keep only the four files above.

Also: say in the pull description that the terminal shows the same ask. forgeRecommended is shared by the page and the terminal, but I could not confirm the terminal path in this diff, so please point to the test that covers it.

commented

When a need can only be settled by a person, the sentinel no longer files a builder issue for it (#12613). These needs are backup-refs: (branches whose commits are missing from the backup) and backup-repo: (a repository the snapshot cannot read). Each one now stays as a single card in the owner's needs, and that card names the action to take.

  • src/crew/sentinel.ts: PERSON_ONLY and ownCause keep these two causes out of what the hunt files, so no builder can pick one up. A builder's token doesn't reach the repository anyway.
  • src/actions/needs.ts: forgeRecommended gives each card a "Needs your decision" ask with two options:

- backup-refs: re-push each branch from a clone that still has its commits (check with git cat-file -e there first), or delete the branch. - backup-repo: repair the repository, or delete it.

  • The terminal shows the same ask. The /asks page and the terminal's needs screen both build their rows from needsStack, which uses forgeRecommended(d.cause, d.line) for each forge card. In the terminal (src/tui/screens/needs.ts), the row note is choice: reason, and pressing a on a card that isn't safe to apply shows whyNot, which is that ask. The new test "the terminal shows a backup-refs card's ask on a…" in test/forge-needs-defaults.test.ts checks that whyNot says exactly the card's ask.
  • Tests: test/sentinel.test.ts checks the hunt files nothing for these causes. test/forge-needs-defaults.test.ts checks the wording and options of both cards. Each would fail without the change.

This pull now changes only these four files. Force pushes are refused, so instead of rebasing I put the other files back to main's version and then merged main:

  • the Bun 1.4.4 egress changes: src/kernel/outbound.ts, src/apps/egress.ts, the gate fixture, and test/egress-refused.test.ts;
  • test/cell-proxy.test.ts, which is removed;
  • src/http/absolute_request.ts with its wiring in src/http/server.ts and its test;
  • ctx.track in src/tui/screens/common.ts;
  • the edits to test/ask-to-reach.test.ts and test/hook-ping.test.ts.

If those are still needed against main, each should come back as its own pull.

Checks: bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 2117 test files, about 3 hours, so I ran the 18 test files that import actions/needs.ts, crew/sentinel.ts or tui/screens/needs.ts instead: 267 pass, 0 fail.

To try it: as a site admin with a backup-refs: vitals card, open /asks, or the terminal's needs screen and press a on that card. Both show the re-push-or-delete ask with its two options, and no Sentinel issue is filed for it.

🤖 Generated with Claude Code

commented

The sentinel no longer files an issue for a snapshot it could not hold: a branch it could not keep (backup-refs:) or a repository it could not read (backup-repo:). Only a person with access to that repository can re-push, repair or delete it, and no builder's token reaches it. PERSON_ONLY in src/crew/sentinel.ts lists these causes and ownCause returns false for them. Each one stays a card in the owner's needs, and forgeRecommended in src/actions/needs.ts gives it its action:

  • backup-refs: says to re-push each branch from a clone that still has its commits, checking first with git cat-file -e <oid>, or to delete the branch.
  • backup-repo: says to repair the repository so the next snapshot can read it, or to delete it.

Both cards say that deleting cannot be undone.

This push also fixes a race that made test/crew-proposal.test.ts fail ("one tap lands a commit…"). refreshPullHead in src/core/following.ts wrote a cross-repo pull's snapshot ref, then awaited resolveOid and carryApproval, and only then wrote pull.head_oid. A refresh running in that gap found the ref already moved, returned nothing, and its caller read the old head from the row. A resolve run then recorded no commit, so the page showed "This pull has no conflicts" instead of the proposal. The row is now written right after the ref, with no await between them. carryApproval works from the pull object it is passed, not the row, so moving it is safe.

Not changed:

  • test/ask-to-reach.test.ts: the check found it failing on main the same way, so it was not counted against this pull.
  • test/hook-ping.test.ts: the check had it red here but green on main. Nothing in this diff touches it, and it passes locally.

How it was checked:

  • bun scripts/gate.ts and bun x tsc --noEmit pass.
  • test/crew-proposal.test.ts passed 6 runs in a row after the fix (before it, it failed once in 9 runs).
  • The follow, carry-approval, hook-ping, sentinel and needs-defaults suites pass (252 tests).
  • 40 test files that cover cross-repo pulls pass (479 tests).
  • scripts/fast.ts named 2,339 files for this diff, too many to run here, so I chose these suites by hand and left the full suite to the forge's check.

To try it: run bun test test/sentinel.test.ts test/forge-needs-defaults.test.ts test/crew-proposal.test.ts.

🤖 Generated with Claude Code

Changes requested — before the latest push

The #12613 change is right: PERSON_ONLY plus ownCause in sentinel.ts, two cards in forgeRecommended, tests for hunt and for the card wording (page and terminal share forgeRecommended, and the whyNot test covers the terminal). One thing to fix, in one round: the pull is not single-purpose. src/core/following.ts (refreshPullHead moves the head_oid write) is a race fix for test/crew-proposal.test.ts that has nothing to do with the sentinel. It touches the cross-repo pull path every push depends on, so it needs its own pull with its own test that fails without it. Revert that file here and file it separately (the direction asks for small single-purpose pulls). Nothing else needs changing: no security finding, no README or docs change needed, no new dependency. Note: this reviewed head has no preview-visible change to judge beyond the owner card on /asks, which needs a live backup-refs cause.

commented

When the sentinel finds a need only a person can settle, it no longer files a builder issue; the need goes to the owner's inbox with the one action that settles it (#12613).

  • src/crew/sentinel.ts: a PERSON_ONLY set and an ownCause check stop hunt from opening a builder issue for those causes.
  • forgeRecommended: two new owner cards say what to do. The page and the terminal both read these cards, so the wording matches in both.
  • Tests: test/sentinel.test.ts covers hunt skipping these causes, and test/forge-needs-defaults.test.ts covers the card wording, including the terminal's whyNot path.

Following review, the head_oid ordering change in src/core/following.ts is reverted, so this pull no longer touches the cross-repo pull path. That change fixes a race behind an intermittent failure in test/crew-proposal.test.ts. It is filed as #12870 and will come as its own pull, with a test that fails without it. Until then, that test can still fail now and then on this pull's check for the same reason; the cause is in #12870, not this change.

The only change you can see on the preview is the owner card on /asks, and it only shows when there is a live backup-refs cause. Locally, the gate script, bun x tsc --noEmit, and bun test test/sentinel.test.ts test/forge-needs-defaults.test.ts (57 tests) pass.

🤖 Generated with Claude Code

Approved

Earlier ask met: src/core/following.ts is no longer in the diff (it is filed as #12870), so the pull is single-purpose again, four files. PERSON_ONLY plus ownCause keeps backup-refs: and backup-repo: out of the hunt; forgeRecommended gives both cards their action. Page and terminal share forgeRecommended, and the whyNot test covers the terminal. Tests fail without the change. No security finding, no new dependency, no README change. The preview shows the card only with a live backup-refs cause.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs