Skip to content

Operations and Troubleshooting

SergeyGer edited this page Nov 23, 2026 · 6 revisions

Operations and troubleshooting

Daily research workflow

# one-time environment
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

# synthetic demo (offline, no credentials)
topomarket demo
streamlit run app.py -- --profile demo

# private research against a local seed directory (owner data, outside the repo)
topomarket import --input-dir /path/to/seed/raw --output-dir /path/to/data
topomarket report --data-dir /path/to/data
topomarket status --data-dir /path/to/data

# refresh fixed provider sources and inspect freshness
topomarket refresh --data-dir /path/to/data
topomarket sources --data-dir /path/to/data
topomarket validate --data-dir /path/to/data

# compute the causal topological anomaly score
topomarket topology --data-dir /path/to/data --out scores.csv

# industry explorer payload (cloud + Mapper)
topomarket industries --data-dir /path/to/data --date 2020-03-16 --out industry.json

# chronological evaluation and warning evidence (optional private ledger)
topomarket evaluate --data-dir /path/to/data --report-out evaluation.json
topomarket evaluate --data-dir /path/to/data --ledger /outside/repo/forecast-ledger.jsonl

# interactive dashboard (optional [ui] extra)
python -m pip install -e ".[ui]"
streamlit run app.py -- --profile private --data-dir /path/to/data

Imports write normalized tables, raw hash registry, parser reports and an immutable manifest. Re-running the same import on identical bytes produces identical normalized tables.

Windows operator UI

The repository also ships the ADP operator console for Windows (see the CodeFoundry project). On TopoMarket specifically, the Streamlit UI runs with:

py -3.12 -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
streamlit run app.py -- --profile demo

Common problems

Symptom Cause / fix
No module named topomarket Activate the venv / install with pip install -e ., or run with PYTHONPATH=src.
status says "no data available" The data directory is empty; run topomarket import (private) or synthetic/demo (synthetic).
validate exits 2 with "invalid manifest" A manifest hash/count was modified; re-run the import/regenerate the demo instead of editing manifests.
Empty industry columns Fixed in Step 2: section detection must read the French value-weighted block. Re-import the seed.
pytest skips private acceptance TOPOMARKET_SEED_DIR is not set; this suite is opt-in and never runs in public CI.
UI shows synthetic badge incorrectly Check the profile argument (--profile demo vs private); the demo profile is always synthetic.
Private data would be committed Stop: private_data/, .adp-inputs/ and local data directories must stay untracked; run git status and keep them out.
CI failed at ruff format --check Run ruff format . and commit the formatted files.
Push to main rejected main is protected: create a branch and a pull request (required checks must pass; squash merge).
Data refresh fails The previous snapshot stays active; inspect state/refresh_status.json or topomarket sources, fix the provider/network and rerun topomarket refresh.

Diagnostic commands

topomarket --version
topomarket info --profile demo
topomarket status --data-dir ./data --json
topomarket report --data-dir ./data --json
pytest -q                                  # public suite
TOPOMARKET_SEED_DIR=/path pytest -q tests/private_acceptance

Logs and manifests live in the local data directory; CI logs and artifacts are on the Actions page.

Refresh recovery

The full runbook is docs/REFRESH.md. Short version: a failed refresh exits 2, leaves state/active_snapshot.json untouched and records the failed source in state/refresh_status.json; rerun when the provider is available. A 304 refresh changes nothing. Never edit snapshots or manifests by hand.

Next steps for operators

  • Step 7 adds the full four-screen dashboard and its keyboard/accessibility behaviour.

Clone this wiki locally