Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/scripts/prepare-mature-red-fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Only historical full-production overlays without the provider/QQ/coupon
# implementation omit its later independent test files. The newly merged BPS
# account-search fixture also requires absent historical service symbols.
# Independent BPS settings and provider-team tests also require later APIs.
# GREEN keeps all tests.
# Never remove the selected gateway/moderation/recovery oracle or its fixtures.
set -euo pipefail
Expand Down Expand Up @@ -41,6 +42,9 @@ done < <(git -C "$tree" ls-files \
'backend/internal/service/mature_*_test.go' \
'backend/internal/service/repair_f2_coupon_recovery_test.go' \
'backend/internal/service/openai_excel_bps_search_test.go' \
'backend/internal/service/bps_search_settings_test.go' \
'backend/internal/service/account_ops_providers_test.go' \
'backend/internal/service/account_ops_team_test.go' \
'backend/internal/server/routes/mature_*_test.go' \
'backend/internal/server/routes/repair_r1_payment_review_test.go' \
'backend/internal/server/routes/repair_provider_session_budget_test.go' \
Expand Down
57 changes: 57 additions & 0 deletions .github/scripts/prepare-replay-red-fixtures.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Disposable historical overlays only. Keep all candidate GREEN fixtures and
# all selected historical RED assertions; never backport production behavior.
set -euo pipefail
tree="${2:-.}"
baseline=$(git -C "$tree" rev-parse "$1^{commit}")
candidate=$(git -C "$tree" rev-parse "${3:-HEAD}^{commit}")

exclude_absent_fixture() {
local target="$1" contract="$2"
if git -C "$tree" cat-file -e "$baseline:$target" 2>/dev/null; then
printf 'refusing to exclude baseline replay fixture: %s\n' "$target" >&2
exit 1
fi
local expected actual expected_contract actual_contract
expected_contract=$(git -C "$tree" rev-parse "$baseline:$contract")
actual_contract=$(git -C "$tree" hash-object "$contract")
test "$actual_contract" = "$expected_contract"
expected=$(git -C "$tree" rev-parse "$candidate:$target")
# The mature full-source overlay also owns this independent BPS fixture.
# Both helpers retain their baseline/contract checks; accept only its exact
# already-recorded deletion, never a missing selected replay oracle.
if test "$target" = backend/internal/service/openai_excel_bps_search_test.go && ! test -e "$tree/$target"; then
test "$(git -C "$tree" diff --name-only --diff-filter=D "$candidate" -- "$target")" = "$target"
printf 'shared BPS fixture already excluded baseline=%s candidate=%s path=%s candidate_blob=%s contract_blob=%s\n' "$baseline" "$candidate" "$target" "$expected" "$actual_contract"
return
fi
actual=$(git -C "$tree" hash-object "$target")
test "$actual" = "$expected"
printf 'unrelated replay fixture baseline=%s candidate=%s path=%s baseline_blob=absent expected=%s actual=%s contract=%s contract_blob=%s\n' "$baseline" "$candidate" "$target" "$expected" "$actual" "$contract" "$actual_contract"
rm -- "$tree/$target"
test ! -e "$tree/$target"
}

# Full old-source overlays remove the unit-only OAuth dial seam alongside
# later production files. This separate, later Issue842 matrix is not selected
# by the historical 409/805/shadow regressions. Its own focused RED retains it.
seam=backend/internal/service/issue842_gateway_test_support.go
if ! test -f "$tree/$seam"; then
if git -C "$tree" cat-file -e "$baseline:$seam" 2>/dev/null; then
printf 'historical replay seam unexpectedly missing: %s\n' "$seam" >&2
exit 1
fi
exclude_absent_fixture backend/internal/handler/openai_issue842_oauth_repair_test.go backend/internal/service/openai_ws_agent_recovery.go
fi

# Older Account/search contracts cannot compile the unrelated new search
# fixture in a service-package RED. Preserve the exact historical Account leaf;
# only exclude the test when its baseline absence and candidate blob are proven.
contract=backend/internal/service/account_excel_bps_tools.go
if ! git -C "$tree" grep -q 'func (a \*Account) IsExcelBPSSearchEnabled' "$baseline" -- "$contract"; then
if ! test -f "$tree/$contract"; then
printf 'missing historical BPS account contract: %s\n' "$contract" >&2
exit 1
fi
exclude_absent_fixture backend/internal/service/openai_excel_bps_search_test.go "$contract"
fi
21 changes: 18 additions & 3 deletions .github/workflows/encrypted-history-409.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,26 @@ jobs:
git show "$callers:$target" > "$target"
test "$(git hash-object "$target")" = "$(git rev-parse "$callers:$target")"
done
! git cat-file -e "$callers:backend/internal/service/openai_ws_readable_continuation.go" 2>/dev/null
if git cat-file -e "$callers:backend/internal/service/openai_ws_readable_continuation.go" 2>/dev/null; then exit 1; fi
rm -- backend/internal/service/openai_ws_readable_continuation.go
for target in backend/internal/service/openai_409_readable_shadow.go backend/internal/repository/gateway_cache_readable_shadow.go backend/internal/repository/gateway_cache_agent_shadow_epoch.go backend/internal/service/openai_400_omit_history.go backend/internal/service/openai_history_omission.go; do
! git cat-file -e "$callers:$target" 2>/dev/null
if git cat-file -e "$callers:$target" 2>/dev/null; then exit 1; fi
rm -- "$target"
done
# This later helper is not part of the pinned recovery defect. Its
# pre-OAuth-projection API is compatible with the restored struct;
# preserve every selected defect/caller blob and behavioral assertion.
compatibility=00d2e9be01404c6e85c0560fa196e4650ef5d0fb
target=backend/internal/service/openai_agent_replay_metadata.go
if git cat-file -e "$callers:$target" 2>/dev/null; then exit 1; fi
git fetch --no-tags --depth=1 origin "$compatibility"
candidate_blob=$(git rev-parse "HEAD:$target")
test "$(git hash-object "$target")" = "$candidate_blob"
expected=$(git rev-parse "$compatibility:$target")
git show "$compatibility:$target" > "$target"
actual=$(git hash-object "$target")
test "$actual" = "$expected"
echo "$target defect_source=$callers defect_blob=absent compatibility=$compatibility candidate=$candidate_blob expected=$expected actual=$actual" >> "$RUNNER_TEMP/omit-history-red-compat.txt"
target=backend/internal/service/openai_409_omit_history.go
git show "$baseline:$target" > "$target"
test "$(git hash-object "$target")" = "$(git rev-parse "$baseline:$target")"
Expand All @@ -74,7 +88,7 @@ jobs:
set -e
cat "$RUNNER_TEMP/omit-history-red.log"
test "$result" -ne 0
! grep -Eiq 'build failed|no tests to run|undefined:|panic|data race|--- SKIP:' "$RUNNER_TEMP/omit-history-red.log"
if grep -Eiq 'build failed|no tests to run|undefined:|panic|data race|--- SKIP:' "$RUNNER_TEMP/omit-history-red.log"; then exit 1; fi
grep -q -- '--- FAIL: TestOpenAI409ReplayMetadataHTTP' "$RUNNER_TEMP/omit-history-red.log"
grep -q 'encrypted_agent_recovery_wire_changed' "$RUNNER_TEMP/omit-history-red.log"
- uses: actions/upload-artifact@v7
Expand All @@ -84,6 +98,7 @@ jobs:
path: |
${{ runner.temp }}/omit-history-protocol.log
${{ runner.temp }}/omit-history-red.log
${{ runner.temp }}/omit-history-red-compat.txt
screenshots:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/future-shadow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- '.github/scripts/test_assert_future_shadow.py'
- '.github/scripts/mutate-future-shadow.py'
- '.github/scripts/prepare-moderation-red-fixtures.sh'
- '.github/scripts/prepare-replay-red-fixtures.sh'
- '.github/workflows/future-shadow.yml'
permissions:
contents: read
Expand Down Expand Up @@ -101,6 +102,7 @@ jobs:
if [ "$PHASE" = RED ]; then
bash "$GITHUB_WORKSPACE/.github/scripts/exclude-later-400-red-fixtures.sh" "$BASELINE_SHA"
bash "$GITHUB_WORKSPACE/.github/scripts/exclude-later-http2-red-fixtures.sh" "$BASELINE_SHA"
bash "$GITHUB_WORKSPACE/.github/scripts/prepare-replay-red-fixtures.sh" "$BASELINE_SHA" . "$CANDIDATE_SHA" | tee "$RUNNER_TEMP/shadow-evidence/replay-fixtures.txt"
bash "$GITHUB_WORKSPACE/.github/scripts/prepare-moderation-red-fixtures.sh" "$BASELINE_SHA" . "$CANDIDATE_SHA" | tee "$RUNNER_TEMP/shadow-evidence/moderation-fixtures.txt"
fi
for target in backend/internal/handler/openai_409_shadow_http_test.go backend/internal/service/openai_agent_message_delivery.go backend/internal/service/openai_409_omit_history.go; do
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/http-task-rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
- '.github/scripts/mutate-http-rebuild-owner-scan.py'
- '.github/scripts/assert-readable-continuation.py'
- '.github/scripts/prepare-moderation-red-fixtures.sh'
- '.github/scripts/prepare-replay-red-fixtures.sh'
- '.github/workflows/http-task-rebuild.yml'

permissions:
Expand Down Expand Up @@ -117,6 +118,7 @@ jobs:
if [ "$PHASE" = RED ]; then
bash "$GITHUB_WORKSPACE/.github/scripts/exclude-later-400-red-fixtures.sh" "$BASELINE_SHA"
bash "$GITHUB_WORKSPACE/.github/scripts/exclude-later-http2-red-fixtures.sh" "$BASELINE_SHA"
bash "$GITHUB_WORKSPACE/.github/scripts/prepare-replay-red-fixtures.sh" "$BASELINE_SHA" . "$CANDIDATE_SHA" | tee "$RUNNER_TEMP/http-task-evidence/replay-fixtures.txt"
bash "$GITHUB_WORKSPACE/.github/scripts/prepare-moderation-red-fixtures.sh" "$BASELINE_SHA" . "$CANDIDATE_SHA" | tee "$RUNNER_TEMP/http-task-evidence/moderation-fixtures.txt"
fi
for target in backend/internal/handler/openai_409_http_rebuild_test.go backend/internal/handler/openai_409_readable_continuation_test.go backend/internal/handler/openai_responses_failover_cancel_test.go; do
Expand Down Expand Up @@ -218,6 +220,7 @@ jobs:
git diff --exit-code "$CANDIDATE_SHA" -- 'backend/**/*_test.go'
bash "$GITHUB_WORKSPACE/.github/scripts/exclude-later-400-red-fixtures.sh" "$REVIEW_BASELINE"
bash "$GITHUB_WORKSPACE/.github/scripts/exclude-later-http2-red-fixtures.sh" "$REVIEW_BASELINE"
bash "$GITHUB_WORKSPACE/.github/scripts/prepare-replay-red-fixtures.sh" "$REVIEW_BASELINE" . "$CANDIDATE_SHA" | tee "$RUNNER_TEMP/http-review-red-evidence/replay-fixtures.txt"
bash "$GITHUB_WORKSPACE/.github/scripts/prepare-moderation-red-fixtures.sh" "$REVIEW_BASELINE" . "$CANDIDATE_SHA" | tee "$RUNNER_TEMP/http-review-red-evidence/moderation-fixtures.txt"
for suite in pointer-waiver normalization; do
test_name=TestOpenAI409HTTPUnownedPointerMustDetach
Expand Down
Loading
Loading