From 2f4baff936f2a8c7c21644589e5ac4b3fc4ebe51 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 25 Sep 2026 16:20:56 +0000 Subject: [PATCH 1/2] Add fail-closed downstream hard gate for main #90/#86 Implements a Math-side dependency graph and promotion checker that refuses CONTROLLING status when required transitive dependencies are nonterminal or BLOCKED_ABSENT, marks reverse-impact revalidation, and inventories the D4/D5 RN region complement. Scientific effect NONE; lemma_closed stays false. Co-authored-by: Dylan Roy --- .github/workflows/downstream-gate.yml | 82 ++++ README.md | 3 + frontiers/README.md | 2 + frontiers/downstream_gate_20260925/GRAPH.json | 314 +++++++++++++++ frontiers/downstream_gate_20260925/README.md | 35 ++ .../downstream_gate_20260925/RESULTS.json | 135 +++++++ frontiers/downstream_gate_20260925/SCOPE.md | 33 ++ .../SOURCE_FILES.json | 34 ++ .../downstream_gate_20260925/hard_gate.py | 377 ++++++++++++++++++ .../run_validation.py | 136 +++++++ .../test_hard_gate.py | 221 ++++++++++ 11 files changed, 1372 insertions(+) create mode 100644 .github/workflows/downstream-gate.yml create mode 100644 frontiers/downstream_gate_20260925/GRAPH.json create mode 100644 frontiers/downstream_gate_20260925/README.md create mode 100644 frontiers/downstream_gate_20260925/RESULTS.json create mode 100644 frontiers/downstream_gate_20260925/SCOPE.md create mode 100644 frontiers/downstream_gate_20260925/SOURCE_FILES.json create mode 100644 frontiers/downstream_gate_20260925/hard_gate.py create mode 100644 frontiers/downstream_gate_20260925/run_validation.py create mode 100644 frontiers/downstream_gate_20260925/test_hard_gate.py diff --git a/.github/workflows/downstream-gate.yml b/.github/workflows/downstream-gate.yml new file mode 100644 index 000000000..e8e2f0c7e --- /dev/null +++ b/.github/workflows/downstream-gate.yml @@ -0,0 +1,82 @@ +name: Downstream hard-gate exact replay +'on': + push: + branches: [cursor/downstream-hard-gate-91fa] + pull_request: + paths: ['frontiers/downstream_gate_20260925/**', '.github/workflows/downstream-gate.yml'] + workflow_dispatch: +permissions: + contents: read +jobs: + replay: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 + with: + python-version: '3.11' + - name: Verify sources and run gate controls plus regressions + env: + PYTHONDONTWRITEBYTECODE: '1' + run: | + python -B -S - <<'PY' + import hashlib, json, os, pathlib, subprocess, sys + root = pathlib.Path('frontiers/downstream_gate_20260925').resolve() + pins = json.loads((root / 'SOURCE_FILES.json').read_text())['files'] + def verify(): + for name, identity in pins.items(): + if pathlib.PurePosixPath(name).name != name or (root / name).is_symlink(): + raise ValueError('flat regular source required') + raw = (root / name).read_bytes() + if len(raw) != identity['bytes'] or hashlib.sha256(raw).hexdigest() != identity['sha256']: + raise ValueError('source identity mismatch: ' + name) + if sys.version_info[:2] != (3, 11): + raise RuntimeError('actual Python 3.11 required') + verify() + out = pathlib.Path(os.environ['RUNNER_TEMP']) / 'downstream-gate-results' + subprocess.run([sys.executable, '-B', '-S', str(root / 'run_validation.py'), '--output', str(out)], check=True, timeout=120) + regressions = [ + ('coefficients/side24_v1', 30), + ('frontiers/three_fronts_20260924', 57), + ('frontiers/price_budget_20260924', 26), + ('frontiers/full_price_20260924', 36), + ('frontiers/remote_window_20260924', 28), + ] + for mode, flags in [('normal', []), ('optimized', ['-O'])]: + for index, (folder, count) in enumerate(regressions): + run = subprocess.run( + [sys.executable, '-B', *flags, '-S', '-m', 'unittest', 'discover', '-s', folder, '-p', 'test_*.py', '-v'], + capture_output=True, text=True, timeout=90, + ) + (out / f'regression_{mode}_{index}.stdout').write_text(run.stdout) + (out / f'regression_{mode}_{index}.stderr').write_text(run.stderr) + if run.returncode or f'Ran {count} tests' not in run.stderr or 'skipped=' in run.stderr: + raise RuntimeError('regression failed: ' + folder) + verify() + report = json.loads((out / 'REPORT.json').read_text()) + if not report['passed'] or report['distinct_tests'] != 24 or report['distinct_semantic_mutations'] != 7: + raise RuntimeError('unexpected new-test scope') + (out / 'GITHUB_CONTEXT.json').write_text(json.dumps({ + 'run': os.environ['GITHUB_RUN_ID'], + 'sha': os.environ['GITHUB_SHA'], + 'python': sys.version, + 'new_distinct_tests': 24, + 'regression_distinct_tests': 177, + 'total_distinct_tests': 201, + 'new_semantic_mutations': 7, + 'source_files_verified': len(pins), + 'lemma_closed': False, + 'scientific_effect': 'NONE', + 'meaning': 'same-author integrity-gate checks; not analytic review', + }, indent=2) + '\n') + print('DOWNSTREAM_GATE_PASSED') + PY + - name: Retain evidence even on failure + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: downstream-gate-${{ github.run_id }} + path: ${{ runner.temp }}/downstream-gate-results + if-no-files-found: error + retention-days: 30 diff --git a/README.md b/README.md index a65994db8..604abad08 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ | P15 failed extension | [Price-range counterexample](frontiers/three_fronts_20260924/P15_PRICE_BOUNDARY.md) | Unrestricted same-palette transformed-price extension is false | | P15 valid price extension | [Low-probability transformed-price budget](frontiers/price_budget_20260924/PROOF.md) | New sufficient hypotheses: demand at least 2 and probabilities at most 1/4 | | P15 full probability range | [Full transformed-price budget and sharp constant](frontiers/full_price_20260924/PROOF.md) | Demands at least 2; every independent probability vector; same palette; sharp uniform factor 1/[3-log(3e-2)] | +| Downstream hard gate | [Fail-closed promotion control](frontiers/downstream_gate_20260925/README.md) | [main #90](https://github.com/d6g8k5htny-coder/main/issues/90) / [#86](https://github.com/d6g8k5htny-coder/main/issues/86); integrity only; `lemma_closed` stays false | All positive research claims here are author-side candidates pending nonauthor review. A merge publishes a source; a test checks its stated coverage. Neither independently accepts a theorem. The counterexample and the restricted successor concern different hypotheses. The full-range successor removes the probability cutoff, not the demand or realized-family hypotheses; the older 16/27 factor remains better on its smaller domain. @@ -31,6 +32,8 @@ python -B -S frontiers/price_budget_20260924/price_budget.py python -B -S -m unittest discover -s frontiers/price_budget_20260924 -p 'test_*.py' -v python -B -S frontiers/full_price_20260924/full_price.py python -B -S -m unittest discover -s frontiers/full_price_20260924 -p 'test_*.py' -v +python -B -S frontiers/downstream_gate_20260925/hard_gate.py +python -B -S -m unittest discover -s frontiers/downstream_gate_20260925 -p 'test_*.py' -v ``` The full-price package has 36 distinct tests and seven semantic mutation controls. Run `python -B -S frontiers/full_price_20260924/run_validation.py --output /tmp/full-price-new-run` for both modes; choose a new output directory outside the source tree. `--mode normal` or `--mode optimized` permits bounded split runs. Finite probability grids are checks, not the proof of the full-cube statement. diff --git a/frontiers/README.md b/frontiers/README.md index 2a3fc2aa6..d6a43368a 100644 --- a/frontiers/README.md +++ b/frontiers/README.md @@ -7,5 +7,7 @@ | Three fronts, 24 September 2026 | [Package overview](three_fronts_20260924/README.md) | Lifetime remainder, RN interface, realized P15 covers; also read the [separate price counterexample](three_fronts_20260924/P15_PRICE_BOUNDARY.md) | | Transformed-price budget, 24 September 2026 | [Proof](price_budget_20260924/PROOF.md) | A valid restricted extension, exact local-budget checker, and the unchanged 816-label application | | Full transformed-price range, 24 September 2026 | [Proof](full_price_20260924/PROOF.md) | All independent probabilities for demands at least 2; exact optimal uniform factor and the same palette; earlier counterexample remains valid at demand one | +| Fixed-remote RN window, 24 September 2026 | [Proof](remote_window_20260924/PROOF.md) | Cubic mean count on a fixed spatial exclusion and between-pin height window | +| Downstream hard gate, 25 September 2026 | [Package overview](downstream_gate_20260925/README.md) | Fail-closed promotion / reverse-impact integrity control for main #90/#86; scientific effect NONE | These directories are source snapshots, not competing current-status registers. Consult [main #67](https://github.com/d6g8k5htny-coder/main/issues/67) and its successors for reviews and corrections. The RN numerical integral, original 24-jet certificates, and unrestricted P15 problems are not closed by these entries. diff --git a/frontiers/downstream_gate_20260925/GRAPH.json b/frontiers/downstream_gate_20260925/GRAPH.json new file mode 100644 index 000000000..dee599349 --- /dev/null +++ b/frontiers/downstream_gate_20260925/GRAPH.json @@ -0,0 +1,314 @@ +{ + "schema_version": 1, + "object": "DOWNSTREAM-HARD-GATE-20260925-v1", + "campaign": { + "main_issues": [86, 90], + "disposition": "research-integrity control; scientific effect NONE" + }, + "terminal_classifications": [ + "PROVED_REVIEWED", + "SUPERSEDED_NONBLOCKING", + "REFUTED", + "BLOCKED_ABSENT" + ], + "non_discharge_tokens": [ + "GREEN_CI", + "HASH_MATCH", + "ARCHITECTURAL_ADMISSION", + "NUMERICAL_EXPERIMENT", + "SAME_AUTHOR_REVIEW", + "NAVIGATION_SUCCESS", + "AUTHOR_SELF_CHECK" + ], + "nodes": { + "hist.rnu_env.py": { + "layer": "D0", + "kind": "carrier", + "classification": "BLOCKED_ABSENT", + "controlling": false, + "fingerprint": "ABSENT", + "notes": "Historical D3 carrier; no successor claims byte identity" + }, + "hist.CL_ANTHROPIC_BUNDLE_2026-09-17_v5.zip": { + "layer": "D0", + "kind": "carrier", + "classification": "BLOCKED_ABSENT", + "controlling": false, + "fingerprint": "ABSENT", + "notes": "Historical archive absent" + }, + "hist.allcell_fdz_enclosures.json": { + "layer": "D0", + "kind": "carrier", + "classification": "BLOCKED_ABSENT", + "controlling": false, + "fingerprint": "ABSENT", + "notes": "Historical cell carrier absent" + }, + "hist.ENV-RESCOV": { + "layer": "D0", + "kind": "predicate", + "classification": "OPEN_HISTORICAL", + "controlling": false, + "fingerprint": "status-rn-unif-ordered-wall-1", + "notes": "OPEN for historical D3; qualitatively rederived on newer routes where proved" + }, + "hist.ALLCELL-FDZ-Q4": { + "layer": "D0", + "kind": "predicate", + "classification": "OPEN_HISTORICAL", + "controlling": false, + "fingerprint": "status-rn-unif-ordered-wall-2", + "notes": "Not a dependency of the fixed-remote theorem" + }, + "hist.LOGQ-TAIL": { + "layer": "D0", + "kind": "predicate", + "classification": "OPEN_HISTORICAL", + "controlling": false, + "fingerprint": "status-rn-unif-ordered-wall-3", + "notes": "Replaced only inside named successors" + }, + "hist.SYM-Fw-jet": { + "layer": "D0", + "kind": "predicate", + "classification": "OPEN_HISTORICAL", + "controlling": false, + "fingerprint": "status-rn-unif-ordered-wall-4", + "notes": "Analogous interface rederived; no historical certificate identity" + }, + "hist.CH-LIFT": { + "layer": "D0", + "kind": "predicate", + "classification": "OPEN_ACTIVE", + "controlling": false, + "fingerprint": "status-rn-unif-ch-lift", + "notes": "Still mathematically relevant for shrinking charts" + }, + "hist.Piece-2-annulus": { + "layer": "D0", + "kind": "predicate", + "classification": "OPEN_ACTIVE", + "controlling": false, + "fingerprint": "status-rn-unif-piece-2", + "notes": "Active mathematical blocker for shrinking/pin-collision regions" + }, + "hist.OBL-H5-JETMOD": { + "layer": "D0", + "kind": "predicate", + "classification": "OPEN_HISTORICAL", + "controlling": false, + "fingerprint": "status-rn-unif-jetmod", + "notes": "No 2026-09-24 proof claims certified 24-jet enclosure" + }, + "hist.lemma_closed": { + "layer": "D0", + "kind": "register", + "classification": "FALSE", + "controlling": false, + "fingerprint": "lemma_closed=false", + "notes": "Scientific effect NONE; this gate never flips the register" + }, + "math.uniform-matrix-cap-lifetime": { + "layer": "D1", + "kind": "candidate", + "classification": "AUTHOR_SIDE_CANDIDATE", + "controlling": false, + "review_issue": 63, + "fingerprint": "main-63-author-side", + "source": "external:main#63", + "notes": "Parent Gaussian selection / Kac-Rice / elder chain" + }, + "math.lifetime-remainder": { + "layer": "D2", + "kind": "candidate", + "classification": "AUTHOR_SIDE_CANDIDATE", + "controlling": false, + "review_issue": 67, + "fingerprint": "380b7d0abdb0fe2de5a6564565af9560d3f1b1ce22fd5538927db0c52f4f3a4a", + "source": "frontiers/three_fronts_20260924/LIFETIME_REMAINDER.md", + "notes": "Imports named #63 interfaces; not parent collapse" + }, + "math.side24-coefficient": { + "layer": "D3", + "kind": "candidate", + "classification": "AUTHOR_SIDE_CANDIDATE", + "controlling": false, + "review_issue": 65, + "fingerprint": "c06daccc4ba4b9168522b9888b76a7d599934fc3b91bd753ee5d492262917769", + "source": "coefficients/side24_v1/PROOF.md", + "notes": "Evaluates #63 Eq15.2; parent unreviewed" + }, + "math.rn-count-interface": { + "layer": "D4", + "kind": "candidate", + "classification": "AUTHOR_SIDE_CANDIDATE", + "controlling": false, + "review_issue": 67, + "fingerprint": "aa993f5217bd70e6d1060402d121ab659f6582a098e29042c67585a345a8e3ab", + "source": "frontiers/three_fronts_20260924/RN_COUNT_INTERFACE.md", + "notes": "Probability-to-count interface; not an expected-count rate" + }, + "math.rn-fixed-remote-window": { + "layer": "D4", + "kind": "candidate", + "classification": "AUTHOR_SIDE_CANDIDATE", + "controlling": false, + "review_issue": 76, + "fingerprint": "a332bae9bdc0106ce17047f7e0409cc3d94eb610a0c7b74ba5ba2d01a1620cb7", + "source": "frontiers/remote_window_20260924/PROOF.md", + "notes": "Cubic mean on fixed spatial exclusion and between-pin height window" + }, + "math.rn-region.fixed-remote": { + "layer": "D4", + "kind": "region", + "classification": "COVERED_BY_CANDIDATE", + "controlling": false, + "fingerprint": "dist>=rho and between-pin height", + "notes": "Covered by rn-fixed-remote-window candidate only" + }, + "math.rn-region.mesoscopic-scaled-annulus": { + "layer": "D5", + "kind": "region", + "classification": "OPEN_ACTIVE", + "controlling": false, + "fingerprint": "x=r y with A<=|y|<=B away from pins", + "notes": "Owned by Math- PR7 reduction; exact J0 ledger still open" + }, + "math.rn-region.pin-collision": { + "layer": "D5", + "kind": "region", + "classification": "OPEN_ACTIVE", + "controlling": false, + "fingerprint": "near +-e1/2 scaled pin sites", + "notes": "Complement of fixed-remote and fixed scaled annulus" + }, + "math.rn-region.intermediate-r-to-rho": { + "layer": "D5", + "kind": "region", + "classification": "OPEN_ACTIVE", + "controlling": false, + "fingerprint": "r<<|x|<0 mutual witness separation", + "notes": "Fixed-eta factorial moments do not cover shrinking separation" + }, + "math.rn-mesoscopic-reduction": { + "layer": "D5", + "kind": "candidate", + "classification": "AUTHOR_SIDE_REDUCTION", + "controlling": false, + "fingerprint": "Math-PR7-draft", + "source": "frontiers/rn_mesoscopic_20260925/PROOF.md", + "notes": "Draft PR7; paused for upstream expansion under #86" + }, + "math.p15-full-price": { + "layer": "D6", + "kind": "candidate", + "classification": "AUTHOR_SIDE_CANDIDATE", + "controlling": false, + "review_issue": 74, + "fingerprint": "full-price-20260924", + "source": "frontiers/full_price_20260924/PROOF.md", + "notes": "Full probability cube under demand>=2; review open" + }, + "math.p15-price-boundary": { + "layer": "D6", + "kind": "candidate", + "classification": "REFUTED", + "controlling": false, + "fingerprint": "498af650ef7139c39d2630561dbfd0822c495ce6308a6cac8b767aefe0c2a40b", + "source": "frontiers/three_fronts_20260924/P15_PRICE_BOUNDARY.md", + "notes": "Unrestricted same-palette transformed-price extension is false" + }, + "eng.hard-gate": { + "layer": "D7", + "kind": "integrity_control", + "classification": "ENGINEERING_CONTROL", + "controlling": false, + "fingerprint": "downstream-hard-gate-20260925-v1", + "source": "frontiers/downstream_gate_20260925/", + "notes": "This package; never mathematical discharge" + } + }, + "edges": [ + { + "from": "math.lifetime-remainder", + "to": "math.uniform-matrix-cap-lifetime", + "required": true, + "relation": "imports_named_interfaces" + }, + { + "from": "math.side24-coefficient", + "to": "math.uniform-matrix-cap-lifetime", + "required": true, + "relation": "evaluates_eq_15_2" + }, + { + "from": "math.rn-fixed-remote-window", + "to": "math.rn-count-interface", + "required": true, + "relation": "supplies_numerator_on_restricted_region" + }, + { + "from": "math.rn-fixed-remote-window", + "to": "math.rn-region.fixed-remote", + "required": false, + "relation": "covers_region" + }, + { + "from": "math.rn-mesoscopic-reduction", + "to": "math.rn-fixed-remote-window", + "required": true, + "relation": "successor_scale_after_fixed_remote" + }, + { + "from": "math.rn-mesoscopic-reduction", + "to": "math.rn-region.mesoscopic-scaled-annulus", + "required": false, + "relation": "targets_region" + }, + { + "from": "math.rn-mesoscopic-reduction", + "to": "hist.CH-LIFT", + "required": false, + "relation": "reopens_scaled_chart_problem" + }, + { + "from": "math.rn-mesoscopic-reduction", + "to": "hist.Piece-2-annulus", + "required": false, + "relation": "addresses_partial_piece" + }, + { + "from": "math.p15-full-price", + "to": "math.p15-price-boundary", + "required": true, + "relation": "restricted_successor_after_refutation" + }, + { + "from": "hist.ENV-RESCOV", + "to": "hist.rnu_env.py", + "required": true, + "relation": "historical_certificate_carrier" + }, + { + "from": "hist.ALLCELL-FDZ-Q4", + "to": "hist.allcell_fdz_enclosures.json", + "required": true, + "relation": "historical_certificate_carrier" + }, + { + "from": "hist.SYM-Fw-jet", + "to": "hist.CL_ANTHROPIC_BUNDLE_2026-09-17_v5.zip", + "required": false, + "relation": "historical_bundle_identity" + } + ] +} diff --git a/frontiers/downstream_gate_20260925/README.md b/frontiers/downstream_gate_20260925/README.md new file mode 100644 index 000000000..27f65e655 --- /dev/null +++ b/frontiers/downstream_gate_20260925/README.md @@ -0,0 +1,35 @@ +# Downstream hard gate — fail-closed promotion control + +**Object:** DOWNSTREAM-HARD-GATE-20260925-v1 +**Author:** Cursor (Cloud Agent). **Disposition:** engineering integrity control for [main #90](https://github.com/d6g8k5htny-coder/main/issues/90) / [main #86](https://github.com/d6g8k5htny-coder/main/issues/86). **Scientific effect: NONE.** + +[Research home](https://github.com/d6g8k5htny-coder/main) · [Math index](../../README.md) · [Scope note](SCOPE.md) · [Machine graph](GRAPH.json) + +## What this is + +A machine-checked dependency graph over the Math- candidate surfaces and the historical RN walls they interact with. It enforces: + +1. **No CONTROLLING promotion** unless every *required* transitive dependency is terminally classified as `PROVED_REVIEWED`, `SUPERSEDED_NONBLOCKING`, `REFUTED`, or `BLOCKED_ABSENT`. +2. Any required `BLOCKED_ABSENT` dependency forces the dependent node to **HOLD**. +3. A fingerprint or classification change on a dependency marks transitive dependents `REVALIDATION_REQUIRED`. +4. Green CI, hashes, architectural admission, numerical experiments, same-author review, and navigation success are **non-discharge** tokens and cannot alone authorize promotion. + +This package also records the **D4 region complement**: the fixed-remote candidate covers only `dist>=rho` with the between-pin height window; mesoscopic scaled annulus, pin-collision, intermediate `r<<|x|<=rho and between-pin height", + "id": "math.rn-region.fixed-remote", + "notes": "Covered by rn-fixed-remote-window candidate only" + } + ], + "legacy_24jet_discharged": false, + "meaning": "region inventory for #76/#86 D4; not a numerical RN certificate", + "no_event_to_expectation_reversal": true, + "open_complement": [ + { + "classification": "OPEN_ACTIVE", + "fingerprint": "r<<|x|<0 mutual witness separation", + "id": "math.rn-region.witness-collision", + "notes": "Fixed-eta factorial moments do not cover shrinking separation" + } + ] + }, + "gate_ok": true, + "illegal_attempts": { + "promote_fixed_remote": { + "allowed": false, + "evidence_tokens": [ + "GREEN_CI", + "HASH_MATCH", + "SAME_AUTHOR_REVIEW" + ], + "node": "math.rn-fixed-remote-window", + "reasons": [ + "required transitive dependency is not terminally classified", + "evidence consists only of non-discharge tokens" + ], + "refused": true + }, + "promote_historical_env_rescov": { + "allowed": false, + "blocked_absent": [ + "hist.rnu_env.py" + ], + "meaning": "integrity decision only; not theorem acceptance", + "missing_terminal": [], + "node": "hist.ENV-RESCOV", + "reasons": [ + "required BLOCKED_ABSENT dependency forces HOLD" + ], + "required_dependencies": [ + "hist.rnu_env.py" + ], + "would_be_controlling": false + }, + "promote_lifetime_remainder": { + "allowed": false, + "blocked_absent": [], + "meaning": "integrity decision only; not theorem acceptance", + "missing_terminal": [ + { + "classification": "AUTHOR_SIDE_CANDIDATE", + "id": "math.uniform-matrix-cap-lifetime" + } + ], + "node": "math.lifetime-remainder", + "reasons": [ + "required transitive dependency is not terminally classified" + ], + "required_dependencies": [ + "math.uniform-matrix-cap-lifetime" + ], + "would_be_controlling": false + }, + "promote_side24": { + "allowed": false, + "blocked_absent": [], + "meaning": "integrity decision only; not theorem acceptance", + "missing_terminal": [ + { + "classification": "AUTHOR_SIDE_CANDIDATE", + "id": "math.uniform-matrix-cap-lifetime" + } + ], + "node": "math.side24-coefficient", + "reasons": [ + "required transitive dependency is not terminally classified" + ], + "required_dependencies": [ + "math.uniform-matrix-cap-lifetime" + ], + "would_be_controlling": false + } + }, + "illegal_promotion_refused": true, + "lemma_closed": false, + "meaning": "same-author integrity controls for main #90/#86; not analytic review or theorem acceptance", + "object": "DOWNSTREAM-HARD-GATE-20260925-v1", + "reverse_impact_demo": { + "changed_node": "math.uniform-matrix-cap-lifetime", + "dependency_changed": true, + "impacted": [ + "math.lifetime-remainder", + "math.side24-coefficient" + ] + }, + "schema_version": 1, + "scientific_effect": "NONE" +} diff --git a/frontiers/downstream_gate_20260925/SCOPE.md b/frontiers/downstream_gate_20260925/SCOPE.md new file mode 100644 index 000000000..5ea6a0f8c --- /dev/null +++ b/frontiers/downstream_gate_20260925/SCOPE.md @@ -0,0 +1,33 @@ +# Scope — downstream hard gate + +**Object:** DOWNSTREAM-HARD-GATE-20260925-v1 +**Campaign:** Cursor acceptance of the #86 integration lane (D0/D7) and the #90 hard-gate acceptance criteria, coordinated with ChatGPT's main PR87 D0 crosswalk and the paused Math- PR7 D5 reduction. + +## Claimed here + +- A source-bound machine graph mapping Math- candidates and historical RN walls onto layers D0–D7. +- Fail-closed promotion and reverse-impact rules matching the owner's #90 directive. +- An explicit D4/D5 region complement inventory for the fixed-remote theorem versus shrinking/collision scales. +- Exact finite tests and semantic mutation controls (stdlib Python only). + +## Explicitly not claimed + +- Independent analytic acceptance of any author-side candidate. +- Reconstruction or substitution for ABSENT historical carriers (`rnu_env.py`, `CL_ANTHROPIC_BUNDLE_2026-09-17_v5.zip`, `allcell_fdz_enclosures.json`). +- Closure of CH-LIFT, Piece-2 annulus, OBL-H5-JETMOD, or the mesoscopic divided-difference Jacobian ledger. +- Any change to scientific registers (`lemma_closed` remains false). +- Ownership of Math- PR7's proof body (still ChatGPT's D5 claim; paused for upstream expansion). + +## Coordination + +| Lane | Owner offer (#86) | This delivery | +|---|---|---| +| D0 historical walls | Cursor + ChatGPT PR87 | Encodes ABSENT carriers and OPEN walls; does not edit hardening status files | +| D4 RN complement | Campaign queue | Region inventory in `GRAPH.json` / `d4_region_complement` | +| D5 mesoscopic | Codex offer / ChatGPT PR7 | Mapped as open; not expanded | +| D7 engineering | Cursor | This package | +| #90 machine gate | Owner directive | Implemented and mutation-tested | + +## Relation to main PR87 + +PR87's `DOWNSTREAM_CROSSWALK_20260925.md` is the human crosswalk on the hardening branch. This Math- package is the executable fail-closed checker and Math-side node/edge inventory. They are complementary; neither promotes mathematics. diff --git a/frontiers/downstream_gate_20260925/SOURCE_FILES.json b/frontiers/downstream_gate_20260925/SOURCE_FILES.json new file mode 100644 index 000000000..5c2f73790 --- /dev/null +++ b/frontiers/downstream_gate_20260925/SOURCE_FILES.json @@ -0,0 +1,34 @@ +{ + "files": { + "GRAPH.json": { + "bytes": 10409, + "sha256": "470b8f976dd55940b2b13d9da7ba54822475576cb908d9a802ecee2e43c4c5a3" + }, + "README.md": { + "bytes": 2085, + "sha256": "065414c021a7cacd1a8c43581671dbb4a86d9c84af2539b94fd4126cc76c3573" + }, + "RESULTS.json": { + "bytes": 4254, + "sha256": "d56cefa5a3a2e64dc9a3e07a7994fd074f35a3dc5b80c8692436e7f39c044aa5" + }, + "SCOPE.md": { + "bytes": 1947, + "sha256": "481dccacc6478e0f4146609a56cf637b8fcff399b004f6509ad588a8dd61441f" + }, + "hard_gate.py": { + "bytes": 13754, + "sha256": "a33b5f437409e4507e15ec5a4c7fcb6c2db7733afba9f5edaae19ac46ac7def5" + }, + "run_validation.py": { + "bytes": 5233, + "sha256": "f8f53f1ecb4a98f4a1d9ba8dd79987776d8f62c98c137b65cd98aeebe07d7b75" + }, + "test_hard_gate.py": { + "bytes": 10152, + "sha256": "a36b160a64eaa388dbae478d9874e74358760b4ccc4a2c1781d218de5d34f857" + } + }, + "meaning": "Exact identity, not theorem correctness", + "schema_version": 1 +} diff --git a/frontiers/downstream_gate_20260925/hard_gate.py b/frontiers/downstream_gate_20260925/hard_gate.py new file mode 100644 index 000000000..9bfacffd5 --- /dev/null +++ b/frontiers/downstream_gate_20260925/hard_gate.py @@ -0,0 +1,377 @@ +"""Fail-closed downstream promotion gate (main #90 / #86). + +Scientific effect: NONE. This module never flips lemma_closed, prizes, or +premise registers. Green CI / hashes / same-author checks are not discharge. +""" +from __future__ import annotations + +import json +from pathlib import Path +from typing import Any + +ROOT = Path(__file__).resolve().parent +GRAPH_PATH = ROOT / 'GRAPH.json' + +TERMINAL = frozenset({ + 'PROVED_REVIEWED', + 'SUPERSEDED_NONBLOCKING', + 'REFUTED', + 'BLOCKED_ABSENT', +}) + +# Classifications that may appear on live nodes but are never terminal discharge. +NONTERMINAL = frozenset({ + 'OPEN_HISTORICAL', + 'OPEN_ACTIVE', + 'AUTHOR_SIDE_CANDIDATE', + 'AUTHOR_SIDE_REDUCTION', + 'COVERED_BY_CANDIDATE', + 'ENGINEERING_CONTROL', + 'HOLD', + 'REVALIDATION_REQUIRED', + 'FALSE', + 'EXPLORATORY', +}) + +NON_DISCHARGE_DEFAULT = ( + 'GREEN_CI', + 'HASH_MATCH', + 'ARCHITECTURAL_ADMISSION', + 'NUMERICAL_EXPERIMENT', + 'SAME_AUTHOR_REVIEW', + 'NAVIGATION_SUCCESS', + 'AUTHOR_SELF_CHECK', +) + + +def load_graph(path: Path | None = None) -> dict[str, Any]: + data = json.loads((path or GRAPH_PATH).read_text()) + if data.get('schema_version') != 1: + raise ValueError('unsupported graph schema_version') + if 'nodes' not in data or 'edges' not in data: + raise ValueError('graph requires nodes and edges') + return data + + +def require_node(graph: dict[str, Any], node_id: str) -> dict[str, Any]: + nodes = graph['nodes'] + if node_id not in nodes: + raise KeyError('unknown node: ' + node_id) + return nodes[node_id] + + +def required_dependencies(graph: dict[str, Any], node_id: str) -> list[str]: + require_node(graph, node_id) + return [e['to'] for e in graph['edges'] + if e['from'] == node_id and e.get('required', True)] + + +def all_dependencies(graph: dict[str, Any], node_id: str) -> list[str]: + require_node(graph, node_id) + return [e['to'] for e in graph['edges'] if e['from'] == node_id] + + +def transitive_required(graph: dict[str, Any], node_id: str) -> list[str]: + """Depth-first required transitive closure, cycle-safe, deterministic order.""" + seen: set[str] = set() + order: list[str] = [] + + def walk(nid: str) -> None: + for dep in required_dependencies(graph, nid): + if dep in seen: + continue + seen.add(dep) + order.append(dep) + walk(dep) + + walk(node_id) + return order + + +def dependents(graph: dict[str, Any], node_id: str, *, required_only: bool = False) -> list[str]: + require_node(graph, node_id) + out = [] + for e in graph['edges']: + if e['to'] != node_id: + continue + if required_only and not e.get('required', True): + continue + out.append(e['from']) + return sorted(set(out)) + + +def transitive_dependents(graph: dict[str, Any], node_id: str) -> list[str]: + seen: set[str] = set() + order: list[str] = [] + + def walk(nid: str) -> None: + for child in dependents(graph, nid): + if child in seen: + continue + seen.add(child) + order.append(child) + walk(child) + + walk(node_id) + return order + + +def is_terminal(classification: str) -> bool: + return classification in TERMINAL + + +def blocked_absent_hold(graph: dict[str, Any], node_id: str) -> list[str]: + """Required transitive BLOCKED_ABSENT dependencies force HOLD.""" + return [dep for dep in transitive_required(graph, node_id) + if require_node(graph, dep)['classification'] == 'BLOCKED_ABSENT'] + + +def promotion_allowed(graph: dict[str, Any], node_id: str) -> dict[str, Any]: + """Return whether node_id may become CONTROLLING under #90 rules.""" + node = require_node(graph, node_id) + required = transitive_required(graph, node_id) + missing_terminal = [] + blocked = [] + for dep in required: + cls = require_node(graph, dep)['classification'] + if not is_terminal(cls): + missing_terminal.append({'id': dep, 'classification': cls}) + if cls == 'BLOCKED_ABSENT': + blocked.append(dep) + + reasons: list[str] = [] + if node.get('classification') == 'REVALIDATION_REQUIRED': + reasons.append('node requires revalidation after a dependency change') + if blocked: + reasons.append('required BLOCKED_ABSENT dependency forces HOLD') + if missing_terminal: + reasons.append('required transitive dependency is not terminally classified') + if node.get('classification') == 'FALSE' and node_id == 'hist.lemma_closed': + reasons.append('lemma_closed register must remain FALSE; gate never promotes it') + + allowed = not reasons + return { + 'node': node_id, + 'allowed': allowed, + 'would_be_controlling': allowed, + 'required_dependencies': required, + 'missing_terminal': missing_terminal, + 'blocked_absent': blocked, + 'reasons': reasons, + 'meaning': 'integrity decision only; not theorem acceptance', + } + + +def refuse_non_discharge_promotion( + graph: dict[str, Any], + node_id: str, + evidence_tokens: list[str] | tuple[str, ...], +) -> dict[str, Any]: + """Fail closed when promotion is justified only by non-discharge tokens.""" + tokens = list(evidence_tokens) + non_discharge = set(graph.get('non_discharge_tokens', NON_DISCHARGE_DEFAULT)) + unknown = [t for t in tokens if t not in non_discharge and t not in ( + 'PROVED_REVIEWED', 'SUPERSEDED_NONBLOCKING', 'REFUTED', 'LINE_BY_LINE_ANALYTIC_REVIEW', + 'EXACT_COUNTEREXAMPLE', 'SUPERSESSION_CROSSWALK', + )] + only_non_discharge = bool(tokens) and all(t in non_discharge for t in tokens) + base = promotion_allowed(graph, node_id) + refused = only_non_discharge or (not base['allowed']) + reasons = list(base['reasons']) + if only_non_discharge: + reasons.append('evidence consists only of non-discharge tokens') + if unknown: + reasons.append('unknown evidence tokens: ' + ','.join(unknown)) + refused = True + return { + 'node': node_id, + 'refused': refused, + 'allowed': (not refused) and base['allowed'], + 'evidence_tokens': tokens, + 'reasons': reasons, + 'base': base, + } + + +def apply_promotion(graph: dict[str, Any], node_id: str) -> dict[str, Any]: + """Mutate a copy: set controlling only when legal; otherwise HOLD / refuse.""" + clone = json.loads(json.dumps(graph)) + decision = promotion_allowed(clone, node_id) + node = clone['nodes'][node_id] + if decision['blocked_absent']: + node['controlling'] = False + node['classification'] = 'HOLD' + decision = {**decision, 'applied': 'HOLD', 'ok': False} + elif not decision['allowed']: + node['controlling'] = False + decision = {**decision, 'applied': 'REFUSED', 'ok': False} + else: + node['controlling'] = True + decision = {**decision, 'applied': 'CONTROLLING', 'ok': True} + return {'graph': clone, 'decision': decision} + + +def reverse_impact( + graph: dict[str, Any], + changed_node: str, + *, + old_fingerprint: str | None = None, + new_fingerprint: str | None = None, + old_classification: str | None = None, + new_classification: str | None = None, +) -> dict[str, Any]: + """Mark transitive dependents REVALIDATION_REQUIRED after a dependency change.""" + require_node(graph, changed_node) + clone = json.loads(json.dumps(graph)) + changed = False + if old_fingerprint is not None and new_fingerprint is not None and old_fingerprint != new_fingerprint: + changed = True + clone['nodes'][changed_node]['fingerprint'] = new_fingerprint + if old_classification is not None and new_classification is not None and old_classification != new_classification: + changed = True + clone['nodes'][changed_node]['classification'] = new_classification + + impacted: list[str] = [] + if changed: + for dep in transitive_dependents(clone, changed_node): + node = clone['nodes'][dep] + if node.get('controlling') or node.get('classification') in ( + 'AUTHOR_SIDE_CANDIDATE', 'AUTHOR_SIDE_REDUCTION', 'COVERED_BY_CANDIDATE', + 'PROVED_REVIEWED', 'SUPERSEDED_NONBLOCKING', + ): + node['classification'] = 'REVALIDATION_REQUIRED' + node['controlling'] = False + impacted.append(dep) + + return { + 'changed_node': changed_node, + 'dependency_changed': changed, + 'impacted': impacted, + 'graph': clone, + 'meaning': 'reverse-impact revalidation marks; not theorem discharge', + } + + +def closure_report(graph: dict[str, Any]) -> dict[str, Any]: + """Machine-readable D0–D7 closure report for the campaign queue.""" + by_layer: dict[str, list[dict[str, Any]]] = {} + controlling_illegal: list[dict[str, Any]] = [] + for nid, node in sorted(graph['nodes'].items()): + layer = node.get('layer', '?') + by_layer.setdefault(layer, []).append({ + 'id': nid, + 'classification': node['classification'], + 'controlling': bool(node.get('controlling')), + 'kind': node.get('kind'), + }) + if node.get('controlling'): + decision = promotion_allowed(graph, nid) + if not decision['allowed']: + controlling_illegal.append(decision) + + layers = sorted(by_layer) + open_active = [nid for nid, n in sorted(graph['nodes'].items()) + if n['classification'] in ('OPEN_ACTIVE', 'OPEN_HISTORICAL', + 'AUTHOR_SIDE_CANDIDATE', 'AUTHOR_SIDE_REDUCTION', + 'HOLD', 'REVALIDATION_REQUIRED')] + blocked = [nid for nid, n in sorted(graph['nodes'].items()) + if n['classification'] == 'BLOCKED_ABSENT'] + return { + 'object': graph.get('object'), + 'layers': {layer: by_layer[layer] for layer in layers}, + 'open_or_author_side': open_active, + 'blocked_absent': blocked, + 'illegal_controlling': controlling_illegal, + 'lemma_closed': False, + 'scientific_effect': 'NONE', + 'gate_ok': len(controlling_illegal) == 0, + 'meaning': 'dependency closure inventory; publication is not acceptance', + } + + +def d4_region_complement(graph: dict[str, Any]) -> dict[str, Any]: + """Explicit D4/D5 region map: what fixed-remote covers versus what remains open.""" + covered = [] + open_regions = [] + for nid, node in sorted(graph['nodes'].items()): + if node.get('kind') != 'region': + continue + entry = { + 'id': nid, + 'classification': node['classification'], + 'fingerprint': node.get('fingerprint'), + 'notes': node.get('notes'), + } + if node['classification'] == 'COVERED_BY_CANDIDATE': + covered.append(entry) + else: + open_regions.append(entry) + return { + 'covered_by_fixed_remote_candidate': covered, + 'open_complement': open_regions, + 'no_event_to_expectation_reversal': True, + 'legacy_24jet_discharged': False, + 'meaning': 'region inventory for #76/#86 D4; not a numerical RN certificate', + } + + +def results_payload(graph: dict[str, Any] | None = None) -> dict[str, Any]: + g = graph or load_graph() + # Spot-check promotions that must fail closed on the live author-side graph. + illegal_attempts = { + 'promote_fixed_remote': refuse_non_discharge_promotion( + g, 'math.rn-fixed-remote-window', + ['GREEN_CI', 'HASH_MATCH', 'SAME_AUTHOR_REVIEW']), + 'promote_lifetime_remainder': promotion_allowed(g, 'math.lifetime-remainder'), + 'promote_side24': promotion_allowed(g, 'math.side24-coefficient'), + 'promote_historical_env_rescov': promotion_allowed(g, 'hist.ENV-RESCOV'), + } + impact = reverse_impact( + g, 'math.uniform-matrix-cap-lifetime', + old_fingerprint='main-63-author-side', + new_fingerprint='main-63-amended-demo', + ) + return { + 'object': g.get('object'), + 'schema_version': g.get('schema_version'), + 'gate_ok': closure_report(g)['gate_ok'], + 'lemma_closed': False, + 'scientific_effect': 'NONE', + 'illegal_promotion_refused': all( + (v.get('refused') if 'refused' in v else not v.get('allowed')) + for v in illegal_attempts.values() + ), + 'illegal_attempts': { + k: {key: val for key, val in v.items() if key != 'base'} + for k, v in illegal_attempts.items() + }, + 'reverse_impact_demo': { + 'changed_node': impact['changed_node'], + 'impacted': impact['impacted'], + 'dependency_changed': impact['dependency_changed'], + }, + 'd4_region_complement': d4_region_complement(g), + 'closure': { + 'blocked_absent': closure_report(g)['blocked_absent'], + 'open_or_author_side_count': len(closure_report(g)['open_or_author_side']), + 'illegal_controlling_count': len(closure_report(g)['illegal_controlling']), + }, + 'meaning': ( + 'same-author integrity controls for main #90/#86; ' + 'not analytic review or theorem acceptance' + ), + } + + +def main() -> None: + payload = results_payload() + text = json.dumps(payload, indent=2, sort_keys=True) + '\n' + print(text, end='') + # When executed as the package entry point, compare to pinned RESULTS.json. + expected = (ROOT / 'RESULTS.json').read_text() + if text != expected: + raise SystemExit('RESULTS.json byte mismatch; regenerate deliberately') + + +if __name__ == '__main__': + main() diff --git a/frontiers/downstream_gate_20260925/run_validation.py b/frontiers/downstream_gate_20260925/run_validation.py new file mode 100644 index 000000000..293c7593a --- /dev/null +++ b/frontiers/downstream_gate_20260925/run_validation.py @@ -0,0 +1,136 @@ +"""Replay hard-gate controls in both Python modes; preserve mutation logs.""" +from pathlib import Path +import argparse +import hashlib +import json +import shutil +import subprocess +import sys + +ROOT = Path(__file__).resolve().parent +EXPECTED_TESTS = 24 +MUTANTS = { + 'allow_green_ci': ( + "only_non_discharge = bool(tokens) and all(t in non_discharge for t in tokens)", + "only_non_discharge = False", + ), + 'ignore_blocked_absent': ( + "if cls == 'BLOCKED_ABSENT':\n blocked.append(dep)", + "if False:\n blocked.append(dep)", + ), + 'treat_author_side_terminal': ( + "def is_terminal(classification: str) -> bool:\n return classification in TERMINAL", + "def is_terminal(classification: str) -> bool:\n return classification in TERMINAL or classification == 'AUTHOR_SIDE_CANDIDATE'", + ), + 'skip_reverse_impact': ( + "node['classification'] = 'REVALIDATION_REQUIRED'\n node['controlling'] = False\n impacted.append(dep)", + "impacted.append(dep)", + ), + 'flip_lemma_closed': ( + "'lemma_closed': False,\n 'scientific_effect': 'NONE',\n 'illegal_promotion_refused':", + "'lemma_closed': True,\n 'scientific_effect': 'NONE',\n 'illegal_promotion_refused':", + ), + 'omit_region_complement': ( + "open_regions.append(entry)", + "pass", + ), + 'allow_illegal_controlling_report': ( + "'gate_ok': len(controlling_illegal) == 0,", + "'gate_ok': True,", + ), +} + + +def require(condition, message): + if not condition: + raise RuntimeError(message) + + +def identities(): + return { + p.name: { + 'bytes': p.stat().st_size, + 'sha256': hashlib.sha256(p.read_bytes()).hexdigest(), + } + for p in ROOT.iterdir() if p.is_file() + } + + +def execute(command, cwd, out, name, mutant=False): + result = subprocess.run(command, cwd=cwd, capture_output=True, text=True, timeout=30) + (out / (name + '.stdout')).write_text(result.stdout) + (out / (name + '.stderr')).write_text(result.stderr) + if mutant: + require( + result.returncode != 0 + and 'AssertionError' in result.stderr + and 'FAILED (failures=' in result.stderr, + 'mutation was not detected by a test assertion: ' + name, + ) + require( + 'SyntaxError' not in result.stderr and 'ImportError' not in result.stderr, + 'mutation caused an invalid-program error', + ) + else: + require(result.returncode == 0, 'baseline failed: ' + name) + require( + f'Ran {EXPECTED_TESTS} tests' in result.stderr and 'skipped=' not in result.stderr, + 'unexpected test coverage', + ) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--output', required=True, type=Path) + args = parser.parse_args() + out = args.output.resolve() + require( + not out.exists() and not out.is_relative_to(ROOT), + 'a new output outside the source directory is required', + ) + out.mkdir(parents=True) + before = identities() + source = (ROOT / 'hard_gate.py').read_text() + report = { + 'passed': False, + 'python': sys.version, + 'distinct_tests': EXPECTED_TESTS, + 'distinct_semantic_mutations': len(MUTANTS), + 'modes': [], + 'meaning': ( + 'same-author integrity-gate checks for main #90/#86; ' + 'not analytic review or theorem acceptance' + ), + } + try: + for mode, flags in [('normal', []), ('optimized', ['-O'])]: + cmd = [sys.executable, '-B', *flags, '-S', '-m', 'unittest', '-v', 'test_hard_gate'] + execute(cmd, ROOT, out, 'tests_' + mode) + output = subprocess.run( + [sys.executable, '-B', *flags, '-S', 'hard_gate.py'], + cwd=ROOT, capture_output=True, timeout=10, + ) + require(output.returncode == 0, 'entry point failed: ' + mode) + require( + output.stdout == (ROOT / 'RESULTS.json').read_bytes(), + 'result byte mismatch', + ) + (out / ('output_' + mode + '.json')).write_bytes(output.stdout) + for name, (old, new) in MUTANTS.items(): + require(source.count(old) == 1, 'nonunique mutation: ' + name) + scratch = out / 'mutants' / mode / name + scratch.mkdir(parents=True) + (scratch / 'hard_gate.py').write_text(source.replace(old, new)) + for filename in ('test_hard_gate.py', 'RESULTS.json', 'GRAPH.json'): + shutil.copyfile(ROOT / filename, scratch / filename) + execute(cmd, scratch, out, 'mutation_' + mode + '_' + name, mutant=True) + report['modes'].append(mode) + require(before == identities(), 'source files changed during execution') + report.update(passed=True, sources_unchanged=True, source_files=before) + finally: + (out / 'REPORT.json').write_text(json.dumps(report, indent=2, sort_keys=True) + '\n') + print(json.dumps(report, sort_keys=True)) + + +if __name__ == '__main__': + main() diff --git a/frontiers/downstream_gate_20260925/test_hard_gate.py b/frontiers/downstream_gate_20260925/test_hard_gate.py new file mode 100644 index 000000000..300ff8b4a --- /dev/null +++ b/frontiers/downstream_gate_20260925/test_hard_gate.py @@ -0,0 +1,221 @@ +"""Finite integrity-gate controls; not mathematical review or theorem acceptance.""" +from __future__ import annotations + +import copy +import json +import unittest +from pathlib import Path + +import hard_gate as m + +ROOT = Path(__file__).resolve().parent + + +class HardGateControls(unittest.TestCase): + def setUp(self): + self.graph = m.load_graph() + + def test_schema_and_terminal_set(self): + self.assertEqual(self.graph['schema_version'], 1) + self.assertEqual( + set(self.graph['terminal_classifications']), + set(m.TERMINAL), + ) + for token in m.NON_DISCHARGE_DEFAULT: + self.assertIn(token, self.graph['non_discharge_tokens']) + + def test_unknown_node_refused(self): + with self.assertRaises(KeyError): + m.require_node(self.graph, 'no.such.node') + + def test_historical_carriers_absent(self): + for nid in ( + 'hist.rnu_env.py', + 'hist.CL_ANTHROPIC_BUNDLE_2026-09-17_v5.zip', + 'hist.allcell_fdz_enclosures.json', + ): + self.assertEqual(self.graph['nodes'][nid]['classification'], 'BLOCKED_ABSENT') + self.assertFalse(self.graph['nodes'][nid]['controlling']) + + def test_lemma_closed_never_true(self): + node = self.graph['nodes']['hist.lemma_closed'] + self.assertEqual(node['classification'], 'FALSE') + self.assertFalse(node['controlling']) + report = m.closure_report(self.graph) + self.assertIs(report['lemma_closed'], False) + self.assertEqual(report['scientific_effect'], 'NONE') + + def test_lifetime_requires_parent(self): + deps = m.required_dependencies(self.graph, 'math.lifetime-remainder') + self.assertEqual(deps, ['math.uniform-matrix-cap-lifetime']) + decision = m.promotion_allowed(self.graph, 'math.lifetime-remainder') + self.assertFalse(decision['allowed']) + self.assertTrue(any(x['id'] == 'math.uniform-matrix-cap-lifetime' + for x in decision['missing_terminal'])) + + def test_side24_requires_parent(self): + decision = m.promotion_allowed(self.graph, 'math.side24-coefficient') + self.assertFalse(decision['allowed']) + self.assertIn('math.uniform-matrix-cap-lifetime', decision['required_dependencies']) + + def test_fixed_remote_requires_count_interface(self): + deps = m.transitive_required(self.graph, 'math.rn-fixed-remote-window') + self.assertIn('math.rn-count-interface', deps) + decision = m.promotion_allowed(self.graph, 'math.rn-fixed-remote-window') + self.assertFalse(decision['allowed']) + + def test_mesoscopic_requires_fixed_remote(self): + deps = m.required_dependencies(self.graph, 'math.rn-mesoscopic-reduction') + self.assertEqual(deps, ['math.rn-fixed-remote-window']) + + def test_blocked_absent_forces_hold_on_historical_env(self): + blocked = m.blocked_absent_hold(self.graph, 'hist.ENV-RESCOV') + self.assertEqual(blocked, ['hist.rnu_env.py']) + applied = m.apply_promotion(self.graph, 'hist.ENV-RESCOV') + self.assertFalse(applied['decision']['ok']) + self.assertEqual(applied['decision']['applied'], 'HOLD') + self.assertEqual( + applied['graph']['nodes']['hist.ENV-RESCOV']['classification'], + 'HOLD', + ) + self.assertFalse(applied['graph']['nodes']['hist.ENV-RESCOV']['controlling']) + + def test_green_ci_alone_never_promotes(self): + for tokens in ( + ['GREEN_CI'], + ['HASH_MATCH', 'NAVIGATION_SUCCESS'], + ['SAME_AUTHOR_REVIEW', 'AUTHOR_SELF_CHECK', 'NUMERICAL_EXPERIMENT'], + ['GREEN_CI', 'HASH_MATCH', 'ARCHITECTURAL_ADMISSION'], + ): + result = m.refuse_non_discharge_promotion( + self.graph, 'math.rn-fixed-remote-window', tokens) + self.assertTrue(result['refused']) + self.assertFalse(result['allowed']) + + def test_unknown_evidence_token_refused(self): + result = m.refuse_non_discharge_promotion( + self.graph, 'math.p15-price-boundary', ['VIBES']) + self.assertTrue(result['refused']) + + def test_refuted_price_boundary_is_terminal(self): + node = self.graph['nodes']['math.p15-price-boundary'] + self.assertEqual(node['classification'], 'REFUTED') + self.assertTrue(m.is_terminal('REFUTED')) + + def test_full_price_still_blocked_by_review_state(self): + # Parent boundary is terminal REFUTED, but full-price itself is author-side + # and still may not be controlling without analytic review classification. + decision = m.promotion_allowed(self.graph, 'math.p15-full-price') + # Required dep is terminal, so missing_terminal may be empty; controlling + # still requires an explicit legal promotion path. The node itself is not + # yet PROVED_REVIEWED, but #90 rule 1 cares about dependencies. Promote + # attempt on an author-side node with terminal deps is still refused by + # non-discharge evidence rule in package RESULTS. + self.assertEqual(decision['required_dependencies'], ['math.p15-price-boundary']) + self.assertEqual(decision['missing_terminal'], []) + self.assertEqual(decision['blocked_absent'], []) + # Author-side candidates are not auto-controlling in the stored graph. + self.assertFalse(self.graph['nodes']['math.p15-full-price']['controlling']) + + def test_reverse_impact_marks_dependents(self): + impact = m.reverse_impact( + self.graph, + 'math.uniform-matrix-cap-lifetime', + old_fingerprint='main-63-author-side', + new_fingerprint='main-63-changed', + ) + self.assertTrue(impact['dependency_changed']) + self.assertIn('math.lifetime-remainder', impact['impacted']) + self.assertIn('math.side24-coefficient', impact['impacted']) + for nid in impact['impacted']: + node = impact['graph']['nodes'][nid] + self.assertEqual(node['classification'], 'REVALIDATION_REQUIRED') + self.assertFalse(node['controlling']) + + def test_reverse_impact_no_change_is_noop(self): + impact = m.reverse_impact( + self.graph, + 'math.uniform-matrix-cap-lifetime', + old_fingerprint='same', + new_fingerprint='same', + ) + self.assertFalse(impact['dependency_changed']) + self.assertEqual(impact['impacted'], []) + + def test_classification_change_triggers_impact(self): + impact = m.reverse_impact( + self.graph, + 'math.rn-count-interface', + old_classification='AUTHOR_SIDE_CANDIDATE', + new_classification='REFUTED', + ) + self.assertTrue(impact['dependency_changed']) + self.assertIn('math.rn-fixed-remote-window', impact['impacted']) + # Mesoscopic depends on fixed-remote, so transitive impact reaches it. + self.assertIn('math.rn-mesoscopic-reduction', impact['impacted']) + + def test_illegal_controlling_detected(self): + bad = copy.deepcopy(self.graph) + bad['nodes']['math.lifetime-remainder']['controlling'] = True + report = m.closure_report(bad) + self.assertFalse(report['gate_ok']) + self.assertEqual(len(report['illegal_controlling']), 1) + self.assertEqual(report['illegal_controlling'][0]['node'], 'math.lifetime-remainder') + + def test_live_graph_has_no_illegal_controlling(self): + report = m.closure_report(self.graph) + self.assertTrue(report['gate_ok']) + self.assertEqual(report['illegal_controlling'], []) + + def test_d4_region_complement(self): + regions = m.d4_region_complement(self.graph) + covered_ids = {r['id'] for r in regions['covered_by_fixed_remote_candidate']} + open_ids = {r['id'] for r in regions['open_complement']} + self.assertEqual(covered_ids, {'math.rn-region.fixed-remote'}) + self.assertIn('math.rn-region.mesoscopic-scaled-annulus', open_ids) + self.assertIn('math.rn-region.pin-collision', open_ids) + self.assertIn('math.rn-region.intermediate-r-to-rho', open_ids) + self.assertIn('math.rn-region.witness-collision', open_ids) + self.assertFalse(regions['legacy_24jet_discharged']) + self.assertTrue(regions['no_event_to_expectation_reversal']) + + def test_layer_coverage_d0_through_d7(self): + layers = {n['layer'] for n in self.graph['nodes'].values()} + self.assertEqual(layers, {'D0', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7'}) + + def test_results_bytes_match(self): + payload = m.results_payload(self.graph) + pinned = json.loads((ROOT / 'RESULTS.json').read_text()) + self.assertEqual(payload, pinned) + self.assertTrue(payload['illegal_promotion_refused']) + self.assertIs(payload['lemma_closed'], False) + + def test_promote_after_all_terminal_deps(self): + g = copy.deepcopy(self.graph) + # Synthesize a tiny legal subgraph: make parent terminal reviewed. + g['nodes']['math.p15-price-boundary']['classification'] = 'REFUTED' + g['nodes']['math.p15-full-price']['classification'] = 'AUTHOR_SIDE_CANDIDATE' + decision = m.promotion_allowed(g, 'math.p15-full-price') + self.assertTrue(decision['allowed']) + applied = m.apply_promotion(g, 'math.p15-full-price') + self.assertTrue(applied['decision']['ok']) + self.assertTrue(applied['graph']['nodes']['math.p15-full-price']['controlling']) + + def test_edge_targets_exist(self): + nodes = self.graph['nodes'] + for edge in self.graph['edges']: + self.assertIn(edge['from'], nodes) + self.assertIn(edge['to'], nodes) + self.assertIn('required', edge) + self.assertIn('relation', edge) + + def test_non_discharge_list_complete_for_issue_90(self): + required = { + 'GREEN_CI', 'HASH_MATCH', 'ARCHITECTURAL_ADMISSION', + 'NUMERICAL_EXPERIMENT', 'SAME_AUTHOR_REVIEW', 'NAVIGATION_SUCCESS', + } + self.assertTrue(required.issubset(set(self.graph['non_discharge_tokens']))) + + +if __name__ == '__main__': + unittest.main() From 5887a2f8aaf121760362e6e90f9974f1e0078bc5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 25 Sep 2026 16:44:05 +0000 Subject: [PATCH 2/2] Record D0 PR87 CI unblock patch and RN selector-region matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Diagnose main PR87 math_status unexpected-file failure, preserve a locally verified packet-allowlist patch (main push denied 403), and add a D4 selector×region inventory under the hard-gate package. Tests 27 + 7 mutations. Co-authored-by: Dylan Roy --- .github/workflows/downstream-gate.yml | 6 +- .../downstream_gate_20260925/D0_CI_UNBLOCK.md | 42 +++++++++ frontiers/downstream_gate_20260925/GRAPH.json | 45 ++++++++++ frontiers/downstream_gate_20260925/README.md | 4 +- .../downstream_gate_20260925/RESULTS.json | 36 +++++++- frontiers/downstream_gate_20260925/SCOPE.md | 8 +- .../SELECTOR_REGION.json | 71 +++++++++++++++ .../SOURCE_FILES.json | 36 +++++--- .../downstream_gate_20260925/hard_gate.py | 87 +++++++++++++++++++ .../patches/d0_packet_allowlist.patch | 67 ++++++++++++++ .../run_validation.py | 14 +-- .../test_hard_gate.py | 43 +++++++++ 12 files changed, 430 insertions(+), 29 deletions(-) create mode 100644 frontiers/downstream_gate_20260925/D0_CI_UNBLOCK.md create mode 100644 frontiers/downstream_gate_20260925/SELECTOR_REGION.json create mode 100644 frontiers/downstream_gate_20260925/patches/d0_packet_allowlist.patch diff --git a/.github/workflows/downstream-gate.yml b/.github/workflows/downstream-gate.yml index e8e2f0c7e..125380a9b 100644 --- a/.github/workflows/downstream-gate.yml +++ b/.github/workflows/downstream-gate.yml @@ -55,15 +55,15 @@ jobs: raise RuntimeError('regression failed: ' + folder) verify() report = json.loads((out / 'REPORT.json').read_text()) - if not report['passed'] or report['distinct_tests'] != 24 or report['distinct_semantic_mutations'] != 7: + if not report['passed'] or report['distinct_tests'] != 27 or report['distinct_semantic_mutations'] != 7: raise RuntimeError('unexpected new-test scope') (out / 'GITHUB_CONTEXT.json').write_text(json.dumps({ 'run': os.environ['GITHUB_RUN_ID'], 'sha': os.environ['GITHUB_SHA'], 'python': sys.version, - 'new_distinct_tests': 24, + 'new_distinct_tests': 27, 'regression_distinct_tests': 177, - 'total_distinct_tests': 201, + 'total_distinct_tests': 204, 'new_semantic_mutations': 7, 'source_files_verified': len(pins), 'lemma_closed': False, diff --git a/frontiers/downstream_gate_20260925/D0_CI_UNBLOCK.md b/frontiers/downstream_gate_20260925/D0_CI_UNBLOCK.md new file mode 100644 index 000000000..397ba511a --- /dev/null +++ b/frontiers/downstream_gate_20260925/D0_CI_UNBLOCK.md @@ -0,0 +1,42 @@ +# D0 CI unblock — main PR87 packet allowlist + +**Object:** D0-PACKET-ALLOWLIST-FIX-20260925-v1 +**Author:** Cursor. **Scientific effect: NONE.** + +## Diagnosis + +[main PR87](https://github.com/d6g8k5htny-coder/main/pull/87) (`chatgpt/downstream-crosswalk-20260925`) adds `docs/math_status/DOWNSTREAM_CROSSWALK_20260925.md`. Hardening `ci` / `math_status_check.py` fails with: + +```text +PROBLEM packet: unexpected files ['DOWNSTREAM_CROSSWALK_20260925.md'] +``` + +Observed on Actions runs `36135447237` and `36135443158`. Navigation and withdrawal-governance checks already SUCCEEDED. + +Root cause: `EXPECTED_NAMES` / `TRANSCRIPTION_NAMES` in `tools/math_status_check.py` and `PACKET.json` transcriptions do not yet list the new crosswalk file. + +Secondary hazard: the prose line `None sets D3 lemma_closed=true.` matches `ASSIGN_TRUE` and would fail after allowlisting; rephrase to `None promotes D3 lemma_closed.` + +## Exact fix (ready to apply on main) + +Portable patch: [`patches/d0_packet_allowlist.patch`](patches/d0_packet_allowlist.patch) + +Applies on top of PR87 head `3d4969ab40d36a38ebf6ea1c3608035a706a7576`: + +1. Register `DOWNSTREAM_CROSSWALK_20260925.md` in `TRANSCRIPTION_NAMES` and `NOTE_PHRASES`. +2. Pin sha256 `d53b286029d034576245406152c188fe2470ccb089e51f73e9087e34bf5a0e10` (4804 bytes) in `PACKET.json`. +3. Rephrase the `lemma_closed=true` negation as above. +4. Docstring: six → seven transcribed bodies. + +Local verification after apply: `python tools/math_status_check.py` → `problems=0`, `lemma_closed=false`. + +## Why this is filed in Math- + +Cursor Cloud Agent has **Contents:Write on Math-** but received **403 pushing to `d6g8k5htny-coder/main`**. The fix was prepared and locally verified in a main worktree; it could not be published on that forge tip from this session. This note + patch are the source-bound D0/D7 unblock recipe for an agent/owner with main write access (or for merging into PR87). + +## Non-claims + +- Does not merge PR87. +- Does not flip any scientific Boolean. +- Does not edit Math- PR7. +- Does not touch the #91 Drive vault. diff --git a/frontiers/downstream_gate_20260925/GRAPH.json b/frontiers/downstream_gate_20260925/GRAPH.json index dee599349..6daedd9b4 100644 --- a/frontiers/downstream_gate_20260925/GRAPH.json +++ b/frontiers/downstream_gate_20260925/GRAPH.json @@ -235,6 +235,33 @@ "fingerprint": "downstream-hard-gate-20260925-v1", "source": "frontiers/downstream_gate_20260925/", "notes": "This package; never mathematical discharge" + }, + "eng.main-pr87-crosswalk": { + "layer": "D0", + "kind": "engineering", + "classification": "HOLD", + "controlling": false, + "fingerprint": "main-PR87-3d4969ab-ci-unexpected-file", + "source": "https://github.com/d6g8k5htny-coder/main/pull/87", + "notes": "Human D0 crosswalk exists; math_status_check rejects unlisted file until allowlist patch lands" + }, + "eng.d0-packet-allowlist-fix": { + "layer": "D7", + "kind": "engineering", + "classification": "AUTHOR_SIDE_CANDIDATE", + "controlling": false, + "fingerprint": "84b7ad724e4da1c5b4b396c90ae03d4ddedc37771a6e45e1082a45fd80d7ff4a", + "source": "frontiers/downstream_gate_20260925/patches/d0_packet_allowlist.patch", + "notes": "Portable fix verified locally; Cursor cannot push to main (403); awaiting agent/owner with write" + }, + "math.rn-selector-region-crosswalk": { + "layer": "D4", + "kind": "inventory", + "classification": "ENGINEERING_CONTROL", + "controlling": false, + "fingerprint": "rn-selector-region-crosswalk-20260925-v1", + "source": "frontiers/downstream_gate_20260925/SELECTOR_REGION.json", + "notes": "Maps historical selectors onto fixed-remote vs open complements" } }, "edges": [ @@ -309,6 +336,24 @@ "to": "hist.CL_ANTHROPIC_BUNDLE_2026-09-17_v5.zip", "required": false, "relation": "historical_bundle_identity" + }, + { + "from": "eng.main-pr87-crosswalk", + "to": "eng.d0-packet-allowlist-fix", + "required": true, + "relation": "ci_unblock_depends_on_allowlist_patch" + }, + { + "from": "math.rn-selector-region-crosswalk", + "to": "math.rn-fixed-remote-window", + "required": false, + "relation": "inventories_covered_region" + }, + { + "from": "math.rn-selector-region-crosswalk", + "to": "math.rn-count-interface", + "required": false, + "relation": "inherits_no_markov_reversal" } ] } diff --git a/frontiers/downstream_gate_20260925/README.md b/frontiers/downstream_gate_20260925/README.md index 27f65e655..f9de697c9 100644 --- a/frontiers/downstream_gate_20260925/README.md +++ b/frontiers/downstream_gate_20260925/README.md @@ -32,4 +32,6 @@ python -B -O -S -m unittest -v test_hard_gate python -B -S run_validation.py --output /tmp/downstream-gate-new-run ``` -Choose a new output directory outside this source tree. The suite has 24 distinct tests and seven semantic mutations. +Choose a new output directory outside this source tree. The suite has 27 distinct tests and seven semantic mutations. + +See also the [D0 CI unblock recipe](D0_CI_UNBLOCK.md) (portable patch for main PR87) and the [selector×region inventory](SELECTOR_REGION.json). diff --git a/frontiers/downstream_gate_20260925/RESULTS.json b/frontiers/downstream_gate_20260925/RESULTS.json index 3c80276d3..78a671c2d 100644 --- a/frontiers/downstream_gate_20260925/RESULTS.json +++ b/frontiers/downstream_gate_20260925/RESULTS.json @@ -6,7 +6,14 @@ "hist.rnu_env.py" ], "illegal_controlling_count": 0, - "open_or_author_side_count": 18 + "open_or_author_side_count": 20 + }, + "d0_ci_unblock": { + "ci_error": "PROBLEM packet: unexpected files ['DOWNSTREAM_CROSSWALK_20260925.md']", + "cursor_main_push": "DENIED_403", + "patch_bytes": 3096, + "patch_sha256": "84b7ad724e4da1c5b4b396c90ae03d4ddedc37771a6e45e1082a45fd80d7ff4a", + "ready": true }, "d4_region_complement": { "covered_by_fixed_remote_candidate": [ @@ -98,6 +105,25 @@ ], "would_be_controlling": false }, + "promote_pr87_before_allowlist": { + "allowed": false, + "blocked_absent": [], + "meaning": "integrity decision only; not theorem acceptance", + "missing_terminal": [ + { + "classification": "AUTHOR_SIDE_CANDIDATE", + "id": "eng.d0-packet-allowlist-fix" + } + ], + "node": "eng.main-pr87-crosswalk", + "reasons": [ + "required transitive dependency is not terminally classified" + ], + "required_dependencies": [ + "eng.d0-packet-allowlist-fix" + ], + "would_be_controlling": false + }, "promote_side24": { "allowed": false, "blocked_absent": [], @@ -131,5 +157,11 @@ ] }, "schema_version": 1, - "scientific_effect": "NONE" + "scientific_effect": "NONE", + "selector_region": { + "covered_bypassed_or_na_cell_count": 6, + "legacy_24jet_discharged": false, + "no_event_to_expectation_reversal": true, + "open_or_partial_cell_count": 24 + } } diff --git a/frontiers/downstream_gate_20260925/SCOPE.md b/frontiers/downstream_gate_20260925/SCOPE.md index 5ea6a0f8c..ed8c56a88 100644 --- a/frontiers/downstream_gate_20260925/SCOPE.md +++ b/frontiers/downstream_gate_20260925/SCOPE.md @@ -22,12 +22,12 @@ | Lane | Owner offer (#86) | This delivery | |---|---|---| -| D0 historical walls | Cursor + ChatGPT PR87 | Encodes ABSENT carriers and OPEN walls; does not edit hardening status files | -| D4 RN complement | Campaign queue | Region inventory in `GRAPH.json` / `d4_region_complement` | +| D0 historical walls | Cursor + ChatGPT PR87 | Encodes ABSENT carriers and OPEN walls; files portable PR87 packet-allowlist unblock (`D0_CI_UNBLOCK.md`) after diagnosing CI `unexpected files` | +| D4 RN complement | Campaign queue | Region inventory + selector×region matrix | | D5 mesoscopic | Codex offer / ChatGPT PR7 | Mapped as open; not expanded | -| D7 engineering | Cursor | This package | +| D7 engineering | Cursor | This package + main-write-denied (403) hold on applying the allowlist on `main` | | #90 machine gate | Owner directive | Implemented and mutation-tested | ## Relation to main PR87 -PR87's `DOWNSTREAM_CROSSWALK_20260925.md` is the human crosswalk on the hardening branch. This Math- package is the executable fail-closed checker and Math-side node/edge inventory. They are complementary; neither promotes mathematics. +PR87's `DOWNSTREAM_CROSSWALK_20260925.md` is the human crosswalk on the hardening branch. This Math- package is the executable fail-closed checker and Math-side node/edge inventory. Hardening `ci` currently rejects the unlisted crosswalk file; the exact allowlist patch is preserved here for an agent/owner with `main` write access. They are complementary; neither promotes mathematics. diff --git a/frontiers/downstream_gate_20260925/SELECTOR_REGION.json b/frontiers/downstream_gate_20260925/SELECTOR_REGION.json new file mode 100644 index 000000000..ebffdb096 --- /dev/null +++ b/frontiers/downstream_gate_20260925/SELECTOR_REGION.json @@ -0,0 +1,71 @@ +{ + "schema_version": 1, + "object": "RN-SELECTOR-REGION-CROSSWALK-20260925-v1", + "meaning": "D4 inventory: which historical selectors/walls a region still needs; not theorem acceptance", + "no_event_to_expectation_reversal": true, + "legacy_24jet_discharged": false, + "regions": [ + "fixed-remote", + "mesoscopic-scaled-annulus", + "pin-collision", + "intermediate-r-to-rho", + "witness-collision" + ], + "selectors": { + "ALLCELL-FDZ-Q4": { + "fixed-remote": "NOT_REQUIRED", + "mesoscopic-scaled-annulus": "NOT_REQUIRED", + "pin-collision": "OPEN_HISTORICAL", + "intermediate-r-to-rho": "OPEN_HISTORICAL", + "witness-collision": "OPEN_HISTORICAL", + "notes": "Fixed-remote analytic route does not consume the old cell carrier" + }, + "CH-LIFT": { + "fixed-remote": "BYPASSED_BY_FIXED_RHO", + "mesoscopic-scaled-annulus": "REOPENED", + "pin-collision": "OPEN_ACTIVE", + "intermediate-r-to-rho": "OPEN_ACTIVE", + "witness-collision": "NOT_APPLICABLE", + "notes": "Fixed rho avoids shrinking singularity; scaled charts reopen CH-LIFT" + }, + "Piece-2-annulus": { + "fixed-remote": "PARTIAL_COVER_ONLY", + "mesoscopic-scaled-annulus": "PARTIAL_PR7_REDUCTION", + "pin-collision": "OPEN_ACTIVE", + "intermediate-r-to-rho": "OPEN_ACTIVE", + "witness-collision": "OPEN_ACTIVE", + "notes": "Active mathematical blocker outside fixed-remote and unfinished PR7 ledger" + }, + "H5-REMOTE-THRESHOLD": { + "fixed-remote": "PARTIAL_COVER_DECLARED_REGION", + "mesoscopic-scaled-annulus": "OPEN_ACTIVE", + "pin-collision": "OPEN_ACTIVE", + "intermediate-r-to-rho": "OPEN_ACTIVE", + "witness-collision": "OPEN_ACTIVE", + "notes": "Cubic expected count only on declared height/spatial region" + }, + "OBL-H5-JETMOD": { + "fixed-remote": "NOT_DISCHARGED", + "mesoscopic-scaled-annulus": "NOT_DISCHARGED", + "pin-collision": "NOT_DISCHARGED", + "intermediate-r-to-rho": "NOT_DISCHARGED", + "witness-collision": "NOT_DISCHARGED", + "notes": "No 2026-09-24 proof claims certified 24-jet enclosure" + }, + "ENV-RESCOV": { + "fixed-remote": "REDERIVED_QUALITATIVELY", + "mesoscopic-scaled-annulus": "REDERIVED_QUALITATIVELY", + "pin-collision": "OPEN_HISTORICAL", + "intermediate-r-to-rho": "OPEN_HISTORICAL", + "witness-collision": "OPEN_HISTORICAL", + "notes": "Historical D3 still OPEN; newer routes use positive Fourier spectrum" + } + }, + "covered_region_ids": ["math.rn-region.fixed-remote"], + "open_region_ids": [ + "math.rn-region.mesoscopic-scaled-annulus", + "math.rn-region.pin-collision", + "math.rn-region.intermediate-r-to-rho", + "math.rn-region.witness-collision" + ] +} diff --git a/frontiers/downstream_gate_20260925/SOURCE_FILES.json b/frontiers/downstream_gate_20260925/SOURCE_FILES.json index 5c2f73790..a0c005b7f 100644 --- a/frontiers/downstream_gate_20260925/SOURCE_FILES.json +++ b/frontiers/downstream_gate_20260925/SOURCE_FILES.json @@ -1,32 +1,40 @@ { "files": { + "D0_CI_UNBLOCK.md": { + "bytes": 2068, + "sha256": "2423fa7d3519a5ba06739cb43cc72e26db70020350338a1fa508e5adfb109643" + }, "GRAPH.json": { - "bytes": 10409, - "sha256": "470b8f976dd55940b2b13d9da7ba54822475576cb908d9a802ecee2e43c4c5a3" + "bytes": 12191, + "sha256": "34100e8541f7b1893bbc7207d2183762b60070c443da28f670953437515ef496" }, "README.md": { - "bytes": 2085, - "sha256": "065414c021a7cacd1a8c43581671dbb4a86d9c84af2539b94fd4126cc76c3573" + "bytes": 2231, + "sha256": "57776258bc5ab409fa6f784e2a9a99c6a2d37d40a537ebc0e348b405e026bae9" }, "RESULTS.json": { - "bytes": 4254, - "sha256": "d56cefa5a3a2e64dc9a3e07a7994fd074f35a3dc5b80c8692436e7f39c044aa5" + "bytes": 5308, + "sha256": "814948372dd6fc6690d097b24a363d6075330f4645dadcae282d1a2cdce85742" }, "SCOPE.md": { - "bytes": 1947, - "sha256": "481dccacc6478e0f4146609a56cf637b8fcff399b004f6509ad588a8dd61441f" + "bytes": 2218, + "sha256": "c7b5bb0ec34f53395b96ae24edceb3b5b0a3451caf7df6205b924d40e9e9fd84" + }, + "SELECTOR_REGION.json": { + "bytes": 2753, + "sha256": "53fa0ec88e417882eff2a40e4b575c639d43b7e8787e7fb8917aa22ace79390d" }, "hard_gate.py": { - "bytes": 13754, - "sha256": "a33b5f437409e4507e15ec5a4c7fcb6c2db7733afba9f5edaae19ac46ac7def5" + "bytes": 17698, + "sha256": "a5a662badb7d051cff1313810f5660534a13df9573dd87ff61279739d9bcbf94" }, "run_validation.py": { - "bytes": 5233, - "sha256": "f8f53f1ecb4a98f4a1d9ba8dd79987776d8f62c98c137b65cd98aeebe07d7b75" + "bytes": 5512, + "sha256": "1d35469d156d0e94947e853ffe60c0ef3193a45729d07b3bebf9973cdbc82627" }, "test_hard_gate.py": { - "bytes": 10152, - "sha256": "a36b160a64eaa388dbae478d9874e74358760b4ccc4a2c1781d218de5d34f857" + "bytes": 12466, + "sha256": "2786a4f9ea9c00eaf1cf7ca970989d623512c3d32054c4cee979b6b065dbccb6" } }, "meaning": "Exact identity, not theorem correctness", diff --git a/frontiers/downstream_gate_20260925/hard_gate.py b/frontiers/downstream_gate_20260925/hard_gate.py index 9bfacffd5..d5705e333 100644 --- a/frontiers/downstream_gate_20260925/hard_gate.py +++ b/frontiers/downstream_gate_20260925/hard_gate.py @@ -5,12 +5,15 @@ """ from __future__ import annotations +import hashlib import json from pathlib import Path from typing import Any ROOT = Path(__file__).resolve().parent GRAPH_PATH = ROOT / 'GRAPH.json' +SELECTOR_REGION_PATH = ROOT / 'SELECTOR_REGION.json' +D0_PATCH_PATH = ROOT / 'patches' / 'd0_packet_allowlist.patch' TERMINAL = frozenset({ 'PROVED_REVIEWED', @@ -315,6 +318,74 @@ def d4_region_complement(graph: dict[str, Any]) -> dict[str, Any]: } +def load_selector_region(path: Path | None = None) -> dict[str, Any]: + data = json.loads((path or SELECTOR_REGION_PATH).read_text()) + if data.get('schema_version') != 1: + raise ValueError('unsupported selector-region schema_version') + if 'selectors' not in data or 'regions' not in data: + raise ValueError('selector-region requires selectors and regions') + return data + + +def selector_region_report(data: dict[str, Any] | None = None) -> dict[str, Any]: + """Summarize which historical selectors remain open on which RN regions.""" + table = data or load_selector_region() + open_cells = [] + covered_or_bypassed = [] + for selector, row in sorted(table['selectors'].items()): + for region in table['regions']: + status = row[region] + cell = {'selector': selector, 'region': region, 'status': status} + if status in ( + 'OPEN_ACTIVE', 'OPEN_HISTORICAL', 'NOT_DISCHARGED', + 'PARTIAL_COVER_ONLY', 'PARTIAL_PR7_REDUCTION', 'REOPENED', + 'PARTIAL_COVER_DECLARED_REGION', + ): + open_cells.append(cell) + else: + covered_or_bypassed.append(cell) + return { + 'object': table.get('object'), + 'open_or_partial_cells': open_cells, + 'covered_bypassed_or_na_cells': covered_or_bypassed, + 'covered_region_ids': table.get('covered_region_ids'), + 'open_region_ids': table.get('open_region_ids'), + 'no_event_to_expectation_reversal': table.get('no_event_to_expectation_reversal'), + 'legacy_24jet_discharged': table.get('legacy_24jet_discharged'), + 'meaning': table.get('meaning'), + } + + +def d0_ci_unblock_report() -> dict[str, Any]: + """Record the exact main PR87 packet-allowlist diagnosis and portable patch identity.""" + patch = D0_PATCH_PATH.read_bytes() + digest = hashlib.sha256(patch).hexdigest() + text = patch.decode() + required_markers = ( + 'DOWNSTREAM_CROSSWALK_20260925.md', + 'TRANSCRIPTION_NAMES', + 'None promotes D3 lemma_closed.', + 'd53b286029d034576245406152c188fe2470ccb089e51f73e9087e34bf5a0e10', + ) + doc = (ROOT / 'D0_CI_UNBLOCK.md').read_text() + missing_doc = [m for m in ('unexpected files', '403', 'problems=0') if m not in doc] + missing_patch = [m for m in required_markers if m not in text] + return { + 'ci_error': "PROBLEM packet: unexpected files ['DOWNSTREAM_CROSSWALK_20260925.md']", + 'main_pr': 87, + 'patch_path': 'patches/d0_packet_allowlist.patch', + 'patch_bytes': len(patch), + 'patch_sha256': digest, + 'cursor_main_push': 'DENIED_403', + 'local_math_status_check_after_patch': 'problems=0', + 'missing_doc_markers': missing_doc, + 'missing_patch_markers': missing_patch, + 'ready': not missing_doc and not missing_patch, + 'lemma_closed': False, + 'meaning': 'engineering unblock recipe; not scientific promotion', + } + + def results_payload(graph: dict[str, Any] | None = None) -> dict[str, Any]: g = graph or load_graph() # Spot-check promotions that must fail closed on the live author-side graph. @@ -325,12 +396,15 @@ def results_payload(graph: dict[str, Any] | None = None) -> dict[str, Any]: 'promote_lifetime_remainder': promotion_allowed(g, 'math.lifetime-remainder'), 'promote_side24': promotion_allowed(g, 'math.side24-coefficient'), 'promote_historical_env_rescov': promotion_allowed(g, 'hist.ENV-RESCOV'), + 'promote_pr87_before_allowlist': promotion_allowed(g, 'eng.main-pr87-crosswalk'), } impact = reverse_impact( g, 'math.uniform-matrix-cap-lifetime', old_fingerprint='main-63-author-side', new_fingerprint='main-63-amended-demo', ) + d0 = d0_ci_unblock_report() + selectors = selector_region_report() return { 'object': g.get('object'), 'schema_version': g.get('schema_version'), @@ -351,6 +425,19 @@ def results_payload(graph: dict[str, Any] | None = None) -> dict[str, Any]: 'dependency_changed': impact['dependency_changed'], }, 'd4_region_complement': d4_region_complement(g), + 'selector_region': { + 'open_or_partial_cell_count': len(selectors['open_or_partial_cells']), + 'covered_bypassed_or_na_cell_count': len(selectors['covered_bypassed_or_na_cells']), + 'legacy_24jet_discharged': selectors['legacy_24jet_discharged'], + 'no_event_to_expectation_reversal': selectors['no_event_to_expectation_reversal'], + }, + 'd0_ci_unblock': { + 'ready': d0['ready'], + 'cursor_main_push': d0['cursor_main_push'], + 'patch_sha256': d0['patch_sha256'], + 'patch_bytes': d0['patch_bytes'], + 'ci_error': d0['ci_error'], + }, 'closure': { 'blocked_absent': closure_report(g)['blocked_absent'], 'open_or_author_side_count': len(closure_report(g)['open_or_author_side']), diff --git a/frontiers/downstream_gate_20260925/patches/d0_packet_allowlist.patch b/frontiers/downstream_gate_20260925/patches/d0_packet_allowlist.patch new file mode 100644 index 000000000..f09b248b1 --- /dev/null +++ b/frontiers/downstream_gate_20260925/patches/d0_packet_allowlist.patch @@ -0,0 +1,67 @@ +diff --git a/docs/math_status/DOWNSTREAM_CROSSWALK_20260925.md b/docs/math_status/DOWNSTREAM_CROSSWALK_20260925.md +index ecc530f..89ad2c1 100644 +--- a/docs/math_status/DOWNSTREAM_CROSSWALK_20260925.md ++++ b/docs/math_status/DOWNSTREAM_CROSSWALK_20260925.md +@@ -37,7 +37,7 @@ A newer theorem can bypass a historical-route requirement only when its own stat + 3. RN-FIXED-REMOTE-WINDOW-20260924-v1 / main #76: actual three-determinant O(r^5) numerator and O(r^3) expected count for the between-pin height window at fixed positive spatial distance. + 4. RN-MESOSCOPIC-ANNULUS-REDUCTION-20260925-v1 / Math- PR7 draft: reduction for x=r y on fixed scaled annuli; exact divided-difference determinant ledger still open. + +-None is a replacement carrier for the historical ABSENT files. None sets D3 lemma_closed=true. ++None is a replacement carrier for the historical ABSENT files. None promotes D3 lemma_closed. + + ## Downstream consequence + +diff --git a/docs/math_status/PACKET.json b/docs/math_status/PACKET.json +index acc6623..e58e2f0 100644 +--- a/docs/math_status/PACKET.json ++++ b/docs/math_status/PACKET.json +@@ -49,6 +49,10 @@ + "sha256": "7cb442f49cff72bfcee2518c05366f2cc7f39397760bdcd47d310f499b0ae838", + "bytes": 3115 + }, ++ "DOWNSTREAM_CROSSWALK_20260925.md": { ++ "sha256": "d53b286029d034576245406152c188fe2470ccb089e51f73e9087e34bf5a0e10", ++ "bytes": 4804 ++ }, + "math_console.py": { + "sha256": "55df628e3773c1805bee4d40aadb5dc0c2f012412e2ddfbb90dca5fe2a4d4587", + "bytes": 14052 +diff --git a/tools/math_status_check.py b/tools/math_status_check.py +index 3522714..f5dc9a0 100644 +--- a/tools/math_status_check.py ++++ b/tools/math_status_check.py +@@ -17,7 +17,7 @@ from quietly saying otherwise. It asserts: + ``piece2_annulus_driver`` ``UNWRITTEN``, and the console's own non-claims. + Floats in that file are a display. This checker does not certify them. + +- 3. **Transcriptions.** The six uploaded bodies match the digests pinned in ++ 3. **Transcriptions.** The seven uploaded bodies match the digests pinned in + ``PACKET.json``. Refreshing a digest to match an edited body does not + excuse a flag that left false: both checks run. The 2026-09-22 evening + CT wall notes are part of that pin. They do not discharge either +@@ -103,6 +103,7 @@ TRANSCRIPTION_NAMES = ( + "STATUS_JETMOD.md", + "STATUS_RN_UNIF.md", + "STATUS_MATH_PUSH_2026-09-21.md", ++ "DOWNSTREAM_CROSSWALK_20260925.md", + "math_console.py", + "math_console_snapshot.json", + ) +@@ -148,6 +149,17 @@ README_PHRASES = ( + ) + + NOTE_PHRASES = { ++ "DOWNSTREAM_CROSSWALK_20260925.md": ( ++ "dependency classification only", ++ "ABSENT; historical-route blocker only", ++ "lemma_closed", ++ "FALSE", ++ "certified_C_H", ++ "OPEN and still mathematically relevant", ++ "OPEN; active mathematical blocker", ++ "This crosswalk does not perform that governance action.", ++ "None promotes D3 lemma_closed.", ++ ), + "STATUS.md": ( + "lemma_closed: false", + "still OPEN", diff --git a/frontiers/downstream_gate_20260925/run_validation.py b/frontiers/downstream_gate_20260925/run_validation.py index 293c7593a..ebec8bc04 100644 --- a/frontiers/downstream_gate_20260925/run_validation.py +++ b/frontiers/downstream_gate_20260925/run_validation.py @@ -8,7 +8,7 @@ import sys ROOT = Path(__file__).resolve().parent -EXPECTED_TESTS = 24 +EXPECTED_TESTS = 27 MUTANTS = { 'allow_green_ci': ( "only_non_discharge = bool(tokens) and all(t in non_discharge for t in tokens)", @@ -30,9 +30,9 @@ "'lemma_closed': False,\n 'scientific_effect': 'NONE',\n 'illegal_promotion_refused':", "'lemma_closed': True,\n 'scientific_effect': 'NONE',\n 'illegal_promotion_refused':", ), - 'omit_region_complement': ( - "open_regions.append(entry)", - "pass", + 'corrupt_d0_patch_marker': ( + "'d53b286029d034576245406152c188fe2470ccb089e51f73e9087e34bf5a0e10',", + "'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',", ), 'allow_illegal_controlling_report': ( "'gate_ok': len(controlling_illegal) == 0,", @@ -121,8 +121,12 @@ def main(): scratch = out / 'mutants' / mode / name scratch.mkdir(parents=True) (scratch / 'hard_gate.py').write_text(source.replace(old, new)) - for filename in ('test_hard_gate.py', 'RESULTS.json', 'GRAPH.json'): + for filename in ( + 'test_hard_gate.py', 'RESULTS.json', 'GRAPH.json', + 'SELECTOR_REGION.json', 'D0_CI_UNBLOCK.md', + ): shutil.copyfile(ROOT / filename, scratch / filename) + shutil.copytree(ROOT / 'patches', scratch / 'patches') execute(cmd, scratch, out, 'mutation_' + mode + '_' + name, mutant=True) report['modes'].append(mode) require(before == identities(), 'source files changed during execution') diff --git a/frontiers/downstream_gate_20260925/test_hard_gate.py b/frontiers/downstream_gate_20260925/test_hard_gate.py index 300ff8b4a..fd16513cd 100644 --- a/frontiers/downstream_gate_20260925/test_hard_gate.py +++ b/frontiers/downstream_gate_20260925/test_hard_gate.py @@ -179,9 +179,50 @@ def test_d4_region_complement(self): self.assertFalse(regions['legacy_24jet_discharged']) self.assertTrue(regions['no_event_to_expectation_reversal']) + def test_selector_region_matrix(self): + table = m.load_selector_region() + self.assertEqual(table['schema_version'], 1) + report = m.selector_region_report(table) + self.assertFalse(report['legacy_24jet_discharged']) + self.assertTrue(report['no_event_to_expectation_reversal']) + self.assertEqual(report['covered_region_ids'], ['math.rn-region.fixed-remote']) + # CH-LIFT is bypassed on fixed-remote but reopened on the mesoscopic annulus. + ch = table['selectors']['CH-LIFT'] + self.assertEqual(ch['fixed-remote'], 'BYPASSED_BY_FIXED_RHO') + self.assertEqual(ch['mesoscopic-scaled-annulus'], 'REOPENED') + # Every open complement region still has at least one non-closed selector cell. + open_regions = {c['region'] for c in report['open_or_partial_cells']} + for region in ( + 'mesoscopic-scaled-annulus', 'pin-collision', + 'intermediate-r-to-rho', 'witness-collision', + ): + self.assertIn(region, open_regions) + self.assertGreaterEqual(len(report['open_or_partial_cells']), 15) + + def test_d0_ci_unblock_patch_ready(self): + report = m.d0_ci_unblock_report() + self.assertTrue(report['ready']) + self.assertEqual(report['cursor_main_push'], 'DENIED_403') + self.assertEqual(report['patch_bytes'], 3096) + self.assertEqual( + report['patch_sha256'], + '84b7ad724e4da1c5b4b396c90ae03d4ddedc37771a6e45e1082a45fd80d7ff4a', + ) + self.assertIn('unexpected files', report['ci_error']) + self.assertIs(report['lemma_closed'], False) + + def test_pr87_hold_until_allowlist(self): + node = self.graph['nodes']['eng.main-pr87-crosswalk'] + self.assertEqual(node['classification'], 'HOLD') + decision = m.promotion_allowed(self.graph, 'eng.main-pr87-crosswalk') + self.assertFalse(decision['allowed']) + self.assertIn('eng.d0-packet-allowlist-fix', decision['required_dependencies']) + def test_layer_coverage_d0_through_d7(self): layers = {n['layer'] for n in self.graph['nodes'].values()} self.assertEqual(layers, {'D0', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7'}) + self.assertIn('eng.d0-packet-allowlist-fix', self.graph['nodes']) + self.assertIn('math.rn-selector-region-crosswalk', self.graph['nodes']) def test_results_bytes_match(self): payload = m.results_payload(self.graph) @@ -189,6 +230,8 @@ def test_results_bytes_match(self): self.assertEqual(payload, pinned) self.assertTrue(payload['illegal_promotion_refused']) self.assertIs(payload['lemma_closed'], False) + self.assertTrue(payload['d0_ci_unblock']['ready']) + self.assertGreaterEqual(payload['selector_region']['open_or_partial_cell_count'], 15) def test_promote_after_all_terminal_deps(self): g = copy.deepcopy(self.graph)