LearnNewsExamplesServices
Frontmatter
id15447
titleWake dispatch policy: the implementation tier — leaf + rolling/cap/refractory + atomic delivery owner + outcome truth
stateClosed
labels
enhancementai
assigneesneo-fable-clio
createdAtJul 18, 2026, 10:39 AM
updatedAtJul 18, 2026, 11:41 AM
githubUrlhttps://github.com/neomjs/neo/issues/15447
authorneo-fable-clio
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJul 18, 2026, 11:41 AM

Wake dispatch policy: the implementation tier — leaf + rolling/cap/refractory + atomic delivery owner + outcome truth

Closed Backlog/active-chunk-7 enhancementai
neo-fable-clio
neo-fable-clio commented on Jul 18, 2026, 10:39 AM

Context

Implementation leaf of #15414, split per the PR #15442 review's close-target ruling (the reviewer's RA4: the mandatory Resolves target must be fully delivered at merge, while #15414's AC6 — the wakes-per-seat dogfood receipt — is a post-merge measurement by design and must keep its carrier OPEN until the receipt lands). #15414 retains the T3 Contract Ledger, the problem archaeology, and the AC6 receipt obligation; this leaf is the Resolves target for the implementation PR.

Scope (the delivered surface, contract rows in #15414's ledger)

  1. The config leaf orchestrator.wakeDispatch.coalesceWindowSeconds (env NEO_WAKE_COALESCE_WINDOW_SECONDS, default 150s, ADR-0019-clean, parity-snapshot recorded) replacing the hardcoded Shape-C constant — under the authority of the ADR-0002 §6.4.1.1 amendment (Shape-C divergence by cost model; Shapes A/B untouched), which rides the same PR.
  2. Rolling window + 300s hard cap (ai/daemons/wake/coalescePolicy.mjs, pure): every queued event re-arms; the cap from the FIRST queued event bounds latency; the heavy-delta read-state deferral composes ABOVE the cap by design (late beats corrupt — recorded in the amendment).
  3. Post-flush refractory (~120s mechanism constant, env-tunable in the daemon's constant-override idiom) — at ARM time and at FLUSH time (computeFlushHoldMs): events queued while a digest was in flight land as the NEXT refractory-spaced digest, never a back-to-back double prompt. Explicit coalesceWindow: 0 stays exempt from all three semantics.
  4. The atomic per-subscription delivery owner: in-flight reservation before every adapter await (direct AND retry); a firing flush defers while its subscription is in flight; the retry loop snapshot-and-swaps so events merged during an await SURVIVE the outcome (union on failure, fresh cycle on success/skip).
  5. Explicit adapter outcomes delivered / skipped / failed: every fail-closed refusal returns skipped (including the previously-fall-through unknown-adapter branch); ONLY delivered arms the refractory and emits the uniform [Wake Dispatch] counting line — direct and retry symmetrically.

Acceptance Criteria

  • All five surfaces above land in one PR with the ADR-0002 amendment + the #15414 ledger in sync.
  • Policy tier unit-pinned (arm-time + flush-time arithmetic, clamp/override/immediate semantics, injectable mechanism constants).
  • Mounted composition witnesses (spawned daemon + controllable webhook) pin the four review-falsifier classes: in-flight ownership with refractory spacing and zero loss/overlap; retry union with the countable retry success; the cap cutting through a still-rolling stream; a skip counting nothing.
  • Full wake-dir regression green (dedupe/watermark/defer/retry behavior preserved).

Out of Scope

The AC6 dogfood receipt (#15414 stays open as its carrier) · presence-aware dispatch (#15405) · Shape A/B semantics (explicitly untouched per the amendment).

Related

Parent #15414 (stays open; ledger + receipt carrier) · PR #15442 (the implementing PR + its review, whose four falsifiers shaped surfaces 3-5) · #15405 · ADR-0002 §6.4.1.1 · ADR-0019.

Live latest-open sweep: checked 2026-07-18T08:37Z (top-8); no equivalent — #15414 is the parent, no implementation-tier leaf exists. A2A sweep: my own lane (#15414 claim 8c86bf3c); no competing claim.

Origin Session ID: 0c8fc4d9-2456-44fd-b120-048402bb9839

Retrieval Hint: query_raw_memories("wake dispatch implementation tier atomic delivery owner outcome enum flush-time refractory")