Skip to content

Profiles and Local Data

SergeyGer edited this page Nov 22, 2026 · 2 revisions

Profiles and local data

Profiles

Profile Data Network/credentials Purpose
demo Deterministic synthetic tables (seed 42) None Public demo, CI, screenshots and onboarding
private User-controlled local data directory Local input only for now (refresh planned in Step 3) Owner research against the supplied seed

The profile determines the data source and the data directory; both are visible in the CLI output and in the UI badges ("Synthetic demo" / "Private research", data source label).

Private data policy

  • The private seed archive is supplied by the owner and stored outside the repository.
  • private_data/, .adp-inputs/, local data directories, snapshots and exports are ignored by git; tracked files never contain provider data.
  • Tests in public CI use synthetic fixtures only. The opt-in private acceptance suite reads TOPOMARKET_SEED_DIR and is run manually/documented with its evidence; it skips cleanly when the variable is unset.
  • Do not publish genuine market data, private charts or derived tables without reviewing provider terms (see Security and data notices).

Data directory layout

<data-dir>/
  raw/                    original provider bytes (when imported from a directory)
  normalized/             sp500_daily.csv, industries_daily.csv, tda_daily.csv + schema metadata
  reports/                per-source parser reports
  raw_hashes.json         raw byte registry (filename, source, SHA-256, metadata)
  parser_reports.json     combined parser reports
  import_manifest.json    normalized counts, hashes, snapshot id, schema version
  state/                  active snapshot pointer, refresh validators/status, writer lock
  staging/                transient refresh attempts (cleaned up)
  snapshots/<id>/         immutable published snapshots (normalized tables, reports, manifests)

topomarket refresh (Step 3) publishes complete snapshot directories and atomically switches the active pointer; the previous snapshot remains readable on failure.

The current import writes a deterministic snapshot id and an immutable manifest. Step 3 adds atomic publication across refreshes, revision tracking, last-good-snapshot retention and failure recovery; the same directory contract is kept.

Snapshots and manifests

  • A manifest records: schema version, data source, seed/generator (demo), normalized table row counts, per-file SHA-256, latest_data_date, snapshot id (hash over stable manifest content), and warnings/errors.
  • Identical input bytes and configuration produce identical normalized tables and hashes.
  • Writes use atomic text replacement (write-to-temp + replace) so a reader never sees a partial manifest.
  • The demo manifest marks synthetic: true, private_data: false; it is safe to commit/screenshot.

Streamlit application

streamlit run app.py -- --profile demo
streamlit run app.py -- --profile private --data-dir /path/to/data

The UI shows the profile badge, data-source label, latest observation date or a clean empty state, and navigation placeholders for Overview/Topology/Validation/Data that are filled in by Steps 5-7. The UI reads only local data/config; it never fetches providers directly.

Clone this wiki locally