Skip to content

Preserve native function default-storage evidence for one-to-one movement - #161

Open
trissim wants to merge 10 commits into
mainfrom
work/pi-toad-errors--7425ce3d67d94062967e2f4208730b62--nominalrefactoradvisor
Open

trissim wants to merge 10 commits into
mainfrom
work/pi-toad-errors--7425ce3d67d94062967e2f4208730b62--nominalrefactoradvisor

Conversation

@trissim

@trissim trissim commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary — incomplete transport overhaul: original slots, source correspondence and owned dispatch

17 files, +1437/-245; current supplied-target-entry increment5files+191/-4 at5ccb0d7998e28616e278e918e30de0f3ac707aed. Twelve selected production own-family probes removed in prior stages; no extra switch-removal credit claimed here. Current retained scope67modules/22OPEN inheritance cases/no parse omissions, with expanded NRA source-index evidence described in Stage8. Original raw creation/attachment metadata and parameter-to-container-slot associations are queryable through their original graph. Function installation joins that graph to its original source creation/store/cut; plain and decorated functions share the store's binding/frame identity check. SourceFunctionDefault now joins six observed original source defaults to their native slots through that same cut; this does not establish target-runtime object identity. An explicit held-target-code entry now supports a conditional constant-pool birth-object query; ordinary loaders do not acquire it. Its source-only fixture is a supplied contract, not an authenticated observation of a running target. This is the ongoing implementation of Carry52273's bounded one-function-to-one-function default-storage transport work. It is not a promotion certificate: zero new defaults are admitted, and the contextual before/after association proof remains OPEN. Further commits for that same issue stay here.

Owners before → after

Before:

  • NativeParameterDefault.from_function directly decoded the current native code's positional and keyword-only name layout while preserving actual runtime default objects.
  • MAKE_FUNCTION recorded generic NativeFunctionValue inputs, without retaining their original parameter layout or creation-mask field order.
  • SET_FUNCTION_ATTRIBUTE retained its input and integer flag but offered no shared original-field query across raw creation and attachments.

After:

  • NativeFunctionParameters owns the layout decoded from the original CodeType. NativeParameterDefault consumes it; existing runtime default collection still uses native tuple/dict operations and retains original object identity without calling the function.
  • NativeRawFunctionValue retains that same compact layout and the creation operation's actual field flags. It replaces the raw generic production, not a parallel path or adapter. No executable CodeType is retained in the new receipt.
  • The produced-value family owns default failure for type/parameter/metadata queries, typed productions retain their declared type and function members own parameters / attribute_operand behavior. Raw creation selects its original input by the retained flag order; attachment nodes answer their own field or derive the answer through the preceding function value. There is no consumer-side type switch.
  • Supported CPython backends own the lowering distinction: 3.11 derives creation flags from its standard-library dis.MAKE_FUNCTION_FLAGS; 3.14 derives attachment identities from dis.FUNCTION_ATTR_FLAGS and requires the no-argument raw creation form. No copied bit-number table, literal-value passport or method-name exemption.

This deliberately distinguishes an original compiler input from an observed runtime object. The query does not establish source activation, later runtime attribute state, imported binding identity or movement safety.

Retained evidence and source-only checks

Baseline d0667af3c2733b3de298be1af4bd69f963cb9e23; existing isolated owned checkout and retained 18-module/538-original-class map reused. Open-PR census was empty. All production constructors/consumers of NativeFunctionValue, NativeFunctionAttributeValue, NativeParameterDefault and _UnboundEntryParameter were enumerated before editing. The raw constructor has one production site (MakeNativeFunction); attachment creation stays with AttachNativeFunctionAttribute. NativeParameterDefault's production consumers in native_call remain unchanged. Scope omissions/dynamic bindings from the original map remain OPEN; this is not a full scan or equivalence claim.

Actual source query against the edited framework compiled, but did not execute, this subject:

class Base:
    pass
class Child(Base):
    def selected(self, floor=0, *, max_bytes=None):
        return floor, max_bytes

It selected the original store through SourceModule, ModuleSyntaxIndex, SourceByteSpan and native_compilation.value_store_for, queried the backend-derived default field flags, then required each operand in that original store inventory. Observed layout: positional (self, floor), keyword-only (max_bytes,); defaults original NativeConstantValue at offset20, keyword defaults original NativeTypedValue at offset26 with inputs22/24. Those offsets describe the recorded host compilation, not portable API identities or runtime object evidence.

Artifacts under /home/ts/.cache/agent-scratch/pi-toad-errors/:

  • nra-stored-default-operands-1.{log,rc}: rc0, edited import path and original native metadata observations.
  • nra-stored-default-source-1.{log,rc}: failed rc1 because the verification query wrongly indexed positional cls in dataclass's keyword defaults. This was a query bug, not a target execution or a successful check; retained.
  • nra-stored-default-source-2.{log,rc}: rc0; 3 changed modules compile and parse (11/120/4 original ClassDefs respectively); 11 actual stdlib-function default associations preserve object identity against inspect.signature(..., follow_wrapped=False) as an observation oracle only; original native metadata query repeated against the final batch. Zero subject-body invocations and zero movement admissions. The production implementation does not use inspect.signature.

Commands used the existing runtime Python with PYTHONPATH selecting only this owned NRA checkout and -B, under a45s INT bound. No analyzed class/function body ran. One-shot query source is deleted before publication; its behavior is retained in the parameterized test family.

Final follow-up source compile and the 11 actual default-identity observations completed rc0 in nra-stored-default-final-source.{log,rc} after declaring the family's default type-query failure and typing the new fixture parameters. No target subject was invoked.

Four written cases cover both default fields, positional-only, keyword-only and no-default forms using actual compiler receipts; missing attachments refuse. They are not run here. Existing current-runtime default tests retain hostile values/storage subclasses, replaced defaults, ignored extra keyword keys and actual object-identity coverage.

No pytest, full suite, local NRA gate, full rescan, native agent, model, candidate, application or new Comms root launch. CPython3.11 execution has not been qualified in this environment.

Stage 2 — original parameter/storage slots (not source-cut or movement proof)

Before, field inputs were retained, but tuple elements and dictionary entries had no public association query. Both nonempty dictionary builders flattened their results to NativeTypedValue; native keyword consumers separately checked the same constant/name shape.

After:

  • NativeParameterDefaultOperand keeps the original parameter name and native storage. Positional/keyword members own the selector; their value is derived, not copied. NativeFunctionValue aligns birth metadata with its retained actual-code layout. Missing metadata still refuses; no absence, runtime mutation or activation conclusion is manufactured.
  • NativeTupleValue exposes its original producers. Folded NativeConstantValue tuples expose NativeConstantTupleElement(storage,index): a projection, with no invented instruction offset or NativeProducedValue membership. Source origins and target object identities are not inferred.
  • NativeLiteralContentsABC carries the shared question/default refusal; NativeConstantContentsABC owns its concrete constant-content answer. Native productions and constant projections share that capability without making every production a constant. The duplicated literal relay/default is deleted.
  • NativeDictionaryValue owns exact-name entry projection and native overwrite/order behavior. Paired and constant-key builders retain their distinct operand layouts and replace the generic typed productions. Queries accept only proved exact string keys; opaque keys/value contents stay unproved. The returned MappingProxyType is a derived view, not another writable store.
  • Empty dictionary and annotation-namespace siblings share the dict type declaration but retain distinct behavior. Existing annotations are not treated as a fresh empty map. Scoped search: three explicit NativeTypeDeclaration(dict) spellings plus the generic typed(dict) construction become one parent declaration; both builder paths are migrated.
  • Keyword calls and constant-key builders consume the production's owned tuple/name query. Their repeated own-class probes are deleted; duplicate keyword/arity/provenance validation remains. No aliases, format migration or parallel codec.

Before-source extension of the retained map:23modules/568original ClassDefs/561canonical/7OPEN/15,613events/zero parse omissions. After:23modules/576original classes/7OPEN;19 unchanged source hashes verified and4 changed modules compiled/reprojected through NRA. Files nra-default-slots-before.json and nra-default-slots-after.json retain original declarations, inheritance, executable owners, imports, writes, decisions/calls and source hashes. Dynamic bindings remain OPEN; this is a bounded source map, not a full scan or equivalence proof.

Commands (existing dependencies, PYTHONPATH set to the owned NRA checkout, Python -B):

timeout -s INT 90 $PYTHON $WT/.default-slots-map-once.py nra-default-slots-before.json
timeout -s INT 45 $PYTHON $WT/.default-slots-observe-once.py
timeout -s INT 90 $PYTHON $WT/.default-slots-final-once.py

$WT is /home/ts/wt/pi-toad-errors--7425ce3d67d94062967e2f4208730b62--nominalrefactoradvisor; $PYTHON was current runtime core-6e3a2a3a1-lock-b7cd09e875fefab3/bin/python. All three query sources are removed before publication; retained compiler tests carry their cases, not another executable proof authority.

Actual outputs, independently read, all rc0:

  • nra-default-slots-map.{log,rc}: original23-module map above.
  • nra-default-slots-observed-1.{log,rc}: four headers/ten bindings, original storage inventory, folded projections, separate callback productions, missing-field refusal. Callback contents still refuse; no analyzed body ran.
  • nra-default-slots-final.{log,rc}: four changed modules compile; four folded/keyword literal slots preserve their original storage/index or key association; dictionary overwrites select the original last operand while preserving key order; opaque keys and unknown value contents refuse; derived map is read-only; annotation storage is not guessed empty;11 current stdlib default associations retain object identity.

The regression family now has six compiler-default cases plus two named-map cases, written but unrun here. Existing native-default hostile/current-storage, sequence, empty-map, keyword-call and source-default effect cases remain necessary integration coverage. CPython3.11 and its constant-key-map lowering are not execution-qualified here. No pytest/full suite/local gate, analyzed subject, native agent/model/frontend/application/new Comms root or Core move was launched.

The folded tuple did not execute two instructions. Giving its elements fake instruction numbers would be an accounting department for imaginary work.

Stage 3 — historical creation/store/cut join, not default-value correspondence

The retained original graph was queryable, but SourceCreatedFunctionCapture.require_native_installation returned the compiler installation after source availability/name checks without joining the original operand store. SourceFunctionCreationABC separately repeated the creation-offset decision already owned by NativeCaptureSite. The decorated-function path had its own binding/frame identity check.

Now:

  • NativeValueStore.require_original_installation(binding, frame) owns original binding/frame identity. Plain function installation and decorated application topology both consume it. The decorated path's copied decision is deleted; its required answers are unchanged.
  • SourceCreatedFunctionCapture.require_native_installation requires that original store and validates its stored function operand through the existing creation owner at the admitted source cut.
  • SourceFunctionCreationABC.require_native_function_operand consumes NativeCaptureSite.require_definition_operand; its repeated offset check is deleted. No second function classifier, registry, execution owner or metadata codec is added.

Increment:3files+43/-18, no added nominal type. Whole PR:6files+439/-59. IMPL-5 fact: the original function creation/site and store identity, formerly repeated at source_execution.py:531 and :961; derive by the existing native creation and store declarations, not by another caller-side comparison (paper1 Theorems4.6/4.7). The current code's exact lines are in the retained source map.

The23-module retained map was current before editing. Reprojection adds the existing source-installation test module:24modules/576original classes/7OPEN/zero parse omissions;21 unchanged retained hashes verified. nra-default-cut-after.json carries every original class and current canonical projection, and complete imports/declarations/writes/decisions/checks/calls for the two changed production modules. Other event rows remain in the retained23-module map, explicitly not silently omitted. The scope is bounded, not a full repository scan or dynamic proof.

