Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions .github/workflows/nor24-adaptive-audits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: NOR-24 preregistered trained posterior coordinate audit

on:
push:
paths:
- 'research/nor24_adaptive_audits/**'
- '.github/workflows/nor24-adaptive-audits.yml'
pull_request:
paths:
- 'research/nor24_adaptive_audits/**'
- '.github/workflows/nor24-adaptive-audits.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
original-source-locked-first-run-independent-replay:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: SHA-pin and independently replay all original 24 sources and 2,764,800 heldout decisions
run: python research/nor24_adaptive_audits/original_archive_audit.py

exact-controls-and-source-isolation:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Exhaustive finite binomial, sequential scheduling, true-witness and split tests
run: python -m unittest research.nor24_adaptive_audits.test_experiment -v

first-source-locked-training-and-test:
needs: exact-controls-and-source-isolation
runs-on: ubuntu-24.04
timeout-minutes: 40
env:
PYTHONHASHSEED: '0'
OMP_NUM_THREADS: '1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Materialize 24 fresh public-only source identities and disjoint train-test split
run: |
python research/nor24_adaptive_audits/experiment.py \
--make-fixture /tmp/nor24_fixture.json
- name: Freeze public source identities before training attack labels
run: |
python - <<'PY'
import json
from pathlib import Path
from hashlib import sha256
from collections import Counter
raw=Path('/tmp/nor24_fixture.json').read_bytes()
o=json.loads(raw)
assert o['schema']=='nor24.public_source_only_24_disjoint_train_test.v1'
assert o['new_source_offset']==94324000
assert o['public_only'] and o['private_program_and_target_absent']
assert o['heldout_attack_locations_absent']
assert o['train_replicates']==[0,1] and o['test_replicates']==[2,3]
assert len(o['cases'])==24
assert len({x['full_public_input_sha256'] for x in o['cases']})==24
assert Counter(x['split'] for x in o['cases'])=={'TRAIN':12,'TEST':12}
assert all('future' not in x and 'program' not in x and 'attack' not in x for x in o['cases'])
print('NOR24 FROZEN PUBLIC SOURCE SHA256',len(raw),sha256(raw).hexdigest())
PY
- name: Fit only on TRAIN attack families and evaluate frozen posterior versus heldout controls
run: |
python research/nor24_adaptive_audits/experiment.py \
--check-parity --fixture /tmp/nor24_fixture.json \
--out /tmp/nor24_full.json
- name: Independent original-source target and policy replay
run: |
python research/nor24_adaptive_audits/receipt_audit.py --check \
--fixture /tmp/nor24_fixture.json --full /tmp/nor24_full.json
- name: Verify full frozen outcome roster and report PASS or FAIL
run: |
python - <<'PY'
from pathlib import Path
from hashlib import sha256
import json
a=Path('/tmp/nor24_fixture.json').read_bytes()
b=Path('/tmp/nor24_full.json').read_bytes()
z=json.loads(b)
assert z['schema']=='nor24.train_only_sequential_structured_coordinate_audit.v1'
assert z['fixture_sha256']==sha256(a).hexdigest()
assert len(z['source_records'])==12
assert len(z['primary_by_source'])==12
assert all(len(x['observations'])==225 for x in z['source_records'])
assert all(c['detected']+c['missed']==1024 and
c['informed_false_accept']==1024 and
c['informed_detected']==0
for x in z['source_records'] for c in x['observations'])
print('NOR24 ORIGINAL FIXTURE BYTES SHA256',len(a),sha256(a).hexdigest())
print('NOR24 ORIGINAL RESULT BYTES SHA256',len(b),sha256(b).hexdigest())
print('NOR24 REGISTERED PRIMARY PASS',z['registered_primary_pass'])
PY
- uses: actions/upload-artifact@v4
if: always()
with:
name: nor24_original_24_public_sources_and_12_heldout_audits
path: |
/tmp/nor24_fixture.json
/tmp/nor24_full.json
if-no-files-found: warn
retention-days: 90

separate-process-replay:
needs: first-source-locked-training-and-test
runs-on: ubuntu-24.04
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/download-artifact@v4
with:
name: nor24_original_24_public_sources_and_12_heldout_audits
path: /tmp/nor24_original
- name: Independently regenerate all hidden-world and heldout audit decisions
run: |
python research/nor24_adaptive_audits/receipt_audit.py --check \
--fixture /tmp/nor24_original/nor24_fixture.json \
--full /tmp/nor24_original/nor24_full.json
66 changes: 66 additions & 0 deletions research/nor24_adaptive_audits/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# NOR-24: train-only sequential coordinate auditing under structured hidden-future attacks

**Protocol frozen before the new data** in commit 780c822, with complete design at [REGISTRATION.md](REGISTRATION.md). Continues merged NOR-23 and the companion kernel-proved [MathCan NOR-24 PR #113](https://github.com/patrickdugan/MathCan/pull/113).

## What is being tested

NOR-23 proved and experimentally illustrated that an external honest exact-coefficient witness detects a hidden output alteration if a sampled coordinate intersects the changed set. NOR-24 asks whether public source structure and a train-only learned prior improve *where* a limited witness budget is spent. It retains the same exact sixteen-candidate RRC25 grammar and the existing NOR-21 streamed public verifier. The witness still supplies genuinely target-dependent information; all full-target-soundness claims remain scoped to those assumptions.

Four disclosed synthetic attack-location supports are defined entirely from public candidate output and header: the last 96 coefficients, the 96 largest absolute forecast coefficients, the 96 positions from delay+spacing, and all output coordinates as a uniform background. The policy learns the **four mixing weights**, not the attack templates themselves. Its fitted weights from 768 TRAIN labels were: tail 0.38212435, magnitude 0.31865285, lag 0.19818653, uniform 0.10103627.

## First prospective hosted outcome

[Original successful GitHub Actions run #43870686549](https://github.com/MoralityLabAI/Compactification-Theory/actions/runs/43870686549) used **24 genuinely distinct public sources**, split into 12 TRAIN and 12 TEST, at observation degrees 512/1024 with three source families per degree per replicate. Query output lengths were 769 and 1537. All source-only fixtures excluded generating programs, hidden true outputs and target-derived witness values. Every public streamed mask was checked against the original native 16-template interpreter and every in-family full prediction matched native sealed truth.

There were exactly **1,024 challenge ordinals per TEST source and policy**, with k=4,16,64 nested audit budgets; r=1,4,16 altered-coordinate worlds; integer changes +1 and +4294049777; blind supports fixed before the challenge. A separate informed attacker observes the inspection set before changing output coordinates. Five policies are run on matched source/trial worlds: uniform, static learned prior, sequential Bayesian no-hit posterior, shuffled static ranking, and privileged support-informed oracle. The randomized controls share exact audit budgets.

The registered primary comparison was k=16,r=4,δ=1, with fixed family evaluation weights tail .4, magnitude .3, lag .2, uniform .1.

| Policy | Mean weighted detection / source |
| --- | ---: |
| Uniform | 6.145833% |
| Shuffled learned-risk ranking | 6.197103% |
| Static learned-risk ranking | 34.867350% |
| **Sequential posterior** | **34.969889%** |
| Privileged support oracle | 47.443034% |

**PASS:** posterior exceeded uniform on **11/12 TEST sources**, shuffled on **11/12**, and had a **+0.2882405599 absolute** source-mean weighted gain over uniform. Registered thresholds were 9/12 and +0.10. One degree-1024 source produced a negative paired posterior-minus-uniform difference (-0.0121). The **increment over static risk ranking was only +0.001025391**, or about **0.10 percentage points**. The result supports source-risk localization under the specified templates, with little evidence of incremental value from after-check Bayesian updates.

### Required negative controls

At the same k=16,r=4,δ=1, detections by attack family were:

| Attack location | Uniform | Static prior | Posterior | Support oracle |
| --- | ---: | ---: | ---: | ---: |
| Tail window | 5.92% | 51.52% | 52.29% | 52.22% |
| Largest forecast coefficients | 6.38% | 37.83% | 37.13% | 51.76% |
| Delay+spacing window | 6.27% | 13.53% | 13.56% | 52.13% |
| Uniform background | 6.07% | 2.03% | 2.03% | 6.01% |
| **Off-template** | **6.47%** | **0.00%** | **0.00%** | **7.93%** |

The off-template stressor alters only positions outside all three structured regions and is **excluded from the preregistered mixture**. Its zero posterior detection is a concrete assumption-break counterexample. For the informed adversary, all tests under k≤64 permit r≤16 unchecked positions inside each family support, yielding **0% detections** across every policy. Exact witness decisions were invariant to changing δ from 1 to 4,294,049,777.

## Original source-locked evidence

First source-only fixture: **4,300,923 bytes**, SHA-256:

88285e2400566c633d211071ace59784987d6458d743db478321dc90f33ef001

Original complete first-run JSON: **737,700 bytes**, SHA-256:

ed54eabd70637a42c34caf66d04bcadd50f890a1ced46cea0132f8767b476807

The exact byte streams are committed in [results/nor24_original_hosted.zip](results/nor24_original_hosted.zip), with the [frozen receipt](results/nor24_first_frozen_receipt.json). The separate independent replayer reconstructs all 24 original exact programs and hypothetical output masks, all **768** supervised family episodes, and **12,288** heldout 64-query clean-path schedules. It independently checks **2,764,800** paired TEST policy/family/radius/budget decisions using an implementation separate from the new evaluator. All three original CI jobs passed, including the separate-process audit.

The study is **conditional on the synthetic attack template family and the assumed authenticity of an exogenous exact target witness**. The policy's seed is deterministic for evidence replay and does not claim cryptographic unpredictability. Multiple challenge draws and counterfactual worlds share only 12 held-out source identities. A source-level transfer or adversarial guarantee in a real Lean theorem prover is outside these measurements.

The original execution separately recorded aggregate schedule generation cost (approximately 2.1–2.2 seconds per 1024 planned schedules at degree 512 and 3.9–4.0 seconds at degree 1024, including all policy arms). The preregistered separate CPU timing of witness comparisons was **not captured as its own field**. CPU comparisons between audit policies should not be inferred from this original receipt. The correctness and detection criteria were independently replayed and are reported without substituting a performance estimate.

## Reproduction

python -m unittest research.nor24_adaptive_audits.test_experiment -v
python research/nor24_adaptive_audits/experiment.py --make-fixture /tmp/nor24_fixture.json
python research/nor24_adaptive_audits/experiment.py --check-parity --fixture /tmp/nor24_fixture.json --out /tmp/nor24_full.json
python research/nor24_adaptive_audits/receipt_audit.py --check --fixture /tmp/nor24_fixture.json --full /tmp/nor24_full.json

The permanent read-only archive audit also checks both first-run byte hashes and replays the fixed program and decision grid.
33 changes: 33 additions & 0 deletions research/nor24_adaptive_audits/REGISTRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# NOR-24 prospective registration: trained sequential witness auditing

**Frozen on 2026-11-16 before generating any NOR-24 training or held-out sources, attack labels, audit challenge schedules or results.** Continues merged NOR-23 (Compactification-Theory PR #191; MathCan #112).

## Sources and information

- Preserve original exact sixteen-program RRC25 and NOR-21 stream16 full-degree public verifier. 24 distinct source inputs: replicates 0,1 TRAIN and 2,3 TEST; each degree D=512 or 1024 and each of three NOR-21 families. Query OUTPUT length m=3D/2+1 (769 or 1537). Seed: original corpus.SEED + **94324000** + 1000003*rep + 100009*degree_index + 10007*family_index. First source within 100 attempts with unique public header, nonempty accepted mask and unanimous full query prediction. Distinct public hashes across train and test.
- Public fixture contains only two observed D-degree demos, query INPUT, inferred header, original exact acceptance mask, attempt/seed and public digest. There are NO private planted programs, true future outputs, altered coordinates, witness values or test attack labels. Freeze one exact public predicted query OUTPUT before regenerating the true program and native target in a postchoice grader.
- Four predeclared attack supports visible from the frozen candidate output and public header: tail = last 96 coordinates, magnitude = 96 largest abs(candidate coefficient) coordinates with ties at smaller indices, lag = 96 consecutive coordinates starting at header.delay + header.spacing, uniform = all m indices. An off_template stress attacker selects outside the union of the first three supports; exclude it from the primary mixture and require at least 16 eligible positions. The model is explicitly supplied these four templates. It learns mixture weights only, so results are conditional on correct support-template assumptions.

## Registered learning, policies, attacks

- Fit only on 64 labeled synthetic attack episodes per TRAIN source (768 episodes). Each training attack family drawn at weights tail .40, magnitude .30, lag .20, uniform .10, and four distinct attack positions sampled uniformly from that support. Draw using SHA256-derived seeds **202611240071**, public digest and episode number. Add one pseudocount to each of four family counts; fitted priors are frozen before TEST auditing. Family labels are supervised data, never inferred from test targets.
- TEST attacks: kinds tail, magnitude, lag, uniform and off_template; changed coordinate counts r={1,4,16}; integer deltas δ={1,4294049777}. For each TEST source/kind/r, fix the blind set with SHA256 seed **202611240072**, public digest, kind and r, INDEPENDENT of later audit draws. Both magnitudes reuse that set.
- Audit budgets k={4,16,64}, **1024** trial ordinals per TEST source/arm. Each policy draws an ordered 64-coordinate clean-witness-path schedule using SHA256 seed **202611240073**, digest, arm, and ordinal. Budget checks use nested prefixes so source/world/trial comparisons are paired.
- Arms:
1. uniform: independently shuffled range(m).
2. static_prior: rank coordinates by sum_f pi_f * 1{index in support_f}/|support_f|; seeded randomized ties.
3. posterior: sequentially select highest conditional probability of an attack at next index, given all previous authentic audit checks matched. Calibration radius rho=4. For each family f, after t_f matched checks in S_f: likelihood L_f=choose(|S_f|-t_f,rho)/choose(|S_f|,rho); posterior family weight pi_f*L_f normalized; next-index score sum_f posterior_f * rho*1{i in S_f}/(|S_f|-t_f). Select maximum among unchecked, break equal scores using independent seeded tie randomness. The clean-path schedule is extensionally the actual sequential policy until first mismatch; stop at mismatch.
4. shuffled_prior: uniform random permutation of the full static_prior coordinate order, retaining the rank distribution but destroying its localization.
5. oracle_support: privileged upper bound given the true attack family, selecting a seeded random order inside its support. Never give the other arms this family label.
- A separately labeled informed adversary sees each policy's realized k-coordinate schedule and chooses all r changes in unchecked positions of its declared support, which is always feasible since k+r<=80 and |S|>=96. Expected exact detection zero.

## Frozen scoring and control

- On each test source, each kind×radius×arm×k calculate blind detection counts /1024, informed-evasion counts, exact original public mask parity and valid-target acceptance. Reuse both δ values to verify exact magnitude invariance. Report source-level deltas versus uniform, shuffled and static.
- Primary evaluated at k=16,r=4,δ=1: weighted detection over four in-template kinds using weights tail .4, magnitude .3, lag .2, uniform .1. **PASS only if posterior exceeds uniform on >=9/12 held-out sources, exceeds shuffled on >=9/12, and gains >=0.10 absolute in pooled source-weighted mean over uniform.** Failure retained as FAIL with all observations. No predefined advantage requirement for posterior versus static.
- Off-template attacks are a separate stress readout and excluded from the primary weighted mean; do not upgrade passes on k<m sampled coordinates into complete target correctness. Valid target must always pass, and informed attacker must always evade. Differences under δ=1 and δ=4294049777 must be exactly zero.
- Independent raw 24-source identity checks, source-locked candidate freezing, training counts, fitted weights, per-source world records, SHA256 receipt and an auditor importing original RRC25 but NOT the NOR-24 experiment implementation. Run original Python 3.12 Ubuntu CPU CI under 40-minute hard cap with independent replay and preserve first raw bytes. No retroactive change of grid or success threshold.

## Formal companion

MathCan NOR-24: same authentic checked-value transcript implies the same deterministic next query; exact combinatorial number of r-coordinate attacks remaining consistent with a clean audit transcript in a declared support is choose(s-t,r). The abstract proofs do not establish cryptographic trust or external random-seed secrecy.
Loading
Loading