Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
9f5a704
fix: 在完整密文历史快照前规范化回放元数据
ranxi2001 Nov 14, 2026
1f9e947
fix: 冻结每轮 WS 回放并保留完整 reasoning 历史
ranxi2001 Nov 14, 2026
e357dcf
test: 补齐真实 builder 拒绝与 WS 未知交付边界
ranxi2001 Nov 14, 2026
00d2e9b
style: 对齐远程格式检查要求的 WS 回归缩进
ranxi2001 Nov 14, 2026
bf91b6f
test: reproduce owner guard continuation on live websocket
ranxi2001 Nov 14, 2026
276aac9
test: include strict issue854 evidence validator
ranxi2001 Nov 14, 2026
c1b5bcd
test: hydrate authenticated lifecycle fixture group
ranxi2001 Nov 14, 2026
909e2dc
test: cover recovery persistence and safe owner limit diagnostics
ranxi2001 Nov 14, 2026
6b3f760
ci: run isolated issue854 evidence on available macos runner
ranxi2001 Nov 14, 2026
f52a018
test: await relay teardown before attributing owner refusal
ranxi2001 Nov 14, 2026
8a0a51c
fix: rebuild unsent websocket owner continuations and persist refusals
ranxi2001 Nov 14, 2026
e946fc3
fix: preserve missing owner fences and distinguish stream failures
ranxi2001 Nov 14, 2026
470a9c3
ci: install redis for real network continuation evidence
ranxi2001 Nov 14, 2026
7f93438
fix: scope recovery to proven route refusals and preserve initial tur…
ranxi2001 Nov 14, 2026
e60e98f
ci: validate issue854 frontend on available macos runner
ranxi2001 Nov 14, 2026
5a87b15
ci: provide frontend typecheck heap on hosted issue854 runner
ranxi2001 Nov 14, 2026
31cfdd2
fix: recover proven unavailable owners before initial websocket dispatch
ranxi2001 Nov 14, 2026
d159cfd
test: read persisted owner from repository result model
ranxi2001 Nov 14, 2026
9d3ec8e
fix: remove unused initial frame assignment after rebuilding
ranxi2001 Nov 14, 2026
ce4d8ea
ci: keep historical Issue715 handler helpers coherent
ranxi2001 Nov 14, 2026
7c4fda9
test(ops): add reproducible browser evidence for stream failures
ranxi2001 Nov 14, 2026
5e93a9f
test(ops): assert screenshot status cards are in the viewport
ranxi2001 Nov 14, 2026
8ea8974
Merge PR860 source into PR855 retaining typed WS recovery and both re…
ranxi2001 Nov 14, 2026
1491e06
Merge production e90811e27 into issue854 integration
ranxi2001 Nov 14, 2026
a357587
fix(recovery): project empty images before freezing rebuilt HTTP requ…
ranxi2001 Nov 14, 2026
fac7098
test(recovery): distinguish integrated policy matrix from causal RED
ranxi2001 Nov 14, 2026
86f90d7
ci: verify historical bridge refusal with the structured error oracle
ranxi2001 Nov 14, 2026
ee1de20
ci: align unselected fixtures with historical WS ticket APIs
ranxi2001 Nov 14, 2026
d1bd861
test(recovery): await committed owners without detached assertions
ranxi2001 Nov 15, 2026
af0328a
Merge remote-tracking branch 'origin/production' into fix/issue842-no…
ranxi2001 Nov 15, 2026
aeaed24
fix: 冻结 OAuth 无状态 reasoning 的账号专属回放投影
ranxi2001 Nov 15, 2026
b04ff21
style: 移除 OAuth 回归文件尾部空行
ranxi2001 Nov 15, 2026
d6c1247
ci: 修复回放回归的 lint 与历史源码装配兼容
ranxi2001 Nov 15, 2026
73810b1
merge: 同步 production 并保留回放验证与历史时区依赖
ranxi2001 Nov 15, 2026
dd80535
Merge remote-tracking branch 'origin/production' into maintenance/pr8…
ranxi2001 Nov 15, 2026
dd9cabb
merge: 整合 PR853 的完整回放保护并保留 WS 恢复边界
ranxi2001 Nov 15, 2026
8d0285b
merge: 同步渠道运维基线并保留两套历史回归装配
ranxi2001 Nov 15, 2026
fccad89
merge: 同步已合并的运营基线并组合历史回归夹具
ranxi2001 Nov 15, 2026
b522a5a
ci: 允许历史装配共享已核验的 BPS 测试排除
ranxi2001 Nov 15, 2026
99b6c9e
Merge branch 'maintenance/pr853-merge-20261115' into maintenance/pr85…
ranxi2001 Nov 15, 2026
37900ca
ci: 补齐组合树的历史 RED 依赖与独立夹具边界
ranxi2001 Nov 15, 2026
0adb476
ci: 为历史派发 RED 固定兼容的回放调用方
ranxi2001 Nov 15, 2026
c5d7b60
merge: 统一 PR853 与 PR855 的历史派发回归装配
ranxi2001 Nov 15, 2026
7086526
test: 对齐等待时间数值类型并固定历史 scheduler 依赖
ranxi2001 Nov 15, 2026
1cc9e8a
Merge branch 'maintenance/pr853-merge-20261115' into maintenance/pr85…
ranxi2001 Nov 15, 2026
c1c3e4c
ci: 按固定顺序装配 namespace 历史反例
ranxi2001 Nov 15, 2026
176dce4
Merge branch 'maintenance/pr853-merge-20261115' into maintenance/pr85…
ranxi2001 Nov 15, 2026
411caa1
ci: 避免重复处理已验证排除的 BPS 夹具
ranxi2001 Nov 15, 2026
4fd7bd3
Merge remote-tracking branch 'origin/production' into maintenance/pr8…
ranxi2001 Nov 15, 2026
7c6a041
ci: 为完整整合树保留历史反例的独立夹具边界
ranxi2001 Nov 15, 2026
838cca7
Merge branch 'maintenance/pr853-merge-20261115' into maintenance/pr85…
ranxi2001 Nov 15, 2026
d28501a
test: 在阻塞交付提交前建立消费端连接
ranxi2001 Nov 15, 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
100 changes: 100 additions & 0 deletions .github/scripts/issue854-evidence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
"""Accept named business failures only; shared validator rejects dirty logs."""
import importlib.util
import json
import sys
from collections import Counter
from pathlib import Path

spec = importlib.util.spec_from_file_location("common", Path(__file__).with_name("assert-readable-continuation.py"))
common = importlib.util.module_from_spec(spec)
spec.loader.exec_module(common)
ROOT = "TestIssue854OwnerContinuation"
MODES = ("http_bridge", "ctx_pool", "shared", "dedicated", "passthrough")
LEAVES = {f"{ROOT}/{mode}/{case}" for mode in MODES for case in ("original", "fresh", "guard_live")}
PARENTS = {ROOT}


def inventory(suite):
if suite == "lifecycle":
return LEAVES, PARENTS, {n for n in LEAVES if n.endswith("/guard_live")}, ("WS_READABLE_B_DISPATCH_MISSING", "The proven encrypted agent owner is currently unavailable")
if suite == "persistence":
root = "TestIssue854OwnerFailurePersistence"
leaves = {f"{root}/{mode}/{connection}" for mode in MODES for connection in ("guard", "fresh")}
return leaves, {root}, leaves, ("ISSUE854_FAILURE_NOT_PERSISTED",)
if suite == "r1":
root = "TestIssue854FreshOwnerSelection"
leaves = {f"{root}/{mode}/{case}" for mode in MODES for case in ("disabled", "cooldown", "off", "pending", "failed", "conflict", "unfinished")}
return leaves, {root}, {n for n in leaves if n.endswith(("/disabled", "/cooldown"))}, ("ISSUE854_R1_INITIAL_OWNER_REFUSED", "encrypted_agent_recovery_owner_")
if suite == "http-empty-image":
root = "TestIssue854HTTPTransformMatrix"
leaves = {f"{root}/{account}/stream={stream}/empty_image" for account in ("apikey", "oauth") for stream in ("false", "true")}
return leaves, {root}, leaves, ("HTTP_REBUILD_B_DISPATCH_MISSING", "encrypted_agent_recovery_wire_changed")
if suite == "http-transform":
root = "TestIssue854HTTPTransformMatrix"
cases = ("metadata", "message_namespace", "tool_namespace", "empty_image", "reasoning_summary", "compaction_order", "timezone_manual", "timezone_auto", "lite", "reserved_alias", "namespace_declaration", "namespace_flatten", "schema_null", "new_task")
leaves = {f"{root}/{account}/stream={stream}/{case}" for account in ("apikey", "oauth") for stream in ("false", "true") for case in cases}
return leaves, {root}, set(), ()
if suite == "http-route":
root = "TestIssue854HTTPRouteAdmission"
leaves = {f"{root}/stream={stream}/native_available={available}" for stream in ("false", "true") for available in ("false", "true")}
return leaves, {root}, set(), ()
if suite == "postgres":
root = "TestIssue854PostgresRoundtrip"
return {f"{root}/{name}" for name in ("ws_guard", "ws_fresh", "sse")}, {root}, set(), ()
if suite == "ws-upstream":
root = "TestIssue854WSOwnerRateLimit"
leaves = {f"{root}/{mode}/encrypted_agent_recovery_{code}" for mode in MODES for code in ("owner_rate_limited", "untrusted_fixture")}
return leaves, {root}, {n for n in leaves if n.endswith("owner_rate_limited")}, ("ISSUE854_WS_OWNER_LIMIT_CODE_LOST",)
if suite == "upstream":
root = "TestIssue854UpstreamOwnerRateLimit"
parents = {root}
leaves = {f"{root}/stream={stream}/encrypted_agent_recovery_{code}" for stream in ("false", "true") for code in ("owner_rate_limited", "untrusted_fixture")}
return leaves, parents, {n for n in leaves if n.endswith("owner_rate_limited")}, ("ISSUE854_OWNER_LIMIT_CODE_LOST",)
raise ValueError("invalid suite")


def validate(phase, status, raw, suite="lifecycle"):
leaves, parents, red_failures, markers = inventory(suite)
if phase not in ("RED", "GREEN"):
raise ValueError("invalid phase")
if phase == "RED" and suite in ("http-transform", "http-route"):
raise ValueError("updated policy matrix is a GREEN gate; use the named empty-image RED and archived original matrix")
common.check_clean(raw)
if "requires real redis-server in CI" in raw:
raise ValueError("fixture setup failure")
events = []
for line in raw.splitlines():
try:
event = json.loads(line)
except json.JSONDecodeError:
continue
if not isinstance(event, dict):
raise ValueError("invalid event")
events.append(event)
counts = Counter((e.get("Action"), e.get("Test")) for e in events if e.get("Package") == common.PACKAGE)
failures = red_failures if phase == "RED" else set()
failed_parents = {p for p in parents if any(n.startswith(p + "/") for n in failures)}
expected = {n: "fail" if n in failures | failed_parents else "pass" for n in leaves | parents}
expected[None] = "fail" if failures else "pass"
if status != (1 if failures else 0):
raise ValueError("wrong exit status")
for name, terminal in expected.items():
if name and counts["run", name] != 1:
raise ValueError(f"missing/repeated run: {name}")
if counts[terminal, name] != 1 or counts["pass", name] + counts["fail", name] != 1:
raise ValueError(f"wrong terminal: {name}")
for e in events:
if e.get("Action") in ("run", "pass", "fail") and (e.get("Package") != common.PACKAGE or e.get("Test") not in expected):
raise ValueError("unrelated test")
for name in failures:
output = "".join(e.get("Output", "") for e in events if e.get("Test") == name)
for marker in markers:
if marker not in output:
raise ValueError(f"missing business assertion: {name}: {marker}")


if __name__ == "__main__":
phase, status, filename, *extra = sys.argv[1:]
suite = extra[0] if extra else "lifecycle"
validate(phase, int(status), Path(filename).read_text(), suite)
print(f"{phase}: all {len(inventory(suite)[0])} named {suite} leaves verified")
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
25 changes: 15 additions & 10 deletions .github/scripts/prepare-moderation-red-fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ while IFS= read -r target; do
test ! -e "$tree/$target"
done < <(git -C "$tree" ls-files 'backend/internal/handler/moderation_upstream*_test.go' 'backend/internal/handler/admin/moderation_upstream_scope_test.go' 'backend/internal/service/content_moderation_upstream_scope_test.go' 'backend/internal/repository/moderation_upstream_scope*_test.go' 'backend/internal/handler/openai_409_ws_audit_test.go')

# This pre-PR848 fixture retains PR834's actual error observer and all existing
# recovery harness entry points, with the historical eight-argument constructor.
fixture_base=afa7dbd6fccffef950febadc666b9243bba2454d
# Preserve current harness entry points needed by independently compiled newer
# tests. Only adapt the known constructor arity in this disposable RED tree.
# Production stays byte-for-byte historical; selected behavior tests stay intact.
target=backend/internal/handler/openai_ws_v2_passthrough_cyber_test.go
if ! git -C "$tree" cat-file -e "$fixture_base^{commit}" 2>/dev/null; then
git -C "$tree" fetch --no-tags --depth=1 origin "$fixture_base"
fi
candidate_blob=$(git -C "$tree" rev-parse "$candidate:$target")
test "$(git -C "$tree" hash-object "$target")" = "$candidate_blob"
expected=$(git -C "$tree" rev-parse "$fixture_base:$target")
git -C "$tree" show "$fixture_base:$target" > "$tree/$target"
python3 - "$tree/$target" <<'PY_FIXTURE'
from pathlib import Path
import sys
path = Path(sys.argv[1])
source = path.read_text()
new = "service.NewContentModerationService(settingRepo, moderationRepo, nil, nil, nil, nil, nil, nil, accountRepo)"
old = "service.NewContentModerationService(settingRepo, moderationRepo, nil, nil, nil, nil, nil, nil)"
if source.count(new) != 1:
raise SystemExit("unexpected moderation fixture constructor")
path.write_text(source.replace(new, old, 1))
PY_FIXTURE
actual=$(git -C "$tree" hash-object "$target")
test "$actual" = "$expected"
printf 'compatible path=%s fixture_base=%s candidate=%s expected=%s actual=%s\n' "$target" "$fixture_base" "$candidate_blob" "$expected" "$actual"
printf 'compatible test-only constructor path=%s candidate=%s adapted=%s\n' "$target" "$candidate_blob" "$actual"
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
64 changes: 64 additions & 0 deletions .github/scripts/test_issue854_evidence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import importlib.util
import json
import unittest
from pathlib import Path

spec = importlib.util.spec_from_file_location("gate", Path(__file__).with_name("issue854-evidence.py"))
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)


def transcript(phase, suite="lifecycle"):
leaves, parents, failures, markers = gate.inventory(suite)
events = []
for name in sorted(leaves | parents):
events.append(dict(Action="run", Test=name, Package=gate.common.PACKAGE))
failed = phase == "RED" and (name in failures or (name in parents and any(n.startswith(name + "/") for n in failures)))
if failed:
events.append(dict(Action="output", Test=name, Package=gate.common.PACKAGE, Output=" ".join(markers)))
events.append(dict(Action="fail" if failed else "pass", Test=name, Package=gate.common.PACKAGE))
events.append(dict(Action="fail" if phase == "RED" else "pass", Package=gate.common.PACKAGE))
return "\n".join(json.dumps(e) for e in events)


class EvidenceTest(unittest.TestCase):
def test_other_suites(self):
for suite in ("persistence", "upstream", "ws-upstream", "r1", "http-empty-image"):
for phase, code in (("RED", 1), ("GREEN", 0)):
raw = transcript(phase, suite)
gate.validate(phase, code, raw, suite)
for pollution in ("build failed", "setup failed", "requires real redis-server in CI", "no tests to run", "panic", "DATA RACE", "--- SKIP: fixture", "crash"):
with self.assertRaises(ValueError):
gate.validate(phase, code, raw + "\n" + pollution, suite)
with self.assertRaises(ValueError):
gate.validate(phase, code, raw.replace('"Action": "run"', '"Action": "skip"', 1), suite)

def test_updated_policy_matrix_green(self):
for suite in ("http-transform", "http-route"):
raw = transcript("GREEN", suite)
gate.validate("GREEN", 0, raw, suite)
for polluted in (raw + "\npanic: fixture", raw + "\n" + raw, ""):
with self.assertRaises(ValueError):
gate.validate("GREEN", 0, polluted, suite)
with self.assertRaises(ValueError):
gate.validate("RED", 1, raw, suite)

def test_valid_and_polluted(self):
for phase, code in (("RED", 1), ("GREEN", 0)):
raw = transcript(phase)
gate.validate(phase, code, raw)
for pollution in ("panic: fixture", "DATA RACE", "build failed", "setup failed", "requires real redis-server in CI", "no tests to run", "--- SKIP: x", "signal: killed", "fatal error", "test timed out", "crash"):
with self.subTest(phase=phase, pollution=pollution), self.assertRaises(ValueError):
gate.validate(phase, code, raw + "\n" + pollution)
with self.assertRaises(ValueError):
gate.validate(phase, code, raw.replace('"Action": "run"', '"Action": "skip"', 1))
with self.assertRaises(ValueError):
gate.validate(phase, code, raw + "\n" + raw)
with self.assertRaises(ValueError):
gate.validate(phase, code, "")
with self.assertRaises(ValueError):
gate.validate("RED", 1, transcript("RED").replace("WS_READABLE_B_DISPATCH_MISSING", "unrelated error"))


if __name__ == "__main__":
unittest.main()
Loading
Loading