fix/phase0-contract-replay-and-ci #30

Merged
clawdie merged 7 commits from fix/phase0-contract-replay-and-ci into main 2026-10-02 16:42:26 +02:00
Owner
No description provided.
The Phase 0 replay harness asserted only id, error.code, and result.type,
so it passed even when every payload field was wrong. Fixtures were
hand-written expectations that did not match bherdr's actual output
(missing terminal_id/cwd/scroll/revision, wrong agent.get shape, wrong
pane.read fields, an unimplemented live_handoff capability).

Replace the shallow checks with a recursive subset comparison implementing
the README's Normalized Projection Rules: fixture keys must be present and
match, extra response keys are tolerated, dynamic fields (terminal_id) are
format-asserted, environment fields (cwd/foreground_cwd/version/text) are
presence-asserted with placeholders, and error envelopes require the
documented code, a non-empty message, and no result.

Reconcile the fixtures with the real contract and document comparison
semantics, the placeholders, and why bherdr omits live_handoff (out of
Phase 0 scope, no consumer). A mutation check confirms the harness is not
vacuous. Test: go test ./internal/server/ -run TestPhase0ContractReplay.
There was no Go gate in CI: the only workflow was verify-evidence.yml, so
the "Phase 0 complete" claim rested entirely on manual local runs. Add the
Linux lane from docs/BUILD-VALIDATION.md (Stage B): verify the host Go 1.26
and Zig 0.16.0 toolchains, build the vendored libghostty-vt, then gofmt,
go mod tidy -diff, CGO_ENABLED=1 go vet/test/build.

The registered runner (debby, label linux) is host-mode (`linux:host`), so
the job uses plain run steps and host toolchains rather than container-only
setup actions. The Linux lane is supplemental; the authoritative FreeBSD
lane remains the freebsd-15-dev runner on valhala.
Record the Phase 0 scope reduction as a dated decision (persistence and
automatic agent detection deferred; explicit agent reporting completes the
phase). Soften the FreeBSD verification claim in the spec, execution plan,
and fixture README to Linux-verified with the FreeBSD receipt pending the
freebsd-15-dev runner, since no FreeBSD artifact backs it yet.

Rename the deferred capability sequence to "Milestone 1-4" to stop
colliding with the separate "Phase 01" coexistence track, and register the
behavioral fixture pack in the upstream attribution register.

docs only.
The Phase 0 fixtures were hand-written, not captured, and used fields that
do not exist in upstream Protocol 22 (verified via `herdr api schema --json`
and the live herdr 0.9.3 socket on 2026-10-02):

  pane.send_input     `data`  -> `text`   (fixture only; struct was correct)
  agent identity      `name`  -> `agent`  (response; struct + CLI + fixtures)
  workspace.create    `title` -> `label`  (struct accepted a non-schema key)
  pane.split target   `pane_id` -> `target_pane_id`

The request-field mismatches were invisible because the replay runs with PTY
disabled and asserted only id/type, so a discarded payload still returned ok.

Add TestPaneSendInputDeliversToPTY: with a real PTY, pane.send_input {text}
must reach the shell and be observable via pane.read. Add a Protocol 22
schema guard (internal/wire/protocol22_contract_test.go) that fails if a
bherdr param struct ever emits a key outside the upstream schema; it caught
the workspace.create and pane.split drift on first run.
Extract compareProjection (pure, returns []string of mismatches) from the
t.Error-driven compareValue so the recursive comparison is directly
testable, and add comparator_test.go pinning subset tolerance, nested-scalar
detection, missing-field detection, array-element detection, type mismatch,
and each Normalized Projection Rule (terminal_id pattern, cwd/presence,
version, pane.read text). The mutation check is now a committed regression
guard rather than a manual edit-and-revert.
Run the race-detector suite (make test runs -race; CI did not) alongside
the ordinary tests, and state in the workflow header that evidence
integrity is the separate verify-evidence.yml check and that this lane is
not by itself the complete Phase 0 gate. Add the missing trailing newline.
docs: state Phase 0 status as Linux-complete, FreeBSD-pending
All checks were successful
verify-evidence / verify evidence reports (pull_request) Successful in 3s
go-ci / linux (build, vet, test) (pull_request) Successful in 3m15s
2266ea50ce
Replace the bare "Phase 0 Status: COMPLETE" with an explicit split:
implementation and Linux verification complete; authoritative FreeBSD
validation pending the freebsd-15-dev lane. Avoids reading "complete" as an
already-established cross-platform gate.

docs only.
clawdie deleted branch fix/phase0-contract-replay-and-ci 2026-10-02 16:42:27 +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/bherdr!30
No description provided.