Ang9891/dpcf-schema-contracts-pilot
UI Pilot
This folder contains a small local Streamlit app for testing the Sprint 7 schema with a pilot T-shirt dataset.
Purpose
The UI is designed to help reviewers understand:
- how
CIrecords are structured - how
K-MandK-Precords are linked - how a simple product calculation flows through the schema
- where the contract validation checks pass or fail
Contents
app.pyStreamlit application.
requirements.txtMinimal Python dependencies.
data/Pilot CSV files based on the T-shirt example.
Run Locally
From the repository root:
cd ui-pilot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
streamlit run app.pyOptional Access Protection
You can protect the pilot with a shared username and password.
Local option using environment variables:
export PILOT_UI_USERNAME=your_username
export PILOT_UI_PASSWORD=your_password
streamlit run app.pyStreamlit option using secrets:
Create .streamlit/secrets.toml with:
PILOT_UI_USERNAME = "your_username"
PILOT_UI_PASSWORD = "your_password"If no credentials are configured, the app stays open locally for convenience.
Hugging Face Spaces
The pilot is prepared for deployment to Hugging Face Spaces using the Docker SDK.
Relevant files:
Dockerfile.dockerignore.streamlit/secrets.toml.example
Recommended runtime:
- SDK:
Docker - Port:
7860
Secrets to configure in the Space:
PILOT_UI_USERNAMEPILOT_UI_PASSWORD
What The Pilot Shows
- Product-level
CIinputs - Canonical
K-Mmaterial records - Canonical
K-Pprocess and impact records - A simple
quantity x EFcarbon calculation trace - Basic contract and referential-integrity checks
Important Note
This is a pilot validation UI, not a production calculator.
The calculation uses the current T-shirt example and a minimal set of process impact rows to prove that the schema and data contract can be exercised end to end.
