research-agency-hash-compat

Research: agency hash-input compatibility — federation primitive

Metadata

Statusdone
Assignedagent-2371
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelclaude:opus
Created2026-05-04T17:37:36.240373654+00:00
Started2026-05-04T18:37:32.929910484+00:00
Completed2026-05-04T18:41:56.000888949+00:00
Tagsagency,sync,research,federation, eval-scheduled
Eval score0.92
└ blocking impact0.95
└ completeness0.95
└ coordination overhead0.94
└ correctness0.94
└ downstream usability0.96
└ efficiency0.88
└ intent fidelity0.90
└ style adherence0.92

Description

Description

Workgraph and agentbureau/agency both use SHA-256 content-hash IDs for primitives, but they hash DIFFERENT inputs. This is the load-bearing federation primitive: if hashes diverge, the same primitive imported into both systems gets different IDs and federation breaks.

Concrete delta (cited)

Workgraph hash inputs (src/agency/hash.rs):

  • component (hash.rs:16-35): description + category + content — wider than agency
  • outcome (hash.rs:39-52): description + success_criteria — wider than agency
  • tradeoff (hash.rs:56-75): acceptable_tradeoffs + unacceptable_tradeoffs + description — wider than agency
  • role (hash.rs:79-94): sorted component_ids + outcome_id (composition hash) — agency analog: agent_hash
  • agent (hash.rs:98-112): role_id + tradeoff_id (composition hash, with motivation_id rename alias)

Agency v1.2.4 hash inputs (per spec): SHA-256 of description field only. Identity field is description.

What needs to be decided

  • Does wg adopt description-only canonical hashing? Pros: federation hash equality. Cons: two primitives with same description but different category/content/success_criteria collide.
  • Or does wg keep wider hashing and add an agency_compat_hash sidecar for federation? Pros: no breaking change. Cons: two ID spaces, mapping table needed.
  • Or does wg add description_hash as a federation-only equivalence key while keeping the wider id for local identity?
  • Composition hashes (role, agent): Agency uses agent_hash as composition identifier. Verify that wg's role/agent hash inputs match agency's composition hash inputs.

Deliverable

wg log entry with:

  • Per-primitive hash-input table: wg vs agency, what overlaps, what differs
  • Three-way recommendation (subset / sidecar / dual-hash) with the trade-offs scored on: federation correctness, local identity stability, migration cost
  • A 5-line pseudocode sketch of the chosen approach
  • Acknowledge breakage: every existing .wg/agency/primitives/*.yaml filename is the OLD hash; if hash inputs change, all files must be re-hashed and renamed.

Validation

  • All five hash functions in src/agency/hash.rs cited with line ranges
  • Description-only hashing tradeoffs analyzed (collision risk for outcomes / tradeoffs that share description but differ on success_criteria / acceptable lists)
  • Migration plan sketched (re-hash all files, update primitives/{components,outcomes,tradeoffs}/{hash}.yaml filenames, regenerate cache/{roles,agents}/{hash}.yaml)
  • Recommendation justified against the user's "deep alignment" framing (exact federation match vs strict superset)

Depends on

Required by

Log