# MVP Dashboard workflow regressions: FX, Cash, Valuation, Command Center

Use this when polishing the FinanceManager Streamlit MVP after provider integration/manual-position work.

## Behaviors to lock with tests

- Manual Equity/ETF position entry in a foreign currency should first use a locally cached historical FX rate for the trade date. Only require manual override/missing-FX status when no cached/fixed rate exists.
- CHF transactions should preserve the existing `fx_status='ok'`/`fx_source='CHF base currency'` convention unless a broader migration changes existing tests.
- User Mode `Position hinzufügen` must support Cash as a real audited workflow, not a placeholder. Positive amounts increase cash, negative amounts reduce it; require a note/confirmation path because `apply_manual_cash_correction` rejects empty notes.
- Equity/ETF page needs a real explicit-click `Bewertung aktualisieren` action that calls the market-price refresh only on click. Normal render remains local/read-only.
- Command Center `Preise aktualisieren` should refresh both Crypto local prices and Equity/ETF market prices, again only on explicit click.
- Crypto/Coin detail should expose user-meaningful cached-price metadata (`preisquelle`, `cache_status`, last update) while keeping raw IDs such as `asset_id`/`coingecko_id` out of User Mode detail dictionaries.

## Testing pattern

- Extend the lightweight `FakeStreamlit` test helper to accept keyed inputs/checkboxes, not just button presses. This lets tests drive wizard branches without a real Streamlit runtime.
- Add targeted regression tests for each explicit-click workflow: cached FX use, Cash wizard write/audit, Equity valuation refresh, Command Center combined refresh, and Crypto cache-detail exposure.
- Verify RED before implementation: expected failures include missing cached-FX lookup, Cash still being placeholder-only, missing `equity_price_provider_by_name` import in dashboard modules, and missing `preisquelle` in coin detail.
- Use mock providers such as `MockEquityPriceProvider`; do not call real market APIs in dashboard tests.

## Runtime cleanup pattern

When cleanup finds old dry-run/review artifacts under `~/jarvis_runtime/finance-system`, do not simply delete them. Archive first under:

`~/jarvis_runtime/finance-system/cleanup_archive/<UTC timestamp>/...`

Write a `cleanup_manifest.json` containing source, destination, type, size, and SHA256 for every archived file. Then remove the original and verify both: original path absent, manifest present. Report only paths and checksums/status, not financial row contents.

## Push pattern for this repo

If `git push` over HTTPS cannot prompt for credentials, use the FinanceManager token CSV via a temporary askpass script, then delete the script. Never print the token. Verify remote sync with authenticated `git ls-remote` comparing local and remote short SHA.
