Skip to content

feat(hash): add the kernel-owned BLAKE3 content facade #8

Closed

Description

@zackees

Context

kernal-api pins blake3 = =1.8.7, but uses it only internally for platform/broker endpoint naming. It has no public kernel-owned hashing capability, so a first-party client would need to name blake3 directly for content or file hashing.

Issue #5 identifies BLAKE3 as an early zccache migration need. This capability can be delivered independently of the running-process adapter and without speculative data traits.

Proposal

  • Add a concrete kernal_api BLAKE3 content hashing façade with kernel-owned digest/result types.
  • Cover bytes and the file/stream operation shape actually needed by the Phase-0 inventory, including cancellation/size bounds only where a public async operation is introduced.
  • Keep the API concrete; do not add a generic digest/provider trait or a separate kernal-api-data crate.
  • Extend the owned-backend boundary lint only once first-party clients are ready to consume this façade.

Acceptance criteria

  • RED: a focused consumer-style fixture demonstrates that no kernel-owned content/file BLAKE3 operation exists without naming the implementation crate.
  • GREEN: published known-answer vectors and equivalent byte/file fixtures return the canonical BLAKE3 digest through kernal_api-owned types.
  • GREEN: public API/source policy proves no blake3 implementation type is re-exported or required by callers.
  • GREEN: file/stream errors and any configured size/cancellation bounds are deterministic and covered by focused tests.
  • If the direct-blake3 ban is enabled, Dylint fixtures prove normal, aliased, target, build, and test dependencies are rejected; otherwise the issue records why activation waits for client migration.
  • No process, broker, HTTP, database, or zccache call-site migration is included.

Decisions

  • Priority is P1 because this removes a direct implementation dependency from the first migration slice with a small, testable surface.
  • BLAKE3 remains a direct exact dependency of kernal-api; the façade is an ownership boundary, not an attempt to reimplement the algorithm.
  • File hashing is included only as a concrete kernel operation, not as a generic storage/data abstraction.

Related issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions