diff --git a/research/active-mode-restoration/PROOF.md b/research/active-mode-restoration/PROOF.md new file mode 100644 index 0000000000..97f9eded0c --- /dev/null +++ b/research/active-mode-restoration/PROOF.md @@ -0,0 +1,151 @@ +# A late active injection: restoration obstruction and conditional repair + +This checkpoint gives an exact scalar information test for a specified active +injection. It does not rule out active feedback in general, implement a new +physical transfer, or improve the multiplication bound. + +## Frozen interface + +Use the retained `F9-SOURCE-DAG-ALL8-WORD.json.gz`, SHA256 +`934fea11e51f674ce2031b7d3127b994a921a9d83317b00359292752563a1775`, +backward direction, omitting its unimplemented `physical_add` events exactly +as the retained observer probe does. The independent inputs are 112 X fields, +112 Y fields, and 408 arbitrary helper fields H. All owned scratch is separate +from this 632-dimensional input inventory. + +The test cut is immediately before word event 17978, original source event +17155: + +``` +['climb', 'scalar_refactor', 240, 280, 1, 1] +``` + +L240 is then in rank-eight frame 280 and climbs to the unique full frame 1. +Evaluate address operators on their common fixed vector. This retains every +original input coefficient while giving a necessary scalar observer quotient; +it is not a phase-aware physical replay. + +Write R for the retained 8 by 112 mode matrix, with `R R^T = 56 I`, and +`A = I - R^T R/4`. The exact scalar baseline endpoint is + +``` +X -> X - A Y, Y -> Y, H -> H. +``` + +## 1. An active injection does not supply a clean extra observation + +Let M consist of all chronological full-frame snapshot rows on the 632 +original inputs. Let v record each snapshot's response to a unit injection +into L240 at the stated cut. Grant a missing mode m at that cut without +claiming that it can physically be supplied there. The changed snapshots +are `M' = M + v m`, not a collection containing both original and modified +versions of each affected snapshot. + +For m outside `row(M)`, pure m is in `row(M')` exactly when some q satisfies +`qM = 0` and `qv != 0`. Such q extracts m, after which every original snapshot +can also be recovered. Conversely, any extraction must satisfy these two +conditions because m is outside the original row space. Equivalently, +`rank([M|v]) > rank(M)` is necessary and sufficient. + +The exact replay finds 4868 distinct full snapshots and + +``` +rank(M) = rank([M|v]) = 482. +``` + +Every one of the eight RY modes lies outside `row(M)`. The saved certificate +provides a 104-term z and checks `Mz = v` directly on all 4868 rows. Therefore +the changed row space is the graph `r -> r + (rz)m` over the old row space; +it contains no pure m. The coefficient of the original helper endpoint e240 +is `e240 z = 1`, so that original independent helper is not restored by +declaring the changed value a clean mode observation. + +For `m5 = R5 Y`, a second directly checked certificate has + +``` +Mu = 0, m5 u = 1, m5 z = 0, +a = u-z, +(M+v m5)a = 0, m5 a = 1, e240 a = -1. +``` + +This separates both the pure mode and the original helper240 target from +all allowed changed observations. It is an exact certificate, not a modular +no-hit or a failed coefficient search. An invertible change of independent +helper coordinates preserves this information test. + +## 2. Why the fixed full-frame sink gives a larger scoped obstruction + +Metadata verifies that exactly 482 persistent roles enter the full frame, +each once; none leaves it. No owned scratch reaches the full frame. After +entry, full-frame updates are nonaliasing ADDs and nonzero SCALEs, with no +copy, clear, or non-full scalar source. The 72 full-frame warps act as the +identity in this fixed-vector quotient. + +Consequently every recorded full snapshot is a fixed linear combination of +the 482 final full coordinates: `M = S F`. Reverse the invertible full-frame +updates to obtain S, leaving newly arriving coordinates unused until their +arrival. Final observations show that S has full column rank. The same S +applies if only lower-frame histories before first full arrival change. + +The 482 baseline final rows F have distinct X/helper pivots. The eight RY +rows have only Y coordinates and rank eight. Thus their row spaces intersect +trivially and `rank([F; RY]) = 490`. + +Suppose a family of added controls changes the full endpoint only by fixed +missing modes, so `F' = F + V(RY)`, while the full sink interface remains +unchanged. If `aF' = b(RY)`, independence gives `aF = 0`, hence a=0 and b=0. +No nonzero pure missing mode can then be extracted from any number of these +modified full-frame snapshots. This covers multiple fixed-mode injections +inside that interface, not arbitrary feedback words or changed source +alphabets. Feedback carrying other original input combinations, new full +ingress, saved independent owned data, new address maps, or changed target +inventory is not covered. + +Most importantly, this theorem does not prohibit direct repair of the main +endpoint. A successful construction can change F to the desired target +without ever exposing a separate pure missing-mode observation. + +## 3. A direct one-mode repair is algebraically consistent + +The unit L240 impulse has final main coefficient `+R5^T` and helper +coefficient `+S5`, with 56 and 48 nonzero entries respectively. This agrees +with the retained center5 suffix data; that helper cleanup was already known. + +The source already captures `c = R5 Y/4` in ground-frame owned C6 at events +511--567. At events 568--615 it applies `H -= S5 c`. C6 is unchanged through +the tested cut. Conditional on an oracle injection `L240 -= c`, omit those +48 existing helper precompensation ADDs. The resulting effects are + +``` +main: -R5^T c, +helpers: -S5 c + S5 c = 0. +``` + +An independent direct replay verifies every coefficient in all 632 endpoint +rows, all 408 helper identities, all final charts, and every owned zero: + +``` +X -> X - A Y - R5^T R5 Y/4, Y -> Y, H -> H. +``` + +There are no downstream warp events after the named climb. Once the +required field reaches full frame 1, its remaining propagation is therefore +the displayed scalar suffix impulse. The payload supplied in frame 280 +must transport through the selected climb to that required field. The +fixed-vector calculation does not establish this physical availability. + +Indeed C6 is in frame 0 while L240 is in frame 280. The literal ADD between +them fails the ordinary coframing validator. The conditional identity is +therefore a target for a new routing or dependency construction, not an +unpaid legal edit or a claimed improvement. + +## Distinction from retained passive exclusions + +The retained `CORRECTIONS` and observer work study corrections built from +the unchanged history. Here the snapshots themselves change: the extra +response column v and all helper targets are tracked after a granted active +injection. The result adds an exact restoration certificate for this cut and +a fixed-mode extension under the verified full-sink interface. It does not +reprove the source-DAG helper compensation, supersede broader physical +semantics, or turn either the old passive exclusions or this scoped theorem +into a prohibition of active feedback. diff --git a/research/active-mode-restoration/README.md b/research/active-mode-restoration/README.md new file mode 100644 index 0000000000..aad5e2eb82 --- /dev/null +++ b/research/active-mode-restoration/README.md @@ -0,0 +1,125 @@ +# Active-mode restoration at a native paid-query cut + +This package certifies why a granted mode injection into the retained L240 +query does not provide a clean extra observation while preserving the original +helper. It also proves a broader limitation for the same monotone full-frame +observer interface and records a conditional direct endpoint repair whose +physical payload transport remains open. **No new bound, supplier or legal +center replacement is claimed.** + +## Result and evidence + +The frozen source is the backward `F9-SOURCE-DAG-ALL8` program from +[filtered-native-kappa004](../filtered-native-kappa004/README.md), with its +`physical_add` tails omitted. The observer calculation evaluates native address +operators on their common fixed vector and retains all 632 arbitrary original +input amplitudes, including all 408 helpers. It is a scalar necessary interface, +not a complete phase-aware physical replay. + +* **Granted L240 injection.** Immediately before source event 17155 (word event + 17978), grant an additive mode at L240's rank-8 frame 280, just before its + rank-1 climb to full frame 1. The 4,868 distinct full-frame observations have + rank 482 both before and after adjoining the injection-response column. + Explicit rational witnesses check `Mz=v` and separate both the missing mode5 + and the original helper240 output from the changed observation span. This + includes dirty-helper restoration; fitting only a desired main coefficient + would miss the obstruction. See [l240-extra-column-gate.json](l240-extra-column-gate.json) + and [the complete observation data](l240-full-observations.json.gz). +* **Monotone full-frame observer limitation.** The source has 482 persistent + full-frame arrivals, no full-frame departures or new owned full-frame fields, + and only invertible scalar updates within the full-frame subsystem. Its + history is therefore spanned by its 482 final full rows. For the stated + fixed-mode changes `F'=F+VR`, the eight missing R modes cannot become separate + pure observations while preserving the original full targets. This is the + exact interface in [full-sink-gate.json](full-sink-gate.json), not an exclusion + of arbitrary active feedback or new physical observations. +* **Conditional direct repair.** Omitting the 48 helper-precompensation updates + at word events 568–615 and granting `L240 -= C6`, where `C6=R5Y/4`, gives the + scalar endpoint `X-AY-R5^T R5Y/4`, with Y and all helpers unchanged and owned + scratch returned to zero. Here A is the retained center-free owner matrix. + The literal ADD is **illegal**: C6 is at frame 0 while L240 is at frame 280. + The checker rejects that operation under actual coframing. The result in + [direct-l240-repair.json](direct-l240-repair.json) is conditional on supplying + the required transported payload at frame 280, with its entire cost charged. + +[PROOF.md](PROOF.md) states the hypotheses and witness identities. Direct repair +of the prescribed endpoint without exposing a separate pure mode, new full-frame +ingress, changed source dependencies, +additional paid jobs and broader address operations are outside the observer +limitation. No native, caller, compiler, precision or outer-bound certificate +for a successful repair is supplied. + +## Reproduce + +From the repository root, using Python 3.12 and only its standard library: + +```sh +python3 scripts/research_package.py --package research/active-mode-restoration --check-only +python3.12 scripts/research_package.py --package research/active-mode-restoration +``` + +The two registered commands run `verify.py` normally and with `-O`; each has a +120-second timeout. Direct replay is also available: + +```sh +python3 -B research/active-mode-restoration/verify.py +python3 -O -B research/active-mode-restoration/verify.py +``` + +The verifier authenticates the unchanged predecessor archive and four member +hashes, materializes only those regular data members in a temporary directory, +and regenerates the three gates. It compares semantic evidence, excluding +elapsed time, and separately checks the saved witness pairings against every +observation. It imports no scientific source code from the archive. Controls +cover a corrupted witness, useful before/after side information, forbidden +full-frame lifecycle changes, incorrect compensation/sign, and the illegal +cross-frame ADD. No broad parameter search or heavy native suite is run. + +## Sources and relation to prior work + +[SOURCES.json](SOURCES.json) pins main +`df0137efd35e11b4445734bf612bdd4c7ebc330c`, the original task catalogue and +selected record, and the live archive +`research/filtered-native-kappa004/inputs/original-packet.tar.gz` (SHA256 +`595f988e748b1f3b25e7525a226da173966e4278a70f511b2919245cec1b45f7`). +The archive is the only external replay input; the four member paths, sizes +and hashes are recorded too. No predecessor package or archive is copied into +this directory. The declared archive is included by the repository's committed +package exporter. Full Git history is required for registered provenance checks. + +The source packet already implements dirty shared-query reuse and a later +helper-clean source-DAG construction with a filtered main endpoint. Their +helper compensation is not a new result here. The earlier +[coded-active-feedback](../coded-active-feedback/README.md) investigation uses +a different whole-bank feedback grammar. The new evidence is the explicit +all-original-input restoration certificate at this native cut, its stated +full-frame interface extension, and the conditional direct-repair identity. + +The original `joint-query-controller` card is retained verbatim in +[TASK.json](TASK.json). Its scope is marked **changed**: this is a scoped native +observer/endpoint checkpoint, rather than a completed QQ16 protocol or a +favorable supplier invoice. The selected frontier is unchanged. + +## Open next questions + +[TASK.json](TASK.json) records a first test and blocker for each question: + +1. Supply the required payload at frame 280 with a legal, fully charged + schedule. This is the missing step in the conditional direct repair. +2. Change one actual source dependency or full-frame ingress and recompute the + complete chronological observation and restoration maps. More coefficients + within the certified fixed observer interface do not provide new information. +3. Repair the prescribed endpoint directly without requiring a separate pure-mode + observer, then verify every arbitrary input, physical phase and endpoint. + +## Credit + +Prepared for flyingviper with substantial OpenAI Codex assistance, including +separate agent checks. This is not independent human peer review or +proof-assistant formalization. New work is Apache-2.0. The recovered +filtered-native packet retains the prior continuation work. Its source lineage +includes Cao Yifan's 632-field native source and Cinna Davis's center-removal +and cache-kernel work; the retained involutory-producer package was prepared +by Dugongue and preserves the earlier mode and repair sources. All inherited +attribution and notices remain in the unchanged archive. This package does not +claim those predecessor constructions. diff --git a/research/active-mode-restoration/SOURCES.json b/research/active-mode-restoration/SOURCES.json new file mode 100644 index 0000000000..2b325b26fd --- /dev/null +++ b/research/active-mode-restoration/SOURCES.json @@ -0,0 +1,48 @@ +{ + "schema_version": 1, + "base_commit": "df0137efd35e11b4445734bf612bdd4c7ebc330c", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8", + "sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + }, + { + "path": "research/filtered-native-kappa004/inputs/original-packet.tar.gz", + "usage": "input", + "git_blob": "7f904307bd99f2d778bc7b64e98e353715cbc041", + "sha256": "595f988e748b1f3b25e7525a226da173966e4278a70f511b2919245cec1b45f7" + } + ], + "archive_members": [ + { + "path": "filtered_native_implementation/research/retained_state_next/F9-SOURCE-DAG-ALL8-WORD.json.gz", + "bytes": 428325, + "sha256": "934fea11e51f674ce2031b7d3127b994a921a9d83317b00359292752563a1775" + }, + { + "path": "filtered_native_implementation/research/native_contact/SCALED-GLOBAL-CANCEL-WORD.json.gz", + "bytes": 206603, + "sha256": "de4b75c106f8a3ebe1ee68b53fe7e64bd218120526e726d9bdfd4dab711dd4b2" + }, + { + "path": "filtered_native_implementation/upstream/research/involutory-producer-raw-dual/inputs/R/R.json", + "bytes": 4664, + "sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1" + }, + { + "path": "filtered_native_implementation/research/retained_state_next/CENTER5-SUFFIX.json", + "bytes": 102442, + "sha256": "5f2439d2f724f9f6fc6766bd74cd0885e923a0f8f3736d1eff6873c68d99279a" + } + ], + "archive_contract": "The verifier checks the exact archive and four member hashes, then materializes only these regular member files in a private temporary directory. No source code is imported from the archive; no predecessor bytes are duplicated or edited in this package.", + "predecessor_credit": "The retained filtered-native packet, its native/source-DAG/mode authors and pinned upstream notices retain their original attribution and licenses. This package adds scoped restoration certificates and a conditional endpoint identity." +} diff --git a/research/active-mode-restoration/TASK.json b/research/active-mode-restoration/TASK.json new file mode 100644 index 0000000000..07a4d14f09 --- /dev/null +++ b/research/active-mode-restoration/TASK.json @@ -0,0 +1,107 @@ +{ + "schema_version": 1, + "task_id": "joint-query-controller", + "priority_revision": 7, + "base_commit": "df0137efd35e11b4445734bf612bdd4c7ebc330c", + "original_card": { + "id": "joint-query-controller", + "question": "Can the installed QQ16 caller win a complete matched protocol bill, or can a changed demand eliminate actual paid work?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/qq16-caller-install/README.md" + ], + "methods": [ + "Derive the matched whole-caller physical bill for installed and baseline protocols.", + "Change the actual demanded observations and prove a cheaper legal producer/consumer contract." + ], + "acceptance_gate": "Name the changed premise of the fixed F0/B1 observation obstruction. Show exactly which query is recovered, legal native reads and restoration, and a full favorable budget including cover maps, helpers and endpoints. Local inverse identities alone do not close the global controller. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #4166 COST.md and ADMISSION.json. An actual caller connection is now proposed. Its native-component profile loses; parent park/restore versus external-call costs remain unresolved. Retain the producer and recovery lineage rather than rebuild it.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "At the actual installed cut, compare matched complete parent park/restore and external input/return protocols at the same bank/packet geometry, including every later root call and service cost. Alternatively pin both bridge observations and derive a genuinely smaller source-compatible demand. Stop if the complete necessary inequality fails or an essential cost is unknown; no larger decoder scan from a local tape-action saving.", + "bottleneck_link": "The native local words exist; retained query information and its physical access are the missing link to a composed recursive interface.", + "allowed_variations": [ + "One paid query, one changed first pair, or one precisely specified affine helper state.", + "A counterexample or lower bound for that exact proposed repair.", + "One unresolved obligation of a newer local decoder, with exact source heads and a distinct claim/domain." + ], + "scope_change_triggers": [ + "Retaining the fixed first pair and ordinary schedule while allowing only homogeneous selected-only control, already excluded by the witness.", + "Treating cover-map counts as zero-cost physical address operations.", + "Recreating the pending complete local decoder or early-record/output-bank coalescing already under investigation without a distinct audit or changed premise.", + "Treating a completed-output defect inequality as a producer-interior, dirty-range or physical-cost certificate.", + "Recreating completed-output recovery or caller wiring already supplied by #4166 without new independent coverage.", + "Dropping retained later root calls or claiming native-profile dominance from the isolated publication saving." + ], + "overlap_terms": [ + "QQ16", + "joint-query", + "changing-chart controller", + "selected observation", + "1969", + "2540", + "early record", + "output-bank retention", + "complete native decoder", + "2965", + "producer defect", + "dirty-helper range", + "F17 consumer", + "4166", + "qq16-caller-install" + ], + "existing_checks": [ + { + "scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.", + "evidence": "research/qq16-caller-install/README.md", + "remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.", + "status": "author-checked", + "source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Certify the granted single L240 native-injection observer/restoration failure; prove the monotone full-sink fixed-mode observer limitation; retain a conditional one-mode direct repair with its illegal cross-frame operation explicitly rejected.", + "scope_change_reason": "The assigned active-feedback investigation changes a primitive input of the retained filtered-native word. This is a scoped native observer/endpoint checkpoint, rather than the original card's completed QQ16 protocol or a favorable supplier budget.", + "bottleneck_link": "Reusing a later paid query is useful only if all arbitrary helper outputs are restored. The exact witness separates a hidden injected mode from a usable new observation, and the conditional repair identifies the still-missing physical payload provider.", + "budget_minutes": 60, + "budget_scope": "Bounded packaging/verification checkpoint; the parent research run follows the user's separate 30-percent-remaining account cutoff.", + "stop_rule": "Stop this fixed single-injection/full-sink observer family at its exact certificates. Continue only after specifying a changed source/observation interface or a legal direct repair with a complete bill.", + "outcome": "partial", + "new_kappa_claimed": false, + "selected_frontier_unchanged": true, + "evidence": "PROOF.md; l240-extra-column-gate.json; l240-full-observations.json.gz; full-sink-gate.json; direct-l240-repair.json; verify.py", + "author": "flyingviper, with substantial OpenAI Codex assistance", + "ai_assistance": "Research, implementation, documentation and independent agent cross-checks used OpenAI Codex. No independent human peer review or proof-assistant formalization is claimed.", + "assignment": "The user selected active feedback as the next research direction and authorized independent agents and publication of verified partial results.", + "open_questions": [ + { + "question": "Can the required mode payload be supplied at frame 280 before the L240 climb with a favorable complete cost?", + "why_it_matters": "The conditional endpoint repair restores every helper, but its literal ground-to-rank8 ADD is illegal and the transport is unpaid.", + "first_step": "Emit one actual source/transport schedule for the required payload at the named cut, authenticate every phase and frame, and count all queries and retained-state costs.", + "blocked_by": "No legal, fully charged frame-280 payload provider is supplied." + }, + { + "question": "Can a changed native source dependency or new full-frame ingress provide information outside the fixed observer space?", + "why_it_matters": "The 482-row sink result explains why further lower-frame mode injections do not separately recover a pure mode while preserving the original full targets.", + "first_step": "Choose one actual changed paid input or owned ingress; derive its complete chronological observation map and restoration equations on all original columns before any parameter search.", + "blocked_by": "The changed interface and its complete productive/paid inventory are not yet constructed." + }, + { + "question": "Can direct repair of the prescribed endpoint avoid a separate pure-mode observer?", + "why_it_matters": "Direct endpoint repair is outside the sink-observer limitation and is the premise illustrated by the conditional one-mode identity.", + "first_step": "Bind a legal direct repair to its actual source versions and test all original/helper endpoints and owned returns, including the omitted helper precompensation.", + "blocked_by": "Physical availability, exact source phases and the complete caller/compiler cost remain open." + } + ], + "outcome_detail": "Scoped negative certificates and conditional endpoint identity; no physical repair or bound." +} diff --git a/research/active-mode-restoration/VERIFY.json b/research/active-mode-restoration/VERIFY.json new file mode 100644 index 0000000000..a679696061 --- /dev/null +++ b/research/active-mode-restoration/VERIFY.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/filtered-native-kappa004/inputs/original-packet.tar.gz" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Authenticate the original archive and four members; regenerate the L240 granted-injection, full-sink and conditional direct-repair gates in a temporary directory; compare semantic evidence and independently check witness pairings and rejection controls." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Repeat the same explicit checks with Python assertions disabled; source-integrity, scoped mathematical certificates and failure controls must remain active." + } + ] +} diff --git a/research/active-mode-restoration/direct-l240-repair.json b/research/active-mode-restoration/direct-l240-repair.json new file mode 100644 index 0000000000..34775f79ac --- /dev/null +++ b/research/active-mode-restoration/direct-l240-repair.json @@ -0,0 +1,36 @@ +{ + "status": "PASS_CONDITIONAL_ONE_MODE_SCALAR_ENDPOINT_IDENTITY", + "source_sha256": "934fea11e51f674ce2031b7d3127b994a921a9d83317b00359292752563a1775", + "R_sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1", + "center_suffix_sha256": "5f2439d2f724f9f6fc6766bd74cd0885e923a0f8f3736d1eff6873c68d99279a", + "word_cut_before": 17978, + "original_cut_before": 17155, + "owned_mode_capture_events_inclusive": [ + 511, + 567 + ], + "omitted_helper_precompensation_events_inclusive": [ + 568, + 615 + ], + "oracle_operation": "L240 -= C6, where C6=R5Y/4", + "oracle_source_frame": 0, + "oracle_destination_frame": 280, + "oracle_destination_rank": 8, + "literal_coframing": false, + "all632_arbitrary_input_columns": true, + "all408_helpers_identity": true, + "all_owned_scratch_zero": true, + "all_public_final_frames": true, + "endpoint_main": "X-A*Y-(R5^T*R5*Y)/4", + "endpoint_Y": "Y", + "endpoint_helpers": "H", + "downstream_warp_events": 0, + "physical_suffix_scope": "A field already delivered to full frame1 after the selected climb propagates by the displayed scalar impulse. The chosen input payload must be supplied in frame280 with the required transported value.", + "controls": { + "uncompensated_helper_mutant_rejected": true, + "wrong_injection_sign_mutant_rejected": true, + "literal_cross_frame_ADD_rejected": true + }, + "claim_limits": "Conditional scalar identity only. No legal cross-frame transfer, physical source availability, query-cost saving, compiler/caller certificate or new bound is claimed." +} diff --git a/research/active-mode-restoration/direct_l240_repair.py b/research/active-mode-restoration/direct_l240_repair.py new file mode 100644 index 0000000000..d8604d60c0 --- /dev/null +++ b/research/active-mode-restoration/direct_l240_repair.py @@ -0,0 +1,162 @@ +"""Conditional one-mode endpoint identity, not a legal native construction. + +The single extra operation deliberately grants a cross-frame transfer. All +other source operations retain their literal scalar frame checks. No source +scientific code is imported and no paid/native or caller replay is run. +""" +from pathlib import Path +from fractions import Fraction as F +from hashlib import sha256 +import gzip, json, time + +HERE = Path(__file__).resolve().parent +WP = CP = RP = None +WORD_SHA = '934fea11e51f674ce2031b7d3127b994a921a9d83317b00359292752563a1775' +R_SHA = '7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1' +CENTER_SHA = '5f2439d2f724f9f6fc6766bd74cd0885e923a0f8f3736d1eff6873c68d99279a' + +def need(ok, message): + if not ok: + raise ValueError(message) + +def add(a, b, coefficient): + out = dict(a) + for k, v in b.items(): + v = out.get(k, F(0)) + coefficient*v + if v: + out[k] = v + else: + out.pop(k, None) + return out + +def index(ref): + return ref[1] + (632 if ref[0] == 'C' else 0) + +def scalar_contact(source_frame, destination_frame, claimed_frame): + need(source_frame == destination_frame == claimed_frame, 'Literal scalar coframing') + +def main(): + began = time.monotonic() + need(sha256(WP.read_bytes()).hexdigest() == WORD_SHA, 'Frozen source WORD') + need(sha256(RP.read_bytes()).hexdigest() == R_SHA, 'Frozen R source') + need(sha256(CP.read_bytes()).hexdigest() == CENTER_SHA, 'Frozen mode5 suffix receipt') + w = json.loads(gzip.decompress(WP.read_bytes())) + center = json.loads(CP.read_bytes()) + R = [[F(x) for x in row] for row in json.loads(RP.read_bytes())] + S = {int(i): F(c) for i, c in center['capture']['helper_terms']} + mode = {112+i: a/4 for i, a in enumerate(R[5]) if a} + es = w['programs']['backward'] + cut = 17978 + need(es[cut] == ['climb', 'scalar_refactor', 240, 280, 1, 1], 'Bound frozen cut') + need(len(S) == 48 and len(mode) == 56 and S[240] == 1, 'Source mode/support inventory') + need(es[511] == ['scalar', ['clear', ['C', 6]], 0], 'Exact owned mode capture start') + capture = [['scalar', ['add', ['C', 6], ['L', i], a.numerator, a.denominator], 0] + for i, a in sorted(mode.items())] + need(es[512:568] == capture, 'Exact 56-term R5Y/4 source capture') + precomp = [['scalar', ['add', ['L', i], ['C', 6], (-a).numerator, (-a).denominator], 0] + for i, a in sorted(S.items())] + need(es[568:616] == precomp, 'Exact existing 48-helper mode5 precompensation') + need(not any(e[0] == 'warp' for e in es[cut+1:]), 'No downstream warp events') + for i in S: + need(w['canonical']['start'][i] == 0 and w['canonical']['final'][i] == 1, + 'All helper compensation sources start ground and end full') + + oracle_frames = [] + + def replay(omit_precomp, injection): + n = 633+w['owned_extra_slots_by_direction']['backward'] + rows = [{i: F(1)} for i in range(632)] + [{} for _ in range(n-632)] + cur = w['canonical']['start'][:] + [None]*(n-632) + for p, e in enumerate(es): + if p == cut: + need(rows[638] == mode and cur[638] == 0 and cur[240] == 280, + 'Actual captured mode persists, but is NOT coframed with L240') + oracle_frames.append((cur[638], cur[240])) + # Deliberately nonphysical oracle operation. It is the sole + # relaxed premise of this endpoint calculation. + rows[240] = add(rows[240], rows[638], F(injection)) + if omit_precomp and 568 <= p < 616: + continue + typ = e[0] + if typ == 'physical_add': + continue + if typ == 'scalar': + a, f = e[1:] + d = index(a[1]) + if a[0] == 'clear': + need(d >= 632, 'No arbitrary-input erasure') + rows[d] = {}; cur[d] = f + elif a[0] in ('copy', 'add'): + s = index(a[2]) + scalar_contact(cur[s], cur[d], f) + if a[0] == 'copy': + need(d >= 632, 'No arbitrary-input overwrite') + rows[d] = dict(rows[s]) + else: + need(d != s, 'Nonaliasing source ADD') + rows[d] = add(rows[d], rows[s], F(a[3], a[4])) + else: + need(a[0] == 'scale' and cur[d] == f, 'Source scale contact') + factor = F(a[2], a[3]) + rows[d] = {i: v*factor for i, v in rows[d].items() if v*factor} + elif typ in ('warp', 'climb'): + d = index(e[1]) if typ == 'warp' else e[2] + need(cur[d] == e[3], 'Source transport entrance') + cur[d] = e[4] + else: + need(typ in ('phase', 'adapter'), 'Known source metadata') + need(time.monotonic()-began < 45, 'Bounded exact scalar replay') + need(cur[:632] == w['canonical']['final'], 'All final public frames') + need(all(not r for r in rows[632:]), 'All owned scratch restored to zero') + return rows[:632] + + baseline = replay(False, 0) + candidate = replay(True, -1) + expected = [] + for i in range(632): + row = {i: F(1)} + if i < 112: + row[i+112] = F(-1) + for r in R: + row = add(row, {112+j: a/4 for j, a in enumerate(r) if a}, r[i]) + need(baseline[i] == row, 'Every baseline arbitrary-input endpoint verified') + wanted = add(row, mode, -R[5][i]) if i < 112 else row + need(candidate[i] == wanted, 'Every conditional endpoint equals one-mode repaired target') + expected.append(wanted) + dirty = replay(False, -1) + wrong_sign = replay(True, 1) + need(any(dirty[i] != expected[i] for i in range(224, 632)), 'Uncompensated dirty-helper mutant rejected') + need(any(wrong_sign[i] != expected[i] for i in range(112)), 'Wrong mode-injection sign mutant rejected') + # The advertised oracle operation itself fails the literal source ABI. + try: + scalar_contact(0, 280, 280) + except ValueError: + pass + else: + raise ValueError('Illegal oracle ADD passed the ordinary scalar contact validator') + out = { + 'status': 'PASS_CONDITIONAL_ONE_MODE_SCALAR_ENDPOINT_IDENTITY', + 'source_sha256': WORD_SHA, 'R_sha256': R_SHA, + 'center_suffix_sha256': sha256(CP.read_bytes()).hexdigest(), + 'word_cut_before': cut, 'original_cut_before': 17155, + 'owned_mode_capture_events_inclusive': [511, 567], + 'omitted_helper_precompensation_events_inclusive': [568, 615], + 'oracle_operation': 'L240 -= C6, where C6=R5Y/4', + 'oracle_source_frame': 0, 'oracle_destination_frame': 280, + 'oracle_destination_rank': 8, 'literal_coframing': False, + 'all632_arbitrary_input_columns': True, 'all408_helpers_identity': True, + 'all_owned_scratch_zero': True, 'all_public_final_frames': True, + 'endpoint_main': 'X-A*Y-(R5^T*R5*Y)/4', + 'endpoint_Y': 'Y', 'endpoint_helpers': 'H', + 'downstream_warp_events': 0, + 'physical_suffix_scope': 'A field already delivered to full frame1 after the selected climb propagates by the displayed scalar impulse. The chosen input payload must be supplied in frame280 with the required transported value.', + 'controls': {'uncompensated_helper_mutant_rejected': True, + 'wrong_injection_sign_mutant_rejected': True, + 'literal_cross_frame_ADD_rejected': True}, + 'claim_limits': 'Conditional scalar identity only. No legal cross-frame transfer, physical source availability, query-cost saving, compiler/caller certificate or new bound is claimed.', + 'elapsed_seconds': time.monotonic()-began} + (HERE/'direct-l240-repair.json').write_text(json.dumps(out, indent=2)+'\n', encoding='utf-8') + print(json.dumps(out, indent=2)) + +if __name__ == '__main__': + main() diff --git a/research/active-mode-restoration/full-sink-gate.json b/research/active-mode-restoration/full-sink-gate.json new file mode 100644 index 0000000000..eab64ad89c --- /dev/null +++ b/research/active-mode-restoration/full-sink-gate.json @@ -0,0 +1,25 @@ +{ + "status": "PASS_FIXED_VECTOR_FULL_SINK_RESTORATION_CEILING", + "source_sha256": "934fea11e51f674ce2031b7d3127b994a921a9d83317b00359292752563a1775", + "direction": "backward", + "physical_add_omitted": true, + "baseline_full_target_rank": 482, + "full_arrival_coordinates": 482, + "R_Gram": "56I8", + "baseline_full_targets_plus_R_rank": 490, + "full_event_counts": { + "full_add": 4709, + "full_scale": 535, + "full_warp": 72 + }, + "semantic_controls_rejected": { + "public_full_clear": "No persistent clear or owned full-frame creation", + "full_departure": "Full roles never leave full chart", + "owned_full_observer": "No persistent clear or owned full-frame creation", + "external_nonfull_input": "Scalar source frame", + "singular_full_update": "Invertible scalar scale" + }, + "theorem": "Every existing full-frame snapshot is a fixed linear combination of the482 final full rows, independently of changes confined to lower-frame histories before first full arrival. Captured missing R modes cannot be separately decoded while preserving all482 original full targets in this scalar fixed-vector observer interface.", + "fixed_mode_stronger_statement": "For changes whose final effect is V*R, Fprime=F+V*R. Since row(F) intersects row(R) trivially and F has482 independent rows, no nonzero pure R combination belongs to row(Fprime).", + "limits": "No universal physical-feedback impossibility. New full-frame ingress/owned transport, arbitrary new address maps or provider relations, altered target inventory, and direct repair of the prescribed endpoint without a separate pure-mode observer are outside scope." +} diff --git a/research/active-mode-restoration/full_sink_gate.py b/research/active-mode-restoration/full_sink_gate.py new file mode 100644 index 0000000000..b7ce969153 --- /dev/null +++ b/research/active-mode-restoration/full_sink_gate.py @@ -0,0 +1,94 @@ +"""Metadata-only full-frame sink certificate for the frozen scalar quotient.""" +from pathlib import Path +from fractions import Fraction as F +from hashlib import sha256 +from collections import Counter +import gzip,json,time,copy +from l240_extra_column_gate import SOURCE,RP,need,idx + +HERE=Path(__file__).resolve().parent + +def check(w,events): + c=w['canonical'];full=1 + need(len(c['frames'][full])==9 and sum(len(f)==9 for f in c['frames'])==1,'Unique full-frame chart') + n=633+w['owned_extra_slots_by_direction']['backward'];cur=c['start'][:]+[None]*(n-632) + entered={i for i,f in enumerate(cur) if f==full};census=Counter();arrival=[] + need(not entered,'No initial full-frame roles') + for pos,e in enumerate(events): + typ=e[0] + if typ=='scalar': + a,f=e[1:];d=idx(a[1]) + if a[0]=='clear': + need(d>=632 and f!=full,'No persistent clear or owned full-frame creation') + cur[d]=f + else: + need(cur[d]==f,'Scalar destination frame') + if a[0] in ('add','copy'): + s=idx(a[2]);need(cur[s]==f,'Scalar source frame') + if a[0]=='copy':need(d>=632 and f!=full,'No public copying or full owned data') + else: + need(d!=s,'All ADDs non-aliasing') + F(a[3],a[4]) + else:need(a[0]=='scale' and F(a[2],a[3])!=0,'Invertible scalar scale') + if f==full: + need(d<632 and a[0] in ('add','scale'),'Full updates only persistent invertible scalar operations') + if a[0]=='add':need(idx(a[2])<632,'No owned or external source into full subsystem') + census['full_'+a[0]]+=1 + elif typ in ('warp','climb'): + d=idx(e[1]) if typ=='warp' else e[2];old,new=e[3:5] + need(cur[d]==old,'Transport entrance') + need(old!=full or new==full,'Full roles never leave full chart') + if new==full: + need(d<632,'No owned transport into full chart') + if old!=full: + need(d not in entered,'Each persistent role arrives full once') + entered.add(d);arrival.append([pos,d,old,typ]) + else:census['full_'+typ]+=1 + cur[d]=new + else:need(typ in ('phase','adapter'),'Only retained quotient-neutral metadata') + need(cur[:632]==c['final'],'All final frames') + need(entered=={i for i,f in enumerate(c['final']) if f==full},'All full roles persist to endpoint') + need(all(f!=full for f in cur[632:]),'No final owned full source') + return {'full_persistent_roles':len(entered),'arrivals':arrival,'full_event_counts':dict(census)} + +def main(): + start=time.monotonic();raw=SOURCE.read_bytes();w=json.loads(gzip.decompress(raw)) + events=[e for e in w['programs']['backward'] if e[0]!='physical_add'] + result=check(w,events);need(result['full_persistent_roles']==482,'Exact source full-frame bank size') + R=[[F(a) for a in r] for r in json.loads(RP.read_bytes())] + gram=[[sum(a*b for a,b in zip(r,s)) for s in R] for r in R] + need(gram==[[F(56) if i==j else F(0) for j in range(8)] for i in range(8)],'R modes independent with Gram56I') + fullroles={i for i,f in enumerate(w['canonical']['final']) if f==1} + need(set(range(112))<=fullroles and not(fullroles&set(range(112,224))), + 'Original full targets have distinct X/helper pivots and no Y pivots') + # The prior exact 632-row replay binds the baseline endpoint to these + # source rows: X-A*Y and identity helper outputs. Distinct X/H pivots + # give rank482; the eight Y-only R rows add eight independent dimensions. + prior=json.loads((HERE/'l240-extra-column-gate.json').read_text()) + need(prior['source_sha256']==sha256(raw).hexdigest() and prior['all632_baseline_inputs_and408_helpers_verified'], + 'Exact arbitrary-input baseline receipt bound') + controls={} + mutants={ + 'public_full_clear':events+[['scalar',['clear',['L',0]],1]], + 'full_departure':events+[['climb','mutant',0,1,0,9]], + 'owned_full_observer':events+[['scalar',['clear',['C',0]],1]], + 'external_nonfull_input':events+[['scalar',['add',['L',0],['L',112],1,1],1]], + 'singular_full_update':events+[['scalar',['scale',['L',0],0,1],1]], + } + for name,mutant in mutants.items(): + try:check(w,mutant) + except ValueError as ex:controls[name]=str(ex) + else:raise ValueError('Mutant accepted: '+name) + out={'status':'PASS_FIXED_VECTOR_FULL_SINK_RESTORATION_CEILING', + 'source_sha256':sha256(raw).hexdigest(),'direction':'backward','physical_add_omitted':True, + 'baseline_full_target_rank':482,'full_arrival_coordinates':482, + 'R_Gram':'56I8','baseline_full_targets_plus_R_rank':490, + 'full_event_counts':result['full_event_counts'],'semantic_controls_rejected':controls, + 'theorem':'Every existing full-frame snapshot is a fixed linear combination of the482 final full rows, independently of changes confined to lower-frame histories before first full arrival. Captured missing R modes cannot be separately decoded while preserving all482 original full targets in this scalar fixed-vector observer interface.', + 'fixed_mode_stronger_statement':'For changes whose final effect is V*R, Fprime=F+V*R. Since row(F) intersects row(R) trivially and F has482 independent rows, no nonzero pure R combination belongs to row(Fprime).', + 'limits':'No universal physical-feedback impossibility. New full-frame ingress/owned transport, arbitrary new address maps or provider relations, altered target inventory, and direct repair of the prescribed endpoint without a separate pure-mode observer are outside scope.', + 'elapsed_seconds':time.monotonic()-start} + (HERE/'full-sink-gate.json').write_text(json.dumps(out,indent=2)+'\n') + print(json.dumps(out,indent=2)) + +if __name__=='__main__':main() diff --git a/research/active-mode-restoration/l240-extra-column-gate.json b/research/active-mode-restoration/l240-extra-column-gate.json new file mode 100644 index 0000000000..b5107f8519 --- /dev/null +++ b/research/active-mode-restoration/l240-extra-column-gate.json @@ -0,0 +1,1610 @@ +{ + "status": "EXACT_L240_GRANTED_ACTIVE_INJECTION_QUOTIENT", + "source_sha256": "934fea11e51f674ce2031b7d3127b994a921a9d83317b00359292752563a1775", + "original_sha256": "de4b75c106f8a3ebe1ee68b53fe7e64bd218120526e726d9bdfd4dab711dd4b2", + "R_sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1", + "direction": "backward", + "original_event": 17155, + "word_event": 17978, + "filtered_event": 17978, + "paid_event": [ + "climb", + "scalar_refactor", + 240, + 280, + 1, + 1 + ], + "injection": "Unit independent marker into L240 immediately before selected paid climb", + "injection_frame": 280, + "injection_frame_rank": 8, + "all632_baseline_inputs_and408_helpers_verified": true, + "full_frame_observations": 4868, + "baseline_full_rank": 482, + "augmented_rank": 482, + "all8_modes_missing_before_injection": true, + "pure_granted_mode_recoverable": false, + "witness_qM0_qv1": null, + "negative_certificate": { + "Mz_equals_v": [ + [ + 4, + "-1" + ], + [ + 5, + "1" + ], + [ + 10, + "1" + ], + [ + 11, + "-1" + ], + [ + 14, + "-1" + ], + [ + 15, + "1" + ], + [ + 18, + "1" + ], + [ + 19, + "-1" + ], + [ + 20, + "-1" + ], + [ + 21, + "1" + ], + [ + 22, + "1" + ], + [ + 23, + "-1" + ], + [ + 29, + "-1" + ], + [ + 30, + "1" + ], + [ + 33, + "-1" + ], + [ + 34, + "1" + ], + [ + 36, + "1" + ], + [ + 37, + "-1" + ], + [ + 39, + "-1" + ], + [ + 40, + "1" + ], + [ + 41, + "1" + ], + [ + 42, + "-1" + ], + [ + 46, + "-1" + ], + [ + 47, + "1" + ], + [ + 49, + "1" + ], + [ + 50, + "-1" + ], + [ + 52, + "1" + ], + [ + 53, + "-1" + ], + [ + 54, + "1" + ], + [ + 55, + "-1" + ], + [ + 59, + "1" + ], + [ + 60, + "-1" + ], + [ + 62, + "-1" + ], + [ + 63, + "1" + ], + [ + 64, + "1" + ], + [ + 65, + "-1" + ], + [ + 68, + "1" + ], + [ + 69, + "-1" + ], + [ + 70, + "1" + ], + [ + 71, + "-1" + ], + [ + 73, + "1" + ], + [ + 74, + "-1" + ], + [ + 83, + "1" + ], + [ + 84, + "-1" + ], + [ + 90, + "1" + ], + [ + 91, + "-1" + ], + [ + 96, + "1" + ], + [ + 97, + "-1" + ], + [ + 101, + "1" + ], + [ + 102, + "-1" + ], + [ + 105, + "1" + ], + [ + 106, + "-1" + ], + [ + 108, + "1" + ], + [ + 109, + "-1" + ], + [ + 110, + "-1" + ], + [ + 111, + "1" + ], + [ + 240, + "1" + ], + [ + 241, + "1" + ], + [ + 242, + "-1" + ], + [ + 245, + "1" + ], + [ + 246, + "-1" + ], + [ + 250, + "1" + ], + [ + 253, + "1" + ], + [ + 254, + "1" + ], + [ + 255, + "-2" + ], + [ + 288, + "1" + ], + [ + 296, + "-1" + ], + [ + 302, + "-1" + ], + [ + 303, + "-2" + ], + [ + 324, + "-2" + ], + [ + 326, + "2" + ], + [ + 328, + "-4" + ], + [ + 332, + "2" + ], + [ + 334, + "-2" + ], + [ + 335, + "-4" + ], + [ + 352, + "1" + ], + [ + 356, + "-1" + ], + [ + 366, + "-1" + ], + [ + 367, + "-1" + ], + [ + 384, + "1" + ], + [ + 388, + "-1" + ], + [ + 398, + "-1" + ], + [ + 399, + "-1" + ], + [ + 400, + "1" + ], + [ + 401, + "1" + ], + [ + 402, + "-1" + ], + [ + 405, + "1" + ], + [ + 406, + "-1" + ], + [ + 409, + "1" + ], + [ + 410, + "1" + ], + [ + 411, + "-2" + ], + [ + 413, + "1" + ], + [ + 414, + "1" + ], + [ + 415, + "-2" + ], + [ + 432, + "2" + ], + [ + 433, + "-1" + ], + [ + 434, + "1" + ], + [ + 437, + "1" + ], + [ + 438, + "1" + ], + [ + 441, + "-1" + ], + [ + 442, + "-1" + ], + [ + 445, + "-1" + ], + [ + 446, + "1" + ], + [ + 447, + "-2" + ] + ], + "Mu_equals0_mode5_u_equals1": [ + [ + 0, + "1/2" + ], + [ + 1, + "1/2" + ], + [ + 2, + "1/2" + ], + [ + 3, + "1/2" + ], + [ + 5, + "1/2" + ], + [ + 10, + "-1/2" + ], + [ + 14, + "1/2" + ], + [ + 18, + "-1/2" + ], + [ + 20, + "1/2" + ], + [ + 22, + "-1/2" + ], + [ + 24, + "-1/2" + ], + [ + 29, + "1/2" + ], + [ + 33, + "1/2" + ], + [ + 36, + "-1/2" + ], + [ + 39, + "1/2" + ], + [ + 41, + "-1/2" + ], + [ + 43, + "-1/2" + ], + [ + 44, + "-1/2" + ], + [ + 45, + "-1/2" + ], + [ + 47, + "-1/2" + ], + [ + 48, + "1/2" + ], + [ + 50, + "1/2" + ], + [ + 51, + "1/2" + ], + [ + 53, + "1/2" + ], + [ + 55, + "1/2" + ], + [ + 57, + "-1/2" + ], + [ + 58, + "1/2" + ], + [ + 60, + "1/2" + ], + [ + 61, + "-1/2" + ], + [ + 63, + "-1/2" + ], + [ + 65, + "1/2" + ], + [ + 67, + "1/2" + ], + [ + 69, + "1/2" + ], + [ + 71, + "1/2" + ], + [ + 74, + "1/2" + ], + [ + 78, + "1/2" + ], + [ + 79, + "-1/2" + ], + [ + 80, + "1/2" + ], + [ + 81, + "-1/2" + ], + [ + 82, + "1/2" + ], + [ + 84, + "1/2" + ], + [ + 85, + "1/2" + ], + [ + 86, + "1/2" + ], + [ + 87, + "1/2" + ], + [ + 88, + "1/2" + ], + [ + 89, + "1/2" + ], + [ + 91, + "1/2" + ], + [ + 96, + "-1/2" + ], + [ + 101, + "-1/2" + ], + [ + 105, + "-1/2" + ], + [ + 108, + "-1/2" + ], + [ + 110, + "1/2" + ], + [ + 116, + "-1" + ] + ], + "changed_observation_annihilator": [ + [ + 0, + "1/2" + ], + [ + 1, + "1/2" + ], + [ + 2, + "1/2" + ], + [ + 3, + "1/2" + ], + [ + 4, + "1" + ], + [ + 5, + "-1/2" + ], + [ + 10, + "-3/2" + ], + [ + 11, + "1" + ], + [ + 14, + "3/2" + ], + [ + 15, + "-1" + ], + [ + 18, + "-3/2" + ], + [ + 19, + "1" + ], + [ + 20, + "3/2" + ], + [ + 21, + "-1" + ], + [ + 22, + "-3/2" + ], + [ + 23, + "1" + ], + [ + 24, + "-1/2" + ], + [ + 29, + "3/2" + ], + [ + 30, + "-1" + ], + [ + 33, + "3/2" + ], + [ + 34, + "-1" + ], + [ + 36, + "-3/2" + ], + [ + 37, + "1" + ], + [ + 39, + "3/2" + ], + [ + 40, + "-1" + ], + [ + 41, + "-3/2" + ], + [ + 42, + "1" + ], + [ + 43, + "-1/2" + ], + [ + 44, + "-1/2" + ], + [ + 45, + "-1/2" + ], + [ + 46, + "1" + ], + [ + 47, + "-3/2" + ], + [ + 48, + "1/2" + ], + [ + 49, + "-1" + ], + [ + 50, + "3/2" + ], + [ + 51, + "1/2" + ], + [ + 52, + "-1" + ], + [ + 53, + "3/2" + ], + [ + 54, + "-1" + ], + [ + 55, + "3/2" + ], + [ + 57, + "-1/2" + ], + [ + 58, + "1/2" + ], + [ + 59, + "-1" + ], + [ + 60, + "3/2" + ], + [ + 61, + "-1/2" + ], + [ + 62, + "1" + ], + [ + 63, + "-3/2" + ], + [ + 64, + "-1" + ], + [ + 65, + "3/2" + ], + [ + 67, + "1/2" + ], + [ + 68, + "-1" + ], + [ + 69, + "3/2" + ], + [ + 70, + "-1" + ], + [ + 71, + "3/2" + ], + [ + 73, + "-1" + ], + [ + 74, + "3/2" + ], + [ + 78, + "1/2" + ], + [ + 79, + "-1/2" + ], + [ + 80, + "1/2" + ], + [ + 81, + "-1/2" + ], + [ + 82, + "1/2" + ], + [ + 83, + "-1" + ], + [ + 84, + "3/2" + ], + [ + 85, + "1/2" + ], + [ + 86, + "1/2" + ], + [ + 87, + "1/2" + ], + [ + 88, + "1/2" + ], + [ + 89, + "1/2" + ], + [ + 90, + "-1" + ], + [ + 91, + "3/2" + ], + [ + 96, + "-3/2" + ], + [ + 97, + "1" + ], + [ + 101, + "-3/2" + ], + [ + 102, + "1" + ], + [ + 105, + "-3/2" + ], + [ + 106, + "1" + ], + [ + 108, + "-3/2" + ], + [ + 109, + "1" + ], + [ + 110, + "3/2" + ], + [ + 111, + "-1" + ], + [ + 116, + "-1" + ], + [ + 240, + "-1" + ], + [ + 241, + "-1" + ], + [ + 242, + "1" + ], + [ + 245, + "-1" + ], + [ + 246, + "1" + ], + [ + 250, + "-1" + ], + [ + 253, + "-1" + ], + [ + 254, + "-1" + ], + [ + 255, + "2" + ], + [ + 288, + "-1" + ], + [ + 296, + "1" + ], + [ + 302, + "1" + ], + [ + 303, + "2" + ], + [ + 324, + "2" + ], + [ + 326, + "-2" + ], + [ + 328, + "4" + ], + [ + 332, + "-2" + ], + [ + 334, + "2" + ], + [ + 335, + "4" + ], + [ + 352, + "-1" + ], + [ + 356, + "1" + ], + [ + 366, + "1" + ], + [ + 367, + "1" + ], + [ + 384, + "-1" + ], + [ + 388, + "1" + ], + [ + 398, + "1" + ], + [ + 399, + "1" + ], + [ + 400, + "-1" + ], + [ + 401, + "-1" + ], + [ + 402, + "1" + ], + [ + 405, + "-1" + ], + [ + 406, + "1" + ], + [ + 409, + "-1" + ], + [ + 410, + "-1" + ], + [ + 411, + "2" + ], + [ + 413, + "-1" + ], + [ + 414, + "-1" + ], + [ + 415, + "2" + ], + [ + 432, + "-2" + ], + [ + 433, + "1" + ], + [ + 434, + "-1" + ], + [ + 437, + "-1" + ], + [ + 438, + "-1" + ], + [ + 441, + "1" + ], + [ + 442, + "1" + ], + [ + 445, + "1" + ], + [ + 446, + "-1" + ], + [ + 447, + "2" + ] + ], + "mode5_pairing": "1", + "helper240_pairing": "-1", + "mode5_dot_z": "0", + "all4868_rows_checked_directly": true, + "dropped_z_coordinate_rejected": 4, + "before_after_dirty_positive_control": true + }, + "baseline_helper240_graph_coefficient": "1", + "final_impulse_main": [ + [ + 4, + "-1" + ], + [ + 5, + "1" + ], + [ + 10, + "1" + ], + [ + 11, + "-1" + ], + [ + 14, + "-1" + ], + [ + 15, + "1" + ], + [ + 18, + "1" + ], + [ + 19, + "-1" + ], + [ + 20, + "-1" + ], + [ + 21, + "1" + ], + [ + 22, + "1" + ], + [ + 23, + "-1" + ], + [ + 29, + "-1" + ], + [ + 30, + "1" + ], + [ + 33, + "-1" + ], + [ + 34, + "1" + ], + [ + 36, + "1" + ], + [ + 37, + "-1" + ], + [ + 39, + "-1" + ], + [ + 40, + "1" + ], + [ + 41, + "1" + ], + [ + 42, + "-1" + ], + [ + 46, + "-1" + ], + [ + 47, + "1" + ], + [ + 49, + "1" + ], + [ + 50, + "-1" + ], + [ + 52, + "1" + ], + [ + 53, + "-1" + ], + [ + 54, + "1" + ], + [ + 55, + "-1" + ], + [ + 59, + "1" + ], + [ + 60, + "-1" + ], + [ + 62, + "-1" + ], + [ + 63, + "1" + ], + [ + 64, + "1" + ], + [ + 65, + "-1" + ], + [ + 68, + "1" + ], + [ + 69, + "-1" + ], + [ + 70, + "1" + ], + [ + 71, + "-1" + ], + [ + 73, + "1" + ], + [ + 74, + "-1" + ], + [ + 83, + "1" + ], + [ + 84, + "-1" + ], + [ + 90, + "1" + ], + [ + 91, + "-1" + ], + [ + 96, + "1" + ], + [ + 97, + "-1" + ], + [ + 101, + "1" + ], + [ + 102, + "-1" + ], + [ + 105, + "1" + ], + [ + 106, + "-1" + ], + [ + 108, + "1" + ], + [ + 109, + "-1" + ], + [ + 110, + "-1" + ], + [ + 111, + "1" + ] + ], + "final_impulse_helpers": [ + [ + 240, + "1" + ], + [ + 241, + "1" + ], + [ + 242, + "-1" + ], + [ + 245, + "1" + ], + [ + 246, + "-1" + ], + [ + 250, + "1" + ], + [ + 253, + "1" + ], + [ + 254, + "1" + ], + [ + 255, + "-2" + ], + [ + 288, + "1" + ], + [ + 296, + "-1" + ], + [ + 302, + "-1" + ], + [ + 303, + "-2" + ], + [ + 324, + "-2" + ], + [ + 326, + "2" + ], + [ + 328, + "-4" + ], + [ + 332, + "2" + ], + [ + 334, + "-2" + ], + [ + 335, + "-4" + ], + [ + 352, + "1" + ], + [ + 356, + "-1" + ], + [ + 366, + "-1" + ], + [ + 367, + "-1" + ], + [ + 384, + "1" + ], + [ + 388, + "-1" + ], + [ + 398, + "-1" + ], + [ + 399, + "-1" + ], + [ + 400, + "1" + ], + [ + 401, + "1" + ], + [ + 402, + "-1" + ], + [ + 405, + "1" + ], + [ + 406, + "-1" + ], + [ + 409, + "1" + ], + [ + 410, + "1" + ], + [ + 411, + "-2" + ], + [ + 413, + "1" + ], + [ + 414, + "1" + ], + [ + 415, + "-2" + ], + [ + 432, + "2" + ], + [ + 433, + "-1" + ], + [ + 434, + "1" + ], + [ + 437, + "1" + ], + [ + 438, + "1" + ], + [ + 441, + "-1" + ], + [ + 442, + "-1" + ], + [ + 445, + "-1" + ], + [ + 446, + "1" + ], + [ + 447, + "-2" + ] + ], + "no_free_helper_erasure": true, + "physical_mode_availability_proved": false, + "scope": "Exact necessary common-fixed-vector quotient only; grants all chronological full-frame snapshots and missing-mode injection at rank8. Captures, storage, phase-aware maps, legal source availability, actual main target restoration and complete invoice remain unproved." +} diff --git a/research/active-mode-restoration/l240-full-observations.json.gz b/research/active-mode-restoration/l240-full-observations.json.gz new file mode 100644 index 0000000000..ddee54c2e6 Binary files /dev/null and b/research/active-mode-restoration/l240-full-observations.json.gz differ diff --git a/research/active-mode-restoration/l240_extra_column_gate.py b/research/active-mode-restoration/l240_extra_column_gate.py new file mode 100644 index 0000000000..6affd88d20 --- /dev/null +++ b/research/active-mode-restoration/l240_extra_column_gate.py @@ -0,0 +1,198 @@ +"""Exact scalar fixed-vector quotient for one granted active injection. + +All native address operators are evaluated on their common fixed vector. +No assertion of physical availability of the missing mode at the injection +frame is made. Original rows and unit-injection response are replayed together. +""" +from pathlib import Path +from fractions import Fraction as F +from hashlib import sha256 +import gzip,json,time + +HERE=Path(__file__).resolve().parent +SOURCE = ORIGINAL = RP = None + +def need(ok,msg): + if not ok:raise ValueError(msg) + +def axpy(a,b,c): + out=dict(a) + for k,v in b.items(): + value=out.get(k,F(0))+c*v + if value:out[k]=value + else:out.pop(k,None) + return out + +def scaled(a,c):return {k:v*c for k,v in a.items() if v*c} +def idx(ref):return ref[1]+632*(ref[0]=='C') + +def main(): + began=time.monotonic() + w=json.loads(gzip.decompress(SOURCE.read_bytes())) + original=json.loads(gzip.decompress(ORIGINAL.read_bytes())) + canonical=w['canonical'];R=[[F(v) for v in row] for row in json.loads(RP.read_bytes())] + es=[(i,e) for i,e in enumerate(w['programs']['backward']) if e[0]!='physical_add'] + selected=['climb','scalar_refactor',240,280,1,1] + hits=[(j,i) for j,(i,e) in enumerate(es) if e==selected] + need(len(hits)==1,'Unique exact late L240 paid climb') + event_index,word_index=hits[0] + need(word_index==17978 and original['programs']['backward'][17155]==selected, + 'Exact original/new paid event binding') + need(w['source_sha256']==sha256(ORIGINAL.read_bytes()).hexdigest(),'Source packet hash binding') + owned=1+w['owned_extra_slots_by_direction']['backward'] + rows=[{i:F(1)} for i in range(632)]+[{} for _ in range(owned)] + responses=[F(0)]*len(rows);cur=canonical['start'][:]+[None]*owned + observations=[];seen=set();basis={};witness=None + endpoint_impulse=None + + def save(d,pos): + nonlocal witness + if cur[d]!=1 or not rows[d]:return + key=(tuple(sorted(rows[d].items())),responses[d]) + if key in seen:return + seen.add(key) + oi=len(observations) + observations.append({'owner':d,'after_event':pos,'row':dict(rows[d]),'v':responses[d]}) + row=dict(rows[d]);beta=responses[d];recipe={oi:F(1)} + while row: + pivot=min(row) + if pivot not in basis: + z=1/row[pivot] + basis[pivot]=(scaled(row,z),beta*z,scaled(recipe,z)) + return + b,v,rec=basis[pivot];z=row[pivot] + row=axpy(row,b,-z);beta-=z*v;recipe=axpy(recipe,rec,-z) + if beta and witness is None: + witness=(scaled(recipe,1/beta),beta) + + for d in range(632):save(d,-1) + for pos,(rawpos,e) in enumerate(es): + if pos==event_index: + need(cur[240]==280,'Granted injection is at actual rank-eight frame') + responses[240]+=1 + typ=e[0];d=None + if typ=='scalar': + a,f=e[1:];d=idx(a[1]) + if a[0]=='clear': + need(d>=632,'Only owned clearing') + rows[d]={};responses[d]=F(0);cur[d]=f + elif a[0] in ('add','copy'): + s=idx(a[2]);need(cur[s]==cur[d]==f,'Literal scalar coframing') + if a[0]=='copy': + need(d>=632,'Copy only into owned scratch') + rows[d]=dict(rows[s]);responses[d]=responses[s] + else: + coef=F(a[3],a[4]);rows[d]=axpy(rows[d],rows[s],coef) + responses[d]+=coef*responses[s] + else: + need(a[0]=='scale' and cur[d]==f,'Literal scalar scale') + coef=F(a[2],a[3]);rows[d]=scaled(rows[d],coef);responses[d]*=coef + elif typ=='warp': + d=idx(e[1]);need(cur[d]==e[3],'Warp entrance frame');cur[d]=e[4] + elif typ=='climb': + d=e[2];need(cur[d]==e[3],'Paid entrance frame');cur[d]=e[4] + else:need(typ in ('phase','adapter'),'Known center-free event type') + if d is not None:save(d,rawpos) + need(time.monotonic()-began<60,'Bounded lightweight quotient runtime') + need(cur[:632]==canonical['final'] and all(not r for r in rows[632:]),'Baseline final frames and owned return') + need(all(v==0 for v in responses[632:]),'Granted injection leaves no final owned residue') + for i in range(632): + expected={i:F(1)} + if i<112: + expected[i+112]=F(-1) + for r in R: + if r[i]: + for j,a in enumerate(r): + if a:expected[j+112]=expected.get(j+112,F(0))+r[i]*a/4 + need(rows[i]=={k:v for k,v in expected.items() if v},'All632 baseline arbitrary-input endpoint rows') + + def reduce_target(row): + residual=dict(row);value=F(0);recipe={} + while residual: + p=min(residual) + if p not in basis:break + b,beta,rec=basis[p];z=residual[p] + residual=axpy(residual,b,-z);value+=z*beta;recipe=axpy(recipe,rec,z) + return residual,value,recipe + + modes=[{112+i:a for i,a in enumerate(r) if a} for r in R] + need(all(reduce_target(m)[0] for m in modes),'All eight source modes outside old full-frame span') + cert=None + if witness is not None: + q,_=witness;check={};checkv=F(0) + for i,coef in q.items(): + check=axpy(check,observations[i]['row'],coef);checkv+=coef*observations[i]['v'] + need(not check and checkv==1,'Direct exact qM=0, qv=1 certificate') + cert=[{'observation':i,'owner':observations[i]['owner'], + 'after_event':observations[i]['after_event'],'coefficient':str(coef)} for i,coef in sorted(q.items())] + hres,hvalue,hrecipe=reduce_target({240:F(1)}) + need(not hres,'Baseline L240 independent endpoint available in full-frame span') + negative=None + if witness is None: + # A directly checked certificate that the response is a function of + # the old observations, rather than a new independent observation. + z={} + for p,(row,beta,_) in sorted(basis.items(),reverse=True): + val=beta-sum(a*z.get(k,F(0)) for k,a in row.items() if k!=p) + if val:z[p]=val + need(all(sum(a*z.get(k,F(0)) for k,a in o['row'].items())==o['v'] + for o in observations),'Direct Mz=v certificate for every observation') + target=modes[5];residual,_,_=reduce_target(target) + u={min(residual):F(1)} + for p,(row,_,_) in sorted(basis.items(),reverse=True): + val=-sum(a*u.get(k,F(0)) for k,a in row.items() if k!=p) + if val:u[p]=val + else:u.pop(p,None) + pairing=sum(a*u.get(k,F(0)) for k,a in target.items()) + need(pairing!=0,'Missing mode has nonzero dual pairing') + u=scaled(u,1/pairing) + need(all(sum(a*u.get(k,F(0)) for k,a in o['row'].items())==0 + for o in observations),'Direct Mu=0 certificate for every observation') + mz=sum(a*z.get(k,F(0)) for k,a in target.items()) + dual=axpy(scaled(u,1+mz),z,F(-1)) + need(sum(a*dual.get(k,F(0)) for k,a in target.items())==1,'Mode5 dual pairing one') + need(all(sum(a*dual.get(k,F(0)) for k,a in o['row'].items())+o['v']==0 + for o in observations),'Direct (M+v mode5)dual=0 for every changed observation') + need(dual.get(240,F(0))==-hvalue!=0,'Same dual separates original helper240') + # Meaningful witness controls: removing an actual nonzero coordinate + # from z must fail Mz=v; an independent dirty baseline paired with an + # injected copy admits cancellation, a single dirty copy does not. + badz=dict(z);first=min(z);badz.pop(first) + need(any(sum(a*badz.get(k,F(0)) for k,a in o['row'].items())!=o['v'] + for o in observations),'Dropped restoration-certificate coordinate rejects') + toyM=[{0:F(1)},{0:F(1)}];toyv=[F(0),F(1)];toyq=[F(-1),F(1)] + need(sum(toyq[i]*toyv[i] for i in range(2))==1 and + sum(toyq[i]*toyM[i][0] for i in range(2))==0,'Distinct before/after dirty observation positive control') + need(toyv[1]!=0 and toyM[1][0]!=0,'One dirty response cannot be treated as clean') + negative={'Mz_equals_v':[[k,str(a)] for k,a in sorted(z.items())], + 'Mu_equals0_mode5_u_equals1':[[k,str(a)] for k,a in sorted(u.items())], + 'changed_observation_annihilator':[[k,str(a)] for k,a in sorted(dual.items())], + 'mode5_pairing':'1','helper240_pairing':str(dual.get(240,F(0))), + 'mode5_dot_z':str(mz),'all4868_rows_checked_directly':True, + 'dropped_z_coordinate_rejected':first,'before_after_dirty_positive_control':True} + record={'status':'EXACT_L240_GRANTED_ACTIVE_INJECTION_QUOTIENT', + 'source_sha256':sha256(SOURCE.read_bytes()).hexdigest(), + 'original_sha256':sha256(ORIGINAL.read_bytes()).hexdigest(), + 'R_sha256':sha256(RP.read_bytes()).hexdigest(), + 'direction':'backward','original_event':17155,'word_event':word_index, + 'filtered_event':event_index,'paid_event':selected,'injection':'Unit independent marker into L240 immediately before selected paid climb', + 'injection_frame':280,'injection_frame_rank':8, + 'all632_baseline_inputs_and408_helpers_verified':True, + 'full_frame_observations':len(observations),'baseline_full_rank':len(basis), + 'augmented_rank':len(basis)+(witness is not None),'all8_modes_missing_before_injection':True, + 'pure_granted_mode_recoverable':witness is not None, + 'witness_qM0_qv1':cert, + 'negative_certificate':negative, + 'baseline_helper240_graph_coefficient':str(hvalue), + 'final_impulse_main':[[i,str(v)] for i,v in enumerate(responses[:224]) if v], + 'final_impulse_helpers':[[i,str(v)] for i,v in enumerate(responses[:632]) if i>=224 and v], + 'no_free_helper_erasure':True,'physical_mode_availability_proved':False, + 'scope':'Exact necessary common-fixed-vector quotient only; grants all chronological full-frame snapshots and missing-mode injection at rank8. Captures, storage, phase-aware maps, legal source availability, actual main target restoration and complete invoice remain unproved.', + 'elapsed_seconds':time.monotonic()-began} + (HERE/'l240-extra-column-gate.json').write_text(json.dumps(record,indent=2)+'\n',encoding='utf-8') + payload=[{'owner':o['owner'],'after_event':o['after_event'], + 'row':[[k,str(v)] for k,v in sorted(o['row'].items())],'v':str(o['v'])} for o in observations] + (HERE/'l240-full-observations.json.gz').write_bytes(gzip.compress(json.dumps(payload,separators=(',',':')).encode(),mtime=0)) + print(json.dumps(record,indent=2)) + +if __name__=='__main__':main() diff --git a/research/active-mode-restoration/verify.py b/research/active-mode-restoration/verify.py new file mode 100644 index 0000000000..92bf8b13cb --- /dev/null +++ b/research/active-mode-restoration/verify.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +"""Read-only source-bound replay of a scoped active-restoration gate. + +Python standard library only. No native source program is imported. Temporary +replay artifacts are compared semantically, not by their gzip containers. +""" +from contextlib import redirect_stdout +from fractions import Fraction as Q +from hashlib import sha256 +from pathlib import Path +from tempfile import TemporaryDirectory +import gzip +import io +import json +import sys +import tarfile +import types + +HERE = Path(__file__).resolve().parent +ARCHIVE = HERE.parents[1]/'research/filtered-native-kappa004/inputs/original-packet.tar.gz' +ARCHIVE_SHA = '595f988e748b1f3b25e7525a226da173966e4278a70f511b2919245cec1b45f7' +PREFIX = 'filtered_native_implementation/' +MEMBERS = { + 'word': ('research/retained_state_next/F9-SOURCE-DAG-ALL8-WORD.json.gz', + '934fea11e51f674ce2031b7d3127b994a921a9d83317b00359292752563a1775'), + 'original': ('research/native_contact/SCALED-GLOBAL-CANCEL-WORD.json.gz', + 'de4b75c106f8a3ebe1ee68b53fe7e64bd218120526e726d9bdfd4dab711dd4b2'), + 'R': ('upstream/research/involutory-producer-raw-dual/inputs/R/R.json', + '7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1'), + 'center': ('research/retained_state_next/CENTER5-SUFFIX.json', + '5f2439d2f724f9f6fc6766bd74cd0885e923a0f8f3736d1eff6873c68d99279a'), +} + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def read_json(path): + data = path.read_bytes() + return json.loads(gzip.decompress(data) if path.suffix == '.gz' else data) + + +def load_local(name): + """Read committed Python source directly, ignoring all bytecode caches.""" + path = HERE/(name+'.py') + module = types.ModuleType(name) + module.__file__ = str(path) + sys.modules[name] = module + exec(compile(path.read_bytes(), str(path), 'exec'), module.__dict__) + return module + + +def independent_witness_check(record, observations, mode_values): + """Direct pairings only: does not import or reuse search/elimination.""" + def decode(entries): + indices = [int(i) for i, _ in entries] + require(len(indices) == len(set(indices)), 'Unique sparse witness coordinates') + require(all(0 <= i < 632 for i in indices), 'Original input coordinates') + return {int(i): Q(v) for i, v in entries} + + def dot(a, b): + return sum((v*b.get(i, Q(0)) for i, v in a.items()), Q(0)) + + mode = {112+i: Q(v) for i, v in enumerate(mode_values) if Q(v)} + negative = record['negative_certificate'] + z = decode(negative['Mz_equals_v']) + u = decode(negative['Mu_equals0_mode5_u_equals1']) + a = decode(negative['changed_observation_annihilator']) + require(len(observations) == 4868, 'Observation inventory') + require(dot(mode, u) == dot(mode, a) == 1 and a[240] == -1, + 'Both original targets separated') + for item in observations: + row, v = decode(item['row']), Q(item['v']) + require(dot(row, z) == v, 'Direct Mz=v witness') + require(dot(row, u) == 0, 'Direct Mu=0 witness') + require(dot(row, a)+v*dot(mode, a) == 0, 'Direct changed-space annihilator') + bad = dict(a) + bad.pop(240) + require(any(dot(decode(o['row']), bad)+Q(o['v'])*dot(mode, bad) + for o in observations), 'Dropped helper coordinate must reject') + return {'rows': len(observations), 'mode_pairing': str(dot(mode, a)), + 'original_helper240_pairing': str(a[240])} + + +def main(): + raw = ARCHIVE.read_bytes() + require(sha256(raw).hexdigest() == ARCHIVE_SHA, 'Exact original source archive') + with TemporaryDirectory(prefix='active-mode-restoration-') as directory: + temporary = Path(directory) + paths = {} + with tarfile.open(fileobj=io.BytesIO(raw), mode='r:gz') as archive: + inventory = archive.getmembers() + for key, (name, digest) in MEMBERS.items(): + matches = [m for m in inventory if m.name == PREFIX+name] + require(len(matches) == 1 and matches[0].isfile(), 'Unique regular retained member') + data = archive.extractfile(matches[0]).read() + require(sha256(data).hexdigest() == digest, 'Exact retained member: '+name) + # No archive-controlled filesystem paths are extracted. + paths[key] = temporary/(key+'.input') + paths[key].write_bytes(data) + gate = load_local('l240_extra_column_gate') + gate.HERE, gate.SOURCE, gate.ORIGINAL, gate.RP = ( + temporary, paths['word'], paths['original'], paths['R']) + with redirect_stdout(io.StringIO()): + gate.main() + sink = load_local('full_sink_gate') + sink.HERE = temporary + with redirect_stdout(io.StringIO()): + sink.main() + repair = load_local('direct_l240_repair') + repair.HERE, repair.WP, repair.CP, repair.RP = ( + temporary, paths['word'], paths['center'], paths['R']) + with redirect_stdout(io.StringIO()): + repair.main() + for name in ('l240-extra-column-gate.json', 'full-sink-gate.json', + 'direct-l240-repair.json', 'l240-full-observations.json.gz'): + actual, retained = read_json(temporary/name), read_json(HERE/name) + if isinstance(actual, dict): + actual.pop('elapsed_seconds', None) + retained.pop('elapsed_seconds', None) + require(actual == retained, 'Complete semantic artifact comparison: '+name) + witness = independent_witness_check( + read_json(temporary/'l240-extra-column-gate.json'), + read_json(temporary/'l240-full-observations.json.gz'), + json.loads(paths['R'].read_bytes())[5]) + print(json.dumps({'status': 'PASS_SCOPED_ACTIVE_MODE_RESTORATION', + 'archive_sha256': ARCHIVE_SHA, 'independent_witness': witness, + 'conditional_repair_inputs': 632, 'independent_helpers': 408, + 'new_physical_construction': False, 'new_kappa_claim': False}, indent=2)) + + +if __name__ == '__main__': + main()