Repository navigation
fix(sagas): retain ordered SSE events for independent readers - #2646
Conversation
|
[PHASE: RESEARCH] Issue2637 reproduced on unchanged main b0eb079. HTTP regressions:0pass/4fail/0ignored. Fast client sees6while concurrent paused reader misses; resident sees3while native Last-Event-ID reconnect misses consumed data; idle raw native KV list4calls/350ms;300HTTP200publications leave300keys. Real Hono/oRPC/native Deno KV and default production writer, with only the unrelated runtime acceptance receiver inert. No mocked journal/watch; all handles closed and no backend resources started. Native public KV atomic/fixed-key watch and oRPC lastEventId confirmed by deno doc/source. A native wire probe establishes HTTP200 can precede standard SSE error frames, so gap handling must use the native protocol. Scoped test check/lint/fmt0. Exact doc-lint baseline core7/plugin30 measured, not waived. No product implementation. |
|
[PHASE: PLAN] Locked feature plan: one core portable KV journal,256ring slots+head, atomic append order and stable epoch:sequence ids. Native fixed-key subscribe-first/ready/reread plus per-reader cursors and a coalescing notification pump replaces polling and deletion. Known-key reads stay bounded; slow/expired/reset readers receive explicit native error frames, never silent loss/reset. Canonical SSE type identity preserved; plugin remains thin HTTP/publish wiring. Count retention, native-value sizing, CAS conflict bounds, wire error codes, startup/overwrite races, cancellation/unknown outcomes, global filtering and legacy cursor/key upgrade boundary are decided. Per-slice file counts<30 and all F1-F19/integration/plugin gates named. Public quick-start/type contract precedes implementation. Existing package/core KV/watch ports and already locked @std facilities reused; no generic lifecycle/bus or dependency-version change. Runtime proof is real HTTP plus native memory/DenoKV/Redis/Garnet, full affected suites and public/JSR/docs consumers. Full scaffold runtime N/A under user cost policy because this scope changes no scaffold/process/DB/CLI/Aspire/publish-map wiring; rescope triggers it if that changes. No saga transport or Streams edits. Separate GLM5.3/provider-default Plan-Gate next, product source remains unchanged. |
|
[PHASE: PLAN-EVAL] [VERDICT: APPROVED] Independent feature-tier PLAN-EVAL (cycle 1 of 2): the locked plan at Route and independenceRequested and observed route identical to the pinned feature PLAN-EVAL row: GLM 5.3 at provider default via OpenCode Go, fresh session; fallback Fable 5.1 low unused (no failure evidence). Generator: Codex gpt-6.1-sol/xhigh — separate session, different vendor family. Evaluated head Evidence independently re-verified (not taken from the generator)
Findings (non-blocking; no Plan-Gate box failure)
Next
|
|
[PHASE: IMPL] Independent PLAN-EVAL APPROVED, all8boxes. S1 preserves canonical SSE type identity at contracts/v1 while moving vocabulary into the existing domain message file; adds structured invalid-cursor/history-lost/unavailable errors and public quick-start. Epoch creation/inheritance pinned explicitly. Contract tests3/3; scoped check/lint/fmt0, exact doc-lint baseline unchanged, quality:gate/preflight/accuracy PASS. Original4HTTPreds remain pending S2/S3. No transport, dependency version, publish-map or process wiring change. |
|
[PHASE: IMPL] S2/S3 completed: portable256-slot+head journal and native HTTP wiring. Original4HTTPregressions green; extended nativeDeno/memory/Redis/Garnet coverage40/40green,0ignored (journal contract41/41 before one extra post-ready watch-failure case). Real HTTP multi-client ids/replay, native400/409/503 error frames after HTTP200, filter/cancellation/heartbeat semantics verified. Redis INFO commandstatsSCANdelta0 over startup+idle+close. Exact doc-lint core7/plugin30 unchanged, static/quality/preflight/accuracy/nativeJSR green. Four lock snapshots add only the existing std async dependency metadata required by frozen guards; no version/integrity change. Public docs/consumer refresh and independent final evaluation remain. |
|
[PHASE: IMPL] All four issue2637 acceptance criteria are now proven at source0b7ca700faeaecee8965dc42e9da7a86026b4e68. The original real HTTP/nativeDenoKV suite reproduced0pass/4fail on unchanged main and is now green. Extended HTTP9/9 (including realRedis/Garnet), core journal/subscription44/44, and full core249pass/0fail/4existing optional ignores plus plugin196pass/0fail/2existing optional ignores. No new ignore; all newly added backend cases execute with the owned endpoints.
Structured14-file check/lint/fmt0 plus amended test scope0; quality:gate/arch/preflight/accuracy, nativeJSR dry-runs/audits and canonical consumer freshness all pass. Core7/plugin30 exact doc-lint baseline unchanged, no new cardinality/slow types (audit helper's normal banner miscount disclosed). Four metadata-only lock snapshots reuse the existing std dependency; no version/integrity change. Actual canonical generation produces no CLI/scaffold launch diff, so full scaffold.runtime remains N/A under approved scope/cost policy. Independent implementation evaluation is next. Draft final DoD remains unchecked pending that verdict, final owned-resource cleanup and required-head checks/review threads. Two exact owned backends retained for evaluator probes; no foreign resources touched. No merge or publication. |
|
[PHASE: IMPL-EVAL] [VERDICT: PASS] Independent feature IMPL-EVAL passes for issue 2637 at head Findings
Next
Run: |
|
[PHASE: IMPL] Independent feature IMPL-EVAL PASS retained unchanged; no product delta. Evaluator independently confirmed full core249/0/4existing, plugin196/0/2existing, targeted46/0/0 and HTTP9/0/0, all277source gates and public/doc/consumer fitness. Exact2owned backend containers and2original unshared volumes removed after maintained read-only leak/teardown preview plus native immutable identity/label/image/mount and survivor-reference proof. Final owned/volume scans0; post-cleanup maintained reporter0; all foreign/unproven objects retained. Sanitized final evidence committed. Moved out of draft and removed draft skip labels so normal required head checks run. Final checks/threads DoD remains unchecked until those head results are verified; no local-green substitution. Full scaffold.runtime remains honestly N/A under independently approved actual scope. No merge, ready-merge or publication. |
|
[PHASE: IMPL] Required quality found five unbound names in the new README example. Native docs:readme-fences reproduced10typeerrors/5failingREADMEs, then returns PASS at exact baseline5consumer-owned import diagnostics/4otherREADMEs after explicit typed host-context parameters.115checked/0exempt; no gate/ratchet/exemption change. No framework/API/runtime delta after independent PASS. release:preflight fourPASS, docs:accuracyPASS, canonical prose/corpus/publish freshness PASS with no generated diff. Existing independent runtime evidence and zero-owned-resource proof retained. Correction pushed; required head CI and final DoD remain pending their actual results. |
|
[PHASE: IMPL] Old head: Local gates pass: structured check/lint/fmt across 277 saga files; 60 focused tests with zero failures or skips, including real Redis/Garnet fanout and replay; quality/architecture; all carrier freshness checks; release:preflight; docs:accuracy; README fences. Review threads: 0 unanswered. Both owned backend containers and their two original unshared volumes were removed. Labels, PR body and issue checkboxes are unchanged. |
Summary
Replace destructive saga SSE polling with a retained KV journal. Every reader has its own ordered cursor; stable ids support reconnect replay, and slow or expired readers receive an explicit gap.
Scope
Closes #2637
The portable core adapter uses256event slots plus one head. One atomic head/slot CAS orders successful commits across API instances; fixed-head watch plus bounded known-slot reads replaces polling and deletion. Native oRPC Last-Event-ID and error frames preserve the existing route/schema. Default API publication remains acceptance first, observation second.
Slices
Validation
Main0/4HTTPreds become green. Final full core249pass/0fail/4existing optional ignores; plugin196pass/0fail/2existing optional ignores. New core journal/subscription44/44 and HTTP9/9 include separate native Redis/Garnet clients, concurrent writers, slow readers, native header replay, cursor/gap/error/cancel/overwrite races,257-key capacity and large per-record values. Native Redis commandstatsSCANdelta0 over startup+idle+close.
Scoped check/lint/fmt0; quality:gate/architecture, release:preflight/docs:accuracy, nativeJSR dry-runs/audits and canonical consumer freshness pass. Exact doc-lint baseline core7/plugin30 unchanged. Full scaffold.runtimeN/A: no scaffold/launch/DB/Aspire/CLI/publish-map behavior change; asset generation confirms no CLI scaffold output diff.
Independent evaluator re-ran core249/0/4existing and plugin196/0/2existing, targeted46/0/0 and HTTP9/0/0, all277source checks/lint/fmt0 and public/consumer gates. Exactly2owned containers/2unshared original volumes removed after maintained preview and native identity/mount/reference proof; zero survivors, foreign resources retained.
Post-evaluation documentation correction: the native README fence gate caught five undefined example names. The example now declares its host KV, signal and optional cursor as typed function parameters;115fences compile with0exemptions and exactly the existing5consumer-import diagnostics in4otherREADMEs. Framework behavior and public types are unchanged. Documentation preflight/accuracy and canonical consumer freshness pass; normal required new-head CI remains authoritative.
Harness
Run:
.llm/runs/fix-saga-event-feed--issue-2637/. Feature tier, Archetype3 with KV integration2/plugin5. Separate GLM PLAN-EVAL approved; separate Muse IMPL-EVAL PASS. Plan and decisions, validation history.Drift / Debt
No transport/Streams, runtime engine publisher, lifecycle registry or process change. Fixed global count retention and a versioned prefix deliberately leave legacy history unmigrated; upgrade drains old API instances and clears old cursors. Unknown append outcomes are not blindly retried. Four lock snapshots add only metadata for already locked std async, required by frozen workspace guards; no version/integrity change. Existing doctrine/doc-lint debt unchanged; audit helper miscounts the normal slow-type banner, native output has no slow-type finding.
Definition of Done
🤖 Generated with Codex