bankai/ast_bridge
The gleamunison binding bridge for Task content-addressing (pillar 1).
task_hash = SHA-256 over the canonical byte encoding. No gleamunison
evaluation happens here (that’s pillar 2, src/bankai/rules). This is the
cheap, frequent path that meets the sub-5ms NFR.
Values
pub fn content_hash_valid(task: types.Task) -> Bool
Verify a stored Task: its content_hash must equal the hash of its fields. Tamper detection: any field edit without rehash makes this false.
pub fn empty_hash() -> identity.Hash
Empty/placeholder hash — used to seed a draft Task before rehash.
pub fn rehash(task: types.Task) -> types.Task
Set a Task’s content_hash to the hash of its current content fields. Idempotent: rehash(rehash(t)).content_hash == rehash(t).content_hash.
pub fn task_hash(task: types.Task) -> identity.Hash
Content-address a Task: SHA-256 over its canonical byte encoding.
pub fn task_short_id(task: types.Task) -> String
Short human-readable id in beads style: “bk-” + first 4 hex chars.
pub fn validate(task: types.Task) -> Result(types.Task, String)
Verify a stored Task at an authority boundary. A task’s claimed identity must be the hash of its canonical content; callers must reject mismatches rather than silently assigning a new identity to untrusted data.