Files
xiaobaifupan/docs/governance/stage-01-baseline.md
T

2.2 KiB

Stage 01: Governance Baseline

Date: 2026-07-29

Baseline commit: 0030bb8cc18c5aa7107dd8fd866355a6507bd6da

Purpose

This baseline freezes observable behavior before architecture governance begins. Later stages may move code and introduce internal contracts, but must not change API behavior, account boundaries, persisted user data, desktop presentation, or existing workflows unless a change is approved separately.

Deployment Contract

  • One Python process serves the API and static browser client.
  • One SQLite database is persisted at data/review.db.
  • Docker exposes 0.0.0.0:8765 and mounts only ./data at /app/data.
  • Public market data is shared; private records are scoped by user_id.
  • Market-data and LLM credentials remain server-side.

Verified Baseline

  • Python: 169 tests passed.
  • Playwright: 45 tests passed at desktop and mobile viewports.
  • JavaScript entry points pass node --check.
  • git diff --check reports no patch errors.
  • SQLite PRAGMA integrity_check returns ok.
  • The database was backed up with the SQLite backup API to data/backups/governance-stage-01-0030bb8.db and the backup independently passed PRAGMA integrity_check. The backup is intentionally excluded from Git.

Repeatable Verification

Run the fast baseline on every structural change:

python tools/verify_baseline.py

Run the browser suite at phase boundaries:

python tools/verify_baseline.py --e2e

Regression Gates

  1. API routes and response fields remain compatible until a versioned contract says otherwise.
  2. Existing SQLite files must upgrade without deleting or reassigning user-owned rows.
  3. A failed external data request must not synthesize market prices.
  4. Ordinary, member, and administrator permissions must remain distinct.
  5. Desktop visual refactors require 1080P and 4K comparison in both themes.
  6. Mobile work is isolated from the approved desktop shell and workflows.
  7. Old code is deleted only after its replacement is active and reference scans are clean.

Rollback

Code can return to this point with Git commit 0030bb8. Database rollback must use the matching backup above; a code rollback alone is not sufficient after a schema migration.