Skip to content

feat(platform-node): close the host durability gaps - #317

Closed
prisis wants to merge 2 commits into
alphafrom
feat/platform-node
Closed

prisis wants to merge 2 commits into
alphafrom
feat/platform-node

Conversation

@prisis

@prisis prisis commented Aug 2, 2026

Copy link
Copy Markdown
Member

Branched before #288/#289 landed, so it needs a rebase onto current alpha before merge.

Commits

  • feat(platform-node): close the host durability gaps
  • docs(platform-node): record the durability-hardening findings

Files this branch still changes relative to alpha

packages/platform-node/__tests__/engine-conformance.test.ts
packages/platform-node/__tests__/global-store.test.ts
packages/platform-node/__tests__/lifecycle.test.ts
packages/platform-node/package.json
packages/platform-node/src/conformance/index.ts
packages/platform-node/src/index.ts
packages/platform-node/src/node-global-store.ts
packages/platform-node/src/node-platform.ts
packages/platform-node/src/node-scheduler-host.ts
packages/platform-node/src/node-shard-host.ts
packages/platform-node/src/node-socket-host.ts
packages/platform/src/capabilities.ts
plans/234-node-host-findings.md
pnpm-lock.yaml

prisis and others added 2 commits August 2, 2026 00:46
The Node host persisted state without ever restoring it. Alarms wrote a
timestamp to `_lunora_alarm` that nothing re-armed, scheduler jobs lived
only in in-process Maps, and socket attachments and tags did too — so a
process restart silently dropped every pending alarm, every scheduled
job, and every subscription's state, while `get()`/`list()` kept
reporting them as pending.

Each contract now owns both halves:

- Alarms re-arm on construction. One whose time elapsed while nothing
  was running fires late rather than never, and delivery goes to a new
  `onAlarm` option — the host's stand-in for the `alarm()` method
  workerd invokes on a Durable Object.
- The scheduler moves to a SQLite job table re-armed on construction,
  with retry backoff driving `attempts`, a dead-letter set disjoint from
  pending, and runtime `cron` registration. That last one is a tier
  Cloudflare cannot offer, since its crons are declared in
  `wrangler.jsonc` and reconciled at build time.
- Socket attachments and tags move to `_lunora_sockets`. Ids become
  UUIDs: a counter restarts at 1 and would hand a reconnecting client
  someone else's attachment.
- `waitUntil` retains the promise instead of dropping it, so a rejected
  background task is no longer an unhandled rejection, and a new
  `drain()` awaits in-flight work before shutdown.

Adds `.global()` table support via the `@lunora/sql-store` core on its
own SQLite file, so the target is no longer `unsupported` there.

Two restart tests — a second host over the same database file — pin the
claims that the TCK's simulated recycle cannot reach. `NODE_CAPABILITIES`
is rewritten to match; three of its notes asserted gaps that no longer
exist. Cross-shard fan-out, a deploy driver, and the Cloudflare product
bindings remain unsupported and are stated as such.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Supersedes the spike's ratings for the four features that changed, and
explains why Finding 3's reasoning was wrong: the re-arm never needed a
daemon outside the process, only the next construction over the same
database file.

Adds Finding 10 (the reference SQLite dialect lives in @lunora/d1, so a
Node host depends on a package called d1) and Finding 11 (TypeScript
narrows a liveness flag across an await, so the lint that fires on the
re-check would have deleted the guards keeping a timer safe).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@prisis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f27fcf9-5151-443f-aa53-e171835fbc0c

📥 Commits

Reviewing files that changed from the base of the PR and between 6a4dd72 and 8c4963e.

⛔ Files ignored due to path filters (5)
  • packages/platform-node/__tests__/engine-conformance.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/platform-node/__tests__/global-store.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/platform-node/__tests__/lifecycle.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • plans/234-node-host-findings.md is excluded by none and included by none
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
📒 Files selected for processing (9)
  • packages/platform-node/package.json
  • packages/platform-node/src/conformance/index.ts
  • packages/platform-node/src/index.ts
  • packages/platform-node/src/node-global-store.ts
  • packages/platform-node/src/node-platform.ts
  • packages/platform-node/src/node-scheduler-host.ts
  • packages/platform-node/src/node-shard-host.ts
  • packages/platform-node/src/node-socket-host.ts
  • packages/platform/src/capabilities.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for lunorash failed.

Name Link
🔨 Latest commit 8c4963e
🔍 Latest deploy log https://app.netlify.com/projects/lunorash/deploys/6a6f0b994ce238000846f308

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

@prisis

prisis commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

Closing: this PR was opened in error by an automated run, outside the scope of its task.

No work is lost — the branch is retained on origin and this PR can be reopened at any time.

Context: this branch predates the merges of #288 and #289, so much of its content is already on alpha, and it would need a rebase before being reviewable. Reopening deliberately, after a rebase, is preferable to leaving it open in this state.

@prisis prisis closed this Aug 2, 2026
@prisis
prisis deleted the feat/platform-node branch August 5, 2026 06:43
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant