CoolFace
Apppublic

Ang9891/dpcf-schema-contracts-pilot

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
App README

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 CI records are structured
  • how K-M and K-P records are linked
  • how a simple product calculation flows through the schema
  • where the contract validation checks pass or fail

Contents

  • app.py Streamlit application.
  • requirements.txt Minimal Python dependencies.
  • data/ Pilot CSV files based on the T-shirt example.

Run Locally

From the repository root:

bash
cd ui-pilot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
streamlit run app.py

Optional Access Protection

You can protect the pilot with a shared username and password.

Local option using environment variables:

bash
export PILOT_UI_USERNAME=your_username
export PILOT_UI_PASSWORD=your_password
streamlit run app.py

Streamlit option using secrets:

Create .streamlit/secrets.toml with:

toml
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_USERNAME
  • PILOT_UI_PASSWORD

What The Pilot Shows

  1. 1.Product-level CI inputs
  2. 2.Canonical K-M material records
  3. 3.Canonical K-P process and impact records
  4. 4.A simple quantity x EF carbon calculation trace
  5. 5.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.