Skip to content

Add native celld KV through an EdgeZero store service on stock celld - #422

Open
ChristianPavilonis wants to merge 32 commits into
issue-410-native-store-providersfrom
feat/native-celld-stores
Open

ChristianPavilonis wants to merge 32 commits into
issue-410-native-store-providersfrom
feat/native-celld-stores

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Current state: KV on official celld, no modified build

Head 15bdeef6. This PR no longer depends on a modified celld. The scoped listener compiled into celld is gone; live KV now goes through an EdgeZero-owned store service that the official celld release runs as an ordinary application.

Why. Stock celld only exposes storage to Worker code deployed into it, so EdgeZero ships that code: services/celld-store, a Worker plus one SQLite Durable Object per namespace, deployed with celld deploy. Spec: docs/superpowers/specs/2026-11-16-stock-celld-store-service-design.md.

What changed in this update

  • New services/celld-store/ (single module, no_bundle, no npm dependencies). Every mutation applies in one SQLite transaction and records the client's mutation ID. Stock celld resends a buffered Durable Object call after a pooled peer tunnel fails, even if the owner already ran it (send_inner in crates/celld/main/peer_tunnel.rs, v0.6.3); the ledger answers that resend with the first outcome. An apply-before window stops a call held through cell recovery from applying long after the client gave up.
  • New wire protocol: x-edgezero-store-version: 1, a store instance header on every object response, mutations as POST /put and POST /delete with x-edgezero-mutation-id. Forked servers and reset stores fail instead of answering. The client still never resends.
  • Removed the celld-config provider and the fork-only v1 record API (records feature). Records will come back on this service through the record-contract work.
  • Replaced the modified-celld runner and namespace-isolation script with proofs against the official release.
  • Docs: guide rewritten, including an automated Kubernetes deploy Job so operators have no manual step.

For review: each namespace is one Durable Object. Every write for a namespace is serialized on one node and waits for durability, that node carries all of that namespace's traffic, a node failure pauses the namespace until takeover (10 s lease by default), and sharding later would be a storage format change.

Evidence (official celld v0.6.3, binary SHA-256 eb0a8158421b69d68dd5d28f2298a7d411dde498295833deeb1cc5ce53b7eb75, release attestation verified):

  • node --test service, runner and fleet-script suites: 17, 9 and 4 passed.
  • edgezero-store-celld settings / kv / all-features: 4 / 32 / 32 passed. Axum native-bindings lib 25, celld-kv startup 4, mixed AWS+celld lib/startup 442 + 5 + 4 passed.
  • cargo clippy --workspace --all-targets --all-features -D warnings, focused feature-combo Clippy, cargo fmt --check, strict rustdoc for the changed crates, dependency isolation script.
  • Generated consumer, deterministic fixture: default-off rejection, live KV, one unique mutation ID per write, restart, AWS coexistence, delete.
  • node scripts/run_native_celld_integration.mjs: generated consumer against celld dev running the service behind a TLS proxy, authenticated. Binary and empty values, listing, 61-second TTL expiry, restart, rejected token.
  • node scripts/run_celld_store_fleet_proof.mjs: RustFS 1.0.1 container, two nodes. A reply dropped after the owner ran a put made celld resend it; the client got 204 and the value applied once. kill -9 of the owner, then takeover: all acknowledged writes present.
  • Docs format, lint and build.
  • Hosted CI on this head.
  • Production bucket, network isolation, adjacent-version behavior during in-place deploys, sustained throughput. Local loopback numbers only: about 63 sequential writes/s, about 240 writes/s at concurrency 32 on one namespace.

Not done here: forward merges into #439 and the rest of the stack, record endpoints on the service, Trusted Server #1537 fixture changes, new RC tags, and the #437 issue text (it still lists config).

Previous description (modified-celld design, superseded)

Current review readiness

Combined head: 1c90b246af22dad4e38899c8a12a0f81cb2c6fed. This PR includes native config snapshots, ordinary KV and optional conditional/physical record operations. The records feature remains default-off and requires the additive celld record-server extension. Ordinary KV does not acquire CAS semantics.

