Commitment Conservation Test Harness
This directory contains the test harness for validating the commitment conservation law under compression and recursive application.
Overview
The harness implements a falsification framework that operationalizes commitment invariance using:
- Compression-based stress tests
- Lineage-aware evaluation
- Model-agnostic testing infrastructure
Structure
src/ - Core harness implementation
harness.py- Main test harnesstest_harness.py- Test frameworkextraction.py- Commitment extractionmetrics.py- Evaluation metricssamples.py- Sample data managementplotting.py- Visualization utilitiesconfig.py- Configuration managementdeterministic_pipeline.py- Deterministic testing pipelineadvanced_extractor.py- Advanced extraction methods
tests/ - Unit and integration tests
test_harness.py- Harness teststest_full_harness.py- Full integration tests
Configuration Files
requirements.txt- Python dependenciespyproject.toml- Project configurationenvironment.yml- Conda environment specificationHarnesstest.ini- Harness configuration
Quick Start
# Install dependencies
pip install -r requirements.txt
python -m spacy download en_core_web_sm
# Extract commitments from text
python analyze.py "You must complete this by Friday."
# Run experiments (compression/recursion tests)
python analyze.py run compression --signal "You must complete this by Friday."
python analyze.py run recursion --signal "Contract terms apply." --depth 5
Installation
# Install dependencies
pip install -r requirements.txt
# Download spaCy model
python -m spacy download en_core_web_sm
CLI Usage
Quick test — Extract commitments from text:
python analyze.py "You must complete this by Friday."
python analyze.py "Contract terms apply." --quiet
python analyze.py "You shall deliver by Monday." --json
Experiments — Run compression/recursion tests and generate receipts:
python analyze.py run compression --signal "You must complete this by Friday."
python analyze.py run recursion --signal "You must pay $100." --depth 5
python analyze.py run full
Experimental runs output timestamped JSON receipts to outputs/ directory.
Running Tests
# Run all tests
MPLBACKEND=Agg pytest tests/test_full_harness.py -v
# Quick test run
MPLBACKEND=Agg pytest tests/test_full_harness.py -q
CLI Commands
compression
Tests commitment conservation under compression transformations.
Options:
--signal TEXT- Input signal text (required)--out PATH- Output receipt path (default:outputs/compression_receipt.json)
recursion
Tests commitment drift under recursive transformations.
Options:
--signal TEXT- Input signal text (required)--depth N- Recursion depth (default: 8)--enforced- Enable enforcement mode--out PATH- Output receipt path (default:outputs/recursion_receipt.json)
full
Runs the complete deterministic pipeline.
Options:
--out PATH- Output receipt path (default:outputs/full_receipt.json)
Output
The CLI generates:
- JSON receipts in
outputs/with all experimental data - Compression fidelity plots (
fid_*.png) - Recursion drift plots (
delta_*.png)
Purpose
This harness is designed to test whether commitment content is conserved under:
- Compression - Reduction to essential structure
- Recursion - Repeated self-application with lineage tracking
The framework is model-agnostic and can be applied to both human and machine-generated language.
Environment Notes
This harness specifies the structure and invariants of the evaluation. Exact dependency resolution may vary across systems (OS, Python, backend). Environment-related failures should be distinguished from invariant violations.
Citation
If you use this harness, please cite the original paper:
McHenry, D. J. (2026). A Conservation Law for Commitment in Language Under
Transformative Compression and Recursive Application. Zenodo.
DOI: 10.5281/zenodo.18267279