Agent state is defined three times with no single source of truth #87
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Agent state is defined three times with no single source of truth
Summary
The agent-state vocabulary is independently defined in three places across the
Clawdie platform, with no shared contract. Two of the three are the same
5-value model in different languages; the third is the bherdr pane subset.
Drift here is silent — a rename or new state in one copy breaks the others at
runtime, not at compile time.
The three definitions
colibri/internal/zotrpc/events.go(State)idle, working, blocked, done, errorcolibri/crates/colibri-glasspane/src/lib.rs(AgentState)Idle, Working, Blocked, Done, Errorbherdr/internal/server/server.go(reportable)idle, working, blocked, unknownThe first two are the same 5-value model with the same fold semantics
(
session→idle, turn/tool events→working,queue_update→blocked,terminal→
done,errorsticky). They are independent copies, not a sharedtype.
Finding (Jev probe, advisory)
zotrpc.Statea redundant duplicate of glasspaneAgentState?no0.51 /partial0.42Jev correctly declines to be authoritative (confidences 0.26–0.46); the
duplication itself is plain from the sources.
Why it matters now
Colibri is migrating Rust → Go. The Rust
AgentState(glasspane) will bereplaced by the Go
zotrpc.State, but nothing binds them, and bherdr adds afourth consumer. This is the same class of problem the hive-capabilities
fixture pack already solved: capture the shared contract once, replay it in
every implementation.
Options
testdata/contracts/agent-state/v1/(mirrorstask-slice/v1andhive-capabilities/v1): the vocabulary, the fold rules,and cases; Rust and Go both replay it. Ownership stays with whoever owns the
event source.
go:generatestep shared with the Rust build. Heavier; needs a codegendecision.
is deleted.
Recommendation
Option 1, scoped to the 5-value colibri model now, with the bherdr subset
recorded as a documented projection (
idle/working/blockedshared;done/errorderivable). It is cheap, matches two existing fixture packs, and gives the
migration a replay target instead of a hope.
Refs: colibri
internal/zotrpc/events.go,crates/colibri-glasspane/src/lib.rs;testdata/contracts/task-slice/v1/,testdata/contracts/hive-capabilities/v1/.