Skip to content

feat: protocol standard library and conformance binary - #1

Draft
usrbinkat wants to merge 9 commits into
mainfrom
usrbinkat/feat/draft-kappa-distribution
Draft

usrbinkat wants to merge 9 commits into
mainfrom
usrbinkat/feat/draft-kappa-distribution

Conversation

@usrbinkat

@usrbinkat usrbinkat commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

What

The kappa-Distribution protocol standard library (crates/kappa-distribution/) and conformance test binary (kappa-conformance). The standard library defines cross-registry byte contracts. The conformance binary is an adversarial harness that validates any kappa-Distribution registry over HTTP, now extended with SHA-1 axis support, object-type metadata queries, and bundle bulk transfer conformance tests.

Passes against the kappa-registry:

  • 187 conformance tests, 0 failures, 0 warnings, 10 skips (federation requires external peers)
  • 32 unit tests across the workspace (26 conformance binary + 6 standard library)

How to verify

cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test --workspace
cargo build --release --target x86_64-unknown-linux-musl

Run against a live registry:

KAPPA_REGISTRY_URL=http://localhost:8080 ./target/release/kappa-conformance

Standard library (crates/kappa-distribution/)

  • Edge canonical byte form (Appendix A layout): source || 0x00 || relation || 0x00 || target || 0x00 || u32-BE(len) || metadata
  • Five composition canonical forms (G2/F4/E6/E7/E8) with wire-format hex output
  • Self-describing witness blob header (6-byte: label_width u16 LE + fp_width u16 LE + trace_count u16 LE)
  • Error code taxonomy (20 codes, uppercase-underscore wire tokens)
  • Conformance level enum (Blobs/Tags/Edges/Composition/Federation)
  • no_std + alloc, zero dependencies

Conformance binary changes in this PR

SHA-1 axis support (P1)

  • sha1-checked 0.10.0 added as independent SHA-1 implementation with collision detection
  • KappaLabel::sha1() returns Result<Self, LabelError> with CollisionDetected variant
  • Parser accepts 45-byte sha1 labels (sha1: + 40 hex)
  • assert_kappa_matches handles sha1 axis
  • TestBlob struct gains sha1 field computed via make_blob()
  • Dedicated sha1_upload and sha1_multi test blobs in TestData
  • L1-70: SHA-1 blob push and retrieve (uses data.hello.sha1)
  • L1-71: SHA-1 chunked upload complete (uses data.sha1_upload.sha1)
  • L1-72: SHA-256 primary with SHA-1 also label (uses data.sha1_multi)
  • Test vectors verified against system sha1sum: empty = da39a3ee..., hello = aaf4c61d...
  • 8 new kappa.rs unit tests: sha1_empty, sha1_hello, sha1_label_length, parse_roundtrip_sha1, parse_sha1_wrong_digits, complement_sha1_roundtrip, plus existing reject tests updated for 45..=135 length range

OCI distribution-spec parity

  • DIGEST_INVALID status corrected from 409 to 400 per OCI spec (L1-04, L1-32, L1-53)
  • Docker-Content-Digest header assertions (L1-05, L1-06)
  • Location header assertion on blob PUT 201 (L1-02)
  • Upload complete with ?digest= alias (L1-55)
  • Single-POST blob push with ?digest= (L1-56)
  • Tag list flat string array parsing (OCI format, L2-11)
  • Tag list repository name field (L2-65)
  • Manifest delete by digest (L2-66)
  • OCI-Subject header on manifest PUT with subject field (L2-70)
  • Referrers API returning OCI Image Index (L2-71, L2-72, L2-73)

Object-type metadata queries

  • L5-68: object-type=manifest query after manifest PUT
  • L5-69: object-type=composition and object-type=witness after compose
  • L5-70: Filter and pin object-type metadata (L5-70, L5-71)

Bundle bulk transfer

  • L6-20: bundle create and ingest roundtrip
  • L6-21: bundle with delta compression (similar blobs, verify size reduction)
  • L6-22: corrupted bundle trailer rejection
  • L6-23: empty kappas list rejection

Infrastructure improvements

  • TracedResponse struct with eagerly consumed body, header(), body_text(), fail_msg() methods
  • Per-level namespace isolation (B34): each conformance level runs in {namespace}/l{level}
  • All match arms use Ok(r) pattern with r.status, r.body, r.trace
  • SHOULD/MAY failures downgraded to WARN, MUST failures are FAIL
  • Response body included in every FAIL verdict for diagnostics
  • Test data uses pre-computed fixtures exclusively -- zero inline hash computation in test code

Dependencies

Crate Version Purpose
sha2 0.10 Independent SHA-256
sha1-checked 0.10 Independent SHA-1 with collision detection
blake3 1 Independent BLAKE3
reqwest 0.12 Synchronous HTTP client (rustls-tls)
serde + serde_json 1 Response deserialization
base64 0.22 HTTP Basic auth
chrono 0.4 Report timestamps
uuid 1 Federation test blob uniqueness

Not in scope

  • Federation tests (require KAPPA_FEDERATION_PEERS with a second registry instance)
  • Redirect tests (require proxy configuration)

Related

Standard crate (crates/kappa-distribution/):
- edge_canonical(): source || 0x00 || NFC(relation) || 0x00 || target || 0x00 || u32-BE(metadata_len) || metadata
- compose_canonical(Op, &[&[u8]]): g2 lex-min-first concat, f4 bitwise-complement lex-min, e6 first-byte-mod-9 tag, e7 S4 24-permutation lex-min, e8 identity
- witness_blob(label_width, fingerprint_width, trace): u16-LE header at offsets 0/2/4, trace at offset 6
- witness_trace(): returns &[u8] past the 6-byte header
- Op enum: parse(), as_str(), arity() for g2/f4/e6/e7/e8
- ComposeError enum: BadArity, AxisMismatch, MalformedOperand
- ErrorCode enum: 20 codes (BLOB_UNKNOWN through SIZE_INVALID), as_str() returns uppercase-underscore wire tokens
- ConformanceLevel enum: Blobs=1, Tags=2, Edges=3, Composition=4, Federation=5, number(), includes()
- no_std + alloc, zero dependencies, cfg_attr(not(feature="std"), no_std)
- axis_of(), digest_of(), hexval() internal helpers for label parsing
- PERMS4: all 24 S4 permutations as [[usize; 4]; 24]
- 5 unit tests: canonical layout byte-for-byte, deterministic sensitivity, error code uppercase validation, level cumulative ordering, composition algebraic properties (commutativity, involution, degree tag, quarter-permutation invariance, witness round-trip)

Conformance binary (src/):

kappa.rs:
- KappaLabel { buf: [u8; 135], len: u8 }: Copy, Eq, Ord, Hash, Display, Debug, Deref<Target=str>, AsRef<str>, AsRef<[u8]>
- parse(s): length 71-135, single colon, recognized axis (sha256/blake3/sha3-256/keccak256/sha512), lowercase hex, per-axis digit count
- sha256(content), blake3(content): independent computation via sha2::Sha256 and blake3::hash
- complement(): zero-allocation bitwise-NOT of digest bytes, copies axis prefix from self.buf directly
- axis(): extracts sigma-axis token before colon
- colon_pos(): buffer position of colon separator
- LabelError: BadLength, NoColon, UnknownAxis, BadHex{position,byte}, WrongDigitCount{expected,got}
- hex_nibble(): shared decode helper
- 17 unit tests: sha256/blake3 empty+hello against constants, config blob against sha256sum-verified constant (77b1c760...), parse round-trips for sha256+blake3, parse validation for sha3-256(73B)/keccak256(74B)/sha512(135B) lengths, reject unknown axis at valid length, reject short unknown axis as BadLength, reject uppercase hex, reject wrong digit count, complement round-trip involution, complement known vector (00..00 -> ff..ff), complement axis preservation

config.rs:
- Config struct: registry_url, namespace, levels Vec<u8>, auth Auth enum (None/Bearer/Basic), timeout_secs, upload_chunk_size, teardown_order TeardownOrder enum (TagsFirst/BlobsFirst), teardown_enabled, follow_redirects, federation_peers Vec<String>, report_dir PathBuf
- Config::from_env(): KAPPA_REGISTRY_URL required, all others with defaults from .env.example
- required_env(), env_or(), config_exit() helpers

