Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
51dc1db
feat(accounts): separate temp-unsched stream timing from the cooldown…
cursoragent Nov 13, 2026
64b7c4d
test(accounts): dismiss the shared temp-unsched notice from either ru…
cursoragent Nov 13, 2026
2ec2e6c
fix(accounts): count each temp-unsched error once and keep legacy timing
cursoragent Nov 13, 2026
d2b2b24
Merge branch 'production' into cursor/temp-unsched-controls-0093
ranxi2001 Nov 13, 2026
8198162
fix: count compatibility HTTP responses once across error handlers
ranxi2001 Nov 13, 2026
1fb872a
test: verify PR838 compatibility counter against the original head
ranxi2001 Nov 13, 2026
189ec88
ci: install Redis for retained HTTP replay regression
ranxi2001 Nov 13, 2026
d70bd58
Merge production while preserving stream phase and weekly observation…
ranxi2001 Nov 13, 2026
a044f6b
ci: isolate weekly429 historical tests and retain Ubuntu fallback
ranxi2001 Nov 13, 2026
cf2c96d
ci: fail explicitly on invalid historical test exclusions
ranxi2001 Nov 13, 2026
189785b
Merge commit '7827a2f5f900ce50aafa37ab71ca1918dfe7cf8a' into fix/main…
ranxi2001 Nov 14, 2026
f73b3c6
fix: preserve output phase for WebSocket semantic 429
ranxi2001 Nov 14, 2026
529b97c
test: fence committed WS ownership and exercise real Redis reset inte…
ranxi2001 Nov 14, 2026
51356e4
ci: preserve URL DSN contract for PostgreSQL replica fixtures
ranxi2001 Nov 14, 2026
0556b35
Merge live production into PR838 for final UI acceptance
ranxi2001 Nov 14, 2026
daccc06
test: verify PR838 administration saves and notices in isolated CI
ranxi2001 Nov 14, 2026
2024b00
ci: resolve UI evidence paths after runner allocation
ranxi2001 Nov 14, 2026
edf550f
ci: bound browser dependency downloads for PR838 acceptance
ranxi2001 Nov 14, 2026
8f13c3b
ci: keep notice fixture compatible with the production browser target
ranxi2001 Nov 14, 2026
6da23a3
ci: create the disposable application data directory
ranxi2001 Nov 14, 2026
6c25275
ci: reach the isolated application through its bridge address
ranxi2001 Nov 14, 2026
fe05da9
ci: acknowledge first-login requirements before account acceptance
ranxi2001 Nov 14, 2026
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
7 changes: 7 additions & 0 deletions .github/fixtures/pr838-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:3.23
WORKDIR /app
RUN mkdir -p /app/data
COPY server /app/sub2api
COPY resources /app/resources
ENV DATA_DIR=/app/data
ENTRYPOINT ["/app/sub2api"]
52 changes: 52 additions & 0 deletions .github/fixtures/pr838-ui/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Disposable Actions installation. No upstream, SMTP, host config or egress.
services:
postgres:
image: postgres:18.1-alpine3.23
container_name: pr838-ui-pg
environment:
POSTGRES_PASSWORD: fixture-only-postgres
POSTGRES_DB: sub2api_test
networks: [isolated]
healthcheck:
test: [CMD-SHELL, "pg_isready -U postgres -d sub2api_test"]
interval: 2s
timeout: 3s
retries: 45
redis:
image: redis:8.4-alpine
command: [redis-server, --save, "", --appendonly, "no"]
networks: [isolated]
healthcheck:
test: [CMD, redis-cli, ping]
interval: 2s
timeout: 3s
retries: 45
app:
image: pr838-ui-app:${CANDIDATE:?required}
networks: [isolated]
environment:
AUTO_SETUP: "true"
ADMIN_EMAIL: reviewer@example.invalid
ADMIN_PASSWORD: Fixture-Only-838-Password!
JWT_SECRET: fixture-only-pr838-jwt-not-real-0123456789abcdef
DATABASE_HOST: postgres
DATABASE_USER: postgres
DATABASE_PASSWORD: fixture-only-postgres
DATABASE_DBNAME: sub2api_test
DATABASE_SSLMODE: disable
REDIS_HOST: redis
SERVER_HOST: 0.0.0.0
SERVER_PORT: "8080"
SERVER_MODE: release
TZ: UTC
depends_on:
postgres: {condition: service_healthy}
redis: {condition: service_healthy}
healthcheck:
test: [CMD, wget, -q, -T, "3", -O, /dev/null, http://localhost:8080/health]
interval: 3s
timeout: 5s
retries: 90
networks:
isolated:
internal: true
10 changes: 10 additions & 0 deletions .github/scripts/oauth429-weekly-only-evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,14 @@
]
for name in required:
assert "TestOAuth429WeeklyOnly" + name in passed, "missing regression: " + name
if mode == "green":
for name in (
"TestCompatErrorPipelineCountsEachResponseOnce",
"TestFastPathThenGeneralHandler_CountsOne502UntilThreshold",
"TestPendingModel401_DoesNotDisableWholeAccount",
"TestCredential401_StillDisablesDespitePendingModelRule",
"TestOpenAIWSAfterOutput_Generic500AndExplicit502NeedAfterStream",
"TestMemoryTempUnschedTriggerDelayedResetKeepsNewRound",
):
assert name in passed, "missing candidate-only regression: " + name
print(f"Validated {mode.upper()}: {len(passed)} passed events, {len(failed)} failed events")
271 changes: 271 additions & 0 deletions .github/scripts/pr838-ui-browser.mjs

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions .github/scripts/pr838-ui-build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// CI only: unmodified complete application entry, project Vite/Tailwind/plugins.
// A separate test page exercises real NewFeatureBadge/store announcement epochs.
import { writeFileSync, rmSync, mkdirSync } from 'node:fs'
import { resolve, join } from 'node:path'
import { pathToFileURL } from 'node:url'

