Architecture

Runtime topology, evidence flow, trust boundaries, persistence, and deployment design.

Status
Source verified
Baseline
662c254
Primary source
src/changeproof

System overview

contextIsKey investigates proposed data-contract changes before execution. It turns an SRS or incident brief into bounded DataHub context, a deterministic impact assessment, hidden SQL-consumer findings, reviewable remediation artifacts, and approval-gated catalog proposals.

Incident inputPasted requirements or extracted PDF, DOCX, text, Markdown, SQL, and CSV content
Context graphDataHub schema and lineage through MCP, with optional entity, search, and query-history context
Impact engineDeterministic classification, blast radius, SQL module discovery, regions, and remediation planning
Review boundaryDownloadable artifacts and server-rebuilt DataHub proposals that require explicit approval

Runtime topology

RuntimeResponsibilitiesPrimary implementation
FastAPI web appServe seven product workspaces, accept incident input, sign analysis state, and expose exportsapp.py
Triage pipelineExtract documents, parse rules, map requirements to assets, and compose chronological investigationstriage.py, document_ingest.py
DataHub MCP adapterRequire schema and lineage tools, bound lineage to three hops, and read optional entity and query contextmcp_client.py, live.py
Impact and planningScore evidence completeness, discover SQL consumers, group regional exposure, and produce rollout plansimpact.py, sql_impact.py, planner.py
Evidence outputsBuild deterministic SQL, JSON, SARIF, validation, rollback, text, and PDF artifactsartifacts.py, exports.py, gate.py
Write-back boundaryRebuild approved proposals server-side and apply simulated or explicitly enabled GraphQL writeswriteback.py

Investigation flow

  1. ExtractRead requirements from pasted text or a supported uploaded document; discard the original binary after extraction.
  2. MapConvert rules into explicit mapped or unmapped results instead of inventing missing assets.
  3. RetrieveRead schema and downstream lineage through the official DataHub MCP contract when live mode is enabled.
  4. AssessCombine catalog evidence with static SQL-module discovery and regional metadata.
  5. PlanProduce dependency-ordered remediation, validation, rollback, and manual-review decisions.
  6. ApproveApply only selected proposal IDs after the server reconstructs their catalog content.

Design invariant

Generated SQL is review material. contextIsKey never executes database SQL automatically.

Authority and evidence model

ConcernControlFailure behavior
Evidence modeBundled synthetic mode and live DataHub MCP mode are labeled separatelyNo silent fallback presented as live evidence
Missing contextUnmapped rules, incomplete lineage, missing owners, and absent regions remain visibleLower confidence or require review
AI interpretationRuns only after an explicit user action and cannot replace deterministic evidenceReturn the grounded deterministic result
Write-back contentBrowser submits proposal IDs; the server rebuilds catalog content from signed analysis valuesReject invalid state or ignore unknown IDs
Real DataHub writesRequire DataHub mode, an enabled flag, reachability, and selected proposalsReturn an error stating that nothing was written

State and persistence

The hosted application is request-oriented. Analysis state is recomputed from signed change values rather than trusted from browser content. Uploaded document bytes are not persisted by the application after text extraction. The bundled scenario and generated artifacts are deterministic; DataHub remains the system of record for approved catalog changes.

Data classLocationContinuity
Bundled evidencePython fixtures and static scenario dataVersioned with the repository
Uploaded documentRequest memory during extractionOriginal binary discarded
Analysis stateRecomputed from HMAC-signed valuesBound to the running application key
Generated artifactsBuilt from the current analysis responseDownloaded by the user when needed
Approved metadataDataHub through GraphQL in explicitly enabled live modePersisted by DataHub

Build and delivery

The Python 3.12 application is packaged with setuptools, tested with pytest, linted with Ruff, and served by Uvicorn. Railway uses Nixpacks, starts changeproof.app:app, and requires /healthz before considering the service healthy.

  1. InstallResolve the locked Python environment and package templates, styles, and scenario fixtures.
  2. VerifyRun unit and integration tests plus Ruff before release.
  3. ServeStart the FastAPI application through Uvicorn on the assigned port.
  4. AcceptCheck the health route and exact user workflows; HTTP availability alone is not outcome proof.

Current boundaries

  • The public Railway demo uses deterministic synthetic DataHub-shaped context, not a live cloud catalog.
  • The opt-in live path requires get_lineage and list_schema_fields from the official DataHub MCP server.
  • Static SQL discovery can miss runtime dynamic SQL, external tools, and assets absent from metadata.
  • AI explanations are advisory and cannot alter deterministic scores, evidence, or execution state.
  • Generated fixes, rollout steps, and gate results remain review material until a human verifies and applies them.