Skip to content

gh-shim: refuse GitHub writes from worker shells with a report-to-parent instruction - #1065

Queued
aft-alfonso[bot] wants to merge 9 commits into
mainfrom
land/gh-worker-write-refusal
Queued

aft-alfonso[bot] wants to merge 9 commits into
mainfrom
land/gh-worker-write-refusal

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

A worker shell carries the read broker and never a write ticket, so a write such as gh issue comment from it could never succeed. It used to end in the governance-unavailable refusal, which told the agent to retry. Now any write-class command from a worker shell is refused up front, before the manifest lookup, the rung probe and any broker or relay traffic, with exit 86 and the approved text:

gh-shim: gh_shim_worker_write_refused: workers cannot write to GitHub; report what should be posted to your parent instead

Unchanged: worker reads still go through the broker. Head-session writes still route through the relay. Credential commands from a worker (gh auth token, auth status --show-token, auth login) keep their existing gh_shim_operator_credentials refusal.

Tests check the exact line the agent sees (through a test-only refusal sink), six write shapes with zero delegation, identity lookups, relay requests or broker connections, a brokered worker read and a routed head write that refuse nothing, and the credential commands. 417 gh_shim tests pass on Linux; Windows target check with -D warnings passes.


Summary by cubic

Worker shell GitHub writes are now refused up front instead of ending in the governance-unavailable refusal that looped the agent back to retry.

The refusal exits with 86 and the exact line gh-shim: gh_shim_worker_write_refused: workers cannot write to GitHub; report what should be posted to your parent instead, before manifest lookup, rung probe, or any broker/relay traffic. Worker reads, head-session writes, and credential commands (gh auth token, auth status --show-token, auth login) keep their existing behavior.

  • Adds a test-only refusal sink so tests assert the exact rendered refusal the agent sees.
  • Covers six write shapes with zero delegation or lookups, brokered reads, routed head writes (stabilized with a seeded cached rung so the test never depends on live discovery timing), and credential refusals.

Written for commit 9a128a6. Summary will update on new commits.

View guided diff Turn on auto-fix

ualtinok and others added 9 commits October 28, 2026 00:39
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit bd95058b5db40cd375158c8fadf5d49a187e2060)
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit bfc3c8cd7001d84ab0eb298bdf849ca0a165bb4e)
…nk for tests

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit 5cc3b1815a20bfe70881531873d40667d269ac05)
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit 282847dbf9ab0ade4186d38a096ce632ca911f65)
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit 97e5251a0a4fb29131b3fc4a74c61bc99a964bce)
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 28, 2026
Any commits made after this event will not be merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant