Skip to content

feat(engine+skill): cash 呈現層 — 現金上卡 + 入金判讀 + 無錨點誠實揭露 (refs #171)#175

Merged
atomchung merged 1 commit into
mainfrom
claude/fomokernel-cash-presentation
Jul 12, 2026
Merged

feat(engine+skill): cash 呈現層 — 現金上卡 + 入金判讀 + 無錨點誠實揭露 (refs #171)#175
atomchung merged 1 commit into
mainfrom
claude/fomokernel-cash-presentation

Conversation

@atomchung

Copy link
Copy Markdown
Owner

這個 PR 做什麼

接續 #174 的現金 ingestion 地基層(engine 吃得到現金、算對、存進對帳記憶)——這個 PR 是呈現層,把現金功能對用戶做到「可見、可用」。完成 #174 body「還沒做」清單的全部項目。

⚠️ 這是 stacked PR,base = claude/fomokernel-cash-ingestion#174 的分支),所以下面 diff 只含呈現層增量、不含地基。
合併順序:先合 #174不要 --delete-branch)→ 本 PR retarget 到 main → 再刪 base 分支。

Scope(呈現,非地基)

  • build_card_datacash(TR_JSON 上卡):Claude 讀 balance/weight/source/reliable/recent_net_deposit 寫進敘事
  • build_honesty_ledgercash_reliability key:只在「有可誤導的 weight 但不可信」(reliable=False + weightNone)觸發;weight=None(算不出、不上卡)不空吠。判定進 engine、文案留 Claude(照 [design] 卡片呈現一致性完全依賴執行當下的 self-check 自律,沒有機械式強制 #82 機制,Step 3 gate 的既有第 4 項自動涵蓋,SKILL 主檔零新增 guardrail prose
  • render() Rich 文字卡總覽段:reliable 才報「帳戶現金 $X(佔帳戶 Y%)」+ 本期淨入金;無錨點盲算不上卡
  • SKILL Step 0 收現金餘額錨點 UXTR_CASH JSON,讓 cash_weight 通電,這是功能真正通電的關鍵)+ Step 1 card.cash 欄位說明
  • card-spec 現金與入金判讀段reliable 講帳戶權重 +「這筆入金加深還是解集中度」;無錨點誠實邀請補餘額
  • EVALS B17 + 契約測試(TR_JSON cash key / HL cash_reliability)+ 單元測試(三情境觸發矩陣)

honesty 三路徑(cash_reliability 精確觸發)

情境 reliable weight cash_reliability 卡面行為
有現金錨點 true 0.37 不觸發 報帳戶現金 % + 入金判讀
無錨點・淨買入 false null 不觸發 不冒現金數字(算不出,不空吠)
無錨點・csv_sum 正餘額 false 非 null 觸發 揭露盲算近似 + 邀用戶補餘額

測試 / 核對

  • run_all 十套全綠
  • 全 13 mock persona 產卡核對cash 欄位 + cash_reliability 觸發一致,零 INCONSISTENT(day_trader/insufficient/swing 的 csv_sum「看似 100% 現金」正確觸發揭露,不裸報假值)
  • 錨點路徑 render帳戶現金 \$19,284(佔帳戶 37%)
  • 入金判讀端到端:TR_PREV_END 過濾本期存款 → recent_net_deposit=10000 → 卡面「本期淨入金 $10,000」

事實鏈路(CLAUDE.md 連動)

build_honesty_ledger ↔ SKILL Step 1 card.cash + honesty 列舉 ↔ card-spec 現金與入金判讀段 ↔ EVALS B17 ↔ test_tr_json_contractHL_KEYSTR_JSON_KEYS

refs #171 · 承接 #174(地基層)

🤖 Generated with Claude Code

#174 地基層讓 engine 吃得到現金(load_cash_flows/cash_position/state.cash),
但只進對帳記憶、還沒對用戶「可見可用」。這個 PR 接呈現層(#174 body 的「還沒做」清單):

- build_card_data 加 `cash` 欄(TR_JSON 上卡):Claude 讀 balance/weight/reliable/recent_net_deposit 寫進敘事
- build_honesty_ledger 加 `cash_reliability` key:只在「有可誤導的 weight 但不可信」(reliable=False + weight 非 None)觸發;
  weight=None(算不出、不上卡)不空吠。判定進 engine、文案留 Claude(照 #82 機制,Step 3 gate 無需新增 prose)
- render() Rich 文字卡總覽段:reliable 才報「帳戶現金 $X(佔帳戶 Y%)」+ 本期淨入金;無錨點盲算不上卡
- SKILL Step 0 收現金餘額錨點 UX(TR_CASH JSON,讓 cash_weight 通電)+ Step 1 card.cash 欄位說明
- card-spec 現金與入金判讀段:reliable 講帳戶權重 + 「這筆入金加深還是解集中度」;無錨點誠實邀請補餘額
- EVALS B17 + 契約測試(TR_JSON cash key / HL cash_reliability)+ 單元測試(三情境觸發矩陣)

驗證:run_all 十套全綠;全 13 mock persona 產卡核對 cash 欄位 + cash_reliability 觸發一致(零 INCONSISTENT);
錨點路徑 render 顯示「帳戶現金 $19,284(佔帳戶 37%)」;入金判讀端到端(TR_PREV_END 過濾本期存款)。

呈現層需視覺核對,交棒乾淨 session 完成(#174 交棒理由)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@atomchung atomchung force-pushed the claude/fomokernel-cash-presentation branch from ed52d14 to 7af4d37 Compare July 12, 2026 06:04
@atomchung atomchung changed the base branch from claude/fomokernel-cash-ingestion to main July 12, 2026 06:04
@atomchung atomchung merged commit 162183f into main Jul 12, 2026
3 checks passed
@atomchung atomchung deleted the claude/fomokernel-cash-presentation branch July 12, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant