Qualify the role permission version upsert and wait for the second HITL card #246

Merged
weichen merged 1 commits from fix/pg-role-policy-version-and-hitl-wait into main 2026-10-22 06:42:24 +00:00
Owner

Why: Dev composite test-pg (Agent-System-Dev#691, run 4841 job 8030) is the first to include Backend#240 and failed:

  • PostgreSQL: column reference "permission_version" is ambiguous (SQLSTATE 42702) in the role_permissions ON CONFLICT DO UPDATE (6 role policy tests).
  • TestResolveHITLSecondRoundKeepsTerminalStatus read the round-2 HITL card right after the asked signal, before it was persisted.

What: qualify role_permissions.permission_version+1; test waits for waiting_hitl + an unresolved card before reading (mirrors round 1). Test-only change for runmgr.

Evidence: go test ./internal/store ./internal/runmgr pass; HITL test -count=20 passes (SQLite, SELF). PostgreSQL verified by the Dev composite test-pg.
Refs: Agent-System-Backend#240, Agent-System-Dev#691 (fix authorized by owner)

Why: Dev composite test-pg (Agent-System-Dev#691, run 4841 job 8030) is the first to include Backend#240 and failed: - PostgreSQL: column reference "permission_version" is ambiguous (SQLSTATE 42702) in the role_permissions ON CONFLICT DO UPDATE (6 role policy tests). - TestResolveHITLSecondRoundKeepsTerminalStatus read the round-2 HITL card right after the asked signal, before it was persisted. What: qualify role_permissions.permission_version+1; test waits for waiting_hitl + an unresolved card before reading (mirrors round 1). Test-only change for runmgr. Evidence: go test ./internal/store ./internal/runmgr pass; HITL test -count=20 passes (SQLite, SELF). PostgreSQL verified by the Dev composite test-pg. Refs: Agent-System-Backend#240, Agent-System-Dev#691 (fix authorized by owner)
weichen added 1 commit 2026-10-22 06:40:13 +00:00
Qualify the role permission version upsert and wait for the second HITL card
governance / governance (pull_request) Successful in 16s
ci / vet-and-test (pull_request) Successful in 1m27s
8cd4dd0ab7
Why: Dev composite test-pg failed: PostgreSQL rejects the unqualified
permission_version self-reference in the role_permissions upsert
(SQLSTATE 42702), and TestResolveHITLSecondRoundKeepsTerminalStatus read
the round-2 card before it was persisted.

Evidence: go test ./internal/store ./internal/runmgr pass and the HITL
test passes 20 consecutive runs locally on SQLite (SELF); PostgreSQL is
verified by the Dev composite test-pg job.

Impact: role_permissions.permission_version+1 on conflict; test-only
wait mirrors round 1. No other behavior change.

Refs: Agent-System-Backend#240, Agent-System-Dev#691 (test-pg run 4841);
agent-exec receipt u7-run (pi, success)

Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 7bcbbdb376 into main 2026-10-22 06:42:24 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#246