This is not a model. It's a pre-action auditing pipeline. It works. Run it in 30 seconds.
What this system is
This repository implements a deterministic 4-phase decision observability pipeline for auditing how decisions are formed, validated, and constrained before execution.
It runs scenario rows from a CSV through rule-based phases and writes per-phase artifacts for inspection and evaluation.
This system functions as a pre-action auditing layer, exposing how decisions are formed, validated, and constrained before execution.
The system is designed to be directly testable via scenario packs, allowing failure modes to be observed and analyzed across phases.
What happens when you run this
Each input scenario is forced through a decision pipeline before action:
- A decision posture is selected (PROCEED / PAUSE / ESCALATE)
- That decision is structurally validated (Phase 2 gate)
- Constraints are enforced (Phase 3)
- Behavior is recorded and analyzed over time (Phase 4)
The system exposes:
- where unsafe decisions originate
- whether they are caught downstream
- and how behavior changes across repeated runs
Important scope note
- This is not a model.
- This project does not claim to solve alignment.
Phases (high level)
- Phase 1 (
phase1_rebuild.py): posture + rationale (PROCEED/PAUSE/ESCALATE) - Phase 2 (
phase2_gate.py): validates Phase 1 record integrity and enforces structural gating rules - Phase 3 (
phase3_gate.py): constraint evaluation (ETHICAL_PASS/ETHICAL_FAIL_CONSTRAINT_VIOLATION/ETHICAL_AMBIGUITY_HUMAN_REVIEW_REQUIRED) - Phase 4 (
run_full_pipeline.py): append-only history and cross-run behavioral analysis (drift, consistency, failure concentration)
Repository structure
Key files at repo root:
run_full_pipeline.py— pipeline runnerphase1_rebuild.py— Phase 1 posture + rationale generatorphase2_gate.py— Phase 2 validator/gatephase3_gate.py— Phase 3 constraintssafety_net_evaluator.py— post-run evaluator (optional)
Scenario inputs:
scenarios/— scenario packs (*.csv)
Requirements
- Python 3.11+ (required for
datetime.UTC) - No external dependencies (stdlib only)
- Run from a terminal/command prompt in the repo root directory
Quick Start
Run from the repo root (the directory containing run_full_pipeline.py).
python run_full_pipeline.py scenarios/phase3_tests_v2.csv
Expected Output
Each pipeline run creates a new timestamped folder:
pipeline_outputs/full_pipeline_<timestamp>/phase1_records/<scenario_id>.jsonphase2_results/<scenario_id>_phase2.jsonphase3_results/<scenario_id>_phase3.jsonsummary.txt
Phase 4 files are also written/refreshed:
phase4_history/phase4_history.jsonl(append-only across runs)phase4_outputs/phase4_summary_<timestamp>.jsonphase4_outputs/phase4_summary_<timestamp>.txt
How to interpret results
This system is designed to expose how decisions behave under layered constraints.
When reviewing outputs, focus on:
-
Posture selection (Phase 1)
Does the system choosePROCEEDin cases where uncertainty, harm, or irreversibility suggest escalation? -
Validation behavior (Phase 2)
Are structurally invalid or inconsistent decisions rejected? -
Constraint enforcement (Phase 3)
Are unsafe or ethically invalid scenarios correctly classified as violations? -
Cross-run behavior (Phase 4)
Do repeated runs show consistent patterns, drift, or concentration of failures?
The goal is not to match expected labels, but to observe whether unsafe decisions are consistently blocked or surfaced across phases. Unlike output-only evaluation, this pipeline exposes intermediate decision structure (posture, validation, constraint interaction), allowing failures to be traced to their origin rather than only observed at the final outcome.
Common Failure Signals
-
FileNotFoundError (scenario path / wrong working directory)
Make sure you run from the repo root and the CSV path exists. Example known-good command:python run_full_pipeline.py scenarios/phase3_tests_v2.csv -
Python not found / wrong Python version
Ensurepythonpoints to Python 3.11+. If needed, trypy -3.11(Windows launcher) or checkpython --version.
Example (simplified)
Input scenario:
- High uncertainty
- Potential harm present
- Irreversible action
Observed behavior:
- Phase 1: ESCALATE
- Phase 2: VALID (structure accepted)
- Phase 3: ETHICAL_FAIL_CONSTRAINT_VIOLATION
- Phase 4: Logged for drift analysis
This allows failures to be traced to their origin rather than only observed at output.
Testing layers
The repository has two distinct testing layers. They use different runners, different input contracts, and verify different things. See scenarios/README.md for the full explanation and per-pack classification.
-
Full-pipeline canonical testing — runner:
run_full_pipeline.py. Routes a pack through Phase 1 → Phase 2 → Phase 3 → final execution gate → Phase 4. Each row is projected into the canonical 10-field record (scenario_id,proposed_action,uncertainty,potential_harm,irreversibility,time_pressure,posture,rationale,context_tag,use_domain). Verifies posture selection, Phase 2 gating, final disposition, and cross-run Phase 4 signals. Does not carry atomic/consent fields or honordrop_fields. -
Phase 3 semantic testing — runner:
run_phase3_pack.py. Invokesphase3_gate.evaluate_phase3()directly on each row. Preserves atomic/consent fields (affected_groups,distribution_of_impact,benefit_distribution,population_vulnerability_flag,consent_status,consent_scope,participation_type,participation_information_quality), honors thedrop_fieldscolumn, and does not rewriteposture/rationale/context_tag. Verifies per-constraint semantics includingEC-METAclassification of missing core metadata and theKeyErrorguards on EC-02 / EC-05 / EC-07 / EC-08 / EC-11 / EC-12. Does not exercise Phase 1, Phase 2, the final execution gate, or Phase 4.
Pack-to-layer mapping is listed in scenarios/README.md. Packs that depend on atomic/consent fields or drop_fields (currently phase3_ambiguity_and_hardening_v1.csv) are Phase 3-only and are not valid inputs for run_full_pipeline.py under the current canonical projection.
Current status and limitations
- Rule-based and deterministic by design.
- If scenario fields are mislabeled as low-risk, Phase 1 may still produce
PROCEEDunless downstream constraints catch it. - Phase 4 history is append-only; repeated runs accumulate in
phase4_history/phase4_history.jsonl.