client.rs:
- RegistryClient { inner: Client, auth_header: Option<HeaderValue>, base_url: String }
- inject(): sets Accept + Content-Type application/octet-stream + Authorization on every request
- inject_no_content_type(): Accept + Authorization only, no Content-Type
- get/head/put/post/delete(path): base_url-prefixed, inject()ed
- patch_url/put_url/get_url/delete_url(url): resolve_location() + inject()
- put_no_content_type(path): inject_no_content_type() for L1-17 default Content-Type test
- put_tag(path, name, kappa): PUT /v2/{path}/tags/{name}?kappa={k} pointer-only binding
- get_tag(path, name): GET /v2/{path}/tags/{name} pointer-only resolution
- send_traced(rb): builds request, captures method/url/headers/body_size, executes, captures status/headers/body_size/duration_ms, returns (Response, HttpTrace)
- send_traced cross-host redirect handling: Policy::custom stops on host boundary (scheme://authority differs), send_traced detects 3xx + Location to different origin, re-issues WITHOUT Authorization header, returns redirected response
- resolve_location(base, loc): absolute passthrough, relative via Url::join
- redact_headers(): replaces authorization/cookie/set-cookie/token/password/secret/credential values with [REDACTED]
- HttpTrace: method, url, req_headers, req_body_size, status, resp_headers, resp_body_size, duration_ms
- origin_of(): extracts scheme://authority for host boundary comparison

assertions.rs:
- assert_status(actual, expected): exact status match
- assert_status_in(actual, &[expected]): status in set
- assert_header_present(headers, name): case-insensitive presence
- assert_header_value(headers, name, expected): case-insensitive name, exact value match
- assert_body_eq(body, expected): byte-for-byte comparison
- assert_kappa_matches(body, expected): axis-dispatched re-hash (sha256/blake3) compared against expected KappaLabel
- assert_kappa_valid(s): parse validation returning KappaLabel or error string
- verify_error_response(body, expected_code): JSON parse, errors[0].code == expected_code, uppercase-underscore format validation

runner.rs:
- Requirement enum: Must, Should, May
- TestVerdict enum: Pass, Fail, Warn, Skip
- TestResult: id, level, requirement, description, verdict, message, traces Vec<HttpTrace>, duration_ms
- TestRunner: results Vec<TestResult>, must/should/may() return TestContext, skip() records directly
- TestContext: id, level, requirement, description, traces Vec<HttpTrace>, runner &mut, start Instant
- TestContext::trace(&mut self, HttpTrace): accumulates traces
- TestContext::pass/fail/warn(self): consumes context, downgrades Should+Fail and May+Fail to Warn
- print_verdict(): colored terminal output [PASS] green, [FAIL] red, [WARN] yellow, [SKIP] gray, no color when TERM unset

testdata.rs:
- TestBlob { name, content: &static [u8], sha256: KappaLabel, blake3: KappaLabel }
- TestData { empty, hello, config, layer_a, layer_b, unknown_fields, no_content_type, large_content Vec<u8>, large_sha256, simple_manifest Vec<u8>, simple_manifest_sha256, multi_manifest Vec<u8>, multi_manifest_sha256, cancel_partial_content: &static [u8], cancel_partial_sha256 }
- generate(): empty=b"", hello=b"hello", config=br#{"type":"config"}#, layer_a=34B*120, layer_b=34B*120, unknown_fields=br#{"known":"v","_xyzzy":"preserve"}#, no_content_type=b{"no_content_type_test":true}, cancel_partial_content=b"partial-upload-data-for-cancel-test", large=35B*120000 (~4MiB)
- simple_manifest: JSON with config+layer_a kappas
- multi_manifest: JSON with config+layer_a+layer_b kappas

edge_canon.rs:
- encode_edge(source: &KappaLabel, relation, target: &KappaLabel, metadata): independent Appendix A encoder, source.as_str().as_bytes() || 0x00 || relation.as_bytes() || 0x00 || target || 0x00 || (metadata.len() as u32).to_be_bytes() || metadata

report.rs:
- write_junit(results, path): JUnit 4 XML, one testsuite per level, failure/system-out/skipped per verdict
- write_html(results, registry_url, path): self-contained HTML, summary boxes, per-level tables with ID/Req/Result/Description/ms/Detail, HTTP traces with method/url/status/duration/req_body_size/resp_body_size/req_headers/resp_headers rendered per test row
- xml_escape(), html_escape()

Level 1 tests (src/tests/level1.rs, 47 tests):
- L1-01: GET /v2/ version check, body contains "kappa-distribution"
- L1-02: PUT blob monolithic, inject() Content-Type application/octet-stream
- L1-03: PUT same blob idempotent, 200 or 201
- L1-04: PUT with wrong kappa, 409
- L1-05: HEAD verifies Content-Length present, X-Kappa-Label value == data.hello.sha256, X-Kappa-Axis value == "sha256"
- L1-06: GET verifies X-Kappa-Label header value, body byte-equality
- L1-07: full verify-on-receipt chain: re_hash(body) == X-Kappa-Label header == expected constant
- L1-08: GET absent kappa 404
- L1-09: HEAD absent kappa 404
- L1-10: PUT empty blob (0 bytes)
- L1-11: GET empty blob, body.len() == 0
- L1-12: PUT blob with unknown JSON fields
- L1-13: GET preserves unknown fields byte-for-byte (exact-bytes invariant)
- L1-14: PUT config + layer_a + layer_b, send_traced, failure names blob.name
- L1-15: GET blob list by prefix
- L1-16: PUT with Content-Type application/json, GET echoes it, HEAD echoes it
- L1-17: PUT via put_no_content_type (no Content-Type header), GET returns application/octet-stream
- L1-20: POST upload start, 202, capture Location
- L1-21: Location opaque (pass by construction)
- L1-22: X-Kappa-Chunk-Min-Length (SHOULD warn)
- L1-23: PATCH chunk 1, 202, capture updated Location
- L1-24: PATCH chunk 2, 202
- L1-25: PATCH duplicate chunk, 416
- L1-26: GET upload URL recovery, 204, Range + Location headers present
- L1-27: PATCH out-of-order chunk, 416
- L1-28: GET upload URL after 416, 204
- L1-29: PATCH remaining chunks, send_traced per chunk, capture Location
- L1-30: PUT complete with kappa query param, 201, X-Kappa-Label == large_sha256
- L1-31: GET completed blob, assert_kappa_matches
- L1-32: PUT complete with wrong kappa, 409
- L1-33: POST + PATCH cancel_partial_content + DELETE cancel, 204
- L1-34: GET cancelled session, 404 or 400
- L1-35: GET cancel_partial_sha256, 404 (partial data not stored)
- L1-40: POST mount existing blob, 201 or 202
- L1-41: GET mounted blob, assert_kappa_matches (SHOULD, skip if mount unsupported)
- L1-42: POST mount absent blob, 202, Location present
- L1-43: resolved fallback URL starts with http
- L1-44: POST mount without from parameter
- L1-50: PUT multi-label ?also=blake3, both verified
- L1-51: GET both sha256 and blake3 addresses resolve (SHOULD)
- L1-52: multi-label fallback, primary kappa works (SHOULD)
- L1-53: PUT multi-label with bad also kappa, 409
- L1-60: redirect followed (skip, opportunistic)
- L1-61: auth not forwarded cross-host (pass by construction)
- L1-62: redirect final response correct (pass by construction)
- L1-90: DELETE blob, 202 or 405
- L1-91: teardown cleanup, TeardownOrder::TagsFirst|BlobsFirst, condition checked before TestContext creation

Level 2 tests (src/tests/level2.rs, 39 tests):
- L2-01: PUT /manifests/v1.0, Content-Type application/json, 201
- L2-02: PUT /manifests/l2-02-tag, X-Kappa-Label value == simple_manifest_sha256, assert_kappa_valid
- L2-03: GET /manifests/v1.0, X-Kappa-Label == simple_manifest_sha256, body == simple_manifest, assert_kappa_matches
- L2-04: PUT /manifests/latest, same simple_manifest content
- L2-05: GET v1.0 + GET latest, both X-Kappa-Label equal
- L2-06: PUT /manifests/latest with multi_manifest
- L2-07: GET latest, X-Kappa-Label == multi_manifest_sha256
- L2-08: GET v1.0, X-Kappa-Label == simple_manifest_sha256 (retained)
- L2-09: PUT /tags/should-fail?kappa={never_pushed}, 404, verify_error_response TAG_CONTENT_ABSENT
- L2-10: GET /manifests/nonexistent, 404
- L2-11: GET /tags/list, parse tags array, pairwise ASCIIbetical order assertion
- L2-12: GET /tags/list?n=1, tags.len() <= 1, Link header present (>=2 tags exist)
- L2-13: GET /tags/list?n=0, empty, no Link header
- L2-14: GET /tags/list?n=1, extract first_tag name, GET /tags/list?n=1&last={first_tag}, cursor excludes first_tag
- L2-15: cursor is tag name (pass by construction)
- L2-16: GET /manifests/{sha256:...} direct kappa, X-Kappa-Label + body + assert_kappa_matches
- L2-17: GET /tags/v1.0 direct resolution, X-Kappa-Label matches GET /manifests/v1.0
- L2-18: GET /tags/nonexistent-tag-l2-18, 404
- L2-20: PUT /manifests/2026-07-20T00:00:00 timestamp tag (SHOULD)
- L2-21: PUT /manifests/2026-07-20T12:00:00 timestamp tag (SHOULD)
- L2-22: GET /tags/list?after=...&before=... range filter (SHOULD)
- L2-23: GET /tags/list?order=desc (SHOULD)
- L2-24: GET /tags/list?order=asc (SHOULD)
- L2-30: PUT /tags/v1.0?kappa={multi_manifest_sha256} If-Match:{simple_manifest_sha256} CAS success (SHOULD)
- L2-31: PUT /tags/v1.0?kappa={simple_manifest_sha256} If-Match:{wrong} CAS conflict 409 (SHOULD)
- L2-32: PUT /tags/cas-create?kappa={simple_manifest_sha256} If-None-Match:* CAS create (SHOULD)
- L2-33: GET /manifests/v1.0, X-Kappa-Label == multi_manifest_sha256 after CAS success
- L2-34: GET /manifests/v1.0, X-Kappa-Label == multi_manifest_sha256 unchanged after CAS failure
- L2-40: PUT /manifests/mtag-a?tag=mtag-b multi-tag bind (SHOULD)
- L2-41: GET mtag-a + GET mtag-b, same X-Kappa-Label (SHOULD)
- L2-42: multi-tag fallback (SHOULD)
- L2-50/51/52: warning headers (SHOULD/MUST/SHOULD)
- L2-60: DELETE /manifests/v1.0, capture delete_body for L2-61
- L2-61: verify_error_response(delete_body, "UNSUPPORTED") if status 400
- L2-62: GET /manifests/v1.0 returns 404 after deletion (MAY)
- L2-63: GET /blobs/{simple_manifest_sha256} returns 200 (content survives tag deletion)
- L2-64: teardown tag cleanup

Level 3 tests (src/tests/level3.rs, 20 tests):
- independently computed expected_edge_kappa via edge_canon::encode_edge + KappaLabel::sha256
- L3-01: PUT /edges/ derives-from edge, capture edge_kappa
- L3-02: edge_kappa == expected_edge_kappa (independent verification)
- L3-03: GET /blobs/{edge_kappa}, assert_kappa_matches (axis-aware)
- L3-04: body == expected_edge_bytes (0xA0 CBOR empty map)
- L3-05: GET /edges/{source}?direction=outbound&relation=derives-from, target in results
- L3-06: GET /edges/{target}?direction=inbound&relation=derives-from, source in results
- L3-07: GET /edges/?relation=owns, 0 results (filter works)
- L3-08: GET /edges/?direction=both, derives-from present
- L3-09: PUT same edge idempotent, X-Kappa-Label unchanged
- L3-10: PUT edge with absent source, 4xx, verify_error_response EDGE_SOURCE_ABSENT
- L3-11: PUT edge with absent target, 201/200 (lazy replication tolerance)
- L3-12: edge_kappa starts with data.simple_manifest_sha256.axis() + ":"
- L3-13: PUT refers-to referrer edge, capture referrer_edge_kappa
- L3-14: GET /edges/?inbound&refers-to, source + referrer_edge_kappa both present (fail if kappa not captured)
- L3-15: PUT edge to absent subject, 201/200
- L3-16: GET /edges/{absent_subject}?inbound, hello in results
- L3-17: GET /edges/?n=1 pagination (SHOULD)
- L3-20: PUT sacrificial edge + DELETE, both send_traced
- L3-21: GET /edges/{hello}?outbound&relation=sacrificial, 0 results after delete
- L3-22: HEAD source (hello) + HEAD target (config), both 200 after edge delete

Level 4 tests (src/tests/level4.rs, 29 tests):
- compose() helper returns (u16, String, HttpTrace) for trace capture
- L4-01: POST /compose/g2, capture composed_kappa + witness_kappa + l4_01_body
- L4-02: validate l4_01_body fields (composed, witness, operation=="g2", operands)
- L4-03: POST /compose/g2 reversed operands, composed == composed_kappa (commutative)
- L4-04: GET /blobs/{composed_kappa}, 200
- L4-05: GET /edges/{composed_kappa}?composed-of, both operands present, capture l4_05_body
- L4-06: l4_05_body contains "g2" (edge metadata operation type)
- L4-07: GET /witnesses/{composed_kappa}, 200, capture witness_body
- L4-08: witness_body[0..2] == 71u16 LE, [2..4] == 32u16 LE (self-describing header)
- L4-09: GET /edges/{composed_kappa}?inbound&witness-of, witness_kappa in results
- L4-10: POST /compose/g2 cross-axis (sha256 + blake3), 422
- L4-11: verify_error_response AXIS_MISMATCH
- L4-20: POST /compose/f4, capture f4_kappa
- L4-21: POST /compose/f4 with complement(), f4_kappa unchanged (involution)
- L4-22: POST /compose/e6, capture e6_kappa
- L4-23: GET /blobs/{e6_kappa}, body[0] == 0x05 or 0x06 per first_byte%9
- L4-24: POST /compose/e7, capture e7_kappa
- L4-25: POST /compose/e8, capture e8_kappa
- L4-26: e8_kappa != hello.sha256
- L4-27: compare f4/e7/e8 digest portions for coincidence (MAY, informational)
- L4-28: if coincidence, GET /edges/ verify metadata contains operation type
- L4-40: PUT /schemas/test-scope, 201, capture schema_kappa
- L4-41: GET /schemas/test-scope, X-Kappa-Label == schema_kappa, body == schema_content
- L4-42: GET /schemas/, contains "test-scope"
- L4-43: PUT /manifests/schema-pass {"name":"valid"}, 201, capture valid_kappa
- L4-44: PUT /manifests/schema-fail {"not_name":"invalid"}, 422, verify_error_response SCHEMA_VIOLATION
- L4-45: GET /blobs/{rejected_kappa}, 404
- L4-46: valid_kappa == KappaLabel::sha256(br#{"name":"valid"}#) (schema does not alter kappa)
- L4-47: PUT /schemas/test-scope updated, capture new_schema_kappa (SHOULD)
- L4-48: GET /edges/{new_schema_kappa}?derives-from, schema_kappa in results (SHOULD)

Level 5 tests (src/tests/level5.rs, 41 tests):
- poll_sweep(): send_traced GET /gc/status, 1s interval, 60s timeout
- L5-01: POST /gc/pin kappa=hello ttl=0, 201, capture pin_kappa
- L5-02: pin_kappa valid via assert_kappa_valid
- L5-03: PUT /edges/ hello owns layer_a
- L5-04: GET /tags/list, find+delete any tag pointing to layer_a.sha256
- L5-05: POST /gc/sweep, 202
- L5-06: poll_sweep 60s timeout
- L5-07: GET /blobs/{hello}, 200 (pinned survives)
- L5-08: GET /blobs/{layer_a}, 200 (reachable via owns survives)
- L5-09: POST /gc/unpin pin_kappa, 200
- L5-10: unpin derives (SHOULD, pass)
- L5-11: POST /gc/sweep, 202
- L5-12: poll_sweep 60s timeout
- L5-13: GET /blobs/{hello}, 404 expected (SHOULD warn if 200)
- L5-14: GET /blobs/{layer_a}, 404 expected (SHOULD warn if 200)
- L5-15: re-push config, POST /gc/pin kappa=config controller="test-ctrl", capture finalizer_pin_kappa
- L5-16: POST /gc/unpin finalizer_pin_kappa, 409, verify_error_response FINALIZER_OUTSTANDING
- L5-17: GET /gc/status, body contains "test-ctrl"
- L5-18: POST /gc/unpin finalizer_pin_kappa release=true, 200
- L5-19: POST /gc/unpin finalizer_pin_kappa, 200 (unpin succeeds after release)
- L5-20: POST /gc/sweep + poll + GET /blobs/{config}, 404 expected (SHOULD)
- L5-30: PUT /filters/test-filter-scope, 201, capture filter_kappa
- L5-31: GET /filters/, contains "test-filter-scope"
- L5-32: PUT /manifests/filter-pass {"data":"...accept..."}, 201
- L5-33: PUT /manifests/filter-fail {"data":"...refused..."}, 422, capture l5_33_body
- L5-34: verify_error_response(l5_33_body, "FILTER_REJECTED")
- L5-35: GET /blobs/{rejected_kappa}, 404
- L5-36: DELETE /filters/{filter_kappa}, 202
- L5-37: GET /blobs/{filter_kappa}, 200 (filter blob persists after unlink)
- L5-38: PUT /manifests/filter-fail same content, 201 (accepted after filter removal)
- L5-50: PUT to peer with Content-Type application/octet-stream (SHOULD)
- L5-51: GET /blobs/{peer_kappa} from primary, capture fed_status + timing
- L5-52: fed_status == 200 (SHOULD warn if 404)
- L5-53: GET /blobs/{peer_kappa}, assert_kappa_matches (MUST, skip if federation absent)
- L5-54: GET /blobs/{peer_kappa} cached, capture timing (SHOULD)
- L5-55: cached_duration < fed_duration (SHOULD warn if slower)
- L5-56/57/58: multi-peer/multi-hop (skip, topology not discoverable)
- L5-60/61/62: rate limiting (skip/pass/skip)

Spec amendments (specs/draft/KAPPA_DISTRIBUTION_SPEC_v2_ADDENDUM.md):
- A12: PUT /v2/{path}/tags/{name}?kappa={k} direct tag binding, no body, 201/200/404/422, If-Match CAS, If-None-Match:* create, TAG_CONTENT_ABSENT on absent kappa, Level 2 REQUIRED
- A13: GET /v2/{path}/tags/{name} direct tag resolution, 200 with X-Kappa-Label + JSON body, 404 absent, Level 2 REQUIRED
- 37 endpoints, 6 consensus, 31 non-consensus

Draft specs (specs/draft/):
- KAPPA_DISTRIBUTION.md v0.1.0: CRD-typed namespaces, 14-method storage interface, RADOS/FS/S3/SQLite backends
- KAPPA_DISTRIBUTION_v1.1.md v1.1.0: everything-is-a-blob, org:path@version addressing
- KAPPA_DISTRIBUTION_SPEC_v2.md v2.0.0: 35 endpoints, chunked upload recovery, multi-label push, mount, extensions, MUST/SHOULD/MAY summary
- KAPPA_DISTRIBUTION_SPEC_v2_ADDENDUM.md: A1-A13, axiomatic/derived blobs, superseded-by edge, grammar tightening, eviction loss, LWW tie-break, §8 informative reclassification, agreement demo, future work, tag_set/tag_get endpoints
- KAPPA_CONFORMANCE_SPEC.md v1.0.0: binary design, env vars, test data, test execution order, report formats, exit codes, credential redaction
- KAPPA_CONFORMANCE_IMPL_SPEC.md v1.0.0: crate identity, file tree, type specifications (KappaLabel, Config, RegistryClient, HttpTrace, TestRunner, TestContext, TestResult, TestBlob, TestData), 149 test IDs (107 MUST, 36 SHOULD, 6 MAY), expected kappa reference, implementation constraints
- KAPPA_CONFORMANCE_IMPL_SPEC_ADDENDUM.md: per-test expansion E1-E6 (L1-15, L1-41, L1-43, L1-51, L1-52, L1-60-62, L1-91, L2-02, L2-32-34, L2-40-42, L2-61-64, L3-02, L3-04, L3-13-17, L3-21, L4-02, L4-11, L4-23, L4-27-28, L4-47-48, L5-02, L5-04, L5-10, L5-12, L5-14, L5-18-20, L5-32, L5-34, L5-55-58, L5-61-62), edge canonical form encoder, F4 complement computation, sweep polling helper

Infrastructure:
- Cargo.toml: workspace with crates/kappa-distribution member, kappa-conformance binary, sha2 0.10, blake3 1, reqwest 0.12 blocking, serde 1 derive, serde_json 1, base64 0.22, chrono 0.4, uuid 1 v4, LTO+strip release profile
- crates/kappa-distribution/Cargo.toml: no deps, default=["std"], no_std via cfg
- flake.nix: Konductor devshell, rust-bin.stable.1.87.0 with rust-src/rust-analyzer/clippy/rustfmt, x86_64-unknown-linux-musl + aarch64-unknown-linux-musl targets, pkg-config, b3sum, openssl, taplo, shellcheck, markdownlint-cli2
- .envrc: dotenv .env.example + dotenv_if_exists .env, sesame vault injection, use flake, NIX_CONFIG github token
- .env.example: KAPPA_REGISTRY_URL, KAPPA_NAMESPACE, KAPPA_TEST_LEVELS, KAPPA_AUTH_TOKEN/USERNAME/PASSWORD, KAPPA_TIMEOUT, KAPPA_UPLOAD_CHUNK_SIZE, KAPPA_TEARDOWN_ORDER, KAPPA_TEARDOWN_ENABLED, KAPPA_FOLLOW_REDIRECTS, KAPPA_FEDERATION_PEERS, KAPPA_REPORT_DIR
- .github/workflows/ci.yml: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test --workspace, cargo build -p kappa-distribution --no-default-features, cargo build --release --target x86_64-unknown-linux-musl, upload artifact
- Dockerfile: FROM scratch, COPY release musl binary, ENTRYPOINT
- LICENSE-MIT + LICENSE-APACHE: from GitHub API /licenses/MIT and /licenses/Apache-2.0
- CLAUDE.md: project conventions
- .gitignore: /target/, /.direnv/, /.env, /kappa-conformance-report/
…te F4/E7 canonical form

Standard crate (crates/kappa-distribution/):
- compose_canonical F4/E7 re-encode decoded digest bytes to hex via
  to_hex() before prefixed(), producing wire-format axis:hexdigest
  output consistent with G2/E6/E8. Previously F4 and E7 emitted raw
  binary digest bytes in the canonical form while G2/E6/E8 emitted
  wire-format axis:hexdigest bytes, causing cross-operation canonical
  form inconsistency
- Add hex_of() helper extracting the hex portion of a kappa-label as
  a byte slice (everything after the colon)
- Add to_hex() helper re-encoding raw digest bytes as lowercase hex
  via HEX_ENC lookup table
- f4(): decode digest via digest_of(), compute bitwise complement,
  take core::cmp::min of digest and complement vectors, re-encode
  via to_hex(), wrap with prefixed(axis, &to_hex(&m))
- e7(): decode digest via digest_of(), divide into 4 quarters,
  enumerate all 24 PERMS4 permutations, concatenate quarter slices
  per permutation, track lexicographic minimum via best Option,
  re-encode via to_hex(), wrap with prefixed(axis, &to_hex(...))
- Replace best.as_ref().is_none_or(|b| cand < *b) with
  best.as_ref().map_or(true, |b| cand < *b) in E7 S4 orbit loop.
  is_none_or stabilized in Rust 1.82; map_or is available since 1.0
- Add canonical_forms_output_wire_format test: constructs blake3
  labels from [0x11; 32] and [0x22; 32] digests, verifies G2 output
  starts with b"blake3:" and has length a.len() + b.len(), verifies
  F4 output passes is_wire_label (colon present, hex after colon),
  verifies E6 output byte 0 is 0x05 or 0x06 and remainder passes
  is_wire_label, verifies E7 output passes is_wire_label, verifies
  E8 output passes is_wire_label and equals input

Conformance binary -- client.rs:
- Add TracedResponse struct with status: u16, headers: Vec<(String,
  String)>, body: Vec<u8>, trace: HttpTrace fields. Response body is
  eagerly consumed via resp.bytes().unwrap_or_default().to_vec() in
  send_traced() before the response object is dropped
- TracedResponse::body_text() returns String::from_utf8_lossy(&body)
- TracedResponse::header(name) does case-insensitive lookup returning
  Option<&str>
- TracedResponse::fail_msg(expected_status) formats "expected status
  {expected}, got {actual}: {body_preview}" with 4096-byte truncation
- send_traced() return type changes from Result<(Response, HttpTrace)>
  to Result<TracedResponse>. resp_body_size computed from body.len()
  instead of resp.content_length()
- Remove inject() and inject_no_content_type() methods
- Add headers_no_body() building HeaderMap with accept +
  authorization (no content-type). Used by get/head/delete/get_url/
  delete_url/put_no_content_type/put_tag/get_tag
- Add headers_with_body(content_type) building HeaderMap via
  headers_no_body() plus content-type header. Used by put/post/
  patch_url/put_url
- Add put_with_content_type(path, content_type) for tests needing
  non-default Content-Type (L1-16 application/json, L2-01, L2-02,
  L2-40, L4-40, L4-43, L4-44)
- Add post_with_content_type(path, content_type) for JSON-body
  POST requests (gc/pin, gc/unpin, gc/sweep, edge PUT, compose,
  filter registration)
- All path-based methods (get/head/put/post/delete) call
  .headers(self.headers_*()) instead of self.inject()
- All url-based methods (patch_url/put_url/get_url/delete_url) call
  .headers(self.headers_*()) instead of self.inject()

Conformance binary -- config.rs:
- Config struct derives Clone for per-level namespace isolation
- Auth enum derives Clone
- TeardownOrder enum derives Clone

Conformance binary -- assertions.rs:
- Remove assert_status(actual, expected) -> Result<(), String>
- Remove assert_status_in(actual, expected) -> Result<(), String>
- Status checks at call sites now compare TracedResponse.status
  directly: if r.status == 200, if r.status != 201, etc.
- Remaining functions unchanged: assert_header_present,
  assert_header_value, assert_body_eq, assert_kappa_matches,
  assert_kappa_valid, verify_error_response

Conformance binary -- main.rs:
- Per-level namespace isolation: for loop over config.levels,
  constructs level_config with namespace = format!("{}/l{level}",
  config.namespace) for each level, passes level_config to level
  runner. Prevents cross-level state contamination (L5 GC sweep
  evicting L1 blobs, L2 tags colliding with L4 schema tags)
- Config::clone() on each iteration (enabled by Clone derive)

Conformance binary -- level1.rs:
- Remove hdrs() and hdr_val() helper functions. All header access
  goes through TracedResponse.header() and TracedResponse.headers
- All match client.send_traced(rb) arms change from
  Ok((resp, trace)) to Ok(r), access r.trace.clone(), r.status,
  r.body, r.header(), r.body_text(), r.fail_msg()
- L1-01: r.body_text().contains("kappa-distribution")
- L1-05: assert_header_present(&r.headers, ...) and
  assert_header_value(&r.headers, ...) on TracedResponse.headers
- L1-06: l1_06_traces changes from Vec to Option, server_label
  extracted via r.header("x-kappa-label"), body via r.body.clone(),
  assert_body_eq(&r.body, ...) directly
- L1-07: if let Some(tr) = &l1_06_trace instead of for loop
- L1-15: runner.should() instead of runner.must()
- L1-16: client.put_with_content_type(&path, "application/json")
  instead of client.put(&path).header("Content-Type", ...)
- L1-20: capture l1_20_headers = r.headers.clone() for L1-22
- L1-22: assert_header_present(&l1_20_headers,
  "x-kappa-chunk-min-length") instead of unconditional warn
- L1-23/L1-24/L1-29: upload_url update via r.header("location")
  .map(|s| s.to_string()) instead of resp.headers().get().to_str()
- L1-30: assert_header_value(&r.headers, "x-kappa-label", ...)
- L1-32: PATCH via client.send_traced(patch_rb) with trace capture
  instead of bare .send(). Match arm Ok(r) if r.status == 202
- L1-33: PATCH result checked via pr.status != 202 with body in
  error message via pr.body_text(). DELETE via
  client.send_traced(client.delete_url(...))
- L1-42: fallback_loc via r.header("location").unwrap_or("")
- L1-44: t.fail() instead of t.warn() on non-201/202 status
- L1-52: unconditional test -- always runs GET for primary kappa,
  removes conditional skip when multi-label was supported
- L1-91: client.send_traced(client.delete(&path)) instead of
  client.delete(&path).send()

Conformance binary -- level2.rs:
- Remove hdrs() and hdr_val() helper functions
- All match arms change from Ok((resp, trace)) to Ok(r)
- L2-01: client.put_with_content_type(..., "application/json")
- L2-02: client.put_with_content_type(..., "application/json"),
  r.header("x-kappa-label") instead of hdr_val()
- L2-03: r.header("x-kappa-label"), assert_body_eq(&r.body, ...),
  assert_kappa_matches(&r.body, ...)
- L2-05: match (r1, r2) with r1.header("x-kappa-label") instead
  of resp.headers().get()
- L2-07/L2-08: r.header("x-kappa-label") instead of hdr_val()
- L2-09: probe PUT /tags/ endpoint with known-good kappa
  (simple_manifest_sha256) before testing absent kappa. If probe
  returns 404, fails with "PUT /tags/ endpoint not implemented".
  Otherwise proceeds with never-pushed kappa test. Error messages
  include r.body_text() for diagnostics
- L2-11: serde_json parse with .get("tags").as_array() extracting
  .get("name").as_str() only (removes .or(t.as_str()) bare-string
  fallback). Strict ordering check: w[0] < w[1] (not <=)
- L2-12: r.header("link").is_some() instead of
  resp.headers().get("link").is_some()
- L2-13: same pattern
- L2-14: r.body_text() and serde_json parse inline
- L2-16: r.header("x-kappa-label"), assert_kappa_matches(&r.body,
  ...)
- L2-17: tag resolution via client.get_tag(), manifest resolution
  via client.get(), compare x-kappa-label headers. Comment
  corrected: "At this point v1.0 points to simple_manifest (set in
  L2-01, verified in L2-08). L2-30 has not yet executed."
- L2-30: client.put_tag() with .header("If-Match", current_kappa),
  CAS success/failure via r.status
- L2-40: client.put_with_content_type(..., "application/json")
- L2-41: match (Ok(a), Ok(b)) with a.header/b.header
- L2-42: unconditional test -- always runs GET for mtag-a primary
  tag, removes conditional skip and pass-by-construction
- L2-50/L2-51/L2-52: active tests replacing skips. Issues GET
  /tags/list, checks for Warning header via r.header("warning").
  L2-50 verifies format starts with "299". L2-51 verifies length
  <= 4096. L2-52 passes if warning observed, warns if not
- L2-61: active test for all outcomes. If delete_status == 400,
  verify UNSUPPORTED error code. If 202 or 405, pass (valid
  responses). Otherwise fail with status and body
- L2-64: teardown tag list adds "l2-09-probe" and "should-fail"
  tags. Uses client.send_traced() instead of .send()

Conformance binary -- level3.rs:
- Remove hdrs() and hdr_val() helper functions
- All match arms change from Ok((resp, trace)) to Ok(r)
- L3-01: client.put_with_content_type(..., "application/json"),
  r.header("x-kappa-label")
- L3-03: r.body used directly, kappa_parsed match on r.body
- L3-05/L3-06/L3-07/L3-08: r.body_text() for body parsing
- L3-09: client.put_with_content_type(), r.header("x-kappa-label")
- L3-10: client.put_with_content_type(), verify_error_response on
  r.body directly instead of resp.bytes()
- L3-11: client.put_with_content_type()
- L3-13: client.put_with_content_type(), r.header("x-kappa-label")
- L3-14: r.body_text() for referrer edge query
- L3-15: client.put_with_content_type()
- L3-16: r.body_text()
- L3-20: client.put_with_content_type(), r.header("x-kappa-label")
  for sacrificial edge, client.delete() for deletion
- L3-21: r.body_text() and serde_json parse for edge count
- L3-22: match (Ok(r1), Ok(r2)) with r1.status/r2.status

Conformance binary -- level4.rs:
- Remove hdrs() and hdr_val() helper functions
- compose() helper return type changes from
  Result<(u16, String, HttpTrace)> to Result<TracedResponse>.
  Removes intermediate resp.text() -- body available via
  TracedResponse.body_text()
- All compose() call sites change from Ok((200, body, trace)) to
  Ok(r) with r.status == 200 check and r.body_text() for JSON
  parsing
- L4-01: composed_kappa and witness_kappa extracted from
  r.body_text() via json_get()
- L4-05: r.body_text() for edge query, l4_05_body captured as String
- L4-07: witness_body = Some(r.body.clone())
- L4-08: extended from header-only validation to header + payload
  re-hash. After verifying label_width=71 and fingerprint_width=32,
  extracts payload = &body[6..], re-hashes under composed kappa's
  axis (sha256 or blake3), compares re-hash result against
  composed_kappa. Fails if payload is empty, axis unsupported, or
  re-hash does not match
- L4-10: l4_10_traces changes from Vec to Option, l4_10_body from
  r.body_text()
- L4-11: if let Some(tr) = &l4_10_trace instead of for loop
- L4-22: e6_kappa from r.body_text()
- L4-23: r.body[0] for tag byte check instead of resp.bytes()
- L4-24: e7_kappa from r.body_text()
- L4-27: _coincidences variable prefixed with underscore (unused)
- L4-28: r.body_text() for edge metadata check
- L4-40: client.put_with_content_type(), r.header("x-kappa-label")
- L4-41: r.header("x-kappa-label"), assert_body_eq(&r.body, ...)
- L4-42: r.body_text()
- L4-43: client.put_with_content_type(), r.header("x-kappa-label")
- L4-44: client.put_with_content_type(). Schema violation changed
  from t.warn() to t.fail(). Content accepted (201/200) changed
  from t.warn() to t.fail() with response body in message
- L4-45: rejected content found changed from t.warn() to t.fail()
  with response body
- L4-46: r.trace.clone() instead of (_, trace)
- L4-47: client.put_with_content_type(), r.header("x-kappa-label").
  Non-201 changed from t.warn() to t.fail(). Error path changed
  from t.warn() to t.fail()
- L4-48: r.body_text(). Edge not found changed from t.warn() to
  t.fail()

Conformance binary -- level5.rs:
- poll_sweep() adds previous_sweep_id: Option<&str> parameter.
  Compares current last_sweep against previous -- returns true only
  when they differ (new sweep completed). Without this parameter,
  poll_sweep could return immediately if a prior sweep's ID was
  still in gc/status
- Add get_current_sweep_id() extracting last_sweep from gc/status
  response JSON
- L5-05: capture pre_sweep_id = get_current_sweep_id() before
  triggering sweep
- L5-06: poll_sweep(client, ns, 60, pre_sweep_id.as_deref())
- L5-11: capture pre_sweep2_id before second sweep trigger
- L5-12: poll_sweep with pre_sweep2_id, adds gc/status trace and
  eprintln diagnostic
- All match arms change from Ok((resp, trace)) to Ok(r)
- L5-01: client.post_with_content_type(.., "application/json"),
  r.header("x-kappa-label")
- L5-03: client.put_with_content_type(.., "application/json")
- L5-04: r.body_text(), client.send_traced(del_rb) with
  dr.trace.clone()
- L5-09: client.post_with_content_type(.., "application/json")
- L5-13: unpinned blob not evicted changed from t.warn() to
  t.fail() with response body
- L5-14: unreachable blob not evicted changed from t.warn() to
  t.fail() with response body
- L5-15: client.post_with_content_type(), r.header("x-kappa-label")
- L5-16: client.post_with_content_type(), verify_error_response on
  r.body directly
- L5-17: r.body_text() with body in failure message
- L5-18: client.post_with_content_type()
- L5-19: client.post_with_content_type()
- L5-20: capture pre_sweep3_id, poll_sweep with it. Eviction changed
  from t.warn() to t.fail() with response body
- L5-30: client.put_with_content_type(), r.header("x-kappa-label").
  Filter format not supported (422) changed from t.warn() to
  t.fail()
- L5-31: r.body_text() with body in failure message
- L5-32: client.put_with_content_type(). Failure message includes
  r.body_text()
- L5-33: client.put_with_content_type(). l5_33_body = r.body.clone().
  Failure message includes r.body_text()
- L5-38: client.put_with_content_type(). Failure message includes
  r.body_text()
- L5-52: federation not resolved changed from t.warn() to t.fail()
- L5-55: cached not faster changed from t.warn() to t.fail()
- L5-60/L5-61/L5-62: active rate limiting tests replacing skips.
  500-iteration burst loop issuing GET /blobs/{hello.sha256},
  capturing status codes in Vec<u16>, breaking on first 429.
  HashMap status counting with eprintln diagnostic. L5-60 checks
  429 received and Retry-After header present. L5-61 validates
  Retry-After as u64 integer or HTTP-date (contains comma). L5-62
  passes if 429 observed, warns if not
Cargo.toml:
- reqwest: set default-features = false, add rustls-tls feature,
  remove implicit native-tls dependency. native-tls pulls openssl-sys
  which fails on musl cross-compile (CI builds with --target
  x86_64-unknown-linux-musl and the GitHub Actions runner has no
  musl-compatible OpenSSL headers)

src/tests/level5.rs:
- Remove L5-12 eprintln sweep status dump and gc/status trace
  capture added during sweep polling debugging
- Remove L5-60 eprintln burst status counting (HashMap of status
  code frequencies) added during rate limiting instrumentation
- Remove unused mut on L5-12 TestContext (no longer calls trace()
  after removing the gc/status diagnostic)

Cargo.lock:
- Drop openssl, openssl-sys, openssl-probe, openssl-macros,
  native-tls, tokio-native-tls, hyper-tls, schannel,
  security-framework, security-framework-sys, core-foundation,
  foreign-types, foreign-types-shared, vcpkg, pkg-config
- Add rustls 0.23, rustls-webpki 0.103, rustls-pki-types 1.15,
  ring 0.17, webpki-roots 1.0, tokio-rustls 0.26, hyper-rustls
  0.27, quinn 0.11, quinn-proto 0.11, quinn-udp 0.5
assertions.rs:
- Add assert_docker_content_digest() verifying Docker-Content-Digest
  header value matches expected digest string
- Add assert_location_present() verifying Location header exists and
  is non-empty
- Replace unicode kappa symbol in assert_kappa_valid error message
  with ASCII "kappa-label"

src/tests/level1.rs:
- L1-02: verify Location header present on 201 blob PUT response
- L1-05: verify Docker-Content-Digest header value matches expected
  digest on HEAD blob response
- L1-06: verify Docker-Content-Digest header value matches expected
  digest on GET blob response
- L1-22: accept either X-Kappa-Chunk-Min-Length or OCI-Chunk-Min-Length
  header name on upload POST response
- L1-55: new test verifying upload complete accepts ?digest= query
  parameter as alias for ?kappa=, performs POST + PATCH + PUT with
  digest= on the close URL
- L1-56: new test verifying single-POST blob push with ?digest= query
  parameter on /v2/{ns}/blobs/uploads/?digest={digest}, falls back to
  PUT if registry returns 202

src/tests/level2.rs:
- L2-01: verify Location header and Docker-Content-Digest header on
  manifest PUT 201 response
- L2-03: verify Docker-Content-Digest header value on manifest GET
  response
- L2-11: tag name extraction accepts both flat string array entries
  (OCI format) and objects with name field (kappa format)
- L2-65: new test verifying tag list response body contains top-level
  name field with repository name
- L2-66: new test verifying manifest delete by digest, pushes content
  with a tag then issues DELETE /v2/{ns}/manifests/{digest}, verifies
  subsequent GET returns 404
- Update module doc comment range to L2-66
ring v0.17.14 build script requires x86_64-linux-musl-gcc for
assembling cryptographic routines when targeting
x86_64-unknown-linux-musl. The GitHub Actions ubuntu-latest runner
does not include musl-tools by default.

Add apt-get install musl-tools step before the Rust toolchain
installation.
@usrbinkat

usrbinkat commented Jul 23, 2026 •

Copy link
Copy Markdown
Member Author

Click To Expand Results:

OCI Conformance Result
Configuration:
  registry: 127.0.0.1:9878
  tls: disabled
  repo1: conformance/repo1
  repo2: conformance/repo2
  username: ""
  password: ""
  cacheAuth: true
  logging: warn
  apis:
    ping: true
    pull: true
    push: true
    blobs:
      atomic: true
      delete: true
      digestHeader: false
      mountAnonymous: true
      uploadCancel: false
    manifests:
      atomic: true
      delete: true
      digestHeader: false
      tagParam: false
    tags:
      atomic: true
      delete: true
      list: true
    referrer: true
  data:
    image: true
    index: true
    indexList: true
    sparse: false
    artifact: true
    subject: true
    subjectMissing: true
    artifactList: true
    subjectList: true
    dataField: true
    nondistributable: true
    customFields: true
    noLayers: true
    emptyBlob: true
    sha512: true
  roData:
    tags: []
    manifests: []
    blobs: []
    referrers: []
  resultsDir: /workspace/usrbinkat/github.com/UOR-Foundation/kappa-registry/tmp/oci-conformance-report
  version: "1.1"
  commit: 967efdc079b91785ad18c77cc4f8991a47feefbf

OCI Conformance Result: Pass
  Disabled......................:          2
  Skip..........................:         12
  Pass..........................:        848
  FAIL..........................:          0
  Error.........................:          0
  Total.........................:        862

API conformance:
  Tag listing...................:       Pass
  Tag delete....................:       Pass
  Tag delete atomic.............:       Pass
  Blob upload cancel............:   Disabled
  Blob push.....................:       Pass
  Blob post only................:       Pass
  Blob post put.................:       Pass
  Blob chunked..................:       Pass
  Blob streaming................:       Pass
  Blob mount....................:       Pass
  Blob anonymous mount..........:       Pass
  Blob get......................:       Pass
  Blob get range................:       Skip
  Blob head.....................:       Pass
  Blob delete...................:       Pass
  Blob delete atomic............:       Pass
  Manifest put by digest........:       Pass
  Manifest put by tag...........:       Pass
  Manifest put with tag params..:   Disabled
  Manifest put with subject.....:       Pass
  Manifest get by digest........:       Pass
  Manifest get by tag...........:       Pass
  Manifest head by digest.......:       Pass
  Manifest head by tag..........:       Pass
  Manifest delete...............:       Pass
  Manifest delete atomic........:       Pass
  Referrers.....................:       Pass
  Ping..........................:       Pass

Data conformance:
  Artifact......................:       Pass
  Artifact Index................:       Pass
  Artifact without Layers.......:       Pass
  Artifacts with Subject........:       Pass
  Bad Digest Image..............:       Pass
  Blobs sha256..................:       Pass
  Blobs sha512..................:       Pass
  Custom Fields.................:       Pass
  Data Field....................:       Pass
  Empty Index...................:       Pass
  Image.........................:       Pass
  Image Uncompressed............:       Pass
  Index.........................:       Pass
  Index with Subject............:       Pass
  Invalid Manifest Digest.......:       Pass
  Image with Large Manifest.....:       Pass
  Missing Subject...............:       Pass
  Nested Index..................:       Pass
  No Layers.....................:       Pass
  Non-distributable Layers......:       Pass
  Digest Algorithm sha512.......:       Pass
  Sparse Manifests..............:   Disabled
  Tag Param.....................:   Disabled
  Tag Param sha512..............:   Disabled


OCI conformance: PASS
reports: /workspace/usrbinkat/github.com/UOR-Foundation/kappa-registry/tmp/oci-conformance-report
store:   /tmp/nix-shell.uoF5rM/tmp.os0oJYfGGH

usrbinkat@mithril kappa-registry usrbinkat/feat/draft-kap…
❯
Kappa Registry Conformance Result
usrbinkat@mithril kappa-registry usrbinkat/feat/draft-kap…
❯ ./scripts/conformance.sh
starting registry on 127.0.0.1:9877 with store at /tmp/nix-shell.uoF5rM/tmp.cS0Z2u1BnR
2026-07-23T04:53:34.457371Z  INFO kappa_registry: kappa-registry listening on 127.0.0.1:9877
2026-07-23T04:53:34.457386Z  INFO kappa_registry: rate limiting enabled: 2 rps, burst 450
registry running (pid 1135807)
running conformance suite...

[PASS]  L1-01  Version check
[PASS]  L1-02  Push blob monolithic
[PASS]  L1-03  Push blob idempotent re-put
[PASS]  L1-04  Push blob wrong kappa-label rejected
[PASS]  L1-05  HEAD blob headers present and correct
[PASS]  L1-06  GET blob content correct
[PASS]  L1-07  Content matches known bytes (full verify-on-receipt chain)
[PASS]  L1-08  GET absent blob returns 404
[PASS]  L1-09  HEAD absent blob returns 404
[PASS]  L1-10  Push empty blob
[PASS]  L1-11  GET empty blob
[PASS]  L1-12  Push blob with unknown fields
[PASS]  L1-13  GET blob preserves unknown fields
[PASS]  L1-14  Push config and layer blobs
[PASS]  L1-15  List blobs by prefix
[PASS]  L1-16  Content-Type round-trip (GET and HEAD)
[PASS]  L1-17  Content-Type default octet-stream
[PASS]  L1-20  Chunked upload start
[PASS]  L1-21  Upload location is opaque
[PASS]  L1-22  Chunk-Min-Length observed
[PASS]  L1-23  Chunked upload chunk 1
[PASS]  L1-24  Chunked upload chunk 2
[PASS]  L1-25  Duplicate chunk returns 416
[PASS]  L1-26  Upload recovery endpoint
[PASS]  L1-27  Out-of-order chunk returns 416
[PASS]  L1-28  Recovery after 416
[PASS]  L1-29  Remaining chunks in order
[PASS]  L1-30  Upload complete with kappa-label
[PASS]  L1-31  Completed blob retrievable
[PASS]  L1-55  Upload complete accepts digest query parameter
[PASS]  L1-32  Wrong kappa-label on complete rejected
[PASS]  L1-33  Upload cancellation
[PASS]  L1-34  Cancelled session returns 404
[PASS]  L1-35  Cancelled partial data not stored
[PASS]  L1-40  Mount existing blob
[PASS]  L1-41  Mounted blob retrievable
[PASS]  L1-42  Mount non-existent falls back
[PASS]  L1-43  Fallback produces upload URL
[PASS]  L1-44  Mount without from parameter
[PASS]  L1-50  Multi-label push
[PASS]  L1-51  Multi-label both resolvable
[PASS]  L1-52  Multi-label fallback
[PASS]  L1-53  Multi-label invalid kappa-label rejected
[PASS]  L1-56  Single-POST blob push with digest parameter
[SKIP]  L1-60  Redirect followed - no redirects observed
[PASS]  L1-61  Auth not forwarded cross-host
[PASS]  L1-62  Redirect final response correct
[PASS]  L1-90  Blob deletion
[PASS]  L1-91  Teardown cleanup
[PASS]  L2-01  Bind tag
[PASS]  L2-02  Tag bind returns correct X-Kappa-Label
[PASS]  L2-03  Resolve tag (body + header + re-hash)
[PASS]  L2-04  Bind second tag to same content
[PASS]  L2-05  Both tags resolve same kappa-label
[PASS]  L2-06  Update tag to different content
[PASS]  L2-07  Updated tag resolves new kappa-label
[PASS]  L2-08  Old tag retains original kappa-label
[PASS]  L2-09  Content-before-tag (direct tag_set rejects absent kappa)
[PASS]  L2-10  Absent tag returns 404
[PASS]  L2-11  Tag list present and ASCIIbetically ordered
[PASS]  L2-12  Tag list pagination n=1
[PASS]  L2-13  Tag list n=0 empty no Link
[PASS]  L2-14  Tag list pagination cursor
[PASS]  L2-15  Cursor is tag name not index
[PASS]  L2-16  Resolve by kappa-label directly (header + body + re-hash)
[PASS]  L2-17  Direct tag resolution (pointer only, no content)
[PASS]  L2-18  Absent tag resolution returns 404
[PASS]  L2-20  Timestamp tag bind
[PASS]  L2-21  Timestamp tag second
[PASS]  L2-22  Timestamp range filter
[PASS]  L2-23  Tag list descending
[PASS]  L2-24  Tag list ascending
[PASS]  L2-30  Compare-and-swap success (direct tag_set)
[PASS]  L2-31  Compare-and-swap conflict (direct tag_set)
[PASS]  L2-32  CAS on non-existent tag (direct tag_set)
[PASS]  L2-33  CAS value after success
[PASS]  L2-34  CAS value after failure (verify unchanged)
[PASS]  L2-40  Multi-tag bind
[PASS]  L2-41  Multi-tag both resolve
[PASS]  L2-42  Multi-tag fallback
[PASS]  L2-50  Warning header format
[PASS]  L2-51  Warning data <= 4096 bytes
[PASS]  L2-52  Warning reported
[PASS]  L2-60  Tag deletion
[PASS]  L2-61  Deletion rejection uses UNSUPPORTED
[PASS]  L2-62  Deleted tag returns 404
[PASS]  L2-63  Content survives tag deletion
[PASS]  L2-65  Tag list response includes repository name
[PASS]  L2-66  Manifest delete by digest
[PASS]  L2-70  OCI-Subject header returned when subject present
[PASS]  L2-71  Referrers API returns OCI Image Index
[PASS]  L2-72  Referrers API filters by artifactType
[PASS]  L2-73  Referrers API on absent subject returns empty list
[PASS]  L2-64  Teardown tag cleanup
[PASS]  L3-01  Create edge
[PASS]  L3-02  Edge kappa-label in response matches expected
[PASS]  L3-03  Edge retrievable as blob
[PASS]  L3-04  Edge canonical form correct
[PASS]  L3-05  Edge query outbound
[PASS]  L3-06  Edge query inbound
[PASS]  L3-07  Edge query relation filter
[PASS]  L3-08  Edge query both directions
[PASS]  L3-09  Edge creation idempotent
[PASS]  L3-10  Edge absent source rejected with EDGE_SOURCE_ABSENT
[PASS]  L3-11  Edge absent target accepted
[PASS]  L3-12  Edge kappa-label axis matches source
[PASS]  L3-13  Referrer edge created
[PASS]  L3-14  Referrer edge queryable
[PASS]  L3-15  Edge to absent subject accepted
[PASS]  L3-16  Edge queryable for absent subject
[PASS]  L3-17  Edge pagination
[PASS]  L3-20  Edge deletion
[PASS]  L3-21  Deleted edge absent from queries
[PASS]  L3-22  Edge delete does not delete blobs (source + target)
[PASS]  L4-01  G2 composition
[PASS]  L4-02  Composition response fields
[PASS]  L4-03  G2 commutativity
[PASS]  L4-04  Composed blob retrievable
[PASS]  L4-05  Composed-of edges created
[PASS]  L4-06  Edge metadata includes operation type
[PASS]  L4-07  Witness retrievable
[PASS]  L4-08  Witness self-describing header and payload re-hash
[PASS]  L4-09  Witness-of edge exists
[PASS]  L4-10  Cross-axis composition rejected
[PASS]  L4-11  Axis mismatch error code
[PASS]  L4-20  F4 composition
[PASS]  L4-21  F4 mirror collapse
[PASS]  L4-22  E6 composition
[PASS]  L4-23  E6 tag byte correct
[PASS]  L4-24  E7 composition
[PASS]  L4-25  E8 composition
[PASS]  L4-26  E8 differs from operand
[PASS]  L4-27  F4/E7/E8 coincidence documented
[PASS]  L4-28  Coincidence edge metadata disambiguates
[PASS]  L4-40  Schema registration
[PASS]  L4-41  Schema retrieval (body + header)
[PASS]  L4-42  Schema listing
[PASS]  L4-43  Valid content accepted under schema
[PASS]  L4-44  Invalid content rejected under schema
[PASS]  L4-45  Rejected content not stored
[PASS]  L4-46  Schema does not alter kappa-label
[PASS]  L4-47  Schema evolution with edge
[PASS]  L4-48  Schema evolution edge verified
[PASS]  L5-01  Pin creation
[PASS]  L5-02  Pin response kappa-label
[PASS]  L5-03  Ownership edge for reachability
[PASS]  L5-04  Remove tag from owned blob
[PASS]  L5-05  GC sweep trigger
[PASS]  L5-06  GC status endpoint
[PASS]  L5-07  Pinned blob survives sweep
[PASS]  L5-08  Reachable blob survives sweep
[PASS]  L5-09  Unpin
[PASS]  L5-10  Unpin creates derived pin blob
[PASS]  L5-11  Sweep after unpin
[PASS]  L5-12  Sweep completion polling
[PASS]  L5-13  Unpinned blob evicted
[PASS]  L5-14  Unreachable blob evicted
[PASS]  L5-15  Finalizer pin creation
[PASS]  L5-16  Unpin blocked by finalizer
[PASS]  L5-17  Finalizer in GC status
[PASS]  L5-18  Finalizer release
[PASS]  L5-19  Unpin after release
[PASS]  L5-20  Finalized blob evicted after release
[PASS]  L5-30  Filter registration
[PASS]  L5-31  Filter listing
[PASS]  L5-32  Filter-accepted content stored
[PASS]  L5-33  Filter-rejected content rejected
[PASS]  L5-34  Rejection includes reason
[PASS]  L5-35  Rejected content not stored
[PASS]  L5-36  Filter removal
[PASS]  L5-37  Removed filter blob persists
[PASS]  L5-38  Previously rejected content accepted
[SKIP]  L5-50  Federation fetch - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-51  Federation absent locally - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-52  Federation resolves from peer - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-53  Federation content verified - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-54  Federation caches locally - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-55  Cached fetch faster - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-56  Multi-peer federation - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-57  Multi-hop federation - KAPPA_FEDERATION_PEERS unset
[SKIP]  L5-58  Multi-hop content verified - KAPPA_FEDERATION_PEERS unset
[PASS]  L5-60  Rate limit Retry-After present
[PASS]  L5-61  Retry-After format valid
[PASS]  L5-62  Rate limit behavior recorded

174 pass, 0 fail, 0 warn, 10 skip

conformance: PASS
reports: /workspace/usrbinkat/github.com/UOR-Foundation/kappa-registry/tmp/conformance-report
store:   /tmp/nix-shell.uoF5rM/tmp.cS0Z2u1BnR

usrbinkat@mithril kappa-registry usrbinkat/feat/draft-kap… 4s
❯
usrbinkat@mithril github.com/UOR-Foundation
❯ tree /tmp/tmp.VEhmzj9bel/
 /tmp/tmp.VEhmzj9bel
├──  blobs
│   ├──  blake3
│   │   └──  ea
│   └──  sha256
│       ├──  0a
│       ├──  0e
│       ├──  0f
│       ├──  07
│       ├──  1c
│       ├──  2c
│       ├──  5c
│       │   ├── 󰡯 sha256:5cf418f1e8e07050ed1e42344ecd70c25b1f64335f6e59f2094f5f265f917ffd
│       │   └──  sha256:5cf418f1e8e07050ed1e42344ecd70c25b1f64335f6e59f2094f5f265f917ffd.meta
│       ├──  6a
│       ├──  6c
│       │   ├── 󰡯 sha256:6c8389c3d11e5a08833bb1b9e87232ffa98c0ad13cbfd5a6822aa4f93d59d1ce
│       │   └──  sha256:6c8389c3d11e5a08833bb1b9e87232ffa98c0ad13cbfd5a6822aa4f93d59d1ce.meta
│       ├──  6f
│       │   ├── 󰡯 sha256:6f2ea60c05bdd654077a969bcabcaee333d1fbb6cd0a725c94de35eb4b87d6be
│       │   └──  sha256:6f2ea60c05bdd654077a969bcabcaee333d1fbb6cd0a725c94de35eb4b87d6be.meta
│       ├──  8a
│       ├──  9c
│       │   └── 󰡯 sha256:9cca419a2f2b8e6038a47f5acbef46ee24b92e872426d703dc095addb49820c8
│       ├──  9f
│       ├──  18
│       ├──  33
│       ├──  40
│       ├──  50
│       ├──  53
│       ├──  55
│       ├──  67
│       ├──  70
│       ├──  71
│       ├──  72
│       ├──  77
│       ├──  85
│       ├──  88
│       ├──  93
│       ├──  97
│       ├──  99
│       ├──  a4
│       │   ├── 󰡯 sha256:a4d9a45cf141eb2987d6ada2b78a418cd4bf21eecd8b38a4397da8766e51b78d
│       │   └──  sha256:a4d9a45cf141eb2987d6ada2b78a418cd4bf21eecd8b38a4397da8766e51b78d.meta
│       ├──  a6
│       ├──  ab
│       ├──  ac
│       ├──  ae
│       ├──  bc
│       ├──  c1
│       ├──  c9
│       ├──  cd
│       ├──  d9
│       ├──  dd
│       ├──  e3
│       ├──  f1
│       ├──  f4
│       ├──  f7
│       └──  ff
├──  filters
│   └──  _conformance_test_v1__conformance_l5
├──  gc
│   ├──  pins
│   ├──  status-0a9f20e2-d484-4b68-aa1f-c867fe7dee90.json
│   ├──  status-5ae13e23-65b0-459b-b844-c579e9d396ca.json
│   ├──  status-269b0f9a-a05e-4fe7-941d-c9b9d6735f83.json
│   └──  status.json
├──  index
│   └──  edges
│       ├──  by-kappa
│       ├──  by-source
│       └──  by-target
├──  schemas
│   └──  _conformance_test_v1__conformance_l4
│       └──  test-scope.json
└──  tags
    ├──  _conformance_test_v1__conformance_l2
    │   └──  index.json
    ├──  _conformance_test_v1__conformance_l4
    │   └──  index.json
    └──  _conformance_test_v1__conformance_l5
        └──  index.json

… subject tests

src/tests/level1.rs:
- L1-04: expect 400 instead of 409 for wrong kappa-label on blob PUT
- L1-32: expect 400 instead of 409 for wrong kappa-label on upload
  complete
- L1-53: expect 400 instead of 409 for multi-label invalid kappa-label

src/tests/level2.rs:
- L2-70: new test verifying OCI-Subject header returned when manifest
  body contains subject field with digest, pushes base manifest then
  referrer manifest with subject descriptor
- L2-71: new test verifying referrers API returns OCI Image Index with
  schemaVersion 2, correct mediaType, and manifests array
- L2-72: new test verifying referrers API with artifactType query
  parameter returns OCI-Filters-Applied header containing artifactType
- L2-73: new test verifying referrers API on absent subject digest
  returns 200 with empty manifests array
- Add subject-base and referrer-test to L2-64 teardown tag list
- Update module doc comment range to L2-73
Cargo.toml:
- Add sha1-checked 0.10 dependency with default-features=false
  for independent SHA-1 computation with RUSTSEC-2025-0021
  collision detection

Cargo.lock:
- Add sha1 0.10.7 (cfg-if, cpufeatures, digest)
- Add sha1-checked 0.10.0 (digest, sha1)

src/kappa.rs:
- Import sha1_checked::Sha1 as Sha1Checked
- Add LabelError::CollisionDetected variant for SHA-1 collision
  detection failures
- Display impl for CollisionDetected: "SHA-1 collision detected,
  content rejected"
- Display impl for BadLength: update range string from 71..=135
  to 45..=135
- KappaLabel::parse(): lower bound from 71 to 45 bytes to accept
  sha1:40hex (5+1+40-1 = 45 byte minimum)
- KappaLabel::parse(): add "sha1" => 40 to expected_hex match arm
- KappaLabel::sha1(content) -> Result<Self, LabelError>: compute
  via Sha1Checked::try_digest, check has_collision(), encode 20
  hash bytes as hex into buf[5..45], set len=45, prefix "sha1:"
- Update module doc comment: six recognized axes (sha1, sha256,
  blake3, sha3-256, keccak256, sha512), note sha1 independently
  computed alongside sha256 and blake3
- Replace unicode kappa references with ASCII "kappa-label" in
  doc comments
- Add test constants EMPTY_SHA1 (da39a3ee...) and HELLO_SHA1
  (aaf4c61d...)
- Add tests: sha1_empty, sha1_hello, sha1_label_length (45),
  parse_roundtrip_sha1, parse_sha1_wrong_digits (41 hex -> err),
  complement_sha1_roundtrip
- Rename test reject_short_unknown_axis_is_bad_length to
  reject_short_unknown_axis_is_unknown_axis: "md5:" + 64 hex =
  68 bytes now within 45..=135 range, so axis check fires
  (UnknownAxis) instead of length check
- Add test reject_very_short_is_bad_length: "md5:" + 10 hex =
  14 bytes, below 45-byte minimum

src/assertions.rs:
- assert_kappa_matches(): add "sha1" match arm dispatching to
  KappaLabel::sha1(body) with error mapping for collision
  detection failure

src/testdata.rs:
- TestBlob struct: add sha1: KappaLabel field
- TestData struct: add sha1_upload: TestBlob (content
  b"sha1-upload-complete-test-content") and sha1_multi: TestBlob
  (content b"sha1-multi-label-test-content") for L1-71/L1-72
- make_blob(): compute sha1 via KappaLabel::sha1(content).expect
  for each test blob
- generate(): allocate sha1_upload_bytes and sha1_multi_bytes via
  Box::leak, construct blobs via make_blob()
- Replace unicode kappa in cancel_partial doc comment with ASCII

src/tests/level1.rs:
- L1-70 SHOULD: SHA-1 blob push and retrieve. PUT blob at
  /v2/{ns}/blobs/{sha1}, expect 201/200, GET same path, verify
  body equality via assert_body_eq
- L1-71 SHOULD: SHA-1 chunked upload complete. POST upload start,
  PATCH content with Content-Range header, PUT close URL with
  ?kappa={sha1}, expect 201
- L1-72 SHOULD: SHA-256 primary with SHA-1 also label. PUT blob
  at /v2/{ns}/blobs/{sha256}?also={sha1}, expect 201/200, GET
  via sha1 address, verify body equality via assert_body_eq
src/client.rs:
- Add get_meta_list(path, key, value) -> RequestBuilder: GET
  /v2/{path}/blobs/_meta?key={key}&value={value} with
  headers_no_body(), for querying blobs by metadata key-value pair

src/tests/level2.rs:
- Update module doc comment range to L2-80
- L2-80 SHOULD: manifest sets object-type=manifest metadata. Query
  /v2/{ns}/blobs/_meta?key=object-type&value=manifest via
  get_meta_list(), expect 200, verify response body contains
  "sha256:" indicating at least one manifest-typed blob returned

src/tests/level3.rs:
- Update module doc comment range to L3-30
- L3-30 SHOULD: edge sets object-type=edge metadata. Query
  /v2/{ns}/blobs/_meta?key=object-type&value=edge via
  get_meta_list(), expect 200, verify response body contains
  "sha256:" indicating at least one edge-typed blob returned

src/tests/level4.rs:
- Update module doc comment range to L4-52
- L4-50 SHOULD: composition sets object-type=composition metadata.
  Query /v2/{ns}/blobs/_meta?key=object-type&value=composition,
  expect 200, verify body contains "sha256:"
- L4-51 SHOULD: witness sets object-type=witness metadata. Query
  /v2/{ns}/blobs/_meta?key=object-type&value=witness, expect 200,
  verify body contains "sha256:"
- L4-52 SHOULD: schema registration sets object-type=schema
  metadata. Query /v2/{ns}/blobs/_meta?key=object-type&value=schema,
  expect 200, verify body contains "sha256:"

src/tests/level5.rs:
- Update module doc comment range to L5-71
- Rate limiting burst test rewritten to adaptive discovery:
  - Probe GET /v2/{ns}/blobs/{hello.sha256} extracts
    x-ratelimit-limit header to discover burst capacity
  - If x-ratelimit-limit absent, burst_limit=0, tests warn with
    "rate limiting not configured" instead of blind 500-request loop
  - If present, send burst_limit requests (capped at 2000) to
    exhaust tokens, break on first 429
  - L5-60: warn if burst_limit==0 (not configured), pass if 429
    with Retry-After, fail if 429 without Retry-After
  - L5-62: warn with burst_limit value in message when not triggered
- Burst test cleanup: after 429 received, compute wait from
  Retry-After value * 10 tokens needed, cap at 10 seconds via
  std::thread::sleep(Duration::from_secs(needed_wait)), ensures
  subsequent tests have rate limit tokens available
- L5-70 SHOULD: filter registration sets object-type=filter
  metadata. Query /v2/{ns}/blobs/_meta?key=object-type&value=filter,
  expect 200, verify body contains "sha256:"
- L5-71 SHOULD: pin creation sets object-type=pin metadata. Push
  blob b"pin-metadata-test-blob" via PUT, create pin via POST
  /v2/{ns}/gc/pin with JSON body {"kappa":"{kappa}","ttl":0},
  expect 201, then query
  /v2/{ns}/blobs/_meta?key=object-type&value=pin, expect 200,
  verify body contains "sha256:"
src/client.rs:
- Add bundle_create(path) -> RequestBuilder: POST
  /v2/{path}/_bundle/create with headers_with_body
  ("application/json") for requesting KBND-format bundle export
- Add bundle_ingest(path) -> RequestBuilder: POST
  /v2/{path}/_bundle/ingest with headers_with_body
  ("application/x-kappa-bundle") for importing bundle bytes

src/tests/level1.rs:
- Update module doc comment range to include L1-80 through L1-82
- L1-80 SHOULD: bundle create returns KBND format. POST
  /v2/{ns}/_bundle/create with JSON body
  {"kappas":["{hello.sha256}","{config.sha256}"],"delta":false},
  expect 200, verify content-type contains "kappa-bundle", verify
  body length >= 10 bytes, verify first 4 bytes == b"KBND" magic
- L1-81 SHOULD: bundle create and ingest round-trip. POST
  /v2/{ns}/_bundle/create with hello+config kappas, expect 200,
  POST bundle bytes to /v2/{ns}-bundle-ingest/_bundle/ingest with
  content-type application/x-kappa-bundle, expect 200, parse
  response JSON for ingested array with >= 2 entries, GET
  /v2/{ns}-bundle-ingest/blobs/{hello.sha256} to verify ingested
  blob retrievable with byte-for-byte equality via assert_body_eq
- L1-82 SHOULD: bundle ingest rejects corrupted bundle. POST
  /v2/{ns}/_bundle/create with hello kappa, expect 200, XOR last
  byte of bundle with 0xFF, POST corrupted bytes to
  /v2/{ns}/_bundle/ingest, expect 409 or 400 rejection status
@afflom

afflom commented Jul 24, 2026

Copy link
Copy Markdown
Member

@usrbinkat is this ready?

@usrbinkat

Copy link
Copy Markdown
Member Author

@afflom I recommend this is held back long term until we have an operational and conformant exhibit of this draft. Alternatively, we need semantic releases or other tooling to release pre-v1 alphas as draft distribution spec for formal promotion pathway to v1.

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