feat(contracts): agent-state v1 fixture pack + Go/Rust replay suites #126

Merged
clawdie merged 2 commits from feat/contract-agent-state-v1 into main 2026-10-06 21:52:28 +02:00
Owner

Summary

Captures the agent-state contract once in a language-neutral fixture pack and replays it across the Go and Rust implementations (Issue #87, "Agent state is defined three times with no single source of truth" — Option 1).

Refs #87 — pending closure. This PR does not resolve #87; see Binding status below.

What's included

  • testdata/contracts/agent-state/v1/states.json — canonical 5-state vocabulary (idle, working, blocked, done, error), fold rules, invariants (sticky error, session reset, turn restart, unknown passthrough), bherdr 4-state projection and rollup priority (blocked > working > idle > unknown), plus replay cases: 45 single-step, 6 multi-step, 9 rollup.
  • testdata/contracts/agent-state/v1/README.md — contract spec (OKF frontmatter).
  • internal/zotrpc/agent_state_contract_test.go — Go replay through zotrpc.Apply.
  • crates/colibri-glasspane/src/lib.rs — Rust replay through AgentState / apply_pi_event (agent_state_contract_* tests).
  • internal/zotrpc/events.go — doc comment cites the new pack.

Binding status (why #87 stays open)

The pack binds the two implementations that replay it in this repository: Rust colibri-glasspane and Go zotrpc. The third original definition — bherdr's production pane-status implementation (bherdr/internal/server/server.go) — is specified by the pack but not yet bound: bherdr does not consume these fixtures, and the rollup replay cases validate a test-local projection, not bherdr's code. Bherdr must replay the pack (or a matching suite must land in that repository) before #87 can be considered resolved.

Verification

  • go test -race ./internal/zotrpc/ (contract tests) — PASS
  • cargo test -p colibri-glasspane --lib — 64/64 passed (this is the colibri-glasspane library test count, which includes the 4 agent_state_contract_* tests; not the workspace total)
  • gofmt -l clean; go vet ./internal/zotrpc/ clean
  • ./scripts/ci-checks.sh — PASS
  • check-okf.sh --changed PASS; check-dates.sh --strict clean; check-format.sh clean
  • check-evidence.py — 4 of 8 sets fully checked, 0 errors

Notes

  • Separate PR; does not touch the merged caller_attribution work.
  • verified_by corrected to the current identity policy (antigravity@debby).
  • Verification date retained as 2026-10-06.
## Summary Captures the agent-state contract once in a language-neutral fixture pack and replays it across the Go and Rust implementations (Issue #87, "Agent state is defined three times with no single source of truth" — Option 1). **Refs #87 — pending closure.** This PR does *not* resolve #87; see *Binding status* below. ## What's included - `testdata/contracts/agent-state/v1/states.json` — canonical 5-state vocabulary (`idle, working, blocked, done, error`), fold rules, invariants (sticky error, session reset, turn restart, unknown passthrough), bherdr 4-state projection and rollup priority (`blocked > working > idle > unknown`), plus replay cases: 45 single-step, 6 multi-step, 9 rollup. - `testdata/contracts/agent-state/v1/README.md` — contract spec (OKF frontmatter). - `internal/zotrpc/agent_state_contract_test.go` — Go replay through `zotrpc.Apply`. - `crates/colibri-glasspane/src/lib.rs` — Rust replay through `AgentState` / `apply_pi_event` (`agent_state_contract_*` tests). - `internal/zotrpc/events.go` — doc comment cites the new pack. ## Binding status (why #87 stays open) The pack binds the two implementations that replay it in this repository: Rust `colibri-glasspane` and Go `zotrpc`. The third original definition — bherdr's production pane-status implementation (`bherdr/internal/server/server.go`) — is **specified by the pack but not yet bound**: bherdr does not consume these fixtures, and the rollup replay cases validate a test-local projection, not bherdr's code. Bherdr must replay the pack (or a matching suite must land in that repository) before #87 can be considered resolved. ## Verification - `go test -race ./internal/zotrpc/` (contract tests) — PASS - `cargo test -p colibri-glasspane --lib` — **64/64 passed** (this is the `colibri-glasspane` **library** test count, which includes the 4 `agent_state_contract_*` tests; not the workspace total) - `gofmt -l` clean; `go vet ./internal/zotrpc/` clean - `./scripts/ci-checks.sh` — PASS - `check-okf.sh --changed` PASS; `check-dates.sh --strict` clean; `check-format.sh` clean - `check-evidence.py` — 4 of 8 sets fully checked, 0 errors ## Notes - Separate PR; does not touch the merged `caller_attribution` work. - `verified_by` corrected to the current identity policy (`antigravity@debby`). - Verification date retained as 2026-10-06.
Closes #87 by establishing testdata/contracts/agent-state/v1/ as the single
source of truth for the canonical 5-state agent state vocabulary, fold
transitions, invariants, and bherdr pane status projection.

Replay tests in Go (internal/zotrpc) and Rust (colibri-glasspane) verify:
- Canonical 5-state vocabulary parity (idle, working, blocked, done, error).
- Single-step event transitions and fold semantics.
- Invariants: sticky error across trailing done/turn_end frames, session reset.
- bherdr pane status rollup priority (blocked > working > idle > unknown).

Validated with ./scripts/check-go.sh and ./scripts/ci-checks.sh.
docs(contracts): scope agent-state v1 as fixture contract, not yet bherdr-bound
Some checks failed
CI / markdown (pull_request) Successful in 9s
CI / port (pull_request) Successful in 1s
CI / agent-jail-pkgs (pull_request) Successful in 1s
CI / python-tests (pull_request) Successful in 14s
CI / go (pull_request) Successful in 5s
format-check / prettier (pull_request) Successful in 5s
leak-guard / guard (pull_request) Successful in 9s
ci-gate / gate (pull_request) Has been cancelled
a947d3cc01
- verified_by: agy-debby -> antigravity@debby (harness@host per AGENTS.md)
- distinguish the shared fixture contract from the still-unbound bherdr
  production pane-status implementation; mark the bherdr consumer entry
  as not yet bound so its rollup cannot drift silently
- Refs #87 (pending closure; this PR does not resolve the issue)
clawdie deleted branch feat/contract-agent-state-v1 2026-10-06 21:52:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/colibri!126
No description provided.