# IX-40 · Recovered logic, reconciled

Delivered 2026-10-06 for the bounded XOR core. **Creator and inventor: Lars Rocha.** His Schur/Lars design and historical source credit are preserved. The Spindexin implementation and verification work use AI assistance on his behalf.

The located Schur Logic and Lars Logic copies are the references Lars approved for this wave. Their original files remain unchanged. Fourteen selected source, package-metadata and notice files are pinned in a separate review snapshot; the existing Indexin/Foundry snapshot is unchanged. See the [snapshot manifest](vendor/recovered-logic-manifest.json), [executed audit record](vendor/logic-audit-2026-10-06.json), [original planning survey](library-survey.md) and [complete roadmap](vendor/TASKS.md).

## What is delivered

`spindexin/constraints.py` and the paired [JavaScript module](vendor/constraints.js) provide validation, flat elimination, two-phase elimination, immutable prepared systems and binary probes. Python uses only the standard library; JavaScript uses BigInt and has no runtime dependencies. This is a new bounded implementation of the reviewed XOR algorithm. It does not import the historical circuit, Sudoku, general-SAT or dispatch interfaces.

The public document format is `indexin-constraints`, version 1. Its limits are 1–64 variables, at most 256 input rows and at most 128 variable occurrences per row. A probe has one reserved additional row. Blocks are disjoint lists that cover all variable indices; they may be noncontiguous. Omitted blocks use exact connected components, retaining the caller's variable numbering. These fixed caps bound work and allocations; no measured speedup is claimed.

## Audit findings and corrections

| Case | Recovered sources | Reconciled core |
| --- | --- | --- |
| Later pivots modify an earlier pivot row | Schur and Lars read an old row value and can report a wrong forced bit. | Pivot indices are retained; extraction and back-substitution read final reduced rows. |
| Phase-one pivot count | Schur reports -1 on the six-variable regression. | Count is the actual local pivot count; both phase counts are nonnegative and sum to coefficient rank. |
| `x1 XOR x1` | Both builders set a bit twice using OR, retaining x1. | Repeated occurrences cancel by parity. |
| Interleaved components `{0,2,4,6}` and `{1,3,5,7}` | Both detect artificial contiguous bounds without applying their proposed reordering. | Explicit component membership and block ownership use original indices. |
| Probing a system with `0 = 1` | Both baseline solves find the contradiction, but both probe branches can lose it. | Local and residual contradictions survive every probe. No assignment or forced-value claim is returned for an inconsistent system. |
| Caller mutates inputs after preparation | Mutable system/cache interaction needs care in the recovered API. | A validated immutable snapshot isolates preparation from later caller edits. Returned results are fresh copies. |

The historical six-variable example is:

```text
x1 XOR x3 = 1
x2 XOR x3 = 0
x2        = 1
blocks: {0,1,2}, {3,4,5}
```

Both recovered packages report x1=1. Independent enumeration of all 64 assignments finds eight solutions, all requiring x1=0, x2=1, x3=1. The new core returns those values, rank 3, one local pivot and two cross-block pivots. It gives one satisfying assignment and the exact solution count as decimal text.

## Verification and interpretation

The six Python test methods cover **1,149 systems in three block layouts**: every subset of augmented equation rows for one and two variables, every subset of at most three rows for three variables, and 180 seeded systems with four through eight variables. Each solve and both branches of every variable probe are compared with independent assignment enumeration. Coefficient rank is independently checked from the homogeneous system. Tests also cover four historical pivot examples, contradictions, repeated variables, caller mutation, invalid inputs, maximum sizes and snapshot hashes.

Cross-language checks compare **1,152 documents**, their normalized input, components, blocks, flat/two-phase results and every probe, including 64-variable boundaries. The standalone JavaScript regression checks additional input rejection and mutation cases. These are finite tests, not a proof over every allowed input.

At IX-40 delivery, integration validation found all 106 Python test methods pass, as do the existing studios JavaScript regression and the packaged-site check across all 29 navigation pages. That delivery reported 40 delivered and 38 planned milestones. All 14 newly pinned source hashes and the 11 existing Indexin/Foundry hashes verify. The upload bundle contains 139 assets with 1,571 local references checked; publication remains manual.

`free` means nonpivot parameters in a chosen reduced basis, not every variable that can change across solutions. `forced` contains values shared by every solution only when the system is consistent. The solution count is `2^(variables−rank)` for a consistent system and zero otherwise. Contradictory systems may produce reduced rows with different right-hand sides under different elimination orders; their empty solution set and coefficient rank agree. Row-lineage contradiction certificates remain IX-43 work.

## Source availability and import boundary

| Source class | Present examples | Current disposition |
| --- | --- | --- |
| Historical sources selected for reconciliation | Schur/Lars `systems.py` and solver files; paired plain logic; cards and fix notes | Fourteen source/notice/metadata files pinned. Only the explicitly bounded XOR core is implemented and checked here. |
| Paired engine candidates | lanterns, indexed generators, clocks, txs, edgecert, fast30, primes, folds, meshz, skylight, fluidz, cascade | Identified and hashed in the planning inventory. Each later milestone still needs its own import/fixture/domain review. |
| Recovered Python-only candidates | square_frame, ntpar_joint, Lars SIRO and other annex helpers | Available reference material; no blanket browser-port or correctness claim. |
| Missing original modules | squaretheory, prefixlab and originals listed by the annex | A surviving card or newer engine does not restore the missing original. Recovery or independent reconstruction remains explicit. |
| New experiments | Floating-depth studio, sonification and connected expeditions | Planned adapters and experiments, not discovered engines. |

The original [planning file inventory](vendor/library-survey-2026-10-06.json) records 150 candidate paths, 139 present at that inspection. Historical source test totals remain historical. The new audit does not certify other libraries or mark IX-41–78 complete.

The selected sitoolz license, licensing notes and credits, and the historical packages' license declarations, are preserved verbatim in the local snapshot. They include distinct LREL and AGPL declarations; this audit does not silently replace or reconcile those declarations. The original library notices remain the source record.

## Use and reproduce

```python
from spindexin.constraints import prepare

system = {
    'format': 'indexin-constraints', 'version': 1, 'variables': 6,
    'rows': [
        {'variables': [1, 3], 'rhs': 1},
        {'variables': [2, 3], 'rhs': 0},
        {'variables': [2], 'rhs': 1},
    ],
    'blocks': [[0, 1, 2], [3, 4, 5]],
}
prepared = prepare(system)
print(prepared.solve()['forced'])
print(prepared.solve('flat')['rank'])
zero, one = prepared.probe(0)
```

Node uses `require('./js/constraints.cjs').prepare(system)` with the same document and result fields. In a browser the module exposes `IndexinConstraints`. A probe reuses only the immutable local/residual snapshot; it does not modify the baseline or accumulate assumptions. Multi-assumption interaction and its user interface belong to IX-42.

```sh
python3 -m unittest discover -s tests -p test_constraints.py -v
node tests/constraints.cjs
python3 tools/audit-recovered-logic.py
```

Optional historical reproduction: `python tools/audit-recovered-logic.py --reproduce`, using an environment with NumPy because the unmodified historical modules import it. The new solver and default hash audit do not require NumPy. The audit writes no source files or bytecode caches.

[IX-41 Schur Studio](schur.html) now makes this checked core visible through local blocks, residual elimination and back-substitution. This audit preserves the IX-40 delivery record; current milestone counts are on Roadmap.
