Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .llm/runs/fix-saga-event-feed--issue-2637/context-pack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Context pack

Issue2637, PR2646, branch fix/saga-event-feed, base b0eb079575968e843b781579673c9fe2ae250e07 fetched before checkout/diagnosis. Read plan/research/worklog/supervisor/drift and issue in full. Feature tier; mandatory separate PLAN-EVAL pending, no product implementation. New real HTTP/nativeDenoKV test0pass/4fail/0ignored on unchanged main: concurrent slow-reader loss, Last-Event-ID loss after resident consumes, idle4lists/350ms, unbounded300keys. All handles closed, no backend resource started.

Plan locks portable256-slot+head CAS journal, stable UUID:sequence ids, fixed-key watch ready/reread plus per-client coalescing pump, explicit native SSE cursor/gap errors (HTTPmayalready200), count retention and legacy upgrade boundary. Canonical event types move to existing domain/saga-message.ts while preserving contract aliases, no new domain folder. @std abortable reused for waiting; no new timer/clock needed. No transports/Streams, process/scaffold/DB/CLI/publish-map or version changes. Gates include real native memory/Deno/Redis/Garnet and full package/plugin, no new diagnostic/skip; full CLI scaffold N/A under actual scope/cost policy.

Doc baseline core7/plugin30, exact per-entrypoint private reports measured. Native oRPC lastEventId/error frame and public KV CAS/watch/getMany capabilities verified. Use Deno2.9.7 via mise, structured wrappers with allow-write for output, no rtk/rg. Public artifacts repo-relative/sanitized; no operator paths/hostnames/ports/sessionids/downstream names. No goal/merge/ready-merge/auto-merge/publication. Only independent evaluator agents.

Checkpoint: independent PLAN-EVAL PASS, S1 canonical domain/error/quick-start contract and S2 portable journal committed. S3 native HTTP integration now validated40/40 including all4original reds and realRedis/Garnet, ready/error/filter/cancellation paths. Core targeted suite41pass before one extra post-ready-failure case (now42). Adapter318lines, focused tests175/305 and HTTP363lines below caps. Exact doclint core7/plugin30 unchanged. Two exact owned backends retained for final eval with private immutable identities/mount receipts; do not touch foreign resources. Std dependency mapping uses already locked version and four metadata-only lock mirrors required by frozen guards. No scaffold/launch/publish-map behavior change; full runtime N/A unchanged. Remaining S4 public semantics/consumer refresh, full final gates, independent IMPL-EVAL, cleanup/current-head CI/threads.

Final evaluation checkpoint: production source0b7ca700faeaecee8965dc42e9da7a86026b4e68; later commits run-only. Full core249/0/4existing, plugin196/0/2existing; journal/subscription44/44 and HTTP9/9 with real memory/DenoKV/Redis/Garnet including separate native clients. Quality/static/JSR/docs/freshness green, exact baseline core7/plugin30 retained.4issue boxes proven, proof6935399907, body closing keyword/fenced mappings, final DoD pending independent IMPL-EVAL/headchecks/cleanup. Two owned backend containers retained; private identities/mounts/endpoints in evaluator brief, no foreign cleanup. No scaffold output diff; full smoke N/A remains approved.

Independent implementation PASS comment6935616660 at3e5e67457; evaluator46coretarget/9HTTP plus full249/196green and all277source gates0. All2owned containers/2original volumes now removed after maintained preview and exact identity/mount/reference proof; zero survivors. Private backend receipt is stale: never reuse its endpoints. Product unchanged since evaluated source. Remaining ready transition and required head CI/threads, then all-PR audit and final report.
7 changes: 7 additions & 0 deletions .llm/runs/fix-saga-event-feed--issue-2637/drift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Drift

Independent feature PLAN-EVAL PASS at224e8370, comment6934760031. No design change. Epoch wording explicitly pins first-append minting and later CAS inheritance. Closing keyword/evidence remain deferred until all acceptance is proven, per close-gate policy. Native error-frame distinctions remain mandatory tests. No product implementation preceded PASS.

S2 resolver metadata: adding the already locked std async import requires four synchronized workspace dependency snapshots, discovered by frozen-reference/private-lock guards. S2 expands from <=12 to13files including the three run records, still below30; no dependency version or product/scaffold design change. Error class stays at the existing ./domain boundary; adapters exports only the new feed and types reachable from its public entry contract, avoiding a convenience mirror of the error family.

