Skip to content

[defect·P3] currency_meta.alpha_beta_note has zero readers anywhere, and its literal is a hardcoded Traditional-Chinese sentence sitting beside three fields that do reach the card #689

Description

@atomchung

Status

Discussion — mechanism-level finding from PR #685's investigation into #649, listed in the PR body under "Adjacent findings, deliberately not folded in." No real trade data anywhere below; no maintainer decision yet.

Owning outcome

Every field written into engine_card either reaches a card through a named, mechanical consumer, or it does not exist (the rule #416's audit applied and #429 restates for questions). Separately, no user-facing sentence bypasses copy/<locale>.json: a card rendered with --language en never carries a raw Traditional-Chinese literal (#356's rule).

Mechanism

skills/fomo-kernel/engine/trade_recap.py:2862-2866 (against origin/main@e662164):

"alpha_beta_note": (
    f"α/β 已 per-market 分算:頂層數字僅含 {ab.get('scope')} 部位(對 {ab.get('bench')}),"
    f"其他市場見 by_market——不合成總 α"
    if isinstance(ab, dict) and ab.get("scope")
    else ("多幣別組合(單一市場)的 α/β 按該市場大盤計" if mixed_ccy else None)),

This key is written into the currency_meta dict alongside mixed, aggregate_currency, fx, and pnl_by_currency — all four of which card_renderer.py reads (:843, :866, :974 against the same commit). alpha_beta_note is not among them: a grep of the entire origin/main tree — every .py file, tests included — for the literal string alpha_beta_note returns exactly one hit, the write site above. card_renderer.py has a separate, correctly-localized alpha-caveat mechanism (card.get("alpha_beta_breakdown"), _alpha_interval_line, routed through load_copy(language).get("alpha_interval") — the fix shape #313/#314/#272 already established via PR #332); alpha_beta_note is a different field on a different path and is not part of that mechanism.

Two facts compound rather than sitting side by side as independent nitpicks:

  1. Dead field ([design·P1] Two questions collect an answer nothing reads: initial_thesis and exit_consistency (proved by a byte-identical card) #429/[refactor·P2] Written-never-read fields: seven dead and two audit-only — wire a consumer or remove (the verify rule, applied) #416-class): zero consumers today, paying storage and review-plan-payload cost for nothing, the same pattern [refactor·P2] Written-never-read fields: seven dead and two audit-only — wire a consumer or remove (the verify rule, applied) #416's audit removed elsewhere in this codebase. [refactor·P2] Written-never-read fields: seven dead and two audit-only — wire a consumer or remove (the verify rule, applied) #416 is closed, and its own "Limitations" section states trade_recap.py/card_renderer.py were checked only by targeted greps rather than read end-to-end, and evals//mock fixtures were not swept — this field is exactly the kind of miss that leaves open, and neither [refactor·P2] Written-never-read fields: seven dead and two audit-only — wire a consumer or remove (the verify rule, applied) #416's Class A/B tables nor its do-not-reflag list mention currency_meta or alpha_beta_note.
  2. Latent i18n leak (fix(card): pre-commitment preview leaks a hardcoded Chinese rule string into English cards #356-class): the value is an f-string composed entirely in Traditional Chinese with no copy/<locale>.json routing, sitting inside the one dict on engine_card whose other keys are live, English-safe card inputs. fix(card): pre-commitment preview leaks a hardcoded Chinese rule string into English cards #356 fixed the structurally identical shape — a raw zh literal computed in trade_recap.py (state["rule"]), reaching card_renderer.py's pre-commitment branch untranslated on an English card — by routing the value through card_plan/copy instead of leaving it a trade_recap.py literal. Nothing here marks alpha_beta_note as internal-only or different in kind from its three siblings; the next reader wired for currency_meta — mechanical, or an agent reading engine_card JSON directly, which this product's own architecture treats as a legitimate consumer of engine-computed facts — has no signal that this one key was never meant to reach a user.

PR #685 widens how often the field is populated, without creating it: the field's else branch fires whenever mixed_ccy is True, and #685's whole point is that more books now count as mixed (a cash-flow-only currency is now enough to trigger it). The field was already dead and already carrying this literal before #685; #685 puts one more book shape behind the same latent condition, not fewer.

Evidence

Read against origin/main@e662164. Confirmed by a full-tree grep for the literal string alpha_beta_note (one hit: the write site) and by reading card_renderer.py's actual currency_meta consumers directly. No real trade data; this is a static code-mechanism finding, not a data reproduction.

Cross-references

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions