fix(web): 保留治理頁 enum 顯示清理
Some checks failed
Code Review / ai-code-review (push) Successful in 14s
CD Pipeline / tests (push) Successful in 1m34s
CD Pipeline / build-and-deploy (push) Successful in 5m17s
CD Pipeline / post-deploy-checks (push) Successful in 1m33s
Ansible / Reboot Recovery Contract / validate (push) Has been cancelled

This commit is contained in:
Your Name
2026-06-19 05:04:45 +08:00
parent 060f36a5c8
commit 06cba2d480
2 changed files with 55 additions and 0 deletions

View File

@@ -227,14 +227,20 @@ const PUBLIC_TEXT_REPLACEMENTS: Array<[RegExp, string]> = [
[/live write count/gi, '正式寫入數'],
[/live write/gi, '正式寫入'],
[/live writer/gi, '正式寫入器'],
[/live worker/gi, '正式 worker'],
[/auto worker/gi, '自動 worker'],
[/live execution/gi, '正式執行'],
[/live Telegram send/gi, 'Telegram 正式發送'],
[/Telegram send/gi, 'Telegram 發送'],
[/Direct Bot API/gi, '直接 Bot API'],
[/direct Bot API/gi, '直接 Bot API'],
[/Bot API call/gi, 'Bot API 呼叫'],
[/Gateway queue write/gi, 'Gateway 佇列寫入'],
[/queue write/gi, '佇列寫入'],
[/receipt write/gi, '回執寫入'],
[/receipt production write/gi, '回執正式寫入'],
[/production write/gi, '正式環境寫入'],
[/verifier live readback/gi, '驗證器正式讀回'],
[/host write/gi, '主機寫入'],
[/secret read/gi, '機密讀取'],
[/kubectl action/gi, 'kubectl 操作'],
@@ -245,6 +251,8 @@ const PUBLIC_TEXT_REPLACEMENTS: Array<[RegExp, string]> = [
[/owner acceptance/gi, '負責人驗收'],
[/owner approval/gi, '負責人批准'],
[/owner review/gi, '負責人審查'],
[/dual approval/gi, '雙重批准'],
[/writer idempotency/gi, '寫入器冪等性'],
[/Owner Queue/gi, '負責人佇列'],
[/owner queue/gi, '負責人佇列'],
[/direct Bot API migration/gi, 'direct Bot API 遷移'],
@@ -298,6 +306,16 @@ const PUBLIC_SNAPSHOT_RAW_KEYS = new Set([
'risk_tier',
'owner_agent',
'canonical_room_env',
'approval_gate',
'automation_level',
'deployment_state',
'telegram_policy',
'permission_lane',
'lane_id',
'mode',
'decision',
'readiness',
'overall_readiness',
])
function shouldPreserveSnapshotValue(key?: string): boolean {
@@ -310,6 +328,15 @@ function shouldPreserveSnapshotValue(key?: string): boolean {
|| key.endsWith('_tier')
|| key.endsWith('_agent')
|| key.endsWith('_env')
|| key.endsWith('_policy')
|| key.endsWith('_policies')
|| key.endsWith('_level')
|| key.endsWith('_levels')
|| key.endsWith('_lane')
|| key.endsWith('_lanes')
|| key.endsWith('_mode')
|| key.endsWith('_decision')
|| key.endsWith('_readiness')
}
function sanitizePublicSnapshot<T>(value: T, key?: string): T {