fix(harness-replays): use github.sha not branch-name as HEAD for push events #500

Closed
hongming-pc2 wants to merge 2 commits from sre/fix-harness-replays-detect-changes into main

2 Commits

Author SHA1 Message Date
af2a777200 fix: update test assertions for OFFSEC-003 boundary wrapping (PR #477)
All checks were successful
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 8s
audit-force-merge / audit (pull_request) Has been skipped
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 6m44s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 13s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 12s
Harness Replays / detect-changes (pull_request) Successful in 15s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 15s
sop-tier-check / tier-check (pull_request) Successful in 14s
Harness Replays / Harness Replays (pull_request) Successful in 4s
CI / Detect changes (pull_request) Successful in 39s
E2E API Smoke Test / detect-changes (pull_request) Successful in 39s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 44s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 41s
CI / Platform (Go) (pull_request) Successful in 6s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 45s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 2m4s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 6s
CI / Canvas (Next.js) (pull_request) Successful in 7s
PR #477 added _A2A_BOUNDARY_START/END wrapping to tool_delegate_task's
success path. Three tests in test_delegation_sync_via_polling.py were
checking exact result strings (no boundary markers) and started failing:

- test_flag_off_uses_send_a2a_message_not_polling: "legacy ok"
- test_queued_sentinel_triggers_polling_fallback: "real response from..."
- test_non_queued_send_result_does_not_trigger_fallback: "normal reply"

All three now assert for boundary markers + inner content. The error-path
test (DELEGATION FAILED) is unaffected — errors bypass the wrapping.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 15:59:06 +00:00
d8fc66e9bd fix(harness-replays): use github.sha not branch-name as HEAD for push events
All checks were successful
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 52s
Harness Replays / detect-changes (pull_request) Successful in 17s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 15s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 1m14s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m15s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 18s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 1m17s
sop-tier-check / tier-check (pull_request) Successful in 22s
CI / Platform (Go) (pull_request) Successful in 11s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 8s
CI / Canvas (Next.js) (pull_request) Successful in 11s
CI / Python Lint & Test (pull_request) Successful in 9s
Harness Replays / Harness Replays (pull_request) Successful in 7s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 1m15s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 14s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 12s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 11s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 9s
Root cause: PR #497 used HEAD="${GITHUB_REF#refs/heads/}" (branch name) for
push events. Gitea Compare API returns empty divergent-commits when comparing
a SHA (github.event.before) with a branch name (main) in a linear history —
the branch IS the commit's ancestor, so there are zero divergent commits.

Fix: HEAD="${{ github.sha }}" — both BASE and HEAD are SHAs, so the API
returns the pushed commits' changed files.

Verified: compare/{before_sha}...{current_sha} correctly returns pushed commits
on a linear push. For PR events, branch names still work correctly (the Compare
API handles branch-vs-branch comparisons fine).

Closes regression introduced in PR #497.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 15:42:05 +00:00