Repository navigation
Resolve routes from the held launch root - #3704
Merged
Merged
Conversation
trissim
marked this pull request as ready for review
October 30, 2026 14:07
trissim
enabled auto-merge
October 30, 2026 14:07
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
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.
|
debt-src at 7bbd800, every finding: |
trissim
disabled auto-merge
October 30, 2026 14:30
trissim
force-pushed
the
work/allocation-repair--P1026
branch
from
October 30, 2026 14:31
3c8df27 to
e1f124f
Compare
trissim
force-pushed
the
work/allocation-repair--P1026
branch
from
October 30, 2026 14:51
e1f124f to
4cf2245
Compare
trissim
enabled auto-merge
October 30, 2026 15:04
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.
Summary
3 implementation commits, 8 files, +33/-45 against current main. RouteSelection construction: two implementations -> one explicit held-root factory. Dead capture/for_child entrypoints: 2 -> 0. Discarded startup return values across Core src/tests/tools: 6 -> 0 (five production entrypoints plus selected-write child fixture).
Fixes P1026; paired with OpenHCSDev/toad#1365 (P1015). Land both in one integration batch. Core alone removes imports still used by Toad main.
Startup owns the selected root
Before: LaunchRoot.startup installed its chosen root and returned None. CLI callers reconstructed the choice from ambient state.
After: both branches share install and return the exact LaunchRoot. Core CliInvocation, native_pi.main, commander.cli.main, acp.main and worker.run retain the returned object and supply its path to route resolution or wire. selected_write_owner_child follows the same contract. Existing CliInvocation explicit --root precedence remains implemented by LaunchRequest.resolve.
RouteSelection owns construction and source refusal
Before: capture(source) resolved the process default then compared against source. for_child independently constructed the same selection; its env/cwd parameters were unread.
After: RouteSelection.of(LaunchRoot) resolves the held root and captures its normalized observed root and bus identity. root_is_current(source) and require_source(source) compare against that held selection, preserving foreign-source RouteChangedError. No singleton consulted here.
Deleted: free current_root/root_is_current/child_root helpers, optional-source overload/global comparison, dead capture and for_child methods, unused Mapping import and env/cwd parameters. No compatibility aliases, second store or new classes.
Structure and review correction
LaunchRoot(LaunchSelection, LaunchRequest) stays the identity/install owner. RouteSelection stays the route/root/bus value with one explicit factory. The first head retained two unused ambient wrappers and missed native_pi/commander CLI indirect rereads. Review 45685 correctly rejected that: calling dead wrappers process boundaries was an unsupported claim, not ownership evidence. The first correction deleted them and migrated both named callers. Review correction 45764 identified the same indirect reread through bare wire() in ACP and worker. Both now pass root.path. The complete startup census also exposed tests/selected_write_owner_child.py, migrated in the same commit. All six startup call sites across src/tests/tools retain their return; no bare wire() remains in those six files.
IMPL-12: fact=route selection construction; at=old route_selection.py:38/53; derive=delete-copy; by=RouteSelection.of at route_selection.py:29. Paper1 Theorem 4.7: replicas do not remove outside supply. Paper4 section 1 distinguishes unread inputs from semantic deletion: no live consumer uses the deleted entrypoints or parameters.
Source evidence and checks
Retained NRA ModuleSyntaxIndex map at base df4e952 covers 1,507 Core src/tests/tools and Toad production modules; zero parse omissions. Dynamic bindings unresolved, not claimed proved. Map: /home/ts/.cache/agent-scratch/allocation-repair/p1026-ast-before.log.
Core src/tests/tools: zero RouteSelection.capture or RouteSelection.for_child references after correction; zero declarations in route_selection.py. Toad #1365's zero-caller state was established in commander's exact-head review; Toad remains toad-render's checkout and responsibility, not edited here.
Two literal LaunchRoot.current() expressions remain across Core src, at active_route.py:259 and config_options.py:314. This is a lexical count, NOT a claim that all indirect ambient consumers have vanished. All five production startup entrypoints and the selected-write child fixture explicitly resolve or wire startup's returned root; RouteSelection has zero ambient reads. Literal current() count alone did not establish this: the prior two indirect wire rereads were missed despite leaving the same lexical count.
Order check
git grep -c 'source: str | Path | None' -- src/agent_comms/route_selection.py: no matches, exit 1, count zero.git diff --check: clean.git diff --stat origin/main...HEAD: 8 files, 33 insertions, 45 deletions.Integration acceptance still owed
No author tests, import probes, checker runs, profiles, UI/provider runs, installs or live checkout moves, per assigned restriction. Integrator must exercise both startup branches, missing argument refusal, held root different from ambient, source normalization/symlinks and foreign refusal, CLI flag precedence/restoration, native Pi launch selection, commander CLI routing, ACP/worker explicit wire root and selected-write child fixture, then paired Toad provenance/two-app consumer journey.
Relevant existing paths: tests/test_native_owner_launcher_resolution.py, tests/test_session_setup_ordering.py, tests/test_installer_route_lifetime.py, tests/test_install_worker_holds.py. Source checks are not installed acceptance.
Assumed: