impl-agency-hash-compat

Impl: align primitive hash inputs with agency federation

Metadata

Statusdone
Assignedagent-2389
Agent identity3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3
Modelcodex:gpt-5.5
Created2026-05-04T17:40:27.666508261+00:00
Started2026-05-04T18:45:49.505326541+00:00
Completed2026-05-04T19:18:43.241950973+00:00
Tagsagency,sync,impl,federation, eval-scheduled
Tokens670105 in / 3948 out
Eval score0.90
└ blocking impact0.90
└ completeness0.90
└ constraint fidelity0.85
└ coordination overhead0.86
└ correctness0.93
└ downstream usability0.91
└ efficiency0.84
└ intent fidelity0.83
└ style adherence0.90

Description

Description

Implement the hash-input alignment chosen by research-agency-hash-compat. The likely choice is description-only canonical hashing (or a sidecar agency_compat_hash). This is a BREAKING CHANGE for existing primitive files — every .wg/agency/primitives/**/*.yaml filename is the OLD hash and must be rewritten.

Likely scope (subject to research findings)

  • Update content_hash_component / outcome / tradeoff in src/agency/hash.rs to use only the description field (or whichever canonical input the research picked).
  • Add a one-shot migration: re-hash every primitive file, rename it on disk, update parent_ids/parent_content_hash references in all YAML.
  • Bump a schema version in import-manifest.yaml to mark the cutover.
  • Add tests/fixtures/agency-hash-equality.txt: canned (description, expected_sha256) pairs that match agentbureau/agency's computation.

File scope

  • src/agency/hash.rs
  • src/agency/lineage.rs (parent_ids references if rewritten)
  • src/commands/agency_migrate.rs (migration entry point)
  • tests/fixtures/agency-hash-equality.txt + tests/integration_agency_hash.rs

Do NOT touch:

  • src/agency/types.rs (owned by impl-agency-schema-fields)
  • src/commands/agency_import.rs (owned by impl-agency-csv-roundtrip)

Validation

  • Failing test written first: test_agency_hash_equals_agentbureau_agency_v1_2_4 (compares against canned hashes from agency)
  • Migration is idempotent (running twice is a no-op)
  • All existing wg agency YAML files re-hashed and renamed
  • cargo build + cargo test pass with no regressions
  • Smoke: wg agency stats runs cleanly post-migration

Depends on

Required by

Log