harden: real-binding contract test for registry register/heartbeat payloads #2273
Reference in New Issue
Block a user
Delete Branch "harden/contract-tests-core"
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?
Real-binding contract tests for the registry register/heartbeat payloads (CI-gating hardening wave).
Pins the wire contract the runtime actually sends: binds real register + heartbeat bodies against
RegisterPayload/HeartbeatPayloadvia gin'sShouldBindJSON(the samebinding.JSONpath the handler uses), and asserts the required-field rejections (id,agent_card,workspace_idmissing → must 400). Test-only (+160 LOC), no production change.Part of the "no non-gating CI / regression-coverage" program — closes the gap where a payload-shape drift between runtime and core could ship green.
Reviewed: real-binding registry register/heartbeat contract tests — binds against the actual RegisterPayload/HeartbeatPayload via gin ShouldBindJSON + asserts required-field rejection. Test-only, all 3 required CI green. Verified diff. Approve.
REQUEST_CHANGES: direct Gitea verification does not support approval at head
e6da3b29fb.Source-of-truth combined CI is failure across 30 contexts at the current head. I cannot post a counting approval while the PR is red/pending, even with an existing CEO Assistant approval. Please re-request CR2 review after CI is success on the current head; I will re-run the normal 5-axis review then.
APPROVED after re-review using branch-protection required contexts rather than combined status.
Required-context check: present required context(s) are green at head e6da3b29fbbc; absent required contexts are path-filter absent for this PR. 5-axis review found no blocking issue.
Summary: Registry register/heartbeat payload contract test binds runtime-shaped payloads against real Go binding semantics.
Correctness/robustness: change adds targeted regression coverage or fail-closed behavior for the reported bug class. Security: no new secret exposure or auth broadening found. Performance: no concerning runtime cost. Readability: comments/tests are explicit about the incident class and gate semantics.