Skip to content

Pin the phase-1 clarification and supervised-child contracts - #327

Merged
Birfy merged 1 commit into
mainfrom
docs/198-p1-contracts
Oct 18, 2026
Merged

Birfy merged 1 commit into
mainfrom
docs/198-p1-contracts

Conversation

@hsliuustc0106

Copy link
Copy Markdown
Contributor

Fixes #326. Refs #198 (P1 prep: the two seams called out in the issue discussion as needing a contract before adapter code).

Docs-only, adds two pinned v1 sections to docs/interop/room-participants.md, both explicitly marked not-yet-implemented:

  1. Clarification contract — an external participant's turn ends in exactly one of reply / working / question; question requires a structured flybot-question block (validated taskId/turnId/text), malformed content degrades to a plain reply instead of creating a wait; only the host mints task-wait-input; answers are untrusted data and never widen permissions. DSH already satisfies this via its exchange/waiter machinery — the section states what an OpenCode adapter must provide at the same seam.
  2. Supervised child lifecycle — the driver spawns the pinned version with an empty workspace and no inherited config, persists the roomId+botId+taskId → (pid, session) mapping before first dispatch, owns teardown on round withdrawal / task cancel / member removal / room close / plugin unload (TERM→bounded wait→KILL, disposal recorded as requested/observed/uncertain), reconciles against the process table and runtime history after host restarts (orphans stopped, unconfirmable sessions uncertain with dispatch suppressed), and keeps budget counters host-side so a child restart resets nothing.

Deliberately does not touch the paragraph PR #317 reworks, so both merge independently.

What I ran at tip: full TZ=UTC npm run verify — green except the 3 known macOS-only room-collaboration failures fixed by #315 (docs-only change; CI Linux unaffected). What I did not run: nothing applicable beyond verify (no code changed).

The OpenCode adapter (P1) needs both seams fixed before code: a
machine-checked blocking-question encoding (prose creates no wait) and
the start/supervision/stop/restart-reconciliation/budget rules for the
driver-owned child process. Both sections are pinned v1 design, not
implementation.

Fixes #326

@Birfy Birfy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PASS at tip ec5c956 (T0, docs-only). The clarification contract (structured flybot-question, host-only waits, answers never widen permissions) and the supervised-child lifecycle (persisted mapping before dispatch, owned teardown, restart reconciliation, host-side budgets) match the settled #198 phase-1 decisions and don't touch the #317 paragraphs. Enqueuing.

@Birfy
Birfy added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit b11d43d Oct 18, 2026
8 checks passed
@Birfy
Birfy deleted the docs/198-p1-contracts branch October 18, 2026 10:19
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.

Pin the phase-1 design contracts: cross-runtime clarification and the supervised child lifecycle

2 participants