Skip to content

docs(waitbranch): add the WaitBranch owner contract - #2156

Closed
eric8810 wants to merge 1 commit into
mainfrom
dim/2027-waitbranch
Closed

eric8810 wants to merge 1 commit into
mainfrom
dim/2027-waitbranch

Conversation

@eric8810

Copy link
Copy Markdown
Collaborator

Owner: WaitBranch
Batch: 1
Scan issue: #2027
Old PR: #2102
Contract: docs/design/plugins/WaitBranch.md
Base: origin/main 82a91e66a
Head: 53926097d

What

Adds the WaitBranch owner contract: the line's one wait slot, the admission order, the arrivals, wait and the admitted-wait state read, NoTurn/AlreadyWaiting/Reloading/Unavailable, turn-end and close/reload settlement. The Session/branch by-id route is ADR 027's (#2127); the CLI's client path is a separate Rpc decision (#1659).

Shared rows:

  • docs/design/service-faces.md: the waitBranch row with state() and wait(request, cancelled).
  • docs/design/plugins/README.md / zh: owner index row.
  • docs/design/timeline-branches.md and zh: the steer/waiting cells link the contract.
  • docs/design/cli-current-activity.md: the named-wait decision.
  • docs/design/examples/* and the Wait page: target pointers.

Dependencies

The Wait tool (#2026) is the wait caller; ToolExecutor ends its call by cancellation before turn/end. The App Server reads state by (sessionId, branchId) through ADR 027 D1 (#2127) and answers a protocol v4 client through an Rpc method/notice (#1659, #2021). No batch-1 dependency.

Supersedes

  • docs/design/service-faces.md: the waitBranch row.
  • docs/design/timeline-branches.md and zh: the wake cells.
  • docs/design/cli-current-activity.md: the named-wait requirement.
  • docs/design/examples/wait-contract-experiment.md, wait-usage-context.md, capability-models/coverage-audit.md, timeline-contract-coverage.md.
  • docs/design/research/remote-plugins.md and docs/architecture/rust-agent/plugins/Wait.md: target pointers.

Design decisions

  • One wait slot per line; admission confirms the open turn at the committed head and its permitted publishing tail, then checks generation, turn and slot under one lock.
  • An accepted wait ends with a value (NoTurn for a call that is not admitted in a turn, AlreadyWaiting for a held slot, Interrupted at turn end, Reloading at generation end), a timeout, or Unavailable when the confirmation read fails.
  • AlreadyNotified is answered when the model read that task's notice in this turn and no eligible arrival is pending; the read-notice record is decoupled from the arrivals and covers the turn's opening input.
  • A Steer wakes any wait; a task-id wait also wakes on its task's notice.
  • state is a non-blocking read of the line's admitted wait, WaitState {waiting, startedAt?, taskId?}.
  • A closing line is answered by the by-id route as line-gone; a reload ends the generation and an admitted wait answers Reloading.

Review record

  • Pre-review rounds 1-9: no open P1/P2; all P3s fixed.
  • yyhhyyyyyy-style mock review: 2 rounds plus 2 deltas, 无 P1/P2.
  • zerob13-style mock review: 2 rounds plus 3 deltas, 无 P1/P2.
  • Non-blocking P3 notes: settle text for Unavailable; a state caller example; the NoTurn/turn-end race wording; the §7.2 "view" wording; the README By-scope row.

Ready check

  • Every operation, error and caller next step defined.
  • §7.1/§7.2 and ADR 002 rows answered.
  • Dependencies match the batch table.
  • Pre-review and both mock reviews 无 P1/P2.
  • node scripts/adr-check.mjs --base origin/main, cargo run --locked -p xtask-check, git diff --check pass.
  • No maintainer question.

Refs #2027

@eric8810

Copy link
Copy Markdown
Collaborator Author

Closing as part of abandoning the owner-split experiment.

@eric8810 eric8810 closed this Nov 25, 2026
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