Local checks pass on the combined tree:

  • Workspace tests: 2,885 passed, 0 failed, 6 ignored; workspace strict all-feature Clippy, formatting, feature compilation and Spin wasm32-wasip2 compilation pass.
  • Provider default/config/KV/records/all-feature suites: 5 / 28 / 31 / 48 / 56 passed; scoped strict Clippy and dependency isolation pass.
  • Four celld startup tests, the explicitly selected generated-consumer fixture and the explicitly selected real conditional-record interop test pass. The real-service test used the previously fingerprinted modified celld binary with disposable loopback data, not an independent service rebuild or fleet qualification.
  • The changed guide passes Prettier 3.9.10.

Fresh hosted CI and review of the enlarged scope are pending. Existing review feedback remains open; earlier approvals and receipts do not cover the added record feature. Historical checkpoints below describe only their recorded inputs. No deployment, release-tag update or main merge is included.

Current review-stack checkpoint

Publication head: f9b0f20c6857d2e638bcfe7bf1edaa5af5425bfb. This cleanup preserves the existing feature unit and PR identity. The additional change is the completed generated-native build correction: image-only code now follows the scaffold's existing Fastly-example selection, with no request-policy change. Its focused generator/native proof is retained; fresh per-branch hosted checks are not assumed green.

Review order: #275 → #406 → #407 → #409 → #414 → #422 → #439 → #454. Draft integration checkpoint: #462. New SDK/group/codec/phase development and unrelated TS work are not prerequisites or additions to this PR. Earlier notes below retain their original tested revisions and limits; they are not a whole-tree pass for this new head.

Earlier implementation and proof notes

RC refresh checkpoint, 2026-11-10

Current head: d475727691e2a80ca2dbb324568283f63e34a870.

The five celld-only donor commits are replayed onto updated #414, without obsolete hosting or diagnostic ancestry. Config/KV source selection stays typed and feature-isolated; startup snapshots are bounded and KV preserves exact keys, prefixes, continuation and expiry rules.

Feature proof passes 38 celld cases, independent settings/config/KV suites, 478 Axum unit, 6 mixed AWS startup and 4 celld startup cases, CLI/isolation/runner checks and scoped strict Clippy. Independent provider source review found no confirmed defect. Lower namespace/CI fixes are merged and all five locked fetches pass.

Ordinary KV is not conditional create/CAS/atomic RMW or identity-allocation qualification. Optional conditional/physical records provide separate Add, Overwrite and generation-match operations without changing ordinary KV. Prepared celld KV does not prove runtime connectivity/grants, and snapshots are not atomic across documents. Production identity-allocation and fleet acceptance remain separate gates.

Draft pending fresh hosted checks and the combined RC audit. Two unchanged native default-parallel deadline misses remain recorded and unclassified; serial passes and untouched-foundation parallel passes do not clear them. No timing bound was relaxed. No deployment, main merge, security-alert dismissal or review-thread resolution occurred. Historical design/review context follows.


Summary

  • Add native celld configuration snapshots, live KV and conditional/physical records through a scoped API embedded inside celld, with default-off config/KV/records features.
  • Preserve portable store traits and native startup ordering, with separate AWS/celld policies, credentials, accounting and actual-variant preparation sessions.
  • Add bounded transport/fault tests, public-runner and generated-consumer proofs, structural-only CLI support, documentation and CI checks.

Changes

Crate / File Change
edgezero-store-celld Strict settings, redacted explicit tokens, bounded HTTP/TLS client, immutable config snapshots, live KV and optional conditional/physical records. No celld runtime or V8 dependency.
edgezero-adapter-axum Per-ID typed bindings, once-only selected token capture, independent provider policies/capabilities and existing readiness/staging integration.
edgezero-cli and generated Axum manifest Independent feature forwarding, structural-only validation with availability unknown, and selected remote config-push refusal.
Tests, scripts and CI Feature-isolation checks, TLS/proxy/no-replay fault tests, mixed AWS/celld/local startup, generated consumers and explicit local-service acceptance.
Consumer lockfiles Refresh settings-only provider edges for the excluded demo and reusable-app workspaces without registry version changes.
Documentation Native celld guide, reviewed spec/plan and exact local verification evidence with remaining gaps.

Closes

Closes #437.

Related to #410 and stacked on #414. This is store-provider work, not the celld HTTP runtime adapter in #421.

Dependencies and draft status

  • Base branch: issue-410-native-store-providers, currently draft Add native AWS store providers #414.
  • Config and ordinary KV require the unreleased embedded celld scoped API at f72ae21a515859570622ac9d6ca9c19cf6870b81. Records additionally require the conditional-record server extension with x-celld-record-version: 1; the original listener does not support records. The companion celld changes are not published by this PR.
  • No gateway, sidecar, Worker bridge, celld secret provider or portable core trait changes.
  • Fleet forwarding/reload/failover, production deployment isolation, replication/storage acceptance, upgrades and sustained fault/shutdown stress remain open. The generated TLS and disposable namespace-isolation proofs are separate arrangements.
  • A real-service CI job remains deferred until a reviewed service artifact is available. Missing prerequisites fail the explicit local harness instead of passing by skipping.

Test plan

  • cargo test --workspace --all-targets: 2,028 passed, 6 ignored. Ignored acceptance tests listed below were explicitly selected separately.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings, with focused Clippy follow-ups for the final test-only additions.
  • cargo fmt --all -- --check and git diff --check.
  • cargo check --workspace --all-targets --features "fastly cloudflare spin".
  • All provider WASM target builds. Spin wasm32-wasip2 check passed; full Fastly and Cloudflare target builds were not executed.
  • examples/app-demo full workspace tests. Both excluded consumer lockfiles passed offline locked metadata validation; reusable fixture-axum check passed.
  • Docs lint, format and site build.
  • Manual edgezero serve --adapter axum. Production-runner and generated native binaries were exercised instead.
  • Provider settings/config/KV/combined suites: 4 / 27 / 30 / 38 passed, with independent feature Clippy checks.
  • Native feature matrices, 253 combined native units, 4 celld startup subprocess tests, and 6 mixed/AWS startup tests. AWS-only startup also passed all 5 existing cases.
  • Generated celld target with neither feature, each feature alone, both, and both alongside all AWS provider features.
  • Real generated app against modified celld over verified TLS: binary/empty KV, pagination, 61-second expiry, immutable config adoption and persistence across app/celld restarts.
  • Disposable user/network/mount/PID namespace proof for scoped access, internal-listener denial, hidden service files and server procfs isolation.
  • Existing generated AWS and DynamoDB proofs, dependency feature-isolation checks, and 24 integration-runner Node tests.

All Cargo verification used offline locked dependencies after reviewed lockfile updates. The workspace test runner needed stdin closed because existing consent tests assume noninteractive CI. No test was excluded to resolve that run.

The real-service command requires an explicit modified binary and uses only disposable state and dummy credentials:

CELLD_BIN=/absolute/path/to/modified/celld \
EDGEZERO_GENERATED_TEST_TARGET_DIR=/absolute/path/to/disposable-build-cache \
node scripts/run_native_celld_integration.mjs

The implementation plan records the tested source/binary fingerprints and proof limits. No real AWS/fleet credentials or production deployment were used.

Checklist

  • Changes follow CLAUDE.md conventions.
  • No new direct Tokio dependencies in core or adapter crates; native transport lives in the provider crate.
  • No legacy route-param syntax introduced.
  • Application handlers use edgezero_core types.
  • Store wiring uses the existing typed registries and staging path.
  • New behavior has tests.
  • No production secrets or credentials committed. The checked-in DER key/certificates and token strings are public, disposable fixture material only.

Owned follow-up review checkpoint

  • Branch advanced through an ordinary merge; every previous public head remains an ancestor.
  • Current head: ef1d4ab59427642ef26b0a30d679a068f040157e. Source tree 43174231bb50d19072f33ed7a19734b5bae8c966 is byte-identical to previous head bb56cfe142965bea6c997d0d2e288e2698f8ee64.
  • Related owned draft: #499. It is intentionally a placeholder until the author cleans feat: implement portable outbound HTTP and request lifecycle contracts #275 and the owned baseline/follow-up are reconciled.
  • Review base and ready/draft state are unchanged. The feature-only review diff is byte-identical to the pre-update diff.
  • Existing qualification remains tied to its recorded inputs. New hosted outcomes are reported separately; this history update does not qualify new source-version-bound binaries or move a release tag.