S4 adds two separate-native-client tests and an optional namespace fixture argument to pin the already approved multi-process CAS/fanout contract. This is coverage only. Canonical asset generation confirms zero CLI/scaffold/generated launch diff; metadata reference locks do not alter runtime output, so full scaffold.runtime N/A remains founded on actual final scope.
146 changes: 146 additions & 0 deletions .llm/runs/fix-saga-event-feed--issue-2637/evaluate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Evaluation: fix-saga-event-feed--issue-2637

## Metadata

| Field | Value |
| ----- | ----- |
| Run ID | `fix-saga-event-feed--issue-2637` |
| Target | issue 2637 / PR https://github.com/rickylabs/netscript/pull/2646 |
| Archetype | 3 runtime/behavior with KV integration2 / plugin5 overlays |
| Scope overlays | service (thin HTTP wiring), docs |
| Evaluator | Separate IMPL-EVAL session, 2026-11-17; requested primary Muse Spark 1.3 xhigh via OpenCode Go contributor route, observed same; fallback Opus 5 xhigh unused; generator OpenAI Codex gpt-6.1-sol xhigh separate session/vendor family; feature cycle 1 of 5; no substitution; T3 fresh-delegate rule recorded vs same-session steering, no extra delegates launched |

Route attestation: live pinned matrix via `deno task agentic:matrix --tier feature --impl-evaluator` (Deno 2.9.7 via mise) returns feature IMPL-EVAL primary Muse Spark 1.3 xhigh, fallback Opus 5 xhigh, max 5 roundtrips, notify after 3. Requested and observed route match; fallback unused with no failure evidence. Generator/vendor separation verified via run `supervisor.md` and commit authorship; no privileged-row promotion. Exact evaluated head `3e5e6745760abac0867c5d7e87e35bb311263937`, base `b0eb079575968e843b781579673c9fe2ae250e07`, product source `0b7ca700faeaecee8965dc42e9da7a86026b4e68` with later head run-only.

## Process Verification

| Check | Result | Evidence |
| ----- | ------ | -------- |
| Plan-Gate passed before implementation | PASS | `.llm/runs/fix-saga-event-feed--issue-2637/plan-eval.md` VERDICT PASS at head `224e83706371a1aed813b6962a9583da1a68639a`, all 8 boxes, separate GLM session; branch diff then 7 run artifacts + 1 HTTP test only, product equal main |
| Design section exists in worklog | PASS | `.llm/runs/fix-saga-event-feed--issue-2637/worklog.md` Design checkpoint section locks journal, cursor, watch, error, filter, ownership, upgrade boundary |
| Commit slices match design plan | PASS | Plan S1-S5 map to `334f21485` contracts, `5545d55f0` journal, `5175c6f1b` HTTP, `41213d147` + `0b7ca700f` docs/consumers, `3e5e67457` gates; research `179bb70e4`, red `9959930a3`, plan `224e83706` precede implementation |
| Each slice has a passing gate | PASS | Worklog S1-S5 gates re-verified independently below; reds 0/4 on unchanged main, greens below |
| No speculative seams (unused files) | PASS | New adapter `packages/plugin-sagas-core/src/adapters/kv-saga-event-feed.ts` consumed by `plugins/sagas/services/src/routers/v1-handlers.ts` and all new tests; no orphan exports; `transports/` diff empty |
| Constants used for finite vocabularies | PASS | `SAGA_EVENT_HISTORY_LIMIT`, `HEAD_KEY`, `EPOCH`, `EVENT_TYPES` set, `format:1`, error `reason` union; no magic literals in feed |

## Static Gates

