Skip to content
Open
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Canonical modules:
| semantic boundary | `mathgraph/semantic_validation.py`, `mathgraph/invariants.py` |
| routing memory | `mathgraph/reason_atlas.py`, `mathgraph/reason_atlas_store.py` |
| H-Tilt / scheduling pressure | `mathgraph/spectral_htilt.py`, `mathgraph/reason_atlas_htilt.py`, `mathgraph/viability_operators.py` |
| verification loops | `mathgraph/verification_loop.py`, `mathgraph/compounding_engine.py` |
| verification loops | `mathgraph/verification_loop.py`, `mathgraph/compounding_engine.py`, `mathgraph/autonomous_compounding_engine.py` |
| finite checker | `mathgraph/finite_magma_world.py` |
| SAIR / ETP adapters | `mathgraph/sair_task_loader.py`, `mathgraph/sair_constructor_bank.py` |

Expand Down Expand Up @@ -172,6 +172,47 @@ python scripts/run_mathgraph_compounding_engine.py \

See [docs/compounding_engine.md](docs/compounding_engine.md).

## Autonomous Compounding Engine

The autonomous engine has a compatibility `facade` mode and an explicit
`native_v2` mode. Native v2 is the finite recovery path that builds a
constructor bank, evaluates a SAT cache, repairs residuals, names PQ-IR
obstructions, records advisory Lawbook reuse, and audits the terminal-form
boundary. It remains a finite-core recovery loop, not a TRUE oracle: failed
finite search is residual evidence and every PQ-IR, route, obstruction, and
Lawbook reuse signal is advisory unless a checker/verifier accepts a terminal
artifact.

```bash
python scripts/run_autonomous_compounding_engine.py \
--out-dir /tmp/mathgraph_autonomous_v2_tiny \
--tiny-demo \
--finite-core-mode native_v2 \
--episodes 3 \
--sample-pairs 80 \
--repair-budget 20 \
--max-n 3 \
--seed 20260524 \
--write-report
```

Real ETP/SAIR example:

```bash
python scripts/run_autonomous_compounding_engine.py \
--equations /content/equations.txt \
--matrix /content/etp_matrix_full_best_bool.npy \
--out-dir /content/drive/MyDrive/SAIR_MathGraph/autonomous_v2_real \
--finite-core-mode native_v2 \
--episodes 4 \
--sample-pairs 4000 \
--repair-budget 40 \
--max-n 4 \
--constructor-limit 500 \
--seed 20260524 \
--write-report
```

## TRUE-Side Proof Inventory

The TRUE-side inventory builds bounded congruence traces and Lean-ready
Expand Down
84 changes: 84 additions & 0 deletions docs/autonomous_compounding_engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Autonomous Compounding Engine

The autonomous compounding engine is a repo-native entry point for the serious
ETP finite-recovery path. It has two modes:

- `facade`: the stable compatibility path over the existing finite-core
compounding runner.
- `native_v2`: the repo-native finite recovery, residual repair, and advisory
Lawbook reuse loop.

It wraps `scripts/run_mathgraph_compounding_engine.py` rather than simulating
recovery in `facade` mode. The `native_v2` path uses the finite magma
satisfaction cache directly:

```text
constructor bank -> SAT cache -> generic route -> residual repair
-> PQ-IR obstruction naming -> advisory Lawbook reuse -> compact atlas route
```

## Boundary

- FALSE recovery is counted only when a constructor satisfies the source law and
violates the target law.
- TRUE controls audit contamination.
- Failed finite search is residual evidence, never TRUE.
- PQ-IR, route policies, residual obstructions, and repair family memory are
advisory until a verifier/checker boundary accepts a terminal form.

## Tiny demo

```bash
python scripts/run_autonomous_compounding_engine.py \
--out-dir /tmp/mathgraph_autonomous_demo \
--tiny-demo \
--episodes 2 \
--sample-pairs 80 \
--repair-budget 20
```

Native v2 smoke:

```bash
python scripts/run_autonomous_compounding_engine.py \
--out-dir /tmp/mathgraph_autonomous_v2_tiny \
--tiny-demo \
--finite-core-mode native_v2 \
--episodes 3 \
--sample-pairs 80 \
--repair-budget 20 \
--max-n 3 \
--seed 20260524 \
--write-report
```

## Real ETP / SAIR run

```bash
python scripts/run_autonomous_compounding_engine.py \
--equations /content/equations.txt \
--matrix /content/etp_matrix_full_best_bool.npy \
--out-dir /content/drive/MyDrive/SAIR_MathGraph/Autonomous_Run \
--episodes 4 \
--sample-pairs 4000 \
--repair-budget 40
```

Native v2 real ETP example:

```bash
python scripts/run_autonomous_compounding_engine.py \
--equations /content/equations.txt \
--matrix /content/etp_matrix_full_best_bool.npy \
--out-dir /content/drive/MyDrive/SAIR_MathGraph/autonomous_v2_real \
--finite-core-mode native_v2 \
--episodes 4 \
--sample-pairs 4000 \
--repair-budget 40 \
--max-n 4 \
--constructor-limit 500 \
--seed 20260524 \
--write-report
```

The runner refuses real mode unless the equation and matrix files are supplied.
8 changes: 8 additions & 0 deletions docs/canonical_pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ semantic intake, and model output can guide work but cannot verify claims.
- `mathgraph/verifier_execution.py`: local verifier execution boundary
- `mathgraph/verification_loop.py`: stable loop façade
- `mathgraph/compounding_engine.py`: canonical memory-becomes-capacity runner
- `mathgraph/autonomous_compounding_engine.py`: autonomous finite-core façade and native v2 recovery loop
- `mathgraph/autonomous_finite_recovery.py`: native constructor/SAT-cache recovery adapter
- `mathgraph/kernel.py`: compact kernel acceptance surface

## Canonical Commands
Expand All @@ -62,13 +64,19 @@ python scripts/run_release_check.py --quick
python scripts/run_repo_architecture_audit.py
python scripts/run_mathgraph_compounding_loop.py --allow-fallback-demo --out-dir /tmp/mathgraph_compounding_demo
python scripts/run_mathgraph_compounding_engine.py --out-dir /tmp/mathgraph_compounding_demo --episodes 2 --tiny-demo
python scripts/run_autonomous_compounding_engine.py --out-dir /tmp/mathgraph_autonomous_v2_tiny --tiny-demo --finite-core-mode native_v2 --episodes 3 --sample-pairs 80 --repair-budget 20 --max-n 3 --seed 20260524 --write-report
python scripts/run_true_side_inventory.py --out-dir /tmp/mathgraph_true_inventory_demo --tiny-demo
```

The compounding command is the canonical repo-level loop. Fallback mode proves
the wiring without claiming real SAIR results; real SAIR mode requires explicit
equation and matrix paths.

The autonomous native v2 command is the finite recovery elevation path: it
builds a constructor bank, SAT cache, generic route, residual repair route,
PQ-IR obstruction names, and advisory Lawbook reuse. These objects guide search
only; they cannot promote TRUE or FALSE without checker/verifier evidence.

## Real-Corpus Compounding Benchmark

Recursive residual compounding is the first stronger real-corpus compounding
Expand Down
4 changes: 4 additions & 0 deletions docs/implementation_next_layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,13 @@ Implemented:
- Polarized Quotient-Continuation IR
- Multi-Episode ETP Compounding Engine
- TRUE-Side Proof Inventory
- Autonomous Compounding Engine v2

Still future work:

- scale native v2 autonomous recovery on full real ETP/SAIR splits
- persistent Lawbook admission for native v2 finite countermodel certificates
- compact obstruction-atlas route selection over multiple seeds
- persistent Lawbook admission for accepted finite countermodel certificates generated by compounding runs
- production Reason Atlas entries from compact atlas routes
- TRUE-side Lean proof-route compounding
Expand Down
4 changes: 4 additions & 0 deletions docs/module_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ modules.

- `compounding_lawbook_engine.py`: fallback compounding engine
- `compounding_engine.py`: canonical baseline versus memory compounding loop
- `autonomous_compounding_engine.py`: autonomous finite-core façade plus native v2 finite recovery/residual repair loop
- `autonomous_finite_recovery.py`: constructor bank, SAT-cache recovery, greedy route, and residual repair adapter
- `scripts/run_mathgraph_compounding_engine.py`: multi-episode ETP constructor/residual/Lawbook runner
- `scripts/run_autonomous_compounding_engine.py`: autonomous façade/native v2 CLI
- `scripts/run_true_side_inventory.py`: bounded TRUE-side proof-template inventory runner
- `recursive_residual_compounding.py`: residual-mined constructor memory and compact atlas benchmark
- `scripts/run_polarized_quotient_ir_demo.py`: lightweight PQ-IR feature demo
Expand All @@ -94,6 +97,7 @@ modules.
- `scripts/run_repo_architecture_audit.py`
- `scripts/run_recursive_residual_compounding.py`
- `scripts/run_mathgraph_compounding_engine.py`
- `scripts/run_autonomous_compounding_engine.py`

## Legacy Surface

Expand Down
10 changes: 10 additions & 0 deletions mathgraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2552,4 +2552,14 @@
from mathgraph.proof_congruence import ExplainTrace, ProofCongruenceClosure, ProofStep, explain_bounded_congruence
from mathgraph.true_proof_templates import TrueProofTemplate, build_true_proof_template_inventory, classify_true_pair
from mathgraph.lean_artifacts import generate_false_countermodel_lean_skeleton, generate_true_congruence_lean_skeleton, write_lean_artifacts
from mathgraph.autonomous_finite_recovery import (
FiniteRecoveryConfig,
FiniteRecoveryResult,
build_finite_recovery_core,
evaluate_false_pairs as evaluate_autonomous_false_pairs,
greedy_route as autonomous_greedy_route,
pair_recovery_matrix as autonomous_pair_recovery_matrix,
residual_marginal_repair as autonomous_residual_marginal_repair,
route_metrics as autonomous_route_metrics,
)
from mathgraph.version import __version__, get_version_info
Loading