Files
xiaobaifupan/docs/governance/stage-06-data-gateway.md
T

1.2 KiB

Stage 06: Unified Data Gateway

Date: 2026-07-29

Result

  • Added canonical provider and dataset contracts under backend/data.
  • Added DataSourcePolicy, loaded from the Stage 04 data registry.
  • Added provider adapters for Tushare and iFinD.
  • Added one DataGateway that owns Tushare creation, the shared iFinD client, chart routing, and isolated Eastmoney/Tencent realtime observation.
  • Replaced all real DashboardService Tushare construction paths with the gateway.
  • Kept one compatibility constructor for unit tests that instantiate an incomplete service with __new__; production instances never use it.
  • The Tushare token is supplied lazily, so administrator credential changes do not leave a stale client in memory.

Enforcement Introduced

  • Unregistered datasets fail.
  • Blocked datasets fail.
  • Public-web providers cannot be promoted to calculation inputs through a fallback call.
  • Display chart fallbacks remain distinct from deterministic calculation datasets.

Deferred to Stage 07

Stage 06 centralizes provider access but does not yet attach freshness, coverage, unit, and point-in-time quality evidence to every returned observation. Stage 07 introduces those gates without changing provider routing again.