Repository navigation
Conversation
Pass new_signatures for both constructed and replacement code objects in ManagedModule.prepare() and unpack 3-tuples (a, b, _) from _nested_pairs() without filtering on compatible, restoring structural 1:1 migration and ClosureReversal arming for newly constructed closures (including same-line nested lambdas). Add test_construction_time_same_line_lambdas_and_local_capture_round_trip in test_structural_transactions.py covering same-line nested lambdas created at construction time, ClosureReversal escape isolation, and follow-up local-capture edits. Agent-assisted-by: antigravity-cli / gemini-4-neon [effort=xhigh] (author) Signed-off-by: 李浩瑞 <haoruileee@gmail.com>
This was referenced Dec 4, 2026
This was referenced Dec 4, 2026
Contributor
Author
|
Antigravity (Gemini 4 Neon, xhigh), acting for @haoruilee. Superseded by #1082 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Governing Issue and delivery slice
Refs #1072
src/inferrsi/box/kernel/swap.py:ManagedModule.prepare()(L1690-1694, added in fix(box): track and migrate construction-time closures in ManagedModule #1023) to call_nested_pairs(constructed, replacement, new_signatures, new_signatures)and unpack 3-tuples(a, b, _), matching the updated_nested_pairs()signature from feat(box): support proven local captures and active branch body edits #1060 (L914-926).new_signaturesfor bothconstructedandreplacementbecausebefore is Nonemeans both code objects are compiled from the same new AST nodepath[-1], and does not filter oncompatibleso structural 1:1 migration andClosureReversalarming remain intact even for same-line nested lambdas (wherelen(old) > 1yieldscompatible=False).tests/box/conformance/test_structural_transactions.py:edit/create)test_construction_time_same_line_lambdas_and_local_capture_round_tripcovering top-level, nested-inside-same-line, and class-method same-line nested lambdas created during construction (PAIR,NESTED,CLASS_PAIRwithClosureReversalescape isolation) plus follow-up#1060local-capture edits on construction-time closures (CALLBACK), partial undo, and full uninstall._nested_pairs()'s signature or compatibility rules, changes outsideswap.pyandtest_structural_transactions.py, or Issue closure.Knowledge authorship declaration
No path protected by
docs/knowledge-model-policy.mdis changed. The declaration is filled for completeness against the current head.Changed artifacts and evidence
_nested_pairs()call signature and 3-tuple unpacking atswap.py:1690-1694without skipping same-line nested closuressrc/inferrsi/box/kernel/swap.py: passes(constructed, replacement, new_signatures, new_signatures)and unpacks(a, b, _)020708f4):120 failed, 220 passed(TypeError: _nested_pairs() missing 2 required positional arguments); after (3f8ea35b):341 passed, 0 failedon both Python 3.10.20 and 3.11.14; mutant-kill probe droppingcompatible=Falseentries failstest_construction_time_same_line_lambdas_and_local_capture_round_triptests/box/conformance/test_structural_transactions.py:test_construction_time_same_line_lambdas_and_local_capture_round_trip(edit&create)async def,@classmethodsame-line lambdas, local-capture edit, partial undo, and escapein_doubtisolationChecks and dependencies
3f8ea35b0769cf872074d2b909582f99bf8fe95a(underenv -u PYTHONPATH):ruff check src tests tools(Python 3.10.20 & 3.11.14): passed (All checks passed!).git diff origin/main..HEAD --check: passed.env -u PYTHONPATH pytest -n 4 tests/box/ tests/repository/test_architecture_anchors.py:341 passed, 0 failedon both Python 3.10.20 (8.21s) and Python 3.11.14 (7.72s) (vs120 failed, 220 passedon unmodifiedorigin/main020708f4).git grep -n '_nested_pairs'that zero other stale call sites exist; mutant-kill probe and extra construct probes (listcomp,genexpr, nestedasync def,@classmethodsame-line lambdas) passed on both Python 3.10.20 and 3.11.14.tools/check_pr_references.py,tools/check_knowledge_model_policy.py, andgit merge-tree --write-tree origin/main HEAD(020708f4): passed.git 2.43.0 < 2.45), Windows/macOS advisoryhost-compatibility,installed-package,dashboard-browser, live NPU runtime tests, and upstream GitHub Actions CI (pending on this PR).origin/main020708f4dbfc8bfee6a1bc930cd954cf5f56203b. Zero open PRs targetswap.py:1692; no public Box protocol changes.Remaining work and Issue closure