aram356 added a commit that referenced this pull request Nov 16, 2026
Brings #275 at b65e714 and the refreshed heads of #499, #460, #406,
#407, #409, #414, #422 and #439. Each PR merged the one below it, so
this merge has no conflicts. #409 resolved the one conflict on the way
up, in edgezero-core's app.rs imports, by keeping both.
…ck celld

The celld providers depended on a scoped listener compiled into a modified
celld. Stock celld only exposes storage to Worker code deployed into it, so
EdgeZero now ships that code: services/celld-store, a Worker plus one SQLite
Durable Object per namespace, deployed with `celld deploy` onto the official
release.

- Each mutation applies in one SQLite transaction and records its client
  mutation ID. Stock celld resends a buffered Durable Object call after a
  pooled peer tunnel fails even when the owner already ran it; the ledger
  answers that resend with the first outcome. An apply-before window keeps a
  call held through cell recovery from applying long after the client gave up.
- Responses carry a new protocol header and a store instance ID, so forked
  servers and reset stores fail instead of answering.
- Mutations are POST /put and /delete with a fresh 128-bit ID; the client
  still never resends.
- Remove the celld config provider and the fork-only v1 record API.
- Replace the modified-celld runner and namespace isolation script with a
  generated-consumer proof against official celld behind a TLS proxy, and a
  two-node fleet proof that reproduces the resend and an owner takeover.
… tokens

Review follow-ups for the store service:

- A 404 counts as an absent key only when the store instance header is
  present. A routing 404, such as from a proxy that rewrote the path, is now
  malformed instead of silently reporting existing keys missing.
- The Worker accepts any ASCII graphic token, including commas, and still
  rejects repeated Authorization headers by grammar.
- The Kubernetes deploy recipe maps index.js back under src/, because
  ConfigMap keys cannot contain "/".
- The spec no longer claims to detect a rollback to an older snapshot of the
  same store.
@ChristianPavilonis ChristianPavilonis changed the title Add native celld config, KV and conditional record providers Add native celld KV through an EdgeZero store service on stock celld Nov 16, 2026
aram356 added a commit that referenced this pull request Nov 17, 2026
Brings #275 at ea2549f and the refreshed heads of #499, #460, #406,
#407, #409, #414, #422 and #439, including #422's stock-celld store
service and its merge into #439. Each PR merged the one below it, with
no conflicts on the way up, so this merge has no conflicts.
@ChristianPavilonis
ChristianPavilonis removed this pull request from stack #501 November 17, 2026 17:14
Bring in main's Fastly SDK 0.13.3 upgrade (#529) with Viceroy 0.22.0
and the Fastly CLI 17.2.0 upgrade (#531), with PR #275's exact pins at
0.13.3 and url 2.5.9, its Viceroy readiness repair on 0.22.0 and its
typed Image Optimizer unavailability check for SDK 0.13.3.
Bring in PR #275's installation of the wasm32-unknown-unknown target
before the Viceroy 0.22.0 readiness repair builds, which the fastly
wasm tests and Portable record contracts (Fastly) jobs need.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#495), I pushed b879b743 and d2cec42c, two merges of #414's new heads. b879b743 takes EdgeZero main's Fastly SDK 0.13.3 upgrade (#529), with Viceroy 0.22.0 and the Fastly CLI 17.2.0 upgrade (#531), with #275's exact pins at 0.13.3 and url 2.5.9, its Viceroy readiness repair on 0.22.0, its typed Image Optimizer unavailability check and its drain of declared uploads after an early response on Axum, and #414's lockfile merge and its two macOS fixture fixes (3231baf8, 494845ab). d2cec42c takes #275's d8cd85c8, which installs the wasm32-unknown-unknown target before the Viceroy 0.22.0 readiness repair builds, as the fastly wasm tests and Portable record contracts (Fastly) jobs need. Both merges had no conflicts.

Bring in PR #275's atomic conditional KV insert in the Viceroy readiness
repair, and the production hosting tests' held port reservations and
spawn-token respawn from PR #406 up, with each later PR's tests reading
the live host's address.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#495), I pushed c28a7280, a merge of #414's new head that brings #275's 41cdf035, which makes conditional KV inserts atomic in the Viceroy readiness repair, as the Fastly record contract's native race needs, and the production hosting tests' held port reservations and spawn-token respawn from #406 up, with each later PR's tests reading the live host's address. It had no conflicts.

Bring in PR #275's batch cutoff test fix, which advances the test clock
when the request arms its own deadline instead of after dispatch, and
PR #414's AWS emulator proof marker, now published by rename.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#495), I pushed 57fd4eab, a merge of #414's new head that brings #275's 0e2a58ae, which fixes an intermittent failure of the batch cutoff test by advancing its clock when the request arms its deadline timer, and #414's AWS emulator proof readiness marker, now published by rename. It had no conflicts.

@ChristianPavilonis

ChristianPavilonis commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Review follow-up: 95359e9, scoped to #422 against #414 at 2b13a66.

  • The store preserves exact key bytes, including a leading U+FEFF, in both queries and cursors. Oversized local puts now return validation without contacting celld. Trusted-network HTTP works without a CA bundle; HTTPS verification is unchanged.
  • CLI CI now downloads the official Linux celld v0.6.3 archive, checks the pinned checksum and release attestation, and runs the real generated TLS proof. Provider test modes require named tests to pass, dependency tree failures fail the check, and the proof cleans up its subprocesses.
  • Local results: the exact release verification step and generated TLS proof passed, as did the deterministic generated proof, mixed-provider sentinels, and two-node RustFS fleet proof. Keep one Durable Object per namespace for ordinary KV. Production bucket behavior, isolation, sustained load and takeover, and upgrades need separate qualification.

The celld-config-only lint modes no longer exist. Extra single-feature lint jobs and a portable macro change are deferred. The three Wasm dependency graphs exclude celld and reqwest; Cloudflare already has Tokio through worker, so a blanket Tokio ban would not describe this PR. #414's public wrappers and the unrelated Axum timing test are untouched.

Follow-up test-only commit 47d19ae fixes a shadowing lint in the new limits regression. Local workspace tests (2,983 passed, 7 ignored), strict workspace Clippy, workspace feature compilation and the Spin Wasm check passed.

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review

Summary

Found while reviewing the rc/identity integration branch (#495) and traced to this PR. Each finding was re-checked at this head (47d19aed); line numbers refer to it.

Requesting changes for the missing CHANGELOG entry.

Findings

Blocking

  • 🔧 CHANGELOG: ## Unreleased has no entry for the native celld config and KV stores, or for the EdgeZero store service on stock celld. #414 added an entry for the AWS stores; this needs the same.

Non-blocking

  • 🤔 After a store reset, ordinary KV writes commit but every later call reports InstanceChanged. See store-celld/src/kv.rs:70.
  • 🤔 Port race in native_celld_startup. See native_celld_startup.rs:145.
  • ⛏ CLAUDE.md still describes an "eight-crate production Cargo workspace" and does not list edgezero-store-aws (#414) or edgezero-store-celld. With both it is ten.

CI Status

  • GitHub reports no checks at 47d19aed.

.execute(method, url, body, cap, deadline, kind)
.await?;
if let Some(observed) = instance
&& *self.instance.get_or_init(|| observed.clone()) != observed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤔 After a store reset, ordinary KV writes commit but every call reports InstanceChanged, permanently

Ordinary KV requests carry no expected-instance header, so the service executes the write on the new instance. Only then does this check compare the response's instance with a OnceLock that never resets. The write took effect, the caller gets an error, and nothing recovers short of a restart. Either send the expected instance on ordinary writes too, so the service refuses them before committing, or document the restart requirement.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Addressed in 7521796 with docs and a test. The service has no expected-instance precondition for ordinary KV requests at this head, so a protocol change would not fit here. The PreparationError::InstanceChanged doc comment and a new "Store resets" section in native-celld-stores.md now state three things: the handle never re-pins, every later call fails until the app restarts, and a write that returned the error may already have committed. a_write_from_a_new_instance_commits_and_later_calls_keep_failing pins that behavior so the docs stay true.


impl Host {
fn spawn(root: &Path, bindings: &Path, initializer_gate: bool, supply_state: bool) -> Self {
let listener = TcpListener::bind("127.0.0.1:0").expect("reserve app address");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤔 Bind :0, release, hand to a child: the port race #519 fixed elsewhere

CI runs these tests in parallel, and no_listener() probes the released port, which another test's listener can take in the gap. Reuse the reserved_address() lock from production_hosting.rs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in 9adf6ea. Host::spawn now holds a bound, non-listening TcpSocket reservation under the same RESERVE_OR_SPAWN lock pattern as production_hosting.rs. Failure tests keep the port until Host drops and also assert the host never reached startup bind. The happy path releases the port just before letting the initializer finish. With that release commented out, the happy path fails with "host exited before readiness", which confirms the reservation really blocks the bind.

The workspace has ten members since edgezero-store-aws and edgezero-store-celld joined it.
A released port could be taken by a parallel test's listener before the no-listener check ran. Reuse the reservation and spawn lock from production_hosting.
Ordinary KV writes carry no expected instance, so a write can commit on the new instance and still fail; the handle keeps its first instance until restart. Pin that with a unit test.
Covers the celld-kv feature, binding settings, startup behavior, limits and the EdgeZero store service on stock celld.
@aram356

aram356 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Body findings from the review:

  • CHANGELOG: fixed in 3791a46. ## Unreleased has a new "Native celld KV on Axum" entry. It covers the celld-kv feature and binding settings, startup with EDGEZERO__STORE_BINDINGS_FILE, the default limits, and services/celld-store on stock celld. There is no celld config provider at this head, and the entry says so.
  • CLAUDE.md: fixed in baa93c9. The workspace is described as ten crates, and edgezero-store-aws and edgezero-store-celld are listed in the layout.

@prk-Jr prk-Jr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review (follow-up)

Summary

Reviewed head 3791a465 against the merge base with issue-410-native-store-providers (2b13a665). The move to stock celld with an in-repo store service is a real improvement: no fork, a pinned and attested release, a mutation ledger committed in the same transaction as the write, and a store instance header the client requires. Every blocking item from my last review and from aram356's original review is fixed in the code.

The latest four commits also address everything aram356 raised on 47d19aed: the CHANGELOG entry, the documented reset behaviour with a test for it, the port reservation and the CLAUDE.md crate list.

I'm requesting changes for one merge-readiness item, not for a defect in the provider. The branch no longer merges into its base. The base moved to f1f18b8a minutes after 47d19aed was pushed, and the resolution of one of the conflicts changes runtime behaviour (see inline).

😃 Praise

  • The duplicate-delivery ledger is committed in the same SQLite transaction as the write, and it is checked before the apply-before window, so a late resend of an already-applied write still gets its first outcome (index.js:702-711). I removed the ledger lookup as a check, and a duplicate delivery applies once and returns the first outcome fails (503 instead of 204), so the test really covers it.
  • The Rust and JS key contracts match exactly: 512 UTF-8 bytes, no Unicode Cc controls, form encoding in both directions (+ decodes to a space, index.js:129), a strict UTF-8 decoder that keeps a leading BOM, and code-point order on both sides of the pagination check.

Prior findings status

My review on bb56cfe1:

  • ✅ 🔧 Unguarded celld --lib steps: every celld and axum invocation now runs through run_test_nonzero.sh with a sentinel per feature mode, and the mixed run requires three sentinels (test.yml:201-207).
  • ✅ ⛏ Bare [limits] accepted: rejected again (native_bindings.rs:333-339), and covered by the CLI shared-rejection test.
  • ✅ 🤔 Isolation probes that could not fail: the script was removed along with the fork design.
  • ✅ ⛏ Timeout test passed with a direct-child kill: the fixture parent now ignores SIGTERM, so only the group kill can reap the descendant (run_native_celld_integration.test.mjs:95-118).
  • ✅ ⛏ Guide limits wording: the keys are listed and "setting both fails startup" is stated (native-celld-stores.md:178-188).
  • ✅ ⛏ Plan doc paths: corrected, and the personal paths are gone.

aram356 on f9b0f20c (I carried these forward last time):

  • ✅ 🔧 Oversized value returned 503: the local cap now returns InvalidResource, which maps to KvError::Validation (kv.rs:125-129). The public handle test covers it.
  • ✅ 🔧 Dependency script passed when cargo tree failed: fixed with || return and || exit 1 (check_native_store_dependency_contract.sh:35,41,62). The script passes locally.
  • ✅ 🔧 Generated proof ran the wrong binary: delete now runs before the coexistence build (celld_generated_proof.rs:533-537).
  • ✅ 🔧 Startup suites not nonzero-guarded: fixed, see above.
  • ✅ ❓ Unreleased celld API: the provider now targets stock v0.6.3, and CI checks the archive checksum and attestation.
  • ✅ ❓ Query-string key decoding: the service is in the repo and decodes with form rules, matching append_pair.

aram356 on 47d19aed:

  • ✅ 🔧 CHANGELOG: added as "Native celld KV on Axum" (CHANGELOG.md:17-37).
  • ✅ 🤔 A write commits, then reports InstanceChanged: now documented on the error variant, in the guide's "Store resets" section and in the CHANGELOG, and pinned by a_write_from_a_new_instance_commits_and_later_calls_keep_failing. The behaviour itself is unchanged, which is a reasonable choice for v1. See my follow-up on the guide below.
  • ✅ 🤔 Port race in native_celld_startup: the port stays bound until the host may bind it, and reservations and spawns are serialized.
  • ✅ ⛏ CLAUDE.md crate count: fixed.

Findings

Blocking

  • 🔧 Conflicts with the updated base, and the capability check needs a real resolution: see the inline comment at native_bindings.rs:670. In short, git merge-tree against f1f18b8a reports conflicts in 7 files. If the base's new missing_feature() is kept as it is, celld-only KV builds stop working. Please also move the new CHANGELOG entry next to the base's "Native AWS stores on Axum" entry when you merge.

Non-blocking

  • 🤔 After a restart the app silently adopts the reset store: the guide's "fails rather than mixing" and "restart after any reset" say nothing about this (inline at native-celld-stores.md:88).
  • 📝 The new CI steps have never run on GitHub: GitHub reports no runs for 3791a465 or 47d19aed. The last hosted run on this branch is at 57fd4eab, which is before the stock-celld rewrite. So the release download, the checksum and attestation check, and the TLS proof against the official release are unproven in hosted CI. Please make sure they run green after the forward merge.

CI Status

  • Hosted: GitHub reports no checks or workflow runs for 3791a465 (nor for 47d19aed). The last hosted runs on this branch are for 57fd4eab.
  • Local, Rust 1.98.1, on 47d19aed with the delta re-run on 3791a465:
    • cargo fmt --all -- --check: PASS
    • clippy -D warnings: PASS for edgezero-store-celld, edgezero-adapter-axum and edgezero-cli with --all-features. Also PASS for celld with no features and with kv only, and for axum with native-bindings only.
    • edgezero-store-celld: all features 34 passed, kv only 33 passed.
    • axum native-bindings --lib: 26 passed. Mixed aws-stores,aws-dynamodb,celld-kv: lib 444 passed (1 ignored), native_aws_startup 6 passed, native_celld_startup 4 passed.
    • edgezero-cli --all-targets: 814 passed, 6 ignored.
    • check_native_store_dependency_contract.sh: PASS.
    • Node runner and fleet suites: PASS. service.test.mjs: 17/18 passed on my local Node 24.12. The one failure is the value round-trip test: this Node's node:sqlite binds an ArrayBuffer as NULL (I reproduced that standalone). This looks like a local Node-version issue, not a PR defect, since the pinned toolchain is 24.20.
  • Not run: the official-celld TLS proof (needs Linux and the release binary), the fleet proof (needs Docker), the workspace-wide test run, and the wasm checks.

if (!bindings.config.is_empty() && !capabilities.appconfig_agent)
|| (!bindings.secrets.is_empty() && !capabilities.secrets_manager)
|| (!bindings.kv.is_empty() && !capabilities.dynamodb)
|| bindings.kv.values().any(|binding| match binding {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔧 This branch no longer merges into its base, and this check is where the resolution matters

issue-410-native-store-providers moved to f1f18b8a ("Address native AWS store review feedback") right after this head was pushed. git merge-tree against it reports content conflicts in 7 files:

  • .github/workflows/test.yml
  • native_bindings.rs
  • native_stores.rs
  • run_options.rs
  • edgezero-cli/src/args.rs
  • docs/guide/adapters/axum.md
  • docs/guide/native-aws-stores.md

This line is not a mechanical conflict. The base replaces this check with capabilities.missing_feature(bindings).is_some(), and NativeProviderCapabilities::missing_feature tests !bindings.kv.is_empty() && !self.dynamodb, which returns "aws-dynamodb". native_stores.rs on the base then appends enable Cargo feature aws-dynamodb`` to the startup error.

If the resolution keeps that helper as it is:

  • A celld-kv build without aws-dynamodb rejects every celld KV binding as UnsupportedProvider. That breaks the generated celld-only target this PR proves.
  • A build missing celld-kv tells the operator to enable the wrong feature.

Fix: merge the base, then make missing_feature match on the actual variant, the way this line does:

} else if let Some(binding) = bindings.kv.values().find(|binding| match binding {
    NativeKvBinding::DynamoDb(_) => !self.dynamodb,
    NativeKvBinding::Celld(_) => !self.celld_kv,
}) {
    Some(match binding {
        NativeKvBinding::DynamoDb(_) => "aws-dynamodb",
        NativeKvBinding::Celld(_) => "celld-kv",
    })
}

Then route the selection check through it, and add a celld case to capabilities_follow_actual_variants that asserts the hint. I'll re-review the resolution.

2. Write the policy into `vars.EDGEZERO_STORE_POLICY` as a JSON string.
3. Run `celld deploy <dir> --bucket s3://<fleet-bucket>`. Nodes adopt the new version within `CELLD_DEPLOY_POLL_S` (default 30 seconds) without restarting.

Keep the template's `name`, binding and class name. celld derives each Durable Object's identity from the script and class names, so a rename reaches new, empty storage. The client notices the changed store instance and fails rather than mixing old and new data; see [store resets](#store-resets).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤔 After a restart, the app adopts the reset store without any signal

The new "Store resets" section explains the running-process side well. The other side is missing. The pin lives in a per-handle OnceLock, set from the first response (kv.rs:72-76). Preparation makes no probe, and nothing persists the expected instance. So once the operator follows "restart the application after any reset", the app pins whatever instance answers first and serves from the new, empty storage with no error.

For the rename case this line describes, the client does fail rather than mix data, but only until the restart the guide then asks for. After that, an accidental rename or wrong bucket looks exactly like an empty store.

Suggestion: say so explicitly here and in "Store resets": "after a restart the app adopts the new instance; confirm the reset was intended first". Optionally plan an expected_instance binding field, sent as a request header so the service refuses before committing. That would also remove the commit-then-fail write path.

if (body !== null && body.length > LIMITS.maxValueBytes) fail("limit_exceeded");
const print = await fingerprint(meta, body);
const outcome = this.storage.transactionSync(() => {
const prior = this.sql

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

😃 The ledger lookup, the apply-before check and the write all run in one transactionSync, with the lookup first. A celld peer-tunnel resend that arrives after the window still gets the first outcome instead of a spurious deadline. I removed this lookup as a check, and the duplicate-delivery test fails, so the protection is really tested.

Comment on lines +211 to +216
// Only the store itself can report a key as absent or present. A 404
// from routing, such as a proxy that rewrote the path, has no instance.
let logical_miss = missing && (method == Method::HEAD || kind.optional());
if (success || logical_miss) && instance.is_none() {
return Err(PreparationError::Malformed);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

😃 Requiring a store instance before a 404 counts as a miss closes the "routing 404 looks like an absent key" gap dhruv8sh raised earlier, for both GET and HEAD. A proxy that rewrites the path now surfaces as an error instead of an empty read.

This branch has not been deployed

No deployments
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.

Add native celld configuration and KV store providers

4 participants