Actual source query, final shared-owner version, completed rc0 in nra-default-cut-corrected.{log,rc}:

  • Four original source creation cuts: no defaults, folded repeated positional defaults, keyword-only defaults, mixed positional-only/positional/keyword-only parameters. Each joins the actual original native binding/frame; metadata slots remain in that same store inventory.
  • All four copied cuts refuse.
  • Two substituted store bindings (an equal observation and a binding carrying another function's production) refuse at the new store-owned check; the untouched original remains usable afterward.
  • Three changed files compile. No analyzed subject executes, no physical file is created for the subject, zero movement admissions.

The first combined map query failed rc1 before collecting those cases because it omitted SourceModule.from_source_path's required source argument; nra-default-cut-final.{log,rc} is retained as failed, not evidence of a completed query. An earlier exploratory foreign-operand mutation stopped at the older source-owner lookup, not the added guard; nra-default-cut-source-1 does not count as proof of the new rejection. The corrected store-binding query reached the intended check (nra-default-cut-source-2, rc0) before factoring the shared owner; final evidence above covers the factored implementation.

Commands used the existing current runtime Python, PYTHONPATH selecting the owned NRA checkout, under90s INT bound. The two completed one-shot sources are removed before publication. No pytest/full suite/local NRA gate, subject execution, new Comms root, agent/provider/frontend/application launch or Core move. The source-installation family gains three default-header cases and one substitution regression, written but unrun, alongside the earlier eight unrun compiler/map cases. The integration owner still owes source installation/call binding/definition-application/storage cases, the native-default/compiler/sequence/empty-map/keyword-call selection and supported3.11 qualification.

This does not replace _UnboundEntryParameter: its source-default recapture still lacks actual stored-value correspondence. Historical installation is not continued default storage, and neither is contextual transport.

The store used to show an installation receipt without checking whose luggage it contained. It now checks the binding and frame; the relocation paperwork is still missing.

Stage 4 — source/default-slot correspondence and removal of hidden case switches

Checkpoint bdd0e2198aa4529a5c1f48a18b2e5b10c8d6c1ca, still an unfinished transport overhaul.

Review correction and ownership

Carry52542 reviewed immutable60f and correctly sent back its native case decisions. The source offset copy had gone, but delegation still reached NativeCaptureSite.require_definition_operand and NativeDefinitionApplication.require_definition_operand own-family isinstance tests. A curtain is not a garbage collector.

IMPL-3/BOUND-1: fact=function/application/builder membership of an already-owned native production, at60f native_compilation.py:2138,2161,2221,2240,2254,2459,3531; derive by base-method/subclass behavior on NativeProducedValue, NativeFunctionValue, NativeCallValue, NativeClassBuilderValue. Paper1 §1, Theorems4.6/4.7. Current native_compilation.py:616,715,830,1245 carry the owner methods. The site delegates now reach those owners, not another classifier. The old class-construction helper and application cast are deleted. The store still owns original binding/frame identity and iteration lifetime; calls own argument/provenance/order checks. The traversal stays iterative, not newly recursion-limited.

The related source tuple/list/function dispatch was the same defect at60f source_execution.py:2078,2095,2114. CapturedReferenceResolution now declares refusal defaults; SourceTupleCapture, SourceLiteralCapture and existing SourceFunctionCreationABC own the actual answers. Consumers call those contracts. No visitor roster, kind string, schema mirror or weakened binding guard.

Default correspondence owners

  • DefaultedParameterSource owns original AST/default membership and shared actual-parameter-name selection. Its positional and keyword children own their corresponding native storage queries; the original syntax decoder constructs those roles. No downstream parameter-kind switch is added. The old test that fabricated an impossible source projection by patching our factory is deleted; the declaration test uses the existing ParameterDefaultQuestion instead of its own type probe.
  • NativeOperandValueABC composes the original operand question with literal-contents capability. Produced values resolve through the existing source/native join; NativeConstantTupleElement resolves as its actual (storage,index) projection. It does not acquire an instruction offset or produced-value membership. NativePositionalDefaultOperand rejects a projection of another slot even when contents compare equal.
  • SourceFunctionDefault authenticates original header nodes/read context, source creation/store/cut and slot storage through the existing execution and native owners. Produced operands reuse SourceNativeExpressionABC.require_join; folded projections require the exact selected slot before comparing source/native constant contents.
  • This is not a replacement for SourceFunctionActivation.initial_entries / _UnboundEntryParameter. The existing float default entry remains available, its lifetime proof remains refused, and the stronger new join refuses its unproved original tuple elements. No existing entry domain is narrowed to make this checkpoint pass. No target-runtime object/current-storage/alias or contextual relocation certificate is inferred.

Applied source evidence

nra-source-default-before.json retained29modules/594classes/7OPEN/20,006events/no omissions before editing. The immutable60f native-chain test expands the before map to30modules without adding a class. The new source-default test is after-only. nra-source-default-before-expanded.json / nra-source-default-after.json retain all original declarations, bases, imports, writes, decisions, checks and calls through NRA's ModuleSyntaxIndex and class projection. After:31modules/599classes/7OPEN/no omissions;24 unchanged retained hashes,7 changed files compile. Four new production types and one test question account for the five classes. This is a bounded source map, not a complete repository/dynamic/equivalence proof.

nra-source-default-after.{log,rc} completed0 and records all ten selected production probes and their old executable owners; selected type-probe count10→0 across the complete two production modules. Other families/dynamic ambiguity are not reclassified as zero debt. Whole-tree production/tests/tools search found no direct DefaultedParameterSource construction left beyond declarations and its concrete syntax-decoder members, and no deleted _require_construction_value caller.

Actual source-only queries, not pytest or transport acceptance

nra-source-default-owned-family.{log,rc} completed0 using existing dependencies with PYTHONPATH=.:tests, python -B, INT bound90s:

  • Six original slots across repeated positional0, keyword-onlyNone, positional-only/mixed signatures and a folded literal tuple. Original metadata storage remains in the actual store inventory.
  • Six copied source cuts refuse; an equal-content wrong positional slot and matching foreign source syntax refuse at their intended owners.
  • Twelve class/function compiler chains (zero/one/three decorators, module/nested class contexts), including original function/application membership refusals.
  • Existing float parameter entry retained; independent existing lifetime refusal retained; stronger float join explicitly OPEN. Four source-capture MRO method owners checked. Five files compile in that query; final map compiles all seven changed files.
  • No analyzed subject body/file, agent, provider, frontend, application or new Comms root was executed/created. Zero movement admissions.

Failed attempts remain: nra-source-default-join-1 failed before cases because the current runtime lacks pytest required by an imported fixture helper; no dependency was installed. The corrected existing-dependency query join-2 reached the source/chain cases but failed its mistaken full-float-lifetime expectation. nra-source-default-final printed the six/twelve results, then failed its mistaken expectation that float refusal would happen at constant comparison rather than the earlier native tuple-element owner. Neither is a final pass. The final owned-family log above covers the corrected current implementation.

Commands: PYTHONPATH=.:tests timeout -s INT 90 /home/ts/.cache/agent-scratch/pi-commander/interruptions/test-env/bin/python -B .source-default-owned-family-once.py; PYTHONPATH=. timeout -s INT 90 $CURRENT_RUNTIME/bin/python -B .source-default-after-once.py. Completed one-shot sources are removed before documentation publication. Their regression cases remain in the existing test family, not another tool authority.

Eleven additional regression cases (nine source-slot cases and two native-membership cases) are written, unrun, alongside the earlier twelve. The snapshot test keeps actual pickle/graph assertions but deletes its own-code compiler monkeypatch; it no longer claims a measured no-recompile result. Integration still owes parameter declarations, native definition chains, source default/install/call-binding/activation/storage/definition-application and native-default/compiler/sequence/empty-map/keyword-call coverage, including supported3.11. No local pytest/full suite/NRA gate.

Stage 5 — compact tuple production answers its own role

Checkpoint 526e90b8de94e52971a6ee4c8b6d33a1b60d17cb, same161; no new class, alias, registry or runtime/default law.

Carry52622 reviewed immutablebdd and cleared the previous seven native plus three source dispatch repairs, including the stricter original binding/frame guard and exact source/slot membership. That review is not transport/movement or test approval. Its remaining tuple probes at source_execution.py:1616–1617 are repaired here.

IMPL-3/BOUND-1: fact=the already-owned compact use/value's tuple-production role; at bdd SourceTupleCapture.production; derive by base-method/subclass answers from ValueExpressionShapeABC, CompactValueUse and CompactTupleValue (Paper1 §1, Theorems4.6/4.7). The base refuses; an evaluated use derives the answer from its actual value; the tuple value returns itself. SourceTupleCapture consumes that contract. The tuple no longer gets frisked twice for being a tuple.

Original occurrence authentication still runs before the query. Conditional/repeated creation, native tuple/unpacking, input-count, exact original element-node, dominance and order checks remain unchanged afterward. The query alone establishes no source occurrence, closure, runtime tuple identity or default transport.

Before/after maps use NRA's existing AST/class owners: nra-tuple-role-before.json and nra-tuple-role-after.json, baselinebdd. All31 retained hashes verified before extending with product_flow.py and the existing tuple test. Both maps:33modules/706classes/7OPEN/no omissions. After-map0: two selected tuple-role probes→0, four changed files compile,29 unchanged hashes verified; complete declarations/bases/imports/writes/decisions/checks/calls retained. This remains bounded source evidence, not a full scan or dynamic proof.

Actual corrected source-only query0: nra-tuple-role-source-corrected.{log,rc}. Four tuple forms (ordered, repeated elements, nested, and the existing walrus fixture with its saved reference) retain original productions. Two non-tuple use/payload cases refuse. Nine original/input/unpacking/unknown-value refusals, copied-AST refusal and the exact pending-alias-cycle refusal remain. No analyzed body, provider/native/frontend/application/new-root launch or movement; no pytest/gate.

The initial nra-tuple-role-source query failed1 at the pre-existing independent-retained-reference/lifetime guard: its walrus source omitted the saved reference present in the admitted existing fixture. It is retained as a failure, not counted as a pass. The corrected query uses that original fixture and does not weaken the guard. Stronger transient tuple-input retention remains unfinished with this author; this role fix does not certify it.

Two new parameterized refusal cases are authored unrun;25 added regression cases now remain unrun overall, and the existing tuple family still belongs in the integration selection. Completed one-shot query/map sources are retired after receipts/hash/borrower checks. Commands used existing dependencies, owned PYTHONPATH, Python -B,90s INT bounds.

Independent ongoing source trace (not implementation/admission): source movement's SourceDocumentCorrespondence transports origins only, and generated/moved text does not inherit creation admission. NativeCreationBackend.code_contents retains internal constant alias relations but explicitly not identity with an external reference. CPython's original default-field transfer sites are now retained from v3.11.11 Python/ceval.c:5391–5416 and v3.14.0 Python/bytecodes.c:4956–4980. Those source copies support the unfinished investigation at the existing CPythonFunctionConstruction / source execution owners; no new ABI law, storage/alias/evaluation certificate or literal passport is claimed from reading them.

Stage 6 — conditional native birth-default storage, not later storage or movement

Exact head e988ea58a184d352c0fd6e8f5ffdbe82f327aefb, following6cf5a21e on the same161. No new class, table, registry, cached target value, alias or entry flag. Increment3files+83/-6; whole14files+970/-208.

Owner and consumer structure

Before: CPythonFunctionConstruction owned only fresh custom-namespace semantics; SourceFunctionDefault could join original AST/read/native metadata slots but had no explicit birth-storage contract. NativePythonCompilation and SourceFunctionCreationABC separately authenticated an original function and its creation record.

After:

  • NativeCreationBackend refuses unsupported birth-default storage. Existing CPythonFunctionConstruction supplies the supported native transfer law, sharing its actual-interpreter/compiler precondition with fresh-namespace semantics.
  • NativePythonCompilation.require_original_function_creation authenticates the original compilation's record and returns its actual NativeCaptureSite. Fresh namespace, birth-default storage and SourceFunctionCreationABC now consume this one implementation. The source-side repeated authentication is deleted; its own frame/branch/activation checks remain.
  • SourceFunctionDefault.require_birth_storage first uses the existing exact source/default/store/binding/frame/cut/slot association, then requires its entry's explicit external-noninterference premise and the native birth law. It returns the original operand association, not an observed Python function or a later storage snapshot.
  • Existing operand/result queries remain weaker and available under their existing premises. SourceFunctionActivation.initial_entries/_UnboundEntryParameter and all movement/evaluated-default/cold/custom-loader guards are unchanged. A failed stronger question does not erase weaker information.

Native source basis and limits

New read-only upstream reads used the actual interpreter release3.14.8, not just the previously retained3.14.0 text:

  • CPython v3.14.8 Objects/funcobject.c:205–228 initializes func_defaults/func_kwdefaults toNULL, then calls the create watcher.
  • Python/ceval.c:716–722 declares _Py_FunctionAttributeOffsets using offsetof on those fields.
  • Python/bytecodes.c:4955–4981 MAKE_FUNCTION/SET_FUNCTION_ATTRIBUTE transfers the original operand pointer into that selected field, rather than copying/re-evaluating it. The new annotation-only branch is not used as a default-storage law.
  • Retained v3.11.11 Python/ceval.c:5391–5416 MAKE_FUNCTION directly transfers the popped tuple/dictionary to func_defaults/func_kwdefaults.

The watcher-before-attachment order is why noninterference is required, not a convenience to skip. Ordinary supported CPython/native-API compliance remains a named backend premise; internal source/dependency callbacks and admission remain their existing source owners' obligations. No general claim about later mutation, target objects across compilations, alias/evaluation preservation, custom loaders or a moved function follows. Supported3.11 execution remains unqualified.

Five source copies, owner/purpose/byte sizes/hashes retained in nra-birth-storage-sources.json for independent review and unfinished transport. They are untracked source evidence, not executable product or a second ABI authority. Initial dynamic-destination shell command was refused before execution; literal destinations were then used. Original failed-attempt fetches were not replayed.

Bounded source evidence, not tests

Existing NRA AST/class owners extended the retained33-module map with the three existing namespace/storage/continuation test consumers. Before/after36modules/706classes/7OPEN/no omissions. Initial after-map verified33 unchanged hashes and compiled3 changed files. A final method-body/return-contract correction shares authentication with the source consumer; targeted reproof parsed those2 files, verified unchanged declaration order/names/enclosing owners/bases, retained prior OPEN states and verified34 unchanged hashes. All36 current hashes were checked again before six completed one-shot sources were retired after exact-argument borrower checks.

Final nra-birth-storage-final-corrected.{log,rc} is0: positional and keyword-only birth associations, original site returned to all3 authentication consumers, copied-cut/foreign-compilation/unsupported-backend refusals, explicit-noninterference refusal, unchanged weaker slot queries and fresh namespace. Analyzed source bodies were not executed; no pytest, local gate, native/model/provider/frontend/application/new-root launch or movement.

Earlier source query failed1 before cases because I imported nonexistent NativeCompilation instead of the actual NativePythonCompilation. Corrected source query0 is retained separately. First targeted-map script failed1 because it wrongly assumed lexical enclosing symbols uniquely identify class declarations; final matching uses original ordered declarations with names/bases/enclosing-owner checks. Neither failed run counts as successful proof. No production suppression or fallback was added for either mistake.

Three new parameterized/negative regression cases are authored unrun, bringing added regressions to28 unrun overall. Integration must include source-default operand joins, native fresh-function namespace, source function storage/installation and return-continuation families, alongside prior compiler/default/tuple/call-binding coverage. No movement approval is requested from these controls.

Next: use the authenticated birth association in actual contextual one-function-to-one-function before/after storage/object/alias/evaluation transport. Only that separate certificate may feed selected promotion. Two storage slots now keep their receipt; the moving van still has no relocation permit.

Stage 7 — portable compiler-alias records, not target-object transport

Checkpoint fe454b9d8dbcaf82acf82f837f9df5c70824ff1c. Increment from e988:3files+277/-34, including117 lines of authored alias regressions. Whole15files+1246/-241. Seven new declarations retain an observed relation and its explicit unobserved alternative; no target objects, runtime default state, alternate codec or compatibility reader is added.

Before: NativeConstantValue kept contents; NativeConstantTupleElement kept its original storage/index. Scalar payload is lost sharing when compact stores were pickled together, even though the compiler's original positional and keyword operands shared one object. Separately, code_contents walked the same native code/tuple/frozenset structure to retain alias topology only in its fingerprint.

After:

  • NativeConstantGraph observes raw code/constants once at the existing NativeCreationInventory whole-compilation lifetime. Raw object IDs stay transient and rooted by the original code. Its nominal NativeConstantIdentity nodes preserve repeated references in a shared serialized graph; unequal nodes do not prove distinct target objects.
  • NativeConstantContext supplies the shared observation capability to code/scope observations, stacks, operand windows, store/continuation streams and the inventory. Entry, continuation, keyword-name and prologue projections consume that same graph. Per-load source spans/instruction identity remain separate.
  • NativeLiteralContentsABC supplies the unproved alias query. Observed constant values and folded projections answer through their actual graph nodes; a projection derives its node from its original storage/index. Existing original-production and source-slot authentication must run before stronger contextual use. A copied production carrying an original node still fails the store's identity check.
  • LOAD_CONST/RETURN_CONST pool reads retain their observed node. LOAD_SMALL_INT has its own declaration-owned immediate capture; a boxed disassembly argval is not promoted into pool-identity evidence. Synthetic/content-only and current-runtime default observations remain explicitly unproved, including self-comparison.
  • code_contents derives alias relations from the same graph and deletes its separate pointer traversal. Native content comparison and the broader existing entry/default domain remain unchanged. No target-object identity, cross-execution alias relation, later default mutation, evaluation transport or movement is inferred.

Compiler sharing is proved only within the original observation/shared serialization unit. Separately serialized copies are not rejoined by contents or a fabricated portable global key. A shared alias record is not a license to merge source slots or to authenticate a foreign/copy-created operand.

Source evidence and failures

Retained before-map:53modules/722classes/14OPEN/26,229events/no parse omissions; it covers matched inventory/constant/stack/window/fingerprint consumers plus graph/cache dependencies. After-map:54modules/729classes/14OPEN/26,394events,51 unchanged baseline hashes and3 compiled files. Final targeted test-function/import/member-control reproof retains all class declarations/bases, checks53 unchanged hashes and yields26,406events; no complete rescan was repeated for that correction. Artifacts: nra-constant-alias-{before,after,after-final}.json and nra-constant-alias-final.log, final-source.rc0/final-map.rc0. Coverage is bounded; the14 OPEN cases remain unscored, not cleared.

Actual source-only query:

  • Original and jointly pickled positional/keyword default operands retain their shared compiler alias and contents.
  • Different origins, equal contents from foreign compilation observations, contents-only values and actual runtime-default observations refuse a shared compiler alias. Immediate0 refuses pool identity despite matching0 contents.
  • Copied original productions and out-of-range tuple member indices refuse before and after pickle. This is not a target-object distinctness certificate.
  • Three native fingerprints equal the old owned projection on compiled, unexecuted specimens. Two code objects with equal marshal-v2 contents but different constant sharing still have different fingerprints.
  • Three changed files compile. Zero analyzed subject-body execution, input/root/provider/native/frontend/application launch, pytest/local gate or movement admissions.

Initial nra-constant-alias-source.{log,rc} failed at import: my test used nonexistent enum native_name. Correction consumes the enum's actual declared name; corrected query0 and expanded final query0 are separate retained artifacts, not a relabeling of that failure. No production fallback was added.

Commands used existing dependencies, owned PYTHONPATH=.:tests/PYTHONPATH=., Python -B, timeout -s INT 90, and backgrounded execution. Query/map one-shots are retired after process/hash checks, not retained as another executable authority. Eight new parameterized/negative cases are authored UNRUN,36 added cases overall; supported3.11 execution remains unqualified. Integration adds tests/test_native_constant_aliases.py to the existing combined compiler/default/sequence/dictionary/source-slot/installation/continuation selection.

Carry's exact-e988 review found no blocker in the earlier conditional birth-only increment under its explicit premises. It does not approve this later alias change or any transport/movement claim. Artifact: nra161-e988-birth-source-review.md in Carry's retained shared-board directory.

Two operands can now keep the same luggage tag through pickle. Neither has acquired a passport to the target runtime.

Stage 8 — an explicit held-target-code entry, not an observed target execution

Increment 5files+191/-4, including7 authored cases UNRUN;43 added cases overall remain unrun here. Before: source entry supplied namespace facts, and compiler/source joins could not identify the code that a target executes. After:

  • CompiledSourceModuleEntryPremise(SourceModuleEntryPremise) declares that its activation executes the exact supplied target_code. It owns that code's retained lifetime and cached projection. It does not claim an observed process; its caller must supply the actual target association. Ordinary/imported loaders never infer this premise. Noninterference remains an independent capability, composed by MI in the control, not implied by supplying code.
  • NativePythonCompilation.project_code checks a foreign exact CodeType once and source correspondence through the existing backend's complete code-content projection, then projects the supplied code rather than compiling a replacement operand graph. Fingerprint agreement establishes correspondence, not target identity; that link is the explicit entry contract.
  • The entry's target_store requires the original canonical source store, then selects its counterpart through the existing native store index. SourceFunctionEntry carries this same capability from its originating execution; no competing per-activation registry or target store was added.
  • SourceFunctionDefault.require_target_birth_object consumes original source/cut/slot, existing native birth storage, external noninterference and the explicit target projection. Only an observed original constant-pool value can answer; contents-only/immediate or fresh runtime-built values stay unproved. It returns the actual object held by the supplied code, conditionally at birth, not a current function/default snapshot, cross-execution transport or a promotion certificate.
  • The existing raw observed-contents question/default refusal moved from NativeConstantContentsABC into its existing shared NativeLiteralContentsABC parent: four lines deleted/replaced, no own-family type probe, literal whitelist, new wrapper/manager, ABI table or compatibility alias.

Source evidence for the pool link: retained CPython3.14.8 bytecodes.c:311–342 reads FRAME_CO_CONSTS[oparg] and pushes that object for LOAD_CONST and both specialized siblings; LOAD_SMALL_INT:344 instead selects an immediate from native small-int storage and remains unproved by the pool query. CPython3.11.11 ceval.c:1806–1812 reads the constant tuple and pushes that object. Existing birth attachment law/source and supported-backend/interference premises remain;3.11 execution is still unqualified.

Source/data query nra-target-entry-source-corrected.{log,rc} completed0: positional5000, keyword5000, folded tuple(5000,True), keywordNone; actual supplied-code pool membership/identity, ordinary entry refusal, copied source-store refusal, changed-filename refusal and copied-cut refusal. It compiles but does not execute authored target code. The fixture explicitly supplies a target-code contract, not proof that a real runtime uses that fixture. Initial query nra-target-entry-source.{log,rc} failed1 because its copied-cut error oracle expected 'original' but the preserved guard correctly said 'canonical closed source cut'; original failure retained, guard unchanged.

Import/four production compiles/C3 composition0; final five changed source/test compiles0. Before-map66modules/921classes/22OPEN/32,769events retained. After-map67modules through NRA ParsedModule/ModuleSyntaxIndex/build_source_index:5,010 declaration addresses and123,670 read/write/check/call/import/declaration events,62 unchanged retained hashes, all67 final hashes rechecked, no parse omissions. This expanded syntax event measure differs from the prior event selection; it is not a comparable growth/removal score. The original22 OPEN inheritance cases are carried forward; no new global/dynamic MRO-resolution proof is claimed. Artifacts nra-target-entry-after.json and map log/rc0. Two completed one-shot sources retired after exact-argument process and SHA checks; retained manifest nra-target-entry-retired.json.

Commands: existing installed71e Python, owned NRA PYTHONPATH, backgrounded INT-bounded60s source query/import and90s source-index reprojection. No pytest, local NRA gate/full suite, target body/native-agent/model/provider/frontend/application launch, new Comms root, live install or Core move. Zero movement admissions; the actual before/after target producer, aliases, evaluation/storage transport and promotion-only consumption remain OPEN.

Remaining done list — not waived by these checkpoints

  1. Finish the stored-value/object/alias and evaluation correspondence over the supported input domain beyond the six observed original source/slot joins. Historical/compiler/source correspondence does not establish later target storage, current runtime object identity or preservation under interference.
  2. Prove the contextual one-function-to-one-function before/after storage/association relation, preserving evaluation count, alias relationships and original object distinctions. Source-origin correspondence and equal scalar contents do not prove this.
  3. Consume only that certificate in selected ancestor promotion. Keep shared consolidation/descent hazards and cold/custom-loader refusals unchanged.
  4. Retain contextmanager as separately OPEN: wraps/partial/captured defaults/effects are not proved by this raw metadata work. Do not move Core methods/defaults by hand.
  5. The integration owner runs the necessary bounded native-default/compiler controls once after the coherent implementation; actual application follows. No promotion or Core acceptance is claimed now.

Assumed: the stronger query requires an explicitly supplied entry contract naming the exact held code the target will execute, plus the existing supported-backend/original-cut/noninterference obligations. Its fixture is not an observed runtime producer. No source/runtime identity is inferred from ordinary compiler specimens or fingerprints; no later function/default state or before/after preservation is inferred from a birth query. No stored records, cached summaries, supported domain or source bodies are rewritten to manufacture proof.

The compiler now hands over the luggage tags. That is useful; it still is not permission to move the passenger.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants