Repository navigation
Reduce runtime duplication across WAL, KV, and Git proof - #101
Merged
Merged
Conversation
Reuse one checked conditional head update across retention, collection, and commit publication. Classify storage and admission failures consistently while preserving pending outcomes. Co-authored-by: Codex <noreply@openai.com>
Share the radix insertion path and the provider retry path without changing publication or admission behavior. Co-authored-by: Codex <noreply@openai.com>
Use the authenticated next radix prefix directly and let encoding/json decode validated repository fields. Remove duplicate failure recording already covered by deferred observers. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
The pre-scan can reject a short decoded object before the stored writer closes. Require an unpack failure, no ref acknowledgment, and no published refs for either malformed pack. Co-authored-by: Codex <noreply@openai.com>
Keep the 16,384-object lookup fixture used for before/after timing so future changes can be checked against the same workload. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The WAL, KV provider, and Git example repeated publication, write, and catalog logic. This change consolidates those paths while preserving the public API, durable format, and Git/KV behavior. It removes 177 production runtime lines across Rust and Go; the complete diff is 156 lines smaller after adding a reproducible Git lookup benchmark.
The core now shares checked head publication, pending-result classification, conditional object-store write setup, and one auditable list of durable option fields. KV shares its radix insertion and Spin provider retry paths. Git uses the authenticated next radix prefix directly, decodes validated repository fields once, and removes duplicate read-error observation. The object-store helper returns the backend future directly because an extra async wrapper slowed append benchmarks.
The existing malformed-pack provider test failed on
main: the parser rejects a short object before the stored writer closes, while the test required the writer's exact error phrase. Its assertion now checks the protocol outcome—unpack failure, no ref acknowledgment, and no published refs—without depending on which stage rejects the pack.Validation passed on the final branch:
make check(full workspace tests, Go race/vet, strict native and WASIp2 Clippy),make spin-kv-check,make git-spin-config-test,make wasi-credential-test, Git auth transport tests, core and Spin KV suites against disposable local MinIO, and the default unchanged-client Git provider suite against the composed Spin component and MinIO. Independent correctness reviews found no blocker in the core, KV, Git, durable format, or combined diff.Representative local benchmarks on Apple M4 Pro show no sustained slowdown (Criterion in-memory, 20–30 samples and 2 s measurement; Go 5 × 500 ms):
mainGit lookup allocates zero bytes in both versions. Repository-config decode remained within the before/after run-to-run spread (123–127 vs 124–126 µs, 2,345 allocations in both). The new
BenchmarkLookupCatalogkeeps the lookup comparison reproducible. These are local measurements, not remote-storage performance claims.