Skip to content

chore: deslop pass over the wave 3.5 delta - #177

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
deslop/wave-3.5
Sep 1, 2026
Merged

chore: deslop pass over the wave 3.5 delta#177
ScriptedAlchemy merged 1 commit into
mainfrom
deslop/wave-3.5

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Rebased survivors of the stranded local deslop/wave-3.5 commit (5a8723423, written against pre-#164 main) onto current main. Behavior unchanged.

Applied:

  • Finalizer hardening — sqlite db.close() and the Flight reader cancel() release no longer mask the original failure when teardown itself throws.
  • State drivers — new shared pending-opens.ts tracker replaces the verbatim trackPendingOpen/close-drain duplication in the memory and sqlite drivers; runPromise(Effect.fail(...)) ceremony becomes direct Promise.reject/throw.
  • Boundaries — remove the unused runSyncExit export from both seams (doc line updated), drop the dead E type parameter from rsc-runtime's ScopedEffectRuntime (the dev-seam copy already has the <R> shape), and simplify the redundant string ternary in toDevError/toRuntimeError.
  • Dead code / dedupe — delete epoch-lease-registry.ts (zero importers since refactor(dev): EpochStore staging/leases/recovery on Effect Semaphore + Exit-aware saga (wave 3.5 stage 3, PR 4) #161's epoch-store.ts rewrite); route boundRenderEventStream through emitBoundRenderEvent; trim migration-narration comments in coordinator, epoch-store, and mcp-session.

Dropped as superseded by review-fix PRs that landed since the commit was written:

Test plan

  • pnpm typecheck clean
  • pnpm lint (rslint, 772 files) clean
  • Scoped unit tests over every touched area (effect-boundary, boundary-lint, agent-document, state kernel/conformance/sqlite/cross-process/packaging, runtime, warm-runtime, mcp-projector, epoch-store, dev-coordinator, mcp-session-service): 209 passed, 0 failed

Rebased survivors of the stranded deslop/wave-3.5 commit (5a8723423)
onto current main. Applied:

- finalizers: sqlite connection close and Flight reader cancel no longer
  mask the original failure when teardown itself throws
- state drivers: shared pending-open tracker replaces the verbatim
  trackPendingOpen/close-drain duplication; drop runPromise(Effect.fail)
  ceremony in favor of direct rejections
- boundaries: remove the unused runSyncExit export from both seams, the
  dead ScopedEffectRuntime E type parameter from the rsc-runtime copy
  (matching the dev-seam copy), and the redundant string ternary in
  toDevError/toRuntimeError
- delete dead epoch-lease-registry.ts (zero importers; #161 rewrote the
  same concept in epoch-store.ts); dedupe boundRenderEventStream through
  emitBoundRenderEvent; trim migration-narration comments

Dropped as superseded: the reconciler progress-queue rework (#172
rebuilt that path with a demand-bounded design), the dev-seam trim of
interruptWhenAborted/runPromiseExit (#164 fixed and kept them with
tests), the sqlite #commit self-rewrite (#171 rewrote #commit), and the
lint-plugin inlining (#164 expanded the plugin around those helpers).
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ffbdca0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@agent-bundle/runtime Patch
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T19:14:29.091905Z ffbdca0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@177
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@177
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@177

commit: ffbdca0

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffbdca0f02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +778 to +780
try {
db.close();
} catch {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve SQLite close failures on successful shutdown

If DatabaseSync.close() throws during an otherwise successful store.close() or driver.close(), this unconditional catch makes shutdown resolve even though the database resource may remain open. Suppression should depend on the acquireRelease exit being a failure; when there is no original failure to preserve, the close exception must remain observable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #201 (merged as ae7722c). The sqlite connection release now inspects the scope exit: when the scope failed, close errors are still suppressed to avoid masking the original failure, but on an otherwise-successful shutdown a DatabaseSync.close() failure now propagates as a typed driver error. Regression test patches close() to throw and asserts store.close() rejects with that failure.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addendum: #208 adjusted the mechanism — acquireRelease release finalizers are infallible by contract, so the success-path close failure now surfaces as a defect (Effect.orDie) rather than a typed failure. Behavior for callers is unchanged: store.close() still rejects with the close failure on an otherwise-successful shutdown, and a failing path still keeps the original failure.

(handle) => Effect.promise(() => handle.cancel().then(() => undefined)),
// cancel() rejects when the source already errored; a defect inside
// this closing scope must not replace the stream's own failure.
(handle) => Effect.promise(() => handle.cancel().then(() => undefined, () => undefined)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Flight cancellation failures when no prior failure exists

If Flight consumption finishes or is canceled without an existing stream failure and the underlying source's cancel() hook rejects, converting that rejection to fulfillment hides the only teardown failure and can leave the source incompletely released. The rejection should be suppressed only when the resource scope is already exiting with the original stream failure.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #204 (merged as 7abd6b5). The Flight reader release now distinguishes the two cases: with a prior stream failure the cancel rejection is still suppressed (the original failure keeps priority), but a standalone cancel rejection propagates through a flightDone deferred awaited on the completion path, so it surfaces as the stream's failure instead of being silently dropped. Regression test injects a rejecting cancel() with no prior failure and asserts the consumer observes it.

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