Skip to content

Prove first-run and recovery paths - #2

Merged
cardmagic merged 8 commits into
mainfrom
agent/onboarding-proof
Aug 16, 2026
Merged

Prove first-run and recovery paths#2
cardmagic merged 8 commits into
mainfrom
agent/onboarding-proof

Conversation

@cardmagic

Copy link
Copy Markdown
Owner

Summary

  • rebuild the README around per-identity race-free realtime state, an early-release notice, fit boundaries, and factual provenance
  • add a clean packaged SQLite quickstart and an npm tarball smoke gate
  • add deterministic multi-process serialization, retry, crash recovery, and fencing proof
  • add reproducible SQLite, PostgreSQL, and MySQL benchmarks with observed results and measurement limitations
  • add comparison, support, contribution, security, correctness, and release documentation

Impact

The 0.13.0 package now has an executable first-run path, release-artifact verification, prominent delivery limitations, and reproducible technical evidence. No external service is required for the public SQLite quickstart.

Validation

  • pnpm run format:check
  • pnpm run check
  • pnpm run test:coverage
  • pnpm run build
  • pnpm run pack:check
  • pnpm run test:package
  • pnpm run test:recovery
  • pnpm audit --audit-level=high
  • SQLite, PostgreSQL 18, and MySQL 8.4 benchmark runs

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds executable first-run, package-smoke, benchmark, and multi-process recovery evidence while substantially revising the project documentation.

  • Adds packaged SQLite quickstart and release-artifact verification.
  • Adds reproducible benchmark orchestration and observed database results.
  • Adds deterministic serialization, retry, crash-recovery, and fencing demonstrations.
  • Expands correctness, support, security, comparison, and release documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
benchmarks/processes.ts Adds readiness and exit helpers that detect worker startup exits and settle after removing event listeners.
benchmarks/run.ts Adds multi-process benchmark orchestration and now terminates sibling workers when startup fails.
examples/failure-recovery/demo.ts Adds deterministic recovery assertions and validates parsed event fields before constructing concrete event values.
scripts/release-artifact-smoke.mjs Adds a clean-install smoke test for the generated npm package.
src/cli.ts Adds the packaged SQLite quickstart command used by first-run and artifact verification paths.
.github/workflows/ci.yml Extends CI with package and recovery validation gates.

Reviews (2): Last reviewed commit: "fix: fail fast when benchmark workers ex..." | Re-trigger Greptile

Comment thread benchmarks/run.ts Outdated
Comment on lines +238 to +243
new Promise<void>((resolvePromise, reject) => {
worker.once("error", reject)
worker.on("message", (message) => {
if (message === "ready") resolvePromise()
})
}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Worker startup failure hangs benchmark

When a worker exits during module loading or runtime.install(), it never sends ready, and this promise does not observe the exit, causing the benchmark command to wait indefinitely instead of reporting the startup failure.

Suggested change
new Promise<void>((resolvePromise, reject) => {
worker.once("error", reject)
worker.on("message", (message) => {
if (message === "ready") resolvePromise()
})
}),
new Promise<void>((resolvePromise, reject) => {
worker.once("error", reject)
worker.once("exit", (code, signal) => {
reject(new Error(`benchmark worker exited before ready with code ${code} and signal ${signal}`))
})
worker.on("message", (message) => {
if (message === "ready") resolvePromise()
})
}),
Prompt To Fix With AI
This is a comment left during a code review.
Path: benchmarks/run.ts
Line: 238-243

Comment:
**Worker startup failure hangs benchmark**

When a worker exits during module loading or `runtime.install()`, it never sends `ready`, and this promise does not observe the exit, causing the benchmark command to wait indefinitely instead of reporting the startup failure.

```suggestion
        new Promise<void>((resolvePromise, reject) => {
          worker.once("error", reject)
          worker.once("exit", (code, signal) => {
            reject(new Error(`benchmark worker exited before ready with code ${code} and signal ${signal}`))
          })
          worker.on("message", (message) => {
            if (message === "ready") resolvePromise()
          })
        }),
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread examples/failure-recovery/demo.ts Outdated
Comment on lines +178 to +183
async function jsonLines(path: string): Promise<Array<Record<string, unknown>>> {
return (await readFile(path, "utf8"))
.trim()
.split("\n")
.filter(Boolean)
.map((line) => JSON.parse(line) as Record<string, unknown>)

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 Parsed events retain unknown fields

jsonLines casts every parsed line to Record<string, unknown> and callers then access its fields without narrowing. Define and validate a concrete recovery-event shape so event-schema mistakes remain visible to TypeScript.

Rule Used: What: Disallow the use of unknown in TypeScript ... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: examples/failure-recovery/demo.ts
Line: 178-183

Comment:
**Parsed events retain unknown fields**

`jsonLines` casts every parsed line to `Record<string, unknown>` and callers then access its fields without narrowing. Define and validate a concrete recovery-event shape so event-schema mistakes remain visible to TypeScript.

**Rule Used:** What: Disallow the use of `unknown` in TypeScript ... ([source](https://app.greptile.com/craftsmanfounder/-/custom-context?memory=af673ae0-6488-4c8b-8b4a-1bfea4eb4de7))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reject worker readiness when startup exits and terminate sibling workers so benchmark failures cannot hang. Validate recovery event records against concrete schemas before assertions.

See #2
@cardmagic
cardmagic marked this pull request as ready for review August 16, 2026 14:45
Show concrete stateful coordination patterns before the API example so readers can recognize when a per-identity mailbox fits their problem. Keep the hot-identity and SQL-transaction boundaries beside those examples.

See #2
Lead with the programming model, follow with concrete coordination use cases, and keep the SQLite quickstart directly after both sections.

See #2
Classify the package immediately, describe the exact browser coverage, and scope the quickstart assertions to one local run. Put the runnable example before the broader use-case table.

See #2
State the deployment distinction and existing-database requirement in the repository headline so readers can classify the project immediately.

See #2
Use the familiar Durable Objects category while stating the Node and SQL deployment boundaries in a concise headline and subheadline.

See #2
Remove the temporary registry note before packaging the README and record the intended August 16 publication date in the changelog.

See #2
@cardmagic
cardmagic merged commit 18302bf into main Aug 16, 2026
14 checks passed
@cardmagic
cardmagic deleted the agent/onboarding-proof branch August 16, 2026 15:28
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