From 6fc2f387b13157778aff09b1611425b5cdd2f406 Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Tue, 20 Oct 2026 08:31:25 +0100 Subject: [PATCH] feat(research): audit PR4091 ceiling transfer onto the retained PR4088 head Independent premise equivalence and fresh Decimal-bisection reproduction of the pooled-optimum, pinned-literal and later-head moment roots; remaining headroom is exactly 1.140318244487202e-9 (58.45% of the original margin). No new kappa, no supplier admission, selected record unchanged. --- .../fourth-entry-ceiling-transfer/README.md | 89 ++++ .../fourth-entry-ceiling-transfer/RESULT.json | 119 ++++++ .../SOURCES.json | 114 +++++ .../fourth-entry-ceiling-transfer/TASK.json | 107 +++++ .../fourth-entry-ceiling-transfer/VERIFY.json | 39 ++ .../test_verify.py | 83 ++++ .../fourth-entry-ceiling-transfer/verify.py | 388 ++++++++++++++++++ 7 files changed, 939 insertions(+) create mode 100644 research/fourth-entry-ceiling-transfer/README.md create mode 100644 research/fourth-entry-ceiling-transfer/RESULT.json create mode 100644 research/fourth-entry-ceiling-transfer/SOURCES.json create mode 100644 research/fourth-entry-ceiling-transfer/TASK.json create mode 100644 research/fourth-entry-ceiling-transfer/VERIFY.json create mode 100644 research/fourth-entry-ceiling-transfer/test_verify.py create mode 100644 research/fourth-entry-ceiling-transfer/verify.py diff --git a/research/fourth-entry-ceiling-transfer/README.md b/research/fourth-entry-ceiling-transfer/README.md new file mode 100644 index 000000000..add8ee87a --- /dev/null +++ b/research/fourth-entry-ceiling-transfer/README.md @@ -0,0 +1,89 @@ +# Does PR4091's pooled ceiling transfer to the retained PR4088 head? + +Independent source-bound transfer audit, priority revision 7 card +`independent-moment`. **No new kappa, no supplier admission, and no change to +the selected record.** + +PR4091 (`research/staged-fourth-mixture-ceiling`) certifies a sharp pooled +ceiling `0.001730980255989036959962..963` for a fixed two-provider invoice +pinned to PR4088 head `76088d49e3ed4142a958659aa996b0ca4da5e88e` +(1,080 fourth-entry calls of 3,240). The retained PR4088 head on main +(`research/staged544-mixed-fourth-entry`, `72d7efc181edb21806a878f174847c96 +dd410ab0`) uses 1,090 fourth-entry calls. Revision 7 requires verifying word, +capacity and stock equivalence before applying the ceiling to the later fill. + +## Verdict (all checks pass; `verify.py`) + +1. **Words identical byte-for-byte.** All four shared scalar-word inputs + (`THREE/FOUR × base/extra`) hash identically (gzip payload and canonical + JSON) between the ceiling package's `source4088/inputs/` freeze and the + retained head's `inputs/`: 4/4. The four-entry profile derived from + PR4091's published `L3` and `d = L4-L3` equals PR4088's published table. +2. **Capacity and stock identical.** Bin inventory `8:241,920`, + `16/32/48: 161,280` each, total 725,760 bins (= 360 replicas × 2,016), + agrees with the later fill's published totals (725,760 bins; 1,321,920 + roles); the residual mass is constant at 162,900 across both fills. +3. **Same word law.** Each package's published paid profile decomposes + uniquely as `3,240 x L3 + x (L4-L3) + idle residuals`, with `x` derived + independently from rank-1, rank-3 and rank-4 coordinates giving exactly + the published fourth-call counts (1,080 and 1,090). +4. **Independent moment reproduction.** A fresh Decimal bisection of + `sum_r n_r (r/73)^(1-a) / (896*360) = 1` (no reuse of either package's + solver) reproduces all three published roots inside their own brackets: + pooled optimum `0.001730980255989036959962261...` (the ceiling), pinned + literal `0.001730978305075885693430489...`, and the later head + `0.001730979115670792472760579...`. +5. **Transfer verdict with exact numbers.** The later root stays strictly + below the ceiling; remaining headroom is + `1.140318244487202e-9`, i.e. 58.45% of the original + `1.950913151266532e-9` margin. The consumed `8.10594906779330e-10` + agrees with PR4088's published gain over its previous revision + (`>= 8.10594906779328e-10`, checked as exact rationals). + +## Reproduction + +From the repository root with standard-library Python 3.12: + +```sh +python3.12 -B scripts/research_package.py --package research/fourth-entry-ceiling-transfer +python3.12 -B scripts/check_research_commit.py --package research/fourth-entry-ceiling-transfer --check-source-history +python3.12 -I -Werror -B research/fourth-entry-ceiling-transfer/verify.py +python3.12 -I -O -Werror -B research/fourth-entry-ceiling-transfer/verify.py +python3.12 -I -Werror -B research/fourth-entry-ceiling-transfer/test_verify.py +``` + +`verify.py` reads only the two retained packages and the selected record; +`test_verify.py` carries five rejecting controls (extra rank-1 children, +wrong stock divisor, tampered word delta, corrupted word payload, shifted +idle total). `RESULT.json` is the generated evidence snapshot. + +## Scope and limits + +This is a finite source-bound audit of two retained packages: premise +equivalence plus independent recomputation of their published moment roots. +Not re-derived here: + +- PR4091's 841 whole-helper-pattern coverage and its three dual certificates + are taken as published; this audit does not replay that coverage proof. +- Whether legal exchanges can reach an arbitrary idle multiset with the same + residual total (PR4091's own open question) remains open; the transfer + verdict is at the level of the pooled model's premises, not chronological + attainability. +- Native, owner/phase, chronology, precision, tape, BIT and outer-transfer + obligations are inherited unchanged; the selected #1094 record and its + kappa `0.001672660197076918` are untouched. + +## Open next questions + +- Can a legal chronological exchange reach the pooled eight-pattern idle + multiset at x=1090 (PR4091 open question 1, now with the exact remaining + headroom `1.140318244487202e-9` stated against the retained head)? +- Do later PR4088 revisions that change any word, capacity or stock premise + invalidate the transfer for subsequent ceilings? Any such change requires a + new model per PR4091's own scope note. + +Prepared by Nick Petalas with AI assistance. Credit Ross Richardson/PR4091 +and Cinna Davis/PR4088 with their packages' full retained lineages +(Rohan Arun/PR4076, Dugongue and David Ganz/PR4085/3945, dataisfire/PR3734, +ChaloupeMusic and Erwan Secousses/PR3949/3815, and the staged-release, +solver, native, owner and transfer lineage). Apache-2.0. diff --git a/research/fourth-entry-ceiling-transfer/RESULT.json b/research/fourth-entry-ceiling-transfer/RESULT.json new file mode 100644 index 000000000..b3ad64529 --- /dev/null +++ b/research/fourth-entry-ceiling-transfer/RESULT.json @@ -0,0 +1,119 @@ +{ + "assumptions_not_rederived": [ + "PR4091's 841 whole-helper pattern coverage and three dual certificates are not replayed here; the ceiling is taken as published by its own package.", + "Whether every literal exchange may reach an arbitrary idle multiset with the same residual total (PR4091 open question 1) is not settled by this audit.", + "Native, owner/phase, chronology, precision, tape, BIT and outer transfer obligations are inherited from the pinned packages and are not re-verified." + ], + "bill": { + "W": 322560, + "form": "sum_r n_r (r/m)^(1-a) / W", + "m": 73 + }, + "bin_inventory": { + "ceil_bin_counts_match": true, + "ceil_bin_total": true, + "ceil_bins_divide_replicas": true, + "idle_total_ceiling": 162900, + "idle_total_constant": true, + "idle_total_mixed": 162900, + "mix_publishes_bin_total": true, + "mix_publishes_role_total": true + }, + "card": "independent-moment", + "ceiling_bracket": [ + "0.001730980255989036959962", + "0.001730980255989036959963" + ], + "moments": { + "ceil_minus_later_upper_decimal": "1.140318244487202000000000000000e-9", + "ceiling_profile_root_reproduced": true, + "later_root_below_ceiling": true, + "later_root_in_own_bracket": true, + "margin_consumed_decimal": "8.105949067793300000000000000000e-10", + "margin_consumed_ge_published_gain": true, + "pinned_headroom_decimal": "1.950913151266532000000000000000e-9", + "pinned_literal_profile_parsed_from_proof": true, + "pinned_literal_root_reproduced": true, + "pinned_root_matches_later_packages_pin": true, + "remaining_over_original_float": 0.5845048733957777, + "remaining_over_original_ratio": "383679195/656417444", + "root_later_head": "0.00173097911567079247276057992930279289376037876463631692371950", + "root_pinned_literal": "0.00173097830507588569343048924930444139646206355277330146761050", + "root_pooled_optimum": "0.00173098025598903695996226153870190172368895322140797406630050" + }, + "pinned_head_pr4088": "76088d49e3ed4142a958659aa996b0ca4da5e88e", + "question": "Does PR4091's fixed-inventory pooled ceiling transfer to the retained later PR4088 head?", + "retained_head_pr4088": "72d7efc181edb21806a878f174847c96dd410ab0", + "schema_version": 1, + "status": "TRANSFER_SUPPORTED_AT_MODEL_PREMISES", + "word_file_payload_equal": 4, + "word_files": [ + { + "canonical_equal": true, + "container_sha256_new": "df31495cff95a1e512da398f52841c6b5ade29067869b3d68b89d756a5641112", + "container_sha256_old": "df31495cff95a1e512da398f52841c6b5ade29067869b3d68b89d756a5641112", + "file": "THREE-base.json.gz", + "payload_equal": true, + "payload_sha256": "960867f94fe43489c5108eaff4cc159714a338a8a056837e5c497ded3d72c283", + "present": true + }, + { + "canonical_equal": true, + "container_sha256_new": "9a28f7ef91938c0866e408eb06e03eb5f8e727a00b44eb936ddd5ed48704bd4c", + "container_sha256_old": "9a28f7ef91938c0866e408eb06e03eb5f8e727a00b44eb936ddd5ed48704bd4c", + "file": "THREE-extra.json.gz", + "payload_equal": true, + "payload_sha256": "ef1ca8b7d40346fc2b3261b93dab740322064e47ea194b7d989bac3650e37255", + "present": true + }, + { + "canonical_equal": true, + "container_sha256_new": "aecaddba48fdff6353a6511c3623346b05aa607e30103fb016604a2b1025ce95", + "container_sha256_old": "aecaddba48fdff6353a6511c3623346b05aa607e30103fb016604a2b1025ce95", + "file": "FOUR-base.json.gz", + "payload_equal": true, + "payload_sha256": "cc8e27b329defb34e5fe89bc18f886a4c9ff0f99a08bd4f686f4298b0eb39e04", + "present": true + }, + { + "canonical_equal": true, + "container_sha256_new": "615093190aa5479034bb8acdd8925d7a910e082b84dec7df84b459b62421235a", + "container_sha256_old": "615093190aa5479034bb8acdd8925d7a910e082b84dec7df84b459b62421235a", + "file": "FOUR-extra.json.gz", + "payload_equal": true, + "payload_sha256": "c517eed7547e48ddc9f1f561e2fcc436b5999dab4aeb0cc634806c910d5444fc", + "present": true + } + ], + "word_law_later": { + "rank2_constant": true, + "rank48_is_idle48": true, + "rank5_is_word_plus_idle5": true, + "rank8_constant": true, + "residuals_ok": true, + "x": 1090, + "x_consistent": true, + "x_rank1": "1090", + "x_rank3": "1090", + "x_rank4": "1090" + }, + "word_law_pinned": { + "rank2_constant": true, + "rank48_is_idle48": true, + "rank5_is_word_plus_idle5": true, + "rank8_constant": true, + "residuals_ok": true, + "x": 1080, + "x_consistent": true, + "x_rank1": "1080", + "x_rank3": "1080", + "x_rank4": "1080" + }, + "word_profile_anchors": { + "ceil_proof_has_L3": true, + "ceil_proof_has_delta": true, + "derived_L4_matches": true, + "mix_readme_has_four": true, + "mix_readme_has_three": true + } +} diff --git a/research/fourth-entry-ceiling-transfer/SOURCES.json b/research/fourth-entry-ceiling-transfer/SOURCES.json new file mode 100644 index 000000000..c85103518 --- /dev/null +++ b/research/fourth-entry-ceiling-transfer/SOURCES.json @@ -0,0 +1,114 @@ +{ + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "files": [ + { + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "path": "certificates/selected-result.json", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "usage": "input" + }, + { + "git_blob": "64bfc5af6709ed9811171e0a2108f05e1219cb65", + "path": "docs/research/agent-task-catalog.json", + "sha256": "352a6184713b8843d96fd2c2071eb7aeaa655906b7c51d45ad444912666c8a96", + "usage": "provenance" + }, + { + "git_blob": "abdd2792e6a5596b3fa6be3dc9db882bd8e3ef89", + "path": "docs/research/research-family-status.md", + "sha256": "0e61c47dfbc6f16e5f64594fcc7d907d4187568e38dddf10d473f0992419c44f", + "usage": "provenance" + }, + { + "git_blob": "fcbba3a441cbaa16364ef066412ce6309055c2a6", + "path": "docs/research/research-priority-log.md", + "sha256": "9b85c2b2dfa1139b5ade31ecb27408bb00064f7ae1745d6dda5ba0383a691052", + "usage": "provenance" + }, + { + "git_blob": "2803d5c42b5d49ea72bd9bb006ffb4a9eec6a316", + "path": "research/staged-fourth-mixture-ceiling/RESULT.json", + "sha256": "53849028b12f7d9b726ac7576eeb64dc9a1a51bb2890edbb15aa83d1e39fae5f", + "usage": "input" + }, + { + "git_blob": "c67a80c8727ee45e2ba61de28bbaca8bb6d45e2a", + "path": "research/staged-fourth-mixture-ceiling/PROOF.md", + "sha256": "fc9a073b2c334e8e413062157569653e8bb52db81d72d68621287f6810090f40", + "usage": "input" + }, + { + "git_blob": "9960b901cc3927cec93c95cc76e6d488e7fd45a1", + "path": "research/staged-fourth-mixture-ceiling/README.md", + "sha256": "78b487fe1d57a0f1dd69302910735190a4fd4936f7f76b4b43d01f3e4bda5653", + "usage": "provenance" + }, + { + "git_blob": "137793e275870db2161048405017b83dcc1824ee", + "path": "research/staged-fourth-mixture-ceiling/source4088/inputs/THREE-base.json.gz", + "sha256": "df31495cff95a1e512da398f52841c6b5ade29067869b3d68b89d756a5641112", + "usage": "input" + }, + { + "git_blob": "7cce921b20dc0504cea954ab3297c5b55a9468dc", + "path": "research/staged-fourth-mixture-ceiling/source4088/inputs/THREE-extra.json.gz", + "sha256": "9a28f7ef91938c0866e408eb06e03eb5f8e727a00b44eb936ddd5ed48704bd4c", + "usage": "input" + }, + { + "git_blob": "65957e5ca322049d985f23fdc0bd8da07ffa4c2a", + "path": "research/staged-fourth-mixture-ceiling/source4088/inputs/FOUR-base.json.gz", + "sha256": "aecaddba48fdff6353a6511c3623346b05aa607e30103fb016604a2b1025ce95", + "usage": "input" + }, + { + "git_blob": "1f3239c30e9343cf4e34b4371fcbeebb94a19011", + "path": "research/staged-fourth-mixture-ceiling/source4088/inputs/FOUR-extra.json.gz", + "sha256": "615093190aa5479034bb8acdd8925d7a910e082b84dec7df84b459b62421235a", + "usage": "input" + }, + { + "git_blob": "1174e25e2ef8f8bc9a0815c43ba5d64c8af08349", + "path": "research/staged544-mixed-fourth-entry/RESULT.json", + "sha256": "6346ee768637aa9a1891d1d61d800d640235420b320fb7e659d1bf664ec42b3d", + "usage": "input" + }, + { + "git_blob": "29aac74f7ba382aad85189e5e297bf356414e2f9", + "path": "research/staged544-mixed-fourth-entry/README.md", + "sha256": "98b53ad6e6ee7ef7ba106e68e7a2a77d8f5a9823202cb3725cf101f5901e2d6f", + "usage": "input" + }, + { + "git_blob": "77f24f0c846cb00a702cb7aa06c31c02a29198fd", + "path": "research/staged544-mixed-fourth-entry/TASK.json", + "sha256": "8c34b11a10f0317dd4a4dc765b036a2231cee55cb44fc0e1e59fb64e11326a13", + "usage": "input" + }, + { + "git_blob": "137793e275870db2161048405017b83dcc1824ee", + "path": "research/staged544-mixed-fourth-entry/inputs/THREE-base.json.gz", + "sha256": "df31495cff95a1e512da398f52841c6b5ade29067869b3d68b89d756a5641112", + "usage": "input" + }, + { + "git_blob": "7cce921b20dc0504cea954ab3297c5b55a9468dc", + "path": "research/staged544-mixed-fourth-entry/inputs/THREE-extra.json.gz", + "sha256": "9a28f7ef91938c0866e408eb06e03eb5f8e727a00b44eb936ddd5ed48704bd4c", + "usage": "input" + }, + { + "git_blob": "65957e5ca322049d985f23fdc0bd8da07ffa4c2a", + "path": "research/staged544-mixed-fourth-entry/inputs/FOUR-base.json.gz", + "sha256": "aecaddba48fdff6353a6511c3623346b05aa607e30103fb016604a2b1025ce95", + "usage": "input" + }, + { + "git_blob": "1f3239c30e9343cf4e34b4371fcbeebb94a19011", + "path": "research/staged544-mixed-fourth-entry/inputs/FOUR-extra.json.gz", + "sha256": "615093190aa5479034bb8acdd8925d7a910e082b84dec7df84b459b62421235a", + "usage": "input" + } + ], + "schema_version": 1 +} \ No newline at end of file diff --git a/research/fourth-entry-ceiling-transfer/TASK.json b/research/fourth-entry-ceiling-transfer/TASK.json new file mode 100644 index 000000000..28691a842 --- /dev/null +++ b/research/fourth-entry-ceiling-transfer/TASK.json @@ -0,0 +1,107 @@ +{ + "actual_scope": "Finite source-bound transfer audit of the PR4091 fixed-inventory pooled ceiling against the retained PR4088 head: word/capacity/stock premise equivalence, per-coordinate re-derivation of the fourth-call counts, and fresh Decimal-bisection reproduction of the ceiling root, the pinned literal root and the later-head root, with exact remaining headroom 1.140318244487202e-9.", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "author": "Nick Petalas", + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "bottleneck_link": "Revision 7 requires verifying model equivalence before the ceiling can constrain work on the later fill; this audit establishes that conclusion at the premise level and states the exact remaining headroom.", + "budget_minutes": 60, + "evidence": "verify.py fresh Decimal(prec 60) bisection of sum n_r (r/73)^(1-a)/(896*360)=1; sha256 of gzip payloads and canonical JSON for the four shared word files; regex-parsed literal residual profile from PR4091 PROOF.md; five rejecting controls in test_verify.py; RESULT.json snapshot. Scripts complete in about 0.5 s each.", + "open_questions": [ + { + "blocked_by": "PR4091 open question 1: owner/phase and physical-family constraints on residual-bin exchanges are unvalidated.", + "first_step": "Inspect the later fill's residual-bin assignment (idle 22,783 rank-3, 1,625 rank-5, 138,492 rank-48) against the pooled optimum {22,788, 1,620, 138,492} and name the exchange that moves five rank-3 idles to rank-5.", + "question": "Can a legal chronological exchange reach the pooled eight-pattern idle multiset at x=1090?", + "why_it_matters": "If yes, up to the exact remaining headroom 1.140318244487202e-9 becomes attainable inside the fixed two-provider invoice; if no, the transfer ceiling is not the operative bound for the retained head." + }, + { + "blocked_by": "None locally; the audit is rerunnable per head.", + "first_step": "Re-run this package's verify.py word-file hash comparison against each new retained PR4088 head.", + "question": "Do subsequent PR4088 revisions change any word, capacity or stock premise, invalidating this ceiling transfer for later fills?", + "why_it_matters": "PR4091's scope note says changed words, capacities or stock conventions require a new model; knowing whether the premise set drifted decides whether the same screening tool stays applicable." + } + ], + "original_card": { + "acceptance_gate": "Demonstrate independence, source binding, positive cases and semantic failure controls. Name the existing checks and the missing coverage. More digits or another equivalent evaluation of an unchanged root is not by itself new verification coverage.", + "allowed_variations": [ + "Reconstruct either a source ledger or a numeric enclosure with a different method." + ], + "bottleneck_link": "Independent pricing prevents unsupported frontier claims and can reveal genuine accounting slack.", + "existing_checks": [ + { + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Independent binding of changed construction to paid histogram, distinct from full admission.", + "scope": "PR #4088: mixed local/owner/phase ledger and moment reported.", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "status": "author-checked" + }, + { + "evidence": "research/staged-fourth-mixture-ceiling/README.md", + "remaining": "Validate dual, exhaustive pattern scope and exact source equivalence before applying to newer fills.", + "scope": "PR #4091: sharp pooled ceiling proposed for fixed THREE/FOUR words and inventory.", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "a29bdd8f56cd18b805917775cdec09ff935eddc4", + "status": "author-checked" + }, + { + "evidence": "research/r437-two-window-carrier/README.md", + "remaining": "Independent full cost delta; remaining caller/precision/stock obligations are separate.", + "scope": "PR #4067: paid (2,2) to (1,3) exchange and fixed OQ4 host reported.", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "a95f11c52e3ca1e4c5171b3c20d8f4b0815aee2e", + "status": "author-checked" + } + ], + "first_experiment": "Independently reconstruct one changed ledger or pooled certificate with a positive case and a semantic failure control. Compare exact sources and name what existing checks miss. Keep this separate from supplier-boundary-audit (ordinary/outer dispatch) and uniform-transfer-audit (all-size proof). Stop after the chosen implication; more digits of an unchanged root are not additional mechanism coverage.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Choose one uncovered implication in #4088 literal mixed fill, #4091 pooled dual/model binding or #4067 changed frame/host bill. #4091 pins an earlier #4088 head: validate word, capacity and stock equivalence before applying that ceiling to the later fill.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "id": "independent-moment", + "methods": [ + "Independently reconstruct one changed paid ledger or pooled dual with exact source and model binding.", + "Check a genuinely uncovered moment implication with a different enclosure method and semantic controls." + ], + "overlap_terms": [ + "independent moment", + "rank histogram", + "exact enclosure", + "2979", + "rank7 joint endframes", + "paired extraction", + "joint lowering", + "4088", + "4091", + "4067", + "staged544-mixed-fourth-entry", + "staged-fourth-mixture-ceiling", + "r437-two-window-carrier" + ], + "question": "Does a new paid-profile or mixture-ceiling claim have independent source-bound coverage of its actual changed ledger?", + "scope_change_triggers": [ + "Importing the primary function and calling its output independent verification.", + "Calling an aggregate histogram or source archive an independently accepted physical supplier." + ], + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/staged544-mixed-fourth-entry/README.md", + "research/staged-fourth-mixture-ceiling/README.md", + "research/r437-two-window-carrier/README.md" + ] + }, + "outcome": "completed", + "priority_revision": 7, + "result_summary": "TRANSFER_SUPPORTED_AT_MODEL_PREMISES: four shared word files byte-identical, identical capacity inventory and stock convention, word law gives x=1080/1090 from three independent coordinates each, all three published roots independently reproduced within their brackets, later root below the ceiling by exactly 1.140318244487202e-9 (58.45 percent of the original margin remains).", + "schema_version": 1, + "scope_change_reason": "Card question refined to one named ceiling claim (PR4091) and its transfer condition onto the retained later PR4088 head, as required by priority revision 7; the card's general question about new ceiling claims is unchanged.", + "scope_status": "refined", + "stop_rule": "Stop at the first premise mismatch with the exact differing field, or finish the three-root reproduction with the exact headroom. No replay of the 841-pattern coverage proof and no new construction search.", + "task_id": "independent-moment" +} \ No newline at end of file diff --git a/research/fourth-entry-ceiling-transfer/VERIFY.json b/research/fourth-entry-ceiling-transfer/VERIFY.json new file mode 100644 index 000000000..c527d28b8 --- /dev/null +++ b/research/fourth-entry-ceiling-transfer/VERIFY.json @@ -0,0 +1,39 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "certificates/selected-result.json", + "research/staged-fourth-mixture-ceiling/RESULT.json", + "research/staged-fourth-mixture-ceiling/PROOF.md", + "research/staged-fourth-mixture-ceiling/source4088/inputs/THREE-base.json.gz", + "research/staged-fourth-mixture-ceiling/source4088/inputs/THREE-extra.json.gz", + "research/staged-fourth-mixture-ceiling/source4088/inputs/FOUR-base.json.gz", + "research/staged-fourth-mixture-ceiling/source4088/inputs/FOUR-extra.json.gz", + "research/staged544-mixed-fourth-entry/RESULT.json", + "research/staged544-mixed-fourth-entry/README.md", + "research/staged544-mixed-fourth-entry/TASK.json", + "research/staged544-mixed-fourth-entry/inputs/THREE-base.json.gz", + "research/staged544-mixed-fourth-entry/inputs/THREE-extra.json.gz", + "research/staged544-mixed-fourth-entry/inputs/FOUR-base.json.gz", + "research/staged544-mixed-fourth-entry/inputs/FOUR-extra.json.gz" + ], + "commands": [ + { + "argv": ["{python}", "-I", "-Werror", "-B", "{package}/verify.py"], + "timeout_seconds": 300, + "checks": "Independent transfer audit: 4/4 byte-identical word payloads, published word-profile anchors in both packages, identical 725,760-bin capacity inventory and constant 162,900 residual mass, unique word-law fourth-call counts 1080/1090 derived from rank-1/3/4 coordinates, Decimal bisection reproduction of the pooled-optimum ceiling root, the pinned literal root and the later-head root inside their published brackets, exact remaining headroom 1.140318244487202e-9 and consumed-margin agreement with the later package's published gain." + }, + { + "argv": ["{python}", "-I", "-O", "-Werror", "-B", "{package}/verify.py"], + "timeout_seconds": 300, + "checks": "Same audit with assertions disabled; no check may depend on assert." + }, + { + "argv": ["{python}", "-I", "-Werror", "-B", "{package}/test_verify.py"], + "timeout_seconds": 300, + "checks": "Behavioural controls: extra rank-1 children break the word law; a wrong stock divisor moves the reproduced root out of its bracket; a tampered word delta breaks the cross-package L4 derivation; a corrupted word payload fails hash equality; a shifted idle total breaks the constant-residual check." + } + ] +} diff --git a/research/fourth-entry-ceiling-transfer/test_verify.py b/research/fourth-entry-ceiling-transfer/test_verify.py new file mode 100644 index 000000000..fd7078b4e --- /dev/null +++ b/research/fourth-entry-ceiling-transfer/test_verify.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3.12 +"""Behavioural controls for verify.py: each must make the audit reject.""" +import json +import os +import sys + +HERE = os.path.dirname(os.path.abspath(__file__)) +ROOT = os.path.dirname(os.path.dirname(HERE)) +sys.path.insert(0, HERE) +import verify as V # noqa: E402 + + +def expect_false(name, value): + if value: + print("CONTROL_FAILED (control did not reject): " + name) + return 1 + print("control rejects as expected: " + name) + return 0 + + +def main(): + rc = 0 + with open(os.path.join(V.CEIL, "RESULT.json"), encoding="utf-8") as fh: + ceil_res = json.load(fh) + with open(os.path.join(V.MIX4, "RESULT.json"), encoding="utf-8") as fh: + mix_res = json.load(fh) + + # 1. A paid profile with 100 extra rank-1 children breaks the word law. + bad = dict(ceil_res["complete_profile"]) + bad["1"] += 100 + rc |= expect_false( + "extra_rank1_breaks_word_law", + V.derive_x(bad, ceil_res["idle"])["x_consistent"]) + + # 2. A wrong stock divisor moves the recomputed root out of the bracket. + from decimal import Decimal + prof_pool = {int(k): v + for k, v in ceil_res["complete_profile"].items()} + good_root = V.solve_root(prof_pool) + saved = V.STOCK_W + V.STOCK_W = saved + 1 + shifted = V.solve_root(prof_pool) + V.STOCK_W = saved + lo = Decimal(ceil_res["root_decimal_bracket"][0]) + hi = Decimal(ceil_res["root_decimal_bracket"][1]) + rc |= expect_false("wrong_stock_moves_root_out_of_bracket", + lo <= shifted <= hi) + + # 3. A tampered word delta breaks the derived-L4 cross-check. + saved_w4 = dict(V.WORDS4) + V.WORDS4[3] += 1 + anchors = V.check_word_anchors() + V.WORDS4.clear() + V.WORDS4.update(saved_w4) + rc |= expect_false("tampered_word_delta_breaks_anchor", + anchors["derived_L4_matches"]) + + # 4. A corrupted word-file payload fails byte equivalence. + name = "FOUR-base.json.gz" + import gzip + with open(os.path.join(V.CEIL, "source4088", "inputs", name), + "rb") as fh: + old = gzip.decompress(fh.read()) + corrupted = old[:-1] + bytes([old[-1] ^ 1]) + rc |= expect_false("corrupted_word_payload_detected", + V.sha(old) == V.sha(corrupted)) + + # 5. A shifted idle total breaks the constant-residual cross-check. + bad_idle = dict(mix_res["idle"]) + bad_idle["48"] = bad_idle["48"] - 1 + with open(os.path.join(V.MIX4, "TASK.json"), encoding="utf-8") as fh: + text = fh.read() + bins = V.check_bins(ceil_res, {"raw": text, "idle": bad_idle}) + rc |= expect_false("shifted_idle_total_rejected", + bins["idle_total_constant"]) + + if rc == 0: + print("PASS_ALL_CONTROLS") + return rc + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/research/fourth-entry-ceiling-transfer/verify.py b/research/fourth-entry-ceiling-transfer/verify.py new file mode 100644 index 000000000..13eea9c88 --- /dev/null +++ b/research/fourth-entry-ceiling-transfer/verify.py @@ -0,0 +1,388 @@ +#!/usr/bin/env python3.12 +"""Independent transfer audit of the PR4091 pooled ceiling against the +retained PR4088 head. + +Checks, all on committed evidence under the repository root: + +A. Word equivalence: the four shared scalar-word inputs frozen in + research/staged-fourth-mixture-ceiling/source4088/inputs/ (PR4088 head + 76088d49e3ed4142a958659aa996b0ca4da5e88e) versus the retained head + research/staged544-mixed-fourth-entry/inputs/ (72d7efc181edb21806a878f1 + 74847c96dd410ab0), compared as sha256 of each gzip payload and of the + canonical JSON re-serialisation (per CONTRIBUTING, compressed containers + are not compared byte-wise). +B. Word-profile anchors: the exact per-call profiles appear verbatim in both + packages' written proofs. +C. Bin-inventory equivalence: capacity-8/16/32/48 inventory of the ceiling + model versus the later fill's published totals; constant residual mass. +D. Word-law identity: each package's published paid profile must decompose + as calls x three-entry word + x x (four minus three) + idle residual, with + x derived independently from rank-1, rank-3 and rank-4 coordinates and + equal to each package's published fourth-call count. +E. Independent moment recomputation: solve sum_r n_r (r/73)^(1-a) / (896*360) + = 1 by interval bisection in Decimal (precision 60) for both published + profiles and contain the result in each package's own published bracket. +F. Transfer verdict: recomputed roots lie strictly below the PR4091 pooled + ceiling bracket; exact remaining headroom with decimal and ratio. + +This is a finite source-bound audit. It is not a replay of PR4091's +841-pattern coverage proof, not supplier admission, not a new kappa, and it +does not change the selected record. Assumptions that this audit does not +re-derive are listed in RESULT.json under "assumptions_not_rederived". +""" +import gzip +import hashlib +import json +import os +import sys +from decimal import Decimal, getcontext +from fractions import Fraction + +ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +CEIL = os.path.join(ROOT, "research", "staged-fourth-mixture-ceiling") +MIX4 = os.path.join(ROOT, "research", "staged544-mixed-fourth-entry") + +CEIL_HEAD_PR4088 = "76088d49e3ed4142a958659aa996b0ca4da5e88e" +MIX4_HEAD = "72d7efc181edb21806a878f174847c96dd410ab0" + +WORD_FILES = ["THREE-base.json.gz", "THREE-extra.json.gz", + "FOUR-base.json.gz", "FOUR-extra.json.gz"] + +# Per-call local words, PR4085 three-entry receiver-sharing word and the +# PR4088 four-entry variant, as published identically in both packages +# (anchor-checked in check_word_anchors below). +WORDS3 = {1: 2487, 2: 713, 3: 224, 4: 102, 5: 20, 8: 8} +WORDS4 = {1: 2489, 2: 713, 3: 227, 4: 99, 5: 20, 8: 8} + +CALLS = 3240 +WIDTH_M = 73 +STOCK_W = 896 * 360 +BIN_COUNTS = {8: 241920, 16: 161280, 32: 161280, 48: 161280} +BIN_TOTAL = 725760 +ROLE_TOTAL = 1321920 +REPLICAS = 360 +IDLE_TOTAL = 162900 + + +def sha(b): + return hashlib.sha256(b).hexdigest() + + +def canonical(obj): + return json.dumps(obj, sort_keys=True, separators=(",", ":")).encode() + + +def load_json(path): + with open(path, "rb") as fh: + return json.loads(fh.read().decode("utf-8")) + + +def check_word_files(): + """A. Byte-for-byte payload equivalence of the four shared word files.""" + rows = [] + for name in WORD_FILES: + old_p = os.path.join(CEIL, "source4088", "inputs", name) + new_p = os.path.join(MIX4, "inputs", name) + if not (os.path.isfile(old_p) and os.path.isfile(new_p)): + rows.append({"file": name, "present": False}) + continue + with open(old_p, "rb") as fh: + old_raw = fh.read() + with open(new_p, "rb") as fh: + new_raw = fh.read() + old_payload = gzip.decompress(old_raw) + new_payload = gzip.decompress(new_raw) + rows.append({ + "file": name, + "present": True, + "payload_equal": old_payload == new_payload, + "canonical_equal": canonical(json.loads(old_payload)) == + canonical(json.loads(new_payload)), + "payload_sha256": sha(new_payload), + "container_sha256_old": sha(old_raw), + "container_sha256_new": sha(new_raw), + }) + return rows + + +def check_word_anchors(): + """B. Per-call word profiles and the word delta appear in both packages. + + PR4091 PROOF.md publishes L3 and the delta d = L4 - L3; PR4088 README + publishes both full profiles. Deriving WORDS4 = WORDS3 + d from the + ceiling package and comparing against the fill package ties the two + packages to the same word law without trusting either table alone. + """ + with open(os.path.join(CEIL, "PROOF.md"), encoding="utf-8") as fh: + ceil_proof = fh.read() + with open(os.path.join(MIX4, "README.md"), encoding="utf-8") as fh: + mix_readme = fh.read() + l3 = "L3 = 2487 H1 + 713 H2 + 224 H3 + 102 H4 + 20 H5 + 8 H8" + delta = "L4-L3 = 2 H1 + 3 H3 - 3 H4" + t3 = "{1:2487,2:713,3:224,4:102,5:20,8:8}" + t4 = "{1:2489,2:713,3:227,4:99,5:20,8:8}" + derived4 = dict(WORDS3) + derived4[1] += 2 + derived4[3] += 3 + derived4[4] -= 3 + return { + "ceil_proof_has_L3": l3 in ceil_proof, + "ceil_proof_has_delta": delta in ceil_proof, + "derived_L4_matches": derived4 == WORDS4, + "mix_readme_has_three": t3 in mix_readme, + "mix_readme_has_four": t4 in mix_readme, + } + + +def check_bins(ceil_res, mix_task_text): + """C. Bin-inventory equivalence and constant residual mass.""" + idle_c = {int(k): v for k, v in ceil_res["idle"].items()} + idle_m = {int(k): v for k, v in mix_task_text["idle"].items()} + return { + "ceil_bin_counts_match": dict(ceil_res["bin_counts"]) == + {str(k): v for k, v in BIN_COUNTS.items()}, + "ceil_bin_total": sum(BIN_COUNTS.values()) == BIN_TOTAL, + "ceil_bins_divide_replicas": BIN_TOTAL % REPLICAS == 0, + "mix_publishes_bin_total": str(BIN_TOTAL) in mix_task_text["raw"], + "mix_publishes_role_total": str(ROLE_TOTAL) in mix_task_text["raw"], + "idle_total_ceiling": sum(idle_c.values()), + "idle_total_mixed": sum(idle_m.values()), + "idle_total_constant": sum(idle_c.values()) == + sum(idle_m.values()) == IDLE_TOTAL, + } + + +def derive_x(profile, idle): + """D. Independent derivations of the fourth-call count from the profile.""" + prof = {int(k): v for k, v in profile.items()} + idl = {int(k): v for k, v in idle.items()} + base = {r: CALLS * w for r, w in WORDS3.items()} + delta = {r: WORDS4[r] - WORDS3[r] for r in WORDS4} + x1 = None + if delta[1]: + x1 = Fraction(prof[1] - base[1], delta[1]) + x4 = None + if delta[4]: + x4 = Fraction(base[4] - prof[4], -delta[4]) + x3 = None + if delta[3]: + x3 = Fraction(prof[3] - base[3] - idl.get(3, 0), delta[3]) + ok = (x1 == x3 == x4) and x1.denominator == 1 + residuals_ok = (prof[2] == base[2] and prof[8] == base[8] + and prof[5] == base[5] + idl.get(5, 0) + and prof[48] == idl.get(48, 0)) + return { + "x_rank1": str(x1), "x_rank3": str(x3), "x_rank4": str(x4), + "x_consistent": ok, + "rank2_constant": prof[2] == base[2], + "rank8_constant": prof[8] == base[8], + "rank5_is_word_plus_idle5": prof[5] == base[5] + idl.get(5, 0), + "rank48_is_idle48": prof[48] == idl.get(48, 0), + "residuals_ok": residuals_ok, + "x": int(x1) if ok else None, + } + + +def bill(a, profile): + total = Decimal(0) + one = Decimal(1) + for r, n in profile.items(): + ratio = Decimal(r) / Decimal(WIDTH_M) + total += Decimal(n) * ((one - a) * ratio.ln()).exp() + return total / Decimal(STOCK_W) + + +def solve_root(profile): + """E. Bisection on the strictly increasing complete-moment bill.""" + getcontext().prec = 60 + lo, hi = Decimal("0.0010"), Decimal("0.0025") + for _ in range(420): + mid = (lo + hi) / 2 + if bill(mid, profile) < 1: + lo = mid + else: + hi = mid + return (lo + hi) / 2 + + +def frac_to_dec(s): + num, den = s.split("/") + getcontext().prec = 60 + return Decimal(num) / Decimal(den) + + +def literal_profile_from_proof(ceil_res): + """Rebuild the pinned literal fill from the published pooled optimum plus + the residual-bin delta recorded in PR4091 PROOF.md + ("profile is `22785 H3+1625 H5+H16+2H32+138490 H48`").""" + import re + with open(os.path.join(CEIL, "PROOF.md"), encoding="utf-8") as fh: + proof = fh.read() + m = re.search(r"profile is `(\d+) H3\+(\d+) H5\+H16\+2H32\+(\d+) H48`", + proof) + if m is None: + return None, False + h3, h5, h48 = (int(g) for g in m.groups()) + prof = {int(k): v for k, v in ceil_res["complete_profile"].items()} + # pooled optimum residual multiset {3:22788,5:1620,48:138492} is replaced + # by the literal one; delta paid = literal - pooled residuals. + prof[3] += h3 - ceil_res["idle"]["3"] + prof[5] += h5 - ceil_res["idle"]["5"] + prof[16] = prof.get(16, 0) + 1 + prof[32] = prof.get(32, 0) + 2 + prof[48] += h48 - ceil_res["idle"]["48"] + return prof, True + + +def check_roots(ceil_res, mix_res): + prof_pool = {int(k): v for k, v in ceil_res["complete_profile"].items()} + prof_m = {int(k): v for k, v in mix_res["profile"].items()} + prof_lit, lit_parsed = literal_profile_from_proof(ceil_res) + root_pool = solve_root(prof_pool) + root_m = solve_root(prof_m) + lit_lo = frac_to_dec(ceil_res["literal_root_bracket"][0]) + lit_hi = frac_to_dec(ceil_res["literal_root_bracket"][1]) + mix_lo = frac_to_dec(mix_res["root_lower"]) + mix_hi = frac_to_dec(mix_res["root_upper"]) + ceil_lo = Decimal(ceil_res["root_decimal_bracket"][0]) + ceil_hi = Decimal(ceil_res["root_decimal_bracket"][1]) + out = { + "ceiling_profile_root_reproduced": ceil_lo <= root_pool <= ceil_hi, + "root_pooled_optimum": str(root_pool), + "root_later_head": str(root_m), + "later_root_in_own_bracket": mix_lo <= root_m <= mix_hi, + "later_root_below_ceiling": root_m < ceil_lo, + "ceil_minus_later_upper_decimal": f"{ceil_hi - mix_hi:.30e}", + "pinned_literal_profile_parsed_from_proof": lit_parsed, + } + if lit_parsed: + root_lit = solve_root(prof_lit) + out["root_pinned_literal"] = str(root_lit) + out["pinned_literal_root_reproduced"] = lit_lo <= root_lit <= lit_hi + out["pinned_headroom_decimal"] = f"{ceil_hi - lit_hi:.30e}" + prev_up = frac_to_dec(mix_res["previous_revision_upper"]) + out["pinned_root_matches_later_packages_pin"] = ( + ceil_res["literal_root_bracket"][1] + == mix_res["previous_revision_upper"] + and lit_hi <= prev_up + Decimal(0)) + consumed = mix_hi - lit_hi + out["margin_consumed_decimal"] = f"{consumed:.30e}" + out["margin_consumed_ge_published_gain"] = consumed >= frac_to_dec( + mix_res["gain_over_previous_revision"]) + return out + + +def run_audit(): + """Full audit; returns (verdict_bool, result_dict).""" + ceil_res = load_json(os.path.join(CEIL, "RESULT.json")) + mix_res = load_json(os.path.join(MIX4, "RESULT.json")) + with open(os.path.join(MIX4, "TASK.json"), encoding="utf-8") as fh: + mix_task = fh.read() + + words = check_word_files() + anchors = check_word_anchors() + bins = check_bins(ceil_res, {"raw": mix_task, + "idle": mix_res.get("idle", + mix_res.get("idle_profile"))}) + law_c = derive_x(ceil_res["complete_profile"], ceil_res["idle"]) + law_m = derive_x(mix_res["profile"], mix_res["idle"]) + roots = check_roots(ceil_res, mix_res) + + checks_ok = ( + all(r.get("present") and r["payload_equal"] and r["canonical_equal"] + for r in words) + and all(anchors.values()) + and bins["ceil_bin_counts_match"] and bins["ceil_bin_total"] + and bins["ceil_bins_divide_replicas"] + and bins["mix_publishes_bin_total"] and bins["mix_publishes_role_total"] + and bins["idle_total_constant"] + and law_c["x_consistent"] and law_c["residuals_ok"] + and law_m["x_consistent"] and law_m["residuals_ok"] + and law_c["x"] == ceil_res["optimum_fourth_calls"] == 1080 + and law_m["x"] == mix_res["fourth_calls"] == 1090 + and roots["ceiling_profile_root_reproduced"] + and roots["pinned_literal_profile_parsed_from_proof"] + and roots.get("pinned_literal_root_reproduced") is True + and roots.get("pinned_root_matches_later_packages_pin") is True + and roots["later_root_in_own_bracket"] + and roots["later_root_below_ceiling"] + and roots.get("margin_consumed_ge_published_gain") is True + and Decimal(roots["ceil_minus_later_upper_decimal"]) > 0 + ) + if checks_ok: + roots["remaining_over_original_ratio"] = str( + (Fraction(Decimal(roots["ceil_minus_later_upper_decimal"])) + / Fraction(Decimal(roots["pinned_headroom_decimal"])) + ).limit_denominator(10**9)) + roots["remaining_over_original_float"] = float(Decimal( + roots["ceil_minus_later_upper_decimal"]) + / Decimal(roots["pinned_headroom_decimal"])) + verdict = ("TRANSFER_SUPPORTED_AT_MODEL_PREMISES" if checks_ok + else "AUDIT_FAILED") + result = { + "schema_version": 1, + "status": verdict, + "card": "independent-moment", + "question": ("Does PR4091's fixed-inventory pooled ceiling transfer to " + "the retained later PR4088 head?"), + "pinned_head_pr4088": CEIL_HEAD_PR4088, + "retained_head_pr4088": MIX4_HEAD, + "ceiling_bracket": ceil_res["root_decimal_bracket"], + "word_file_payload_equal": sum(1 for r in words + if r.get("payload_equal")), + "word_files": words, + "word_profile_anchors": anchors, + "bin_inventory": bins, + "word_law_pinned": law_c, + "word_law_later": law_m, + "moments": roots, + "bill": { + "form": "sum_r n_r (r/m)^(1-a) / W", + "m": WIDTH_M, + "W": STOCK_W, + }, + "assumptions_not_rederived": [ + ("PR4091's 841 whole-helper pattern coverage and three dual " + "certificates are not replayed here; the ceiling is taken as " + "published by its own package."), + ("Whether every literal exchange may reach an arbitrary idle " + "multiset with the same residual total (PR4091 open question 1) " + "is not settled by this audit."), + ("Native, owner/phase, chronology, precision, tape, BIT and outer " + "transfer obligations are inherited from the pinned packages and " + "are not re-verified."), + ], + } + return checks_ok, result + + +def main(): + out = None + if "--output" in sys.argv: + out = sys.argv[sys.argv.index("--output") + 1] + ok, result = run_audit() + if out: + os.makedirs(os.path.dirname(out), exist_ok=True) + with open(out, "w", encoding="utf-8") as fh: + json.dump(result, fh, indent=2, sort_keys=True) + fh.write("\n") + print("wrote " + out) + if not ok: + print("AUDIT_FAILED") + for name, val in sorted(result.items()): + if isinstance(val, dict): + for k, v in sorted(val.items()): + if v is False: + print("failed:", name, k) + return 1 + print("PASS_CEILING_TRANSFER_AT_MODEL_PREMISES") + print("word payload equal files: %d/4" % result["word_file_payload_equal"]) + print("x pinned=%d later=%d" % (result["word_law_pinned"]["x"], + result["word_law_later"]["x"])) + print("ceiling minus later root: %s" + % result["moments"]["ceil_minus_later_upper_decimal"]) + return 0 + + +if __name__ == "__main__": + sys.exit(main())