Skip to content

docs(oh-my-pi): design task advisory for worker-thread subagents (RIG-9802) - #76

Merged
mattwilkinsonn merged 2 commits into
mainfrom
harness/rig-9802-design-task-advisory-for-worker-thread
Nov 12, 2026
Merged

mattwilkinsonn merged 2 commits into
mainfrom
harness/rig-9802-design-task-advisory-for-worker-thread

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Design record for RIG-9802. It redesigns the oh-my-pi task advisory (RigelBuild/oh-my-pi #241 and #243) so it works when subagents run on worker threads. It follows RIG-9774 option A: the parent thread owns lineage, and workers reach it over RPC.

  • R1: The main thread owns lineage. A main-only AdvisoryHub holds timers, admission state and snapshots, and workers reach it through advisoryThreadService. AssignmentLineage.onMint is the only trigger that creates a snapshot source.
  • R2: When a worker dies, every live instance homed on it is terminally disposed. Parked state has no home, so it survives worker exit as paused until release calls expireParked.
  • R3: TaskAdvisory is unchanged except for readonly contractVersion: 1 (RIG-9798).
  • R4: Admission relaxes only the running-phase check, never the assignment id, so a re-mint makes queued messages from the old assignment stale.
  • Worker-to-main callSync for reads and mutations, notify for events; main never calls a worker synchronously. The hub builds every bound message, and redaction runs on the sender's home thread.

Matt's merge freezes R1 to R4.

Verification

  • bun run gate: OK. bun run ref-gate: clean.
  • The design-critic findings F1 to F4 (at 845c2e1) are folded in.
  • No builds or tests were run; docs only.

Risks

  • R1 and R2 interpret RIG-9774. A different ruling moves the hub or changes exit cleanup.
  • R4 drops a reply queued in a child's last turn if the child is woken before the parent consumes it.

Refs RIG-9802

Co-authored-by: Matt Wilkinson matt@rigel.build

…-9802)

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Nov 12, 2026

Copy link
Copy Markdown

RIG-9802

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Rigel public design docs preview: https://harness-rig-9802-design-task.docs-2ui.pages.dev

Deployed from harness/rig-9802-design-task-advisory-for-worker-thread at 7e09682.

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Design-critic r1 on 845c2e1: 0 critical, 1 high, 2 medium, 1 low. All four are fixed in 7e09682.

  • High F1 (stale messages after a wake): new decision R4. The assignment-id check always runs, so a message from an old assignment is dropped once a new one starts. Tests cover this.
  • Medium F2 (snapshot ownership): the hub now creates sources only through the lineage onMint hook, on every mint path.
  • Medium F3 (worker exit and parked children): parked state no longer belongs to a thread, so a worker exit keeps parked children listed.
  • Low F4 (the Ray citation): rewritten; R2 is our own policy.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review November 12, 2026 02:45
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Paused 2026-11-11 for Factory self-hosting.

@mattwilkinsonn
mattwilkinsonn merged commit 65a9639 into main Nov 12, 2026
1 of 2 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the harness/rig-9802-design-task-advisory-for-worker-thread branch November 12, 2026 21:49
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.

2 participants