Skip to content

fix(console): remove machine-value text leaks from reachable UI (M01-M07, P01-P07) - #1024

Merged
Pigbibi merged 5 commits into
feat/cockpit-frontend-redesignfrom
fix/fe-leak-cleanup
Nov 1, 2026
Merged

Pigbibi merged 5 commits into
feat/cockpit-frontend-redesignfrom
fix/fe-leak-cleanup

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Fourteen display leaks (M01–M07 inherited, P01–P07 cockpit) rendered raw source IDs, execution modes, enrollment enums, dotted i18n keys, control/operation/pause/restriction reasons, audit action/outcome/subject kinds and policy keys/sources/units as visible machine text (or in title attributes).

Resulting behaviour

  • translate gains an optional explicit fallbackKey and resolves: key → fallback → namespace fallback → common.unknown, via own-property lookups only. A missing key can never return the key itself.
  • All 14 sites now render only vetted zh/en copy for known machine values, with localized safe fallbacks for unknown ones (未知操作, 其他参数, 执行模式未知, 结果未知, 其他对象, 来源未知, 市场状态影响未知, 操作结果待确认, 当前不支持该操作, …). Raw codes survive only in non-visual data-* diagnostics; free-form reasons are fully suppressed (never in DOM, title or aria-label).
  • Frontend AuditEvent.subject becomes { kind, id } (adapter splits legacy "kind: id" strings; no wire/schema change); revision copy is 记录修订 {value} / Record revision {value}; 45 percent renders 45%, unknown units are omitted.
  • Display-only: trading, approval, runtime-control semantics, request payloads and enums in POST bodies are unchanged. Business identifiers (account keys, symbols, currencies, timestamps, numeric limits, ids) stay verbatim under localized labels.

Checks actually run (on feat/cockpit-frontend-redesign head + this branch, npm ci)

  • tsc --noEmit: pass · npm run build (tsc + vite + size budget): pass
  • npm run test:operations (incl. extended console_cockpit_decision_validation.mjs and new console_frontend_i18n_validation.mjs, registered in the chain): pass
  • node --experimental-strip-types ../../../tests/initial_enrollment_ui_validation.mjs (extended for M02–M04/M07): PASS
  • console_v2_i18n_validation.mjs: PASS (1416 locale entries, zh/en parity) · console_display_gaps_validation.mjs: PASS
  • No browser/production verification: SSR/build evidence only; no deployment.

Implemented from the audit plan in inputs/plan.md. Note: the plan's #1019 head (ef4e0d3) has diverged from this base; the readback validation it references exists only there, so P01/P02 coverage was folded into the new i18n validation file.

AI assistance

Qwen via the Qoder CLI performed the implementation assistance for this branch; the audit/repair plan behind it was drafted with Kimi.

What changed

Frontend display-leak cleanup on this branch, including commits c0fb1178 and 812f5679: localized unknown audit change-log outcomes and tier labels through i18n (unknown values now render safe zh/en fallbacks instead of raw machine text), and regenerated v2_asset_map.js from the current build. See "Resulting behaviour" above for the full scope.

How verified

All checks below ran to completion on this branch (no check was skipped or unrunnable):

  • npm run build: pass
  • npm run sync:v2-assets: pass (regenerated v2_asset_map.js matches the committed output)
  • console_frontend_i18n_validation.mjs: pass (registered in and exercised by the operations chain)
  • npm run test:operations: pass
    Additional evidence for the earlier leak cleanup is listed under "Checks actually run" above.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant