Skip to content

chore(groom): delete the superseded key-broker.mjs loopback proxy and its test - #326

Merged
mattmillerai merged 4 commits into
mainfrom
matt/be-15722-delete-key-broker
Sep 20, 2026
Merged

mattmillerai merged 4 commits into
mainfrom
matt/be-15722-delete-key-broker

Conversation

@mattmillerai

Copy link
Copy Markdown
Contributor

ELI-5

The groom workflow used to reach Anthropic through a little localhost proxy, key-broker.mjs. That was replaced a while ago by the agent sandbox, which uses broker.mjs over a unix socket instead. The old proxy has been sitting in the repo ever since, loaded by nothing — but it lives inside the groom fleet's watched surface, so any commit that touched it would fan a no-op SHA-bump PR to every groom caller. This deletes it, its test, and its README section.

What changed

  • Deleted .github/groom/key-broker.mjs and .github/groom/tests/test_key_broker.py.
  • .github/groom/README.md — removed the key-broker.mjs — the localhost API-key proxy section (heading through its groom.yml wiring blockquote), and dropped the sentence in the tests/ bullet about key-broker tests booting the real script under node.
  • .github/workflows/bump-groom-callers.yml — rewrote the DELIBERATELY ABSENT comment above WATCHED_EXEC. WATCHED_EXEC, WATCHED_ASSETS and the paths: filter are unchanged — the deleted file was never listed in any of them.
  • .github/groom/jail-shim.mjs:7 — comment says "the broker (broker.mjs)" instead of "the key-broker (broker.mjs)", removing the last misleading mention.
  • The commit carries Skip-caller-bump: true as its sole trailing trailer (verified with git interpret-trailers --parse), so the removal does not itself fan a churn bump. Please keep that trailer intact in the squash-merge messagepreflight.sh reads it only from the trailing trailer block.

Why the deleted README section needed no relocation

The section's blockquote was the guidance to check: if it were the only place the sandbox / broker.mjs hand-off is described, that paragraph had to move rather than die. It is not. ## The agent sandbox — agent-sandbox.sh + broker.mjs already describes the per-job composition end to end — the broker step holding secrets.ANTHROPIC_API_KEY and starting broker.mjs on $BROKER_SOCK, the sandbox preflight, the agent step running with a DUMMY key and ANTHROPIC_BASE_URL pointed at the in-jail jail-shim.mjs, the literal-key scan/capture tripwires, and the always() broker cleanup. Nothing unique was lost, so the blockquote is deleted rather than moved.

Evidence it is dead (re-confirmed, not taken on faith)

Deleting a credential-handling file is a capability removal, so I went and looked via every path rather than trusting the prior investigation:

  • grep -n "broker.mjs" .github/workflows/groom.yml → the three agent jobs each run nohup node "$GROOM_ASSETS/broker.mjs" "$BROKER_SOCK" (lines 1501, 2001, 2941). No reference to the deleted file anywhere in groom.yml.
  • agent-sandbox.sh and jail-shim.mjs reference only broker.mjs / /run/broker.sock.
  • gh search code "key-broker.mjs" --owner Comfy-Org → 6 hits, all in this repo, all now removed by this diff (README ×2, the bump-fleet comment ×2, the test ×2). A second search for key_broker returned nothing.
  • git log -- .github/groom/key-broker.mjs → one commit, the one that added it. Nothing has touched it since.
  • The file was never in WATCHED_EXEC, so its deletion cannot trip preflight.sh's decommission probe, and WATCHED_ASSETS (.github/groom) still resolves.
  • Its GROOM_BROKER_PORT / GROOM_BROKER_UPSTREAM env knobs and port 8199 now appear nowhere in the tree, so removing the README's knob table orphans no live configuration.
  • Post-change git grep -n key-broker returns nothing.

Judgment call

The ticket asked for two things that cannot both hold: rewrite the DELIBERATELY ABSENT comment to name key-broker.mjs as removed, and have git grep -n key-broker return nothing. I resolved in favour of the mechanical check — the rewritten comment states the rule ("this list names only what groom.yml actually starts") and identifies the deleted file by its originating ticket id (BE-4419) rather than by filename, so nothing dangling remains for a future grep to surface while the note still explains why the list is short. Flagging it because it is a deliberate deviation from the literal instruction.

Verified

  • python3 -m unittest discover -s .github/groom/tests -p 'test_*.py' -v → 393 tests, OK
  • bash .github/bump-callers/tests/test_paths_contract.sh → 148 passed, 0 failed; the groom fleet's all 13 WATCHED_EXEC entries resolve to tracked files assertion still passes and the entry count is unchanged
  • bash .github/bump-callers/tests/test_preflight.sh → 445 passed, 0 failed
  • shellcheck -x .github/bump-callers/*.sh .github/bump-callers/tests/*.sh → clean; shellcheck -x .github/groom/*.sh → clean
  • python3 .github/workflow-pins/check_workflow_pins.py → OK, 11 workflows, 156 uses: refs SHA-pinned
  • python3 .github/agents-md-integrity/check_agents_md.py --root . → passed (2 pre-existing warnings, unrelated)
  • shellcheck -x .github/lint/check-org-repo-literals.sh && bash .github/lint/check-org-repo-literals.sh → OK
  • node --check .github/groom/jail-shim.mjs → OK
  • git grep -n key-broker → no output
  • git log -1 --format=%B | git interpret-trailers --parseSkip-caller-bump: true

Residual

  • .github/groom/tests/sandbox-tests.sh was run but could not be made green on this host, and that is pre-existing. It fails at FAIL: broker credential proxy with node: command not found inside the bwrap jail — this host's node lives outside the paths the jail bind-mounts. I confirmed the identical failure on the unmodified checkout before my change, so it is environmental, not a regression; CI is the authority for that suite. It is nonetheless a named groom artifact I did not observe passing against this diff. My change to the only file that suite exercises here is a one-word comment edit in jail-shim.mjs.
  • A pre-existing doc inconsistency is now more exposed, and I did not fix it (out of scope). The deleted blockquote said the pre-BE-4303 state was the BE-4311 loopback-TCP broker with a dummy key; the surviving ## The agent sandbox section says that before BE-4303 "the three agent steps used a hand-rolled chmod/env -u scrub with the real key in the step env". Those describe the same period differently. With the blockquote gone, only the second account remains, and I left it untouched rather than rewrite history prose I cannot verify. Worth one pass by someone who remembers which is right.
  • The fallback path in the source request was not taken and remains available. If a reviewer would rather keep the proxy as a documented standalone tool, the alternative is to exclude it from the groom fleet (paths: negative glob + a WATCHED_PATHSPECS exclude) instead of deleting — note that the WATCHED_PATHSPECS block that approach needs only exists once ci(bump-callers): exclude tests/ and README.md from the agents-md, coderabbit-config, groom and cursor-review fleets #324 merges, which it has not. I chose deletion because the evidence above shows no consumer, inside or outside this repo.

Provenance

  • Authored by: agent-work loop
  • Verified: groom unittest suite 393 passed / 0 failed; test_paths_contract.sh 148 passed / 0 failed; test_preflight.sh 445 passed / 0 failed; check_workflow_pins.py OK (156 refs pinned); check_agents_md.py passed (2 pre-existing warnings); check-org-repo-literals.sh OK; shellcheck clean on bump-callers + groom shell; git grep -n key-broker empty
  • Deviations: the DELIBERATELY ABSENT comment identifies the deleted proxy by ticket id rather than filename, so that git grep -n key-broker returns nothing (see "Judgment call"); sandbox-tests.sh could not be run green on this host for a pre-existing environmental reason (see "Residual")

…-4419 -> BE-4303)

`key-broker.mjs` was the BE-4311 loopback-TCP API-key proxy. BE-4303 replaced
that wiring with the agent sandbox: all three groom agent jobs now start
`broker.mjs` on a bind-mounted unix socket and bridge it with the in-jail
`jail-shim.mjs`. Nothing has loaded `key-broker.mjs` since, so its only live
effect was sitting inside the groom fleet's watched surface, where a commit
touching it fans a no-op SHA-bump PR across every groom caller.

Re-confirmed dead before deleting: `groom.yml` starts `broker.mjs` in all three
agent jobs and never names the deleted file; `agent-sandbox.sh` and
`jail-shim.mjs` reference only `broker.mjs`; an org-wide code search returned
only this repo's own README, test and the bump-fleet comment; its whole history
is the one commit that added it. Its `GROOM_BROKER_PORT` / `GROOM_BROKER_UPSTREAM`
knobs and port 8199 had no other reader, so the README table goes with it.

The README's "The agent sandbox" section already carries the broker.mjs /
jail-shim / dummy-key hand-off and the literal-key output scans, so the deleted
section's `groom.yml wiring` blockquote had nothing unique to relocate.

`WATCHED_EXEC`, `WATCHED_ASSETS` and the `paths:` filter of
`bump-groom-callers.yml` are unchanged — the deleted file was never listed. Its
DELIBERATELY-ABSENT note is rewritten to keep the rule it recorded (only what
`groom.yml` actually starts belongs on the list) without naming a file that no
longer exists.

Skip-caller-bump: true
@mattmillerai mattmillerai added cursor-review Multi-model cursor review agent-coded Authored by the agent-work loop labels Sep 19, 2026
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Warning

Review paused — included plan limit reached

Keep your review moving with free on-demand reviews.

  • Run this review for free

On-demand reviews are free for the next 20 days.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Promotion and pricing details

On-demand reviews are free for the next 20 days. After that, they cost $0.25 per reviewed file.

Review limit details

Or wait 58 minutes for your next included review.

Check out review usage here.

Limit details: You’ve used the included review currently available. Your 144 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: ec078b4c-1039-4f65-b4be-acd0b43c96da

📥 Commits

Reviewing files that changed from the base of the PR and between df7422f and ef6a446.

📒 Files selected for processing (5)
  • .github/groom/README.md
  • .github/groom/jail-shim.mjs
  • .github/groom/key-broker.mjs
  • .github/groom/tests/test_key_broker.py
  • .github/workflows/bump-groom-callers.yml

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

Found 1 finding(s).

Severity Count
🟢 Low 1

Panel: 6/6 reviewers contributed findings.

Comment thread .github/workflows/bump-groom-callers.yml Outdated
mattmillerai and others added 3 commits September 19, 2026 01:14
… not "what groom.yml starts"

The replacement comment claimed the list "names only what `groom.yml` ACTUALLY
starts — broker.mjs", which is both false and self-contradicting: 13 of the 13
entries include the three briefs, package.json and five .py modules that no step
starts, and the paragraphs directly above already state the real inclusion test
("absence breaks a pinned caller at run time", NOT "is it an executable"). A
maintainer applying the comment as written would prune those entries and
silently weaken the per-file decommission probe.

Restate it as the CONVERSE of the run-time test, and demote the
broker.mjs-vs-the-deleted-proxy point to the worked example it always was.

Raised by 3 of 6 cursor-review reviewers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…flight

`sandbox-tests` has been failing on every run since the runner image's cached
package list fell behind the Ubuntu pool: preflight() ran `apt-get install -y
bubblewrap` with no prior refresh, so apt tried to fetch the exact superseded
version it still believed in and got a 404.

    Err:2 ... noble-updates/main amd64 bubblewrap amd64 0.9.0-1ubuntu0.1
      404  Not Found
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Reproduced on a fresh runner (attempt 3, 9s), so it is not a transient mirror
blip. The damage is not just a red check: a stale-index 404 surfaces to the
caller as preflight's fail-loud "sandbox unavailable on this runner image"
verdict, which is a claim about the runner's namespace support, not about apt.

`apt-get update || true` — a flaky mirror during the refresh is survivable, and
the install below stays the step that must fail loud. The fast path (bwrap
present and selftest green) still short-circuits before either call, so this
costs nothing on a warm runner.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…key-broker

# Conflicts:
#	.github/groom/agent-sandbox.sh
@mattmillerai
mattmillerai merged commit 9cbbaa9 into main Sep 20, 2026
9 checks passed
@mattmillerai
mattmillerai deleted the matt/be-15722-delete-key-broker branch September 20, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded Authored by the agent-work loop cursor-review Multi-model cursor review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants