diff --git a/.github/workflows/eval-revision-reference.yml b/.github/workflows/eval-revision-reference.yml new file mode 100644 index 00000000..cd224b9e --- /dev/null +++ b/.github/workflows/eval-revision-reference.yml @@ -0,0 +1,22 @@ +name: EVAL-REV-01 independent source-only reference +on: + push: + paths: + - 'research/delayed_revision_reference/**' + - '.github/workflows/eval-revision-reference.yml' + pull_request: + paths: + - 'research/delayed_revision_reference/**' + - '.github/workflows/eval-revision-reference.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + exact: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: python -m unittest discover -s research/delayed_revision_reference -p 'test_*.py' -v diff --git a/research/delayed_revision_reference/README.md b/research/delayed_revision_reference/README.md new file mode 100644 index 00000000..75df14b2 --- /dev/null +++ b/research/delayed_revision_reference/README.md @@ -0,0 +1,39 @@ +# EVAL-REV-01: evaluating revision-aware recurrent representations + +**Source-only mathematical crosswalk, 18 November 2026.** Upstream [Beyond Bayes BB-CQ-05 PR #24](https://github.com/patrickdugan/beyond-bayes/pull/24), frozen `main` merge `abc89f73d223f00305eb0416a34fe5aee602494d`. Exact model: 12 known-label reports, 3 regime priors (9/20,7/20,1/5), match probabilities (19/20,13/20,3/20), delayed public correction schedule. The independent [oracle](bridge.py) and [tests](test_bridge.py) re-enumerate raw histories on smaller domains; they do not import upstream scorers. + +## Evidence claim to audit + +The current marginal posterior can be sufficient to predict a hidden regime **before** a correction schedule becomes visible while failing to preserve the information needed to update after the schedule arrives. For any 1≤j=59 independent calibration units under the published conditions and provides a per-root tolerance statement. A mean-effect gate requires a mean-matched sham estimator. **Zero external/new protected roots opened** by this crosswalk. + +## Independent oracle scope + +`python -m unittest discover -s research/delayed_revision_reference -p 'test_*.py' -v` checks the conditional posterior through raw bit-vector and named-schedule enumeration for small n, exact Brier variance decomposition and memory accounting. A named-slot collision and a negative full-input-versus-reduced expected excess check enforce the comparator's information contract. It does not claim a second full n=12 enumeration or a new Lean proof. [BB-CQ-05's archived receipt](https://github.com/patrickdugan/beyond-bayes/blob/main/results/bb_cq05_exact_v1.json) remains the canonical larger-domain source with source-hashed reproduction. + diff --git a/research/delayed_revision_reference/bridge.py b/research/delayed_revision_reference/bridge.py new file mode 100644 index 00000000..48a58341 --- /dev/null +++ b/research/delayed_revision_reference/bridge.py @@ -0,0 +1,129 @@ +"""Independent small-world Bayesian oracle for delayed evidence revisions. + +No imports from Beyond Bayes. This is a finite reference for audit and +experimental design, not an authenticated evidence collector or a neural +mechanism test. A provisional report at a corrected slot is fair noise. +""" +from __future__ import annotations + +from fractions import Fraction as Q +from itertools import product +from math import comb + +PRIORS = (Q(9,20), Q(7,20), Q(1,5)) +MATCH = (Q(19,20), Q(13,20), Q(3,20)) + + +def binom(n: int, k: int, p: Q) -> Q: + if not 0 <= k <= n: + return Q(0) + return Q(comb(n,k))*p**k*(1-p)**(n-k) + + +def norm(weights): + z = sum(weights,Q(0)) + if not z: + raise ValueError("impossible observation") + return tuple(w/z for w in weights) + + +def analytic(n: int, slots: tuple[int,...], old_m: int, + new: tuple[int,...], revealed_old: tuple[int,...]): + """Pr(K | S, old_count, new, old prefix from slots), exact rational.""" + j=len(slots);r=len(revealed_old);q=sum(new);s=sum(revealed_old) + if not (1 <= n <= 6 and 0 <= j <= n and 0 <= r <= j + and len(new)==j and len(set(slots))==j + and all(type(i)==int and 0<=i