Skip to content

feat(envelope): pick up cachekit-core 0.4.0 bin envelopes (LAB-900) - #249

Open
27Bslash6 wants to merge 2 commits into
mainfrom
lab-900-core-0.4.0-bin-envelopes
Open

feat(envelope): pick up cachekit-core 0.4.0 bin envelopes (LAB-900)#249
27Bslash6 wants to merge 2 commits into
mainfrom
lab-900-core-0.4.0-bin-envelopes

Conversation

@27Bslash6

@27Bslash6 27Bslash6 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Closes LAB-900 (parent LAB-764 stage 5 — protocol 1.1 rollout, final leg for Python).

What

  • Bump cachekit-core 0.3.0 → 0.4.0 (rust/Cargo.toml + Cargo.lock). Fresh writes now emit StorageEnvelope.compressed_data as MessagePack bin (0xc4/0xc5/0xc6); pre-0.4.0 array-of-ints envelopes remain readable forever. No py-side code change — the envelope codec is single-sourced in cachekit-core.
  • SDK-level byte-verification (tests/unit/protocol/test_envelope_wire_vectors.py, 27 tests; fixture vendored sha256-pinned from protocol wire-format.json @ a4b392b), closing LAB-764's "interop parity proven, not asserted" AC for Python:
    • Legacy-read: all 6 legacy vectors decode via the real FFI retrieve path; a transcoded legacy envelope is also served through the full decorator retrieve path (FileBackend L2, no recompute).
    • Bin-emit: a fresh decorator write stores a CK v3 frame whose envelope element[0] carries a bin marker; bin8/bin16/bin32 width tiers pinned against the real writer (the protocol *_bin pins only cover bin8 — per the decision record's deferred-coverage note).
    • Re-encode identity: ByteStorage.store() reproduces all 6 *_bin protocol pins byte-identically.
    • Round-trip identity through the full stack, compressible + incompressible.
  • DEVELOPMENT.md envelope fix — closes the envelope-description half of Fix false 'Blake3' advertising (checksum is xxHash3-64) and the rmp envelope doc cachekit-core#46: the documented [version:1][format:1][checksum:8][compressed_data] layout never existed. Now documents the real rmp_serde positional fixarray(4) [compressed_data, checksum, original_size, format], the 0.4.0 bin encoding, and the permanent legacy-read rule. (The Blake3-mislabel half of chore(main): release 0.3.1 #46 is a separate residual, untouched here.)
  • .secrets.baseline: the fixture's hex vectors are high-entropy by design; audited in, same convention as the existing AAD/encryption test entries.

Verification (local, CI-equivalent invocations)

  • ruff format --check . / ruff check . — clean
  • basedpyright --level error — 0 errors
  • pytest tests/unit/ -m "not slow" — 1936 passed (includes doctests + markdown-docs)
  • pytest tests/critical/ -m "not slow" — 234 passed
  • pytest tests/integration/ -m "not slow" --ignore=tests/integration/saas — 240 passed
  • cargo test --release --features python — green

Notes

Supply-chain / SCA evidence (cachekit-core 0.3.0 → 0.4.0)

OSV.dev batch scan (api.osv.dev/v1/querybatch, 2026-07-29) of all 243 crates.io packages in Cargo.lock:

  • cachekit-core 0.4.0: 0 known advisories (OSV/RustSec/GHSA). Its full dependency subtree (aes, aes-gcm, ring, lz4_flex, sha2, hkdf, hmac, rmp-serde, xxhash-rust, zeroize, …) is also clean.
  • Cargo.lock is updated: the sole lockfile delta vs main is cachekit-core 0.3.0 → 0.4.0, resolved from crates.io with checksum 6aba1513135a7b92a124ad6983f7e80e5f5c78c4f9c74384079efa3fbf491eab.
  • 5 pre-existing advisories exist in dev-only tooling deps (anyhow via protobuf-codegen, bincode via iai-callgrind, proc-macro-error2 via iai-callgrind-macros, quick-xml via inferno, rand via proptest) — all present on main before this PR, none in the runtime tree, none introduced or touched by this bump.
  • 0.4.0 is a first-party release (chore(main): release cachekit-core 0.4.0 cachekit-core#60) — same maintainers, reviewed in-org.

Bump cachekit-core 0.3.0 -> 0.4.0 (LAB-900, protocol 1.1 rollout stage 5).
Fresh writes now emit StorageEnvelope compressed_data as MessagePack bin
(0xc4/0xc5/0xc6) instead of array-of-ints; legacy envelopes stay readable
forever. No py-side code change — the envelope codec is single-sourced in
cachekit-core.

Byte-verification (tests/unit/protocol/test_envelope_wire_vectors.py, fixture
vendored sha256-pinned from cachekit-io/protocol wire-format.json):
- legacy-read: all 6 pre-0.4.0 array-of-ints vectors decode via the real FFI
  retrieve path, and a transcoded legacy envelope is served through the full
  decorator retrieve path (FileBackend L2, no recompute)
- bin-emit: fresh decorator writes carry a bin-encoded envelope inside the CK
  v3 frame; bin8/bin16/bin32 width tiers pinned against the real writer (the
  protocol *_bin pins only cover bin8)
- re-encode identity: the 0.4.0 writer reproduces all 6 *_bin protocol pins
  byte-identically
- round-trip identity through the full stack, compressible + incompressible

Docs: DEVELOPMENT.md envelope row replaced — the documented custom
[version][format][checksum][...] layout never existed (cachekit-core#46
envelope-doc residual); now describes the real rmp_serde positional
fixarray(4) with the 0.4.0 bin encoding and permanent legacy-read rule.

Secrets baseline: wire-format.json hex vectors are high-entropy test pins,
audited into .secrets.baseline (same convention as the AAD/encryption tests).
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 24 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: ASSERTIVE

Plan: Pro

Run ID: 2d9ebfda-665f-4397-bfa8-7531c4562954

📥 Commits

Reviewing files that changed from the base of the PR and between 539fde9 and 0a9d372.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .secrets.baseline
  • DEVELOPMENT.md
  • rust/Cargo.toml
  • tests/critical/test_byte_storage_error_injection.py
  • tests/unit/protocol/fixtures/wire-format.json
  • tests/unit/protocol/test_envelope_wire_vectors.py

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

@kodus-27b

This comment has been minimized.

Comment thread rust/Cargo.toml
Comment thread tests/unit/protocol/test_envelope_wire_vectors.py
@27Bslash6 27Bslash6 changed the title LAB-900: pick up cachekit-core 0.4.0 (bin envelopes) — bump, byte-verify, fix DEVELOPMENT.md feat(envelope): pick up cachekit-core 0.4.0 bin envelopes (LAB-900) Jul 29, 2026
- tests/critical/test_byte_storage_error_injection.py: the final-envelope-size
  security check's premise died with 0.4.0 — a 500MB incompressible payload no
  longer inflates ~2x (bin encoding is ~1.004x), stores fine, and the expected
  ValueError never raised (slow-marked, so PR CI skipped the breakage). Input
  now sits 16 bytes under the 512MiB input cap so the LZ4 incompressible-block
  overhead pushes the final envelope over the limit again. randbytes chunked at
  128MiB (getrandbits takes a C int).
- tests/unit/protocol/test_envelope_wire_vectors.py: merged the two
  byte-identical decode tests into one parametrized over all 12 vectors.
- DEVELOPMENT.md: 'dual-read proven in both directions' de-ambiguated — this
  repo's suite proves both encodings decode, not cross-SDK direction.
@kodus-27b

kodus-27b Bot commented Jul 29, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@27Bslash6

Copy link
Copy Markdown
Contributor Author

@kody start-review

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