Skip to content

Add the worker-host supervisor ownership pipe - #203

Merged
arasovic merged 2 commits into
mainfrom
run/issue-201
Sep 6, 2026
Merged

Add the worker-host supervisor ownership pipe#203
arasovic merged 2 commits into
mainfrom
run/issue-201

Conversation

@arasovic

@arasovic arasovic commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an EOF-only ownership pipe for hidden worker-host role processes on fd 5
  • keep supervisor role processes on the existing fd 3/fd 4 boundary
  • close inherited child-side handles in the parent and fail closed on partial setup
  • make ownership shutdown idempotent and include it in ordered process teardown
  • add Unix lifecycle, CLOEXEC, descriptor-order, startup-failure, and cleanup regressions while preserving non-Unix compilation

Verification

  • go test -race ./internal/background -run TestRoleProcess -count=20
  • go test -race ./internal/background -count=2
  • npm run verify
  • go build ./...
  • GOOS=windows GOARCH=amd64 go test -c ./cmd/pi-worker
  • verified no role process remained after the suite
  • independent standards review: no actionable findings
  • independent spec review: no spec gaps

Mutation proof

The focused tests failed as expected when deliberately changing each invariant in disposable worktrees:

  • omit worker fd 5
  • swap fd 4 and fd 5
  • omit fd 5 close-on-exec
  • retain the parent's child-side ownership reader after Start
  • mark ownership closed without closing the writer

The unrelated concurrent skill-rules temporary-file collision observed during verification is tracked separately in #202 and is not changed here.

Closes #201

@arasovic
arasovic merged commit 6aa200b into main Sep 6, 2026
23 checks passed
@arasovic
arasovic deleted the run/issue-201 branch September 6, 2026 23:27
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.

Add the worker-host supervisor ownership pipe

1 participant