Skip to content

Move chunked_config to edgezero-core and export it#302

Open
prk-Jr wants to merge 1 commit into
mainfrom
export-chunked-config-to-core
Open

Move chunked_config to edgezero-core and export it#302
prk-Jr wants to merge 1 commit into
mainfrom
export-chunked-config-to-core

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Export the Fastly chunk-pointer writer/resolver (chunked_config) by moving it from edgezero-adapter-fastly (where it was pub(crate)) into edgezero-core, next to its only dependency blob_envelope.
  • The functions are pure — all I/O goes through caller-supplied callbacks — so downstream hosts that read Fastly-shaped config stores via their own store abstractions can reuse the wire format (pointer schema, per-chunk len + sha verification, envelope reassembly) instead of re-implementing it. trusted-server carries a ~150-line copy of the resolver today because it must classify chunk read failures (retryable → 503) separately from verification failures (terminal → 500) at its own error boundary; the callback-based resolver expresses that, the transparent FastlyConfigStore::get path cannot.
  • No behavior change; no wire-format change; edgezero-adapter-fastly keeps compiling unchanged via a pub(crate) re-export.

Changes

Crate / File Change
crates/edgezero-core/src/chunked_config.rs Module moved here from edgezero-adapter-fastly; API made pub (+#[inline] per strict-clippy); cli-feature cfg gates dropped (core has no cli feature; unused pure fns strip at link); module doc explains why it lives in core; all 13 unit tests move with it
crates/edgezero-core/src/lib.rs pub mod chunked_config;
crates/edgezero-adapter-fastly/src/lib.rs pub(crate) mod chunked_config;pub(crate) use edgezero_core::chunked_config; gated any(cli, fastly, test), placed in the import group per arbitrary_source_item_ordering

Closes

n/a — issue linking skipped by request.

Test plan

  • cargo test --workspace --all-targets
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --features "fastly cloudflare spin"
  • WASM builds: wasm32-wasip1 (Fastly) / wasm32-wasip2 (Spin) / wasm32-unknown-unknown (Cloudflare)
  • examples/app-demo workspace: cd examples/app-demo && cargo test --workspace --all-targets
  • Docs build: cd docs && npm run lint && npm run format && npm run build
  • Manual testing via edgezero serve --adapter axum
  • Other: downstream proof — trusted-server patched to this branch with its local resolver replaced by edgezero_core::chunked_config::resolve_fastly_config_value; full suite green (1475 core + 144 adapter tests) including the 503-vs-500 classification tests that motivated the local copy

Checklist

  • Changes follow CLAUDE.md conventions
  • No Tokio deps added to core or adapter crates
  • Route params use {id} syntax (not :id) — n/a, no routing changes
  • Types imported from edgezero_core (not http crate)
  • Store wiring goes through KvRegistry / ConfigRegistry / SecretRegistry — n/a, no store wiring changes
  • New code has tests (13 existing unit tests move with the module)
  • No secrets or credentials committed

The Fastly chunk-pointer writer and resolver are pure functions (I/O is
delegated to caller-supplied callbacks), but lived crate-private inside
edgezero-adapter-fastly. Downstream hosts that read Fastly-shaped config
stores through their own store abstractions could not reuse them and had
to re-implement the wire format (pointer schema, per-chunk len + sha
verification, envelope reassembly).

Move the module to edgezero-core, make its API pub, and keep
edgezero-adapter-fastly compiling unchanged via a pub(crate) re-export.
No behavior change; the module's tests move with it.
@prk-Jr prk-Jr self-assigned this Jul 2, 2026
@@ -5,6 +5,12 @@
//! module splits the envelope into content-addressed chunk entries plus a

@aram356 aram356 Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should not have adapter specific code in the core. Maybe we can do this differently

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