const repo = resolve('.'), output = process.env.EVIDENCE_DIR
if (!output || process.env.GITHUB_ACTIONS !== 'true') throw Error('Isolated CI only')
mkdirSync(output, { recursive: true })
const { build } = await import(pathToFileURL(join(repo, 'frontend/node_modules/vite/dist/node/index.js')))
for (const mode of ['before', 'after']) {
const root = join(repo, mode === 'before' ? '.pr838-baseline/frontend' : 'frontend')
const extra = join(root, 'pr838-notices.html'), entry = join(root, '.pr838-notices.js')
try {
if (mode === 'after') {
writeFileSync(extra, '<!doctype html><html><meta charset="utf-8"><div id="app"></div><script type="module" src="/.pr838-notices.js"></script></html>', { flag: 'wx' })
writeFileSync(entry, `
import {createApp,h} from 'vue';import {createPinia} from 'pinia';
import Badge from '/src/components/common/NewFeatureBadge.vue';
import {NEW_FEATURE_NOTICES as ids} from '/src/constants/newFeatureNotices.ts';
import {i18n,loadLocaleMessages} from '/src/i18n/index.ts';import '/src/style.css';
async function mountNotices(){
await loadLocaleMessages('en');i18n.global.locale.value='en';
// Future C is deliberately a test-only registered ID, not a product announcement.
const registry={A:ids.vipAutoCredit,B:ids.tempUnschedStreamCountWindow,C:'fixture-pr838-future-announcement-C'};
const p=new URLSearchParams(location.search), phase=p.get('phase')||'a',user=Number(p.get('user'));
if(!Number.isSafeInteger(user)||user<1)throw Error('Fictional fixture administrator required');
const entries=phase==='a'?['A']:phase==='b'?['A','B','B']:['A','B','B','C'];
createApp({render:()=>h('main',{class:'p-6 space-y-4'},[
h('h1',{},'CI fixture · actual badge/store · simulated announcement epochs'),
...entries.map((id,i)=>h('section',{'data-testid':'notice-'+id+'-'+i},[h('span',{},id),h(Badge,{noticeId:registry[id],userId:user})]))
])}).use(createPinia()).use(i18n).mount('#app');
}
void mountNotices();
`, { flag: 'wx' })
}
process.chdir(root)
await build({ root, configFile: join(root, 'vite.config.ts'), build: {
outDir: join(output, mode + '-dist'), emptyOutDir: true,
rollupOptions: { input: mode === 'before' ? join(root, 'index.html') : { app: join(root, 'index.html'), notices: extra } },
} })
} finally {
process.chdir(repo)
if (mode === 'after') { rmSync(extra, { force: true }); rmSync(entry, { force: true }) }
}
}
48 changes: 48 additions & 0 deletions .github/scripts/pr838-ws-phase-evidence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""Validate completed remote forwarding regressions; infrastructure is never RED."""
import json
from pathlib import Path
import sys

mode, filename, status = sys.argv[1:]
path = Path(filename)
events = [json.loads(line) for line in path.read_text().splitlines()]
output = "".join(event.get("Output", "") for event in events) + path.with_suffix(".stderr").read_text()
path.with_suffix(".log").write_text(output)
print(output)
assert events and not any(event["Action"] == "skip" for event in events), "missing execution or skipped regression"
assert not any(term in output.lower() for term in (
"build failed", "setup failed", "undefined:", "no tests to run", "panic:",
"fatal error:", "warning: data race", "race detected", "signal:",
"segmentation fault", "test timed out", "unexpected fault", "out of memory",
)), "compilation, race, crash or infrastructure cannot satisfy behavior evidence"
started = {event["Test"] for event in events if event["Action"] == "run" and event.get("Test")}
finished = {event["Test"] for event in events if event["Action"] in ("pass", "fail") and event.get("Test")}
assert started and started == finished, "unfinished forwarding tests"
passed = {event.get("Test") for event in events if event["Action"] == "pass"}
failed = {event.get("Test") for event in events if event["Action"] == "fail"}
terminal = [event for event in events if not event.get("Test") and event["Action"] in ("pass", "fail")]
assert len(terminal) == 1, "missing completed package result"
root = "TestTempUnschedWSForwardAfterOutputSemantic429/"
for entry in ("v2", "ingress"):
assert root + entry + "/after_stream" in passed, "after_stream control missing: " + entry
if mode == "red":
assert root + entry + "/before_stream" in failed, "old source must fail the actual forwarding entry: " + entry
else:
assert root + entry + "/before_stream" in passed, "candidate failed the actual forwarding entry: " + entry
if mode == "red":
assert int(status) == 1 and terminal[0]["Action"] == "fail"
assert "semantic429 must respect the real output phase and count each response once" in output
else:
assert int(status) == 0 and not failed and terminal[0]["Action"] == "pass"
for name in (
"TestCompatErrorPipelineCountsEachResponseOnce",
"TestFastPathThenGeneralHandler_CountsOne502UntilThreshold",
"TestPendingModel401_DoesNotDisableWholeAccount",
"TestCredential401_StillDisablesDespitePendingModelRule",
"TestOpenAIWSAfterOutput_Generic500AndExplicit502NeedAfterStream",
"TestMemoryTempUnschedTriggerDelayedResetKeepsNewRound",
"TestOAuth429WeeklyOnlyService", "TestOAuth429WeeklyOnlyWSForward",
"TestOAuth429WeeklyOnlyWSClientIngress",
):
assert name in passed, "missing safety control: " + name
print(f"Validated WS PHASE {mode.upper()}: {len(passed)} passed events, {len(failed)} failed events")
27 changes: 27 additions & 0 deletions .github/workflows/oauth-degradation-native-controls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,37 @@ jobs:
postgres:
runs-on: ubuntu-latest
timeout-minutes: 35
# Same images as integration_harness_test.go. Provision before the race
# binary starts; keep its migrations, real connections and all regressions.
services:
postgres:
image: postgres:18.1-alpine3.23
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sub2api_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d sub2api_test"
--health-interval 5s
--health-timeout 5s
--health-retries 12
redis:
image: redis:8.4-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 12
env:
CI: 'true'
GOMAXPROCS: '2'
GOFLAGS: '-p=2'
SUB2API_TEST_POSTGRES_DSN: 'postgres://postgres:postgres@127.0.0.1:5432/sub2api_test?sslmode=disable&TimeZone=UTC'
SUB2API_TEST_REDIS_URL: 'redis://127.0.0.1:6379/0'
steps:
- uses: actions/checkout@v6
with:
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/oauth429-weekly-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ jobs:
git worktree add --detach "$RUNNER_TEMP/oauth429-red" "$CANDIDATE"
while read -r expected target; do
test "$(git rev-parse "$BASELINE:$target")" = "$expected"
candidate_blob=$(git rev-parse "$CANDIDATE:$target")
git show "$BASELINE:$target" > "$RUNNER_TEMP/oauth429-red/$target"
actual=$(git hash-object "$RUNNER_TEMP/oauth429-red/$target")
test "$actual" = "$expected"
printf '%s %s %s\n' "$BASELINE" "$actual" "$target" >> evidence/restored-blobs.txt
printf '%s %s %s\n' "$CANDIDATE" "$candidate_blob" "$target" >> evidence/candidate-source-blobs.txt
done <<'BLOBS'
ab9d5251a4acec7c17b0adb0f21ae59a71f89067 backend/internal/service/openai_disable_scheduling_429.go
849aec6c598b9ca5e94f218f76e7d7266505ae57 backend/internal/service/openai_gateway_service.go
Expand All @@ -71,7 +73,6 @@ jobs:
0e4455ea613b07f2775c793346bd0b8fa0257fd5 backend/internal/service/openai_quota_service.go
26744ab312ed9552b375487d34052fd8b7f28da1 backend/internal/service/openai_quota_usage_snapshot.go
BLOBS
git -C "$RUNNER_TEMP/oauth429-red" diff --stat > evidence/red-diff.txt
git ls-files 'backend/internal/service/*429*test.go' 'backend/internal/repository/oauth429_weekly_only*test.go' > evidence/retained-tests.txt
while IFS= read -r test_file; do
candidate_blob=$(git hash-object "$test_file")
Expand All @@ -80,6 +81,19 @@ jobs:
printf '%s %s\n' "$candidate_blob" "$test_file" >> evidence/retained-test-blobs.txt
done < evidence/retained-tests.txt
git -C "$RUNNER_TEMP/oauth429-red" diff --exit-code -- '*_test.go'
# This later, unrelated regression requires the candidate-only WS
# stream-phase helper. Exclude it only from this disposable old-source
# checkout; GREEN explicitly runs all six tests with candidate sources.
excluded=backend/internal/service/temp_unsched_pending_test.go
if git cat-file -e "$BASELINE:$excluded" 2>/dev/null; then echo 'historical-exclusion-baseline-present' >&2; exit 1; fi
candidate_blob=$(git rev-parse "$CANDIDATE:$excluded")
test "$(git hash-object "$RUNNER_TEMP/oauth429-red/$excluded")" = "$candidate_blob"
if grep -q '^func TestOAuth429WeeklyOnly' "$excluded"; then echo 'historical-exclusion-target-regression' >&2; exit 1; fi
rm -- "$RUNNER_TEMP/oauth429-red/$excluded"
test ! -e "$RUNNER_TEMP/oauth429-red/$excluded"
printf '%s baseline=absent candidate=%s red=absent reason=candidate-only-WS-stream-phase-helper\n' "$excluded" "$candidate_blob" > evidence/excluded-tests.txt
git -C "$RUNNER_TEMP/oauth429-red" diff --exit-code -- '*_test.go' ":!$excluded"
git -C "$RUNNER_TEMP/oauth429-red" diff --stat > evidence/red-diff.txt
- name: Require behavioral RED from unchanged service regressions
shell: bash
run: |
Expand Down Expand Up @@ -183,7 +197,7 @@ jobs:
git rev-parse HEAD HEAD^{tree} > evidence/candidate.txt
git diff --exit-code
set +e
(cd backend && go test -race -json -tags=unit ./internal/service -run '^Test(OAuth429WeeklyOnly|DisableScheduling429|RateLimitDisableSchedulingOn429|OpenAIGatewayDisableSchedulingOn429|Managed429WeeklyPolicy|Weekly429Threshold|TOTPRotationOn429|OpenAIStream429|OpenAIQuotaRecovery|CalculateOpenAI429ResetTime)' -count=1 -timeout=10m) > evidence/green.jsonl 2> evidence/green.stderr
(cd backend && go test -race -json -tags=unit ./internal/service -run '^Test(OAuth429WeeklyOnly|DisableScheduling429|RateLimitDisableSchedulingOn429|OpenAIGatewayDisableSchedulingOn429|Managed429WeeklyPolicy|Weekly429Threshold|TOTPRotationOn429|OpenAIStream429|OpenAIQuotaRecovery|CalculateOpenAI429ResetTime|CompatErrorPipelineCountsEachResponseOnce|FastPathThenGeneralHandler_CountsOne502UntilThreshold|PendingModel401_DoesNotDisableWholeAccount|Credential401_StillDisablesDespitePendingModelRule|OpenAIWSAfterOutput_Generic500AndExplicit502NeedAfterStream|MemoryTempUnschedTriggerDelayedResetKeepsNewRound)' -count=1 -timeout=10m) > evidence/green.jsonl 2> evidence/green.stderr
result=$?
set -e
printf '%s\n' "$result" > evidence/green-exit.txt
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/pr838-compat-count.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: PR838 compatibility response counter
on:
push:
branches: [maintenance/pr838-compat-count-fix-20261114]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pr838-compat-count-${{ github.ref }}
cancel-in-progress: true
jobs:
counter:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
- name: Original PR head must fail the retained compatibility regression
shell: bash
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/pr838-counter"
git rev-parse HEAD > "$RUNNER_TEMP/pr838-counter/head.txt"
baseline=d2b2b246fc0235740e87c742b24be5a5c9e055e0
targets=(backend/internal/service/openai_gateway_cc_pipeline.go backend/internal/service/openai_gateway_upstream_errors.go)
trap 'git restore --source=HEAD -- "${targets[@]}"' EXIT
for target in "${targets[@]}"; do
git show "$baseline:$target" > "$target"
test "$(git hash-object "$target")" = "$(git rev-parse "$baseline:$target")"
done
set +e
(cd backend && go test -tags=unit ./internal/service -run '^TestCompatErrorPipelineCountsEachResponseOnce$' -count=1 -v -timeout=3m) > "$RUNNER_TEMP/pr838-counter/red.log" 2>&1
result=$?
set -e
cat "$RUNNER_TEMP/pr838-counter/red.log"
test "$result" -eq 1
! grep -Eiq 'build failed|undefined:|no tests to run|panic:|--- SKIP:' "$RUNNER_TEMP/pr838-counter/red.log"
grep -q 'same upstream response must be counted once across compatibility handlers' "$RUNNER_TEMP/pr838-counter/red.log"
git restore --source=HEAD -- "${targets[@]}"
trap - EXIT
git diff --exit-code
- name: Fixed compatibility pipeline and existing authentication controls
shell: bash
run: |
set -euo pipefail
(cd backend && go test -race -tags=unit ./internal/service -run '^Test(CompatErrorPipeline|FastPathThenGeneralHandler|PendingModel401|Credential401|OpenAIWSAfterOutput)' -count=1 -v -timeout=5m) 2>&1 | tee "$RUNNER_TEMP/pr838-counter/green.log"
grep -q -- '--- PASS: TestCompatErrorPipelineCountsEachResponseOnce' "$RUNNER_TEMP/pr838-counter/green.log"
! grep -Eiq 'build failed|undefined:|no tests to run|panic:|--- SKIP:|DATA RACE' "$RUNNER_TEMP/pr838-counter/green.log"
- uses: actions/upload-artifact@v7
if: always()
with:
name: pr838-compat-counter-${{ github.sha }}
path: ${{ runner.temp }}/pr838-counter/
Loading
Loading