| Gate | Command or check | Result | Evidence | Notes |
| ---- | ---------------- | ------ | -------- | ----- |
| Narrow typecheck core | `deno run --allow-read --allow-run .llm/tools/run-deno-check.ts --root packages/plugin-sagas-core --ext ts,tsx` | PASS | 154 files, 0 findings, Deno 2.9.7 `--unstable-kv` | Independent re-run |
| Narrow typecheck plugin | same wrapper `--root plugins/sagas --ext ts,tsx` | PASS | 123 files, 0 findings | Independent re-run |
| Format core | wrapper `run-deno-fmt.ts --root packages/plugin-sagas-core --ext ts,tsx` | PASS | 154 files, 0 findings | Independent re-run |
| Format plugin | wrapper `--root plugins/sagas --ext ts,tsx` | PASS | 123 files, 0 findings | Independent re-run |
| Lint core | wrapper `run-deno-lint.ts --root packages/plugin-sagas-core` | PASS | 154 files, 0 findings | Independent re-run |
| Lint plugin | wrapper `--root plugins/sagas` | PASS | 123 files, 0 findings | Independent re-run |
| Doc lint core | `run-deno-doc-lint.ts --root packages/plugin-sagas-core` | PASS | combined 7, all private-type-ref, 0 missing; matches private baseline 7; per-entrypoint distribution unchanged | No new diagnostics |
| Doc lint plugin | `run-deno-doc-lint.ts --root plugins/sagas` | PASS | combined 30, all private-type-ref, 0 missing; matches baseline 30 | No new diagnostics |
| Publish dry-run core | `deno publish --dry-run --allow-dirty` in `packages/plugin-sagas-core` | PASS | Success, no slow-type diagnostic | Audit helper banner miscount only, see Fitness F-6 |
| Link/path check | PR body, README, guide links | PASS | Quick-start contract matches `packages/plugin-sagas-core/src/adapters/mod.ts` exports; docs reference versioned prefix only | No broken paths |

## Fitness Gates

| Gate | Function | Result | Evidence | Violations |
| ---- | -------- | ------ | -------- | ---------- |
| F-1 | File-size lint | PASS | New adapter 318 lines, tests 207/305/369 lines under caps; `deno task quality:gate` FAIL=0 | None new |
| F-2 | Helper-reinvention scan | PASS | Reuses `@std/async` abortable, `WatchableKv` atomic/watch/getMany, native `crypto.randomUUID`/`structuredClone`; no new bus/clock | None |
| F-3 | Layering check | PASS | `domain/saga-message.ts` domain-only, `domain/errors.ts` domain-only, `adapters/kv-saga-event-feed.ts` imports domain + external KV/std only, `v1-handlers.ts` presentation imports adapters/domain | None |
| F-4 | Inheritance audit | PASS | No base classes with behavior; `SagasError`/`SagaEventFeedError` stub-only contracts preserved | None |
| F-5 | Public surface audit | PASS | Canonical SSE types moved to existing `domain/saga-message.ts` with identity re-export at `contracts/v1`; adapters entrypoint names only feed + needed types; no root mirror or Zod export | None |
| F-6 | JSR publishability gate | PASS | Dry-run Success; `audit-jsr-package --root packages/plugin-sagas-core` exit 0, 4 findings = 3 preexisting cardinality + 1 known slow-type banner with native no diagnostic | Preexisting only |
| F-7 | Doc-score gate | PASS | Core/plugin READMEs + `docs/site/durable-workflows/sagas.md` document 256/257, live/replay, ids, gaps, filter, cancel, durability, upgrade; `docs:accuracy` PASS | None |
| F-8 | Workspace lib override check | PASS | `quality:gate` FAIL=0 | None |
| F-9 | Permission declaration check | PASS | `quality:gate` FAIL=0; KV ownership stays with host, no new permissions | None |
| F-10 | Test-shape audit | PASS | New tests use `Deno.test`, real Hono/oRPC/native KV/Redis/Garnet, bounded waits, explicit closes; no new ignores | None |
| F-11 | Forbidden-folder lint | PASS | Only `adapters/`, `domain/`, `contracts/`, `tests/`, `routers/` touched; no utils/helpers/common/lib/interfaces | None |
| F-12 | Naming-convention lint | PASS | `quality:gate` FAIL=0 | None |
| F-13 | Saga and runtime invariants | PASS | Atomic head CAS order, epoch fencing, safe-integer, 64-conflict bound, subscribe-first/ready/reread, coalescing pump, explicit gap, abort ownership all tested | None |
| F-14 | Console-log lint | PASS | No new `console.*` in feed/handler; preexisting `getInstanceHistory` catch log untouched | None |
| F-15 | Re-export-of-upstream lint | PASS | No upstream re-export; SSE identity preserved locally | None |
| F-16 | Folder-cardinality lint | PASS | No new folders; audit WARNs are preexisting src/stores/domain counts, unchanged | Preexisting only |
| F-17 | Abstract-derived co-location lint | PASS | `quality:gate` FAIL=0 | None |
| F-18 | Sub-barrel lint | PASS | Existing `domain/mod.ts`, `adapters/mod.ts` curation unchanged; no new barrels | None |
| F-19 | Scoped source gate runners | PASS | All evidence from structured wrappers above, not raw root CLI | None |

`deno task quality:gate` independently re-run: exit 0, FAIL=0 across roots. `deno task arch:check` included: FAIL=0. `deno task release:preflight` 4 PASS. `deno task docs:accuracy` PASS. `deno task check:mcp-export-corpus`, `check:publish-assets`, `check:agent-docs-prose` PASS; only MCP prose/corpus/publish-assets carriers changed, no CLI/scaffold output diff.

## Runtime Gates

| Gate | Validation | Result | Evidence |
| ---- | ---------- | ------ | -------- |
| Red oracles genuine | 4 HTTP reds on unchanged main | PASS | Prior PLAN-EVAL re-ran `plugins/sagas/tests/services/event-feed-http_test.ts` 0/4 at `224e8370` with product equal main; current branch history retains red commit `9959930a3`; no need to revert current product to repeat red |
| Journal/subscription targeted | `packages/plugin-sagas-core/tests/contracts/saga-event-feed_test.ts`, `tests/stores/saga-event-feed_test.ts`, `tests/stores/saga-event-subscription_test.ts` with owned Redis/Garnet | PASS | Independent re-run 46 passed / 0 failed / 0 ignored across memory/DenoKV/Redis/Garnet with new namespaces; covers concurrent writers, independent fast/slow readers, stable replay, 257-key capacity, exact oldest boundary, foreign/reset/malformed/future/corrupt/overflow, detached 16KiB payloads, startup/coalesced/overwrite races, cancel/readiness/pump failure, unsupported capabilities, 2 separate-native-client 32-writer tests |
| HTTP integration | `plugins/sagas/tests/services/event-feed-http_test.ts` with owned Redis/Garnet | PASS | Independent re-run 9 passed / 0 failed / 0 ignored; covers paused-reader fanout with matching ids, Last-Event-ID replay after consume, idle 0 lists, 300→257 bound, malformed/future vs expired/foreign/reset errors as native frames, unavailable frame, sagaName filter with global cursor, real Redis/Garnet fanout/replay |
| Full core | `deno test --unstable-kv --allow-all packages/plugin-sagas-core` with owned endpoints | PASS | Independent re-run 249 passed / 0 failed / 4 ignored, all preexisting option ignores, no new ignore |
| Full plugin | `deno test --unstable-kv --allow-all plugins/sagas` with owned endpoints | PASS | Independent re-run 196 passed / 0 failed / 2 ignored, all preexisting option ignores, no new ignore |
| No SCAN/poll | Fixed-key watch + bounded known-key reads | PASS | Idle spy asserts `list` 0, `watchPrefix` 0, `watch` 1 with head key + initial true on all backends; HTTP idle asserts raw `list` 0 over 350ms; native Redis INFO SCAN delta 0 retained in run evidence over startup/idle/close; `transports/` untouched, no Streams dependency |
| Release-gate class | scaffold.runtime | N/A | Honest N/A: no scaffold output, plugin copy, DB wiring, Aspire helper, CLI command, or publish-map/glob changes; `deno.json` exports unchanged; 4 lock files add only already-locked std async declaration with no version/integrity change; canonical asset generation proves zero CLI/scaffold diff; no scope contradiction found so no smoke dispatched |

Deno doc used before source digs: `WatchableKv` subscribe-first/initial/ready semantics and `ProcedureHandlerOptions.lastEventId` plus `ORPCError` code/status/data confirmed via `deno doc`.

## Consumer Gates

| Consumer | Validation | Result | Evidence |
| -------- | ---------- | ------ | -------- |
| MCP prose/corpus/publish assets | `check:mcp-export-corpus`, `check:publish-assets`, `check:agent-docs-prose` | PASS | Freshness PASS; only 3 MCP carriers changed |
| Docs site | `docs/site/durable-workflows/sagas.md` + core/plugin READMEs | PASS | Count, live/replay, opaque ids, gap codes, filter, cancel, durability, uncertain commit, legacy upgrade all documented; `docs:accuracy` PASS |
| Public imports | Adapters/domain/contract entrypoints | PASS | `KvSagaEventFeed`, `SAGA_EVENT_HISTORY_LIMIT`, feed option/item types, `SagaSSEEvent` identity all importable; typecheck 0 |

## Anti-Pattern Check

Only patterns touched by scope marked CLEAR; others N/A. No DEBT_ACCEPTED needed.

| AP | Status | Evidence | Notes |
| -- | ------ | -------- | ----- |
| AP-1 | CLEAR | Single 318-line adapter, no bus/monolith; transports untouched | - |
| AP-3 | CLEAR | No generic registry; fixed versioned prefix only | - |
| AP-4 | CLEAR | No new abstraction without concept; epoch/sequence/head/slot from plan | - |
| AP-5 | CLEAR | No utils/helpers; cohesive adapter + existing fixtures | - |
| AP-6 | CLEAR | No base lifecycle behavior | - |
| AP-8 | CLEAR | No new folders outside vocabulary | - |
| AP-10 | CLEAR | Only `SagaEventFeedError` mapped to native codes; other errors rethrown | - |
| AP-11 | CLEAR | Per-subscription pump/controller, no process globals | - |
| AP-12 | CLEAR | No timers/clocks; retention by count | - |
| AP-13 | CLEAR | No `console.*` added | - |
| AP-16 | N/A | No helper folders | - |
| AP-17 | N/A | No co-location change | - |
| AP-19 | N/A | No new entrypoints beyond approved adapters | - |
| AP-20 | N/A | No new barrel | - |
| AP-22 | CLEAR | No sibling re-export monolith | - |
| AP-23 | CLEAR | No inline handler bodies | - |
| AP-24 | CLEAR | No kind switch; `EVENT_TYPES` set validation only | - |
| AP-25 | CLEAR | Web Platform + std only in adapter | - |
| Others | N/A | Outside scope | - |

## Arch-Debt Delta

| Metric | Count | Evidence |
| ------ | ----- | -------- |
| New entries | 0 | No new violations; `arch-debt.md` unchanged by run |
| Resolved entries | 0 | No debt claimed closed |
| Deepened violations | 0 | Cardinality/slow-type findings preexisting, unchanged |
| Unrecorded violations | 0 | All WARNs map to preexisting entries or non-blocking lints |

## Findings

| Severity | Finding | Evidence | Required action |
| -------- | ------- | -------- | --------------- |
| low | Preexisting doc-lint cardinality + slow-type banner remain | Core 7 / plugin 30 private-type-ref only, 0 missing; audit 4 findings = 3 cardinality + 1 banner with native dry-run Success and no slow-type diagnostic | None for this run; future waves own |
| low | Final parent cleanup and required-head CI remain | Draft DoD last box unchecked by design pending this verdict; `leak-report.md` states 2 owned backends retained; review-threads 0/0; checks show path-filtered skipping with one pass, parent owns readiness/current required-head CI | Parent to cleanup owned resources and run required head CI before ready-merge; not product acceptance |
| low | Full scaffold.runtime N/A stands | No scaffold/process/DB/CLI/publish-map changes; lock diffs metadata-only; asset freshness PASS | No smoke; rescope only if scope contradicts |

No blocking product, test, doc, or debt findings. Implementation matches all 8 approved Plan-Gate decisions with no unapproved new design. All new backend cases execute with owned endpoints; no new ignores.

## Lessons for Promotion

| Lesson | Pattern | Applies to | Confidence |
| ------ | ------- | ---------- | ---------- |
| Fixed-head watch + wake-token-captured-before-read closes subscribe races without timers | Runtime gate | Archetype 3 | medium |
| Native SSE error frames must be asserted, not HTTP status, when streaming may already be 200 | Consumer gate | Archetype 3/5 | high |

## Verdict

| Field | Value |
| ----- | ----- |
| Verdict | `PASS` |
| Rationale | Approved scope complete; static/fitness/runtime/consumer gates pass or honest N/A with evidence; no new doctrine debt; docs and run artifacts resumable; remaining cleanup/CI owned by parent, not acceptance |
Loading
Loading