Skip to content

fix(client): report a due advisory plan whose notice the sink refused - #206

Merged
gregpriday merged 6 commits into
developfrom
bugfix/issue-183-wait-and-get-hide-a-due-advisory-plan
Nov 19, 2026
Merged

gregpriday merged 6 commits into
developfrom
bugfix/issue-183-wait-and-get-hide-a-due-advisory-plan

Conversation

@gregpriday

Copy link
Copy Markdown
Contributor

Resolves #183

decisions wait and decisions get can run in a process that does not receive: a wait while listen or mcp runs, or any get. When the receiver's sink refused an advisory notice, the notice sat at needs-attention, and nothing in the store said whether the receiver had read the relay before it tried the write. So wait ran until --wait-timeout (exit 16), and get reported outcome: null and fallback_due: false. Meanwhile the receiver's get_decision said fallback_due: true.

Changes

  • Delivery records the refusal. The sink can refuse an advisory write the host had already admitted, past the replay check in thread() and both mustWait() checks under the lock. When it does, settleChunk marks the notice's entry write_refused, in the same locked write that sets needs-attention. A retry clears the mark.
  • The view treats a refused notice as settled, like a written one. AdvisoryTimeoutView.writeRefused exposes the mark. A refused notice no longer waits on the reading process's own ledger clock. Its fallbackDue follows the disposition, still recomputed from the current policy because nothing was typed. The receiver's get_decision and a bridge that never started now give the same answer.
  • It still waits on what the store shows every process, read after the row:
    • an unapplied event of its own question (a reopen read past a gap);
    • a row that changed in the meantime;
    • a store that cannot be read;
    • more unapplied events than one look reads, which hold it at most two minutes from the refused attempt, as a read of the relay in progress does.
  • outcomeOf accepts a refused notice from a non-receiving process, alongside delivered and uncertain. wait exits 13 and get reports advisory-expired, both with fallback_due: true and delivery: needs-attention.
  • A notice that needs attention for another reason keeps today's behaviour, and other processes still don't report it. That covers a pane that was gone before any write was admitted, and a refusal recorded by an older receiver, which carries no mark.
  • docs/operations.md describes the outcome and which sink failures count as a refusal. It also names the cases where get and the receiver's get_decision still differ (a notice an exec: command asked to retry with exit 75, a notice that needs attention for another reason) and what recovers them.

Known limit

The receiver's existing admission rule releases an advisory notice after a read of the relay has been under way for two minutes. A refused write in that window is marked, just as a successful write would be recorded as delivered. Observers already trust a delivered notice, so they report the refused one too. Distinguishing an active replay from a failed read would change delivery admission for every notice, which is outside this fix.

Testing

  • New e2e test in packages/cli/tests/ask-wait.test.ts: "reports a due advisory plan from another process while the receiver's sink cannot write its notice". A daemon with MCP and a file: sink in a missing directory, and a waitCmd confirmed to be only observing. It got exit 16 before the change. It now exits 13 with one result record, and get --pane mcp matches get_decision.
  • New client tests in packages/client/tests/advisory-timeout.test.ts:
    • a refused write is due in the receiver and in a bridge that never started, and stays due after a failed read;
    • a policy change withholds it;
    • a gone pane leaves no mark;
    • a stored reopen of the question holds it;
    • a full look at unapplied events holds it for two minutes;
    • a retry clears the mark, and a reopen supersedes the notice.
  • Updated the outcomeOf unit cases.
  • Ran the own and adjacent tests, then the impact set: 15 of 144 test files (10%), all green after the final rebase. prettier --check passes on the changed files. The repo has no typecheck:changed script, so no type check ran here.

…rocesses see the plan due

- Mark an advisory notice write_refused when its sink refuses a write the host admitted
- Treat a refused notice as settled in the view, like a written one, and expose writeRefused
- Let a non-receiving wait or get report advisory-expired for a refused notice
- Clear the mark when a retry sends the notice again
- A refused notice write still gives advisory-expired with fallback_due true
- Name the remaining case where get and the receiver's get_decision differ
…lied events

- A refused notice still waits while an event of its question is stored and not applied
- Say which sink failures refuse a notice, and which cases other processes still miss
- Pin the refusal's error code, attempt counts and the observing waiter in the tests
- Look for an unapplied event of its question only when the row shows a refused notice
- Hold it when the look is full, the store cannot be read, or the row moved on meanwhile
- Say that an exec command's exit 75 is retried, not uncertain
…d events

- More unapplied events than one look reads hold it two minutes at most, as a read does
- Time the hold from the refused attempt, so every process reads the same bound
@gregpriday gregpriday changed the title fix(client): report a due advisory plan when the sink refuses its notice fix(client): report a due advisory plan whose notice the sink refused Nov 19, 2026
@gregpriday
gregpriday merged commit ad71d2a into develop Nov 19, 2026
2 checks passed
@gregpriday
gregpriday deleted the bugfix/issue-183-wait-and-get-hide-a-due-advisory-plan branch November 19, 2026 14:07
@gregpriday gregpriday mentioned this pull request Nov 19, 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.

wait and get hide a due advisory plan while the receiver's sink fails

1 participant