Skip to content

fix: reclaim expired Bun completion markers and share KV initialization - #131

Merged
argilzar merged 1 commit into
flowcore-io:mainfrom
globe-tracker-assistant-netizen:fix/bun-completion-expiry
Oct 8, 2026
Merged

argilzar merged 1 commit into
flowcore-io:mainfrom
globe-tracker-assistant-netizen:fix/bun-completion-expiry

Conversation

@globe-tracker-assistant-netizen

@globe-tracker-assistant-netizen globe-tracker-assistant-netizen commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Reclaim physically expired Bun/SQLite completion markers on KV access, at most once per 60 seconds (including failed attempts), without background timers.
  • Share one KV initialization across concurrent callers and permit retry after initialization failure.
  • Raise @flowcore/data-pump to ^0.23.4; Deno lock resolves the verified 0.23.4 artifact.
  • Add real generated ESM/CommonJS Bun regressions and a portable, read-only pull_request workflow on Bun 1.3.13.

Safety / behavior

The existing 300000ms TTL, strict expires < now boundary and permanent entries are unchanged. Only maintenance failures are suppressed: real KV reads/writes still reject. Propagating purge errors after successful delivery would enter the handler retry loop and duplicate delivery. Failed purge attempts are throttled too. Idle stores reclaim on next access; persistent purge failure still permits physical growth and has no new telemetry.

Current main deliberately leaves terminal handler failures unprocessed for redelivery. The real-builder test preserves that behavior, including original error, retry count and subsequent redelivery; it does not import older 2.10 terminal-failure semantics.

Verification

  • Baseline 0b17a2ac5bb829897a72f51055e44acdc99e3e4b: generated npm build passed; final regression suite 6 passed / 16 failed. Retained rows grew to 60000, SQLite pages to 1049, and concurrent initialization produced separate adapters.
  • Candidate generated ESM/CJS build and ESM typecheck passed. Final build also passed after removal of the temporary local dependency-age exception.
  • Bun 1.3.13: 22 passed / 0 failed / 6174 assertions across ESM and CommonJS state/adapter outputs. Twelve 5000-ID cycles stay at 5000 rows / 92 pages; continuous simulated 30-minute stream peaks at 3541 rows. These are real SQLite tests with a mocked clock, not a wall-time RSS/OOM attribution claim.
  • Full deno test -A with disposable localhost PostgreSQL 15: 99 passed (250 steps), 0 failed. Initial run without PostgreSQL failed on connection refusal; rerun with the service passed.
  • deno check src/mod.ts, deno lint, deno install --frozen-lockfile, changed-file formatter check, actionlint for the new workflow and git diff --check: passed.
  • Repository-wide deno fmt --check fails on unchanged CHANGELOG.md; the same failure was reproduced on baseline. No unrelated formatting rewrite.
  • Independent Claude CLI review found one blocker in the originally adapted test (obsolete terminal-error expectation). Fixed it, added redelivery coverage, and obtained a second read-only review: approve, no unresolved blockers. Execution claims above come from actual local commands, not the reviewer.

Narrow local dependency-age authorization

Brian explicitly authorized only the already verified data-pump 0.23.4 release. Deno 2.9.6's versioned schema supports minimumDependencyAge: { age: 1440, exclude: ["npm:@flowcore/data-pump"] }. This temporary local setting preserved the 24-hour rule for all other packages, was removed in a finally block after lock/build, and is not committed or used in CI. The regenerated lock integrity matches the independently verified release artifact. No broad policy disablement.

Compatibility / remaining gates

Targets current main (3.0.1); no merge, package publication, deployment, manifest change or downstream major upgrade is authorized here. A compatible 2.10.x backport of the adapter/state fix should be considered by maintainers; no maintenance branch currently exists, and the tests must preserve the target branch's own handler-failure semantics rather than silently changing them. This PR does not create a speculative release branch or replace the separate downstream adoption work.

Hosted verification: Bun completion expiry run 37777871475 SUCCESS on exact head 60985470d988e1a1ad54642ac6f246e2a7230712, including frozen install, generated ESM/CJS build and regressions. Marked ready after independent review and that check passed. The existing full-suite workflow is push-only; its PostgreSQL suite was verified locally, not claimed as hosted here.

Pending: upstream maintainer approval and release/backport decision. Requesting argilzar through the reviewer API returned HTTP 404 with this upstream READ permission; no reviewer request is claimed. Persistent-purge observability and long-running live RSS attribution remain follow-up work. CJS adapter/state are tested with the real ESM builder because the existing CJS builder has a separate ESM-only file-type resolution issue.

@globe-tracker-assistant-netizen
globe-tracker-assistant-netizen marked this pull request as ready for review October 8, 2026 12:35
@argilzar
argilzar merged commit 3169782 into flowcore-io:main Oct 8, 2026
1 check passed
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.

2 participants