Skip to content

Commit cdf4d2a

Browse files
Route Windows Codespaces owner ingress through managed UV (#14407)
* Route Windows Codespaces owner ingress through managed UV Preserve scheduling and capability holds while admitting the addressed runtime through the existing prepared native selector. Retain the selected-owner daemon spawn path and qualify the installed entry on both PowerShell hosts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refresh the changed Codespaces installer unit-source admission Retain the complete existing unit packet and coverage targets after changing the Windows owner producer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Preserve isolated owner UTF-8 and repair the retained qualification fixtures Route the remaining owner-config fixture through the installed entry, explicitly retain UTF-8 under isolation, and declare the existing seasoned YAML stubs for the touched test scope. Share owner and unit-writer runner preparation without dropping native controls or raising the six five-minute job limits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Record the manager-owned typecheck prerequisite update Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Classify the canonical Codespaces bootstrap capture launch The byte-identical native capture host retains the existing caller-contained classification used by the Bridge and Vault consumers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 35a865c commit cdf4d2a

21 files changed

Lines changed: 1131 additions & 37 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"comment": "Route Windows Connection Owner task, status and startup through the prepared managed-UV entry.",
3+
"changes": [
4+
{
5+
"plugin": "agent-codespaces",
6+
"type": "patch"
7+
}
8+
]
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"comment": "Include the declared seasoned Codespaces YAML typing prerequisites in shared source validation.",
3+
"changes": [
4+
{
5+
"plugin": "worktree-manager",
6+
"type": "patch"
7+
}
8+
]
9+
}

‎.github/workflows/python-selection-native.yml‎

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ on:
4949
- libs/payload-invocation/tests/test_codespaces_owner_source.py
5050
- libs/payload-invocation/tests/test_budget_index_source.py
5151
- plugins/agent-codespaces/scripts/install.sh
52+
- plugins/agent-codespaces/scripts/install.ps1
53+
- plugins/agent-codespaces/scripts/windows-scheduled-task.ps1
54+
- plugins/agent-codespaces/scripts/codespaces-owner.ps1
55+
- plugins/agent-codespaces/scripts/bootstrap-uv.ps1
56+
- plugins/agent-codespaces/scripts/bootstrap-capture.ps1
57+
- plugins/agent-codespaces/scripts/bootstrap-capture.exe
58+
- plugins/agent-codespaces/tests/test_managed_owner_ingress_ps1.py
59+
- libs/payload-invocation/tests/test_codespaces_windows_owner_source.py
5260
- plugins/agent-codespaces/scripts/codespaces-owner.sh
5361
- plugins/agent-codespaces/scripts/bootstrap-uv.sh
5462
- plugins/agent-codespaces/scripts/native_owned.sh
@@ -739,21 +747,26 @@ jobs:
739747
uv python install --no-bin --no-registry cpython@3.13.12 cpython@3.11.18 cpython@3.10.20
740748
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
741749
"UV_PYTHON_INSTALL_DIR=$env:UV_PYTHON_INSTALL_DIR" >> $env:GITHUB_ENV
742-
- name: Qualify managed Windows services, queries and both cold-reader hosts
750+
- name: Qualify managed Windows services, owner ingress and generated units
743751
env:
744752
PYTEST_ADDOPTS: "-x -vv --durations=12"
745753
run: >-
746754
python tools/run-plugin-tests.py payload-invocation
747755
--test-file tests/test_dispatch_construction_source.py --allow-explicit-tiers
748-
-k "managed_service_ingress or managed_service_packaged or managed_service_raw_snapshot or managed_supervisor_description or generated_description_preserves or native_coordinator_producer_to_stop or stable_entrypoint_releases or managed_service_query_tree or powershell_cold_readers or raw_powershell_cold_reader or (powershell_construction and not pwsh)"
756+
--test-file tests/test_codespaces_windows_owner_source.py
757+
--test-file tests/test_service_unit_source.py
758+
-k "test_codespaces_windows_owner_source.py or actual_unit_writer_is_accepted_by_daemon_admission or
759+
managed_service_ingress or managed_service_packaged or managed_service_raw_snapshot or managed_supervisor_description or generated_description_preserves or native_coordinator_producer_to_stop or stable_entrypoint_releases or managed_service_query_tree or powershell_cold_readers or raw_powershell_cold_reader or (powershell_construction and not pwsh)"
749760
--junit-dir qualification-evidence/dispatch-managed-services
750761
- name: Require all forty-three service, wheel, snapshot, description, producer and stable-entrypoint controls
751762
run: >-
752763
python -c "import json; from pathlib import Path; import xml.etree.ElementTree as ET;
753764
roots=[ET.parse(p) for p in Path('qualification-evidence/dispatch-managed-services').rglob('*.xml')];
754765
all_cases=[c for root in roots for c in root.iter('testcase')];
755-
assert len(all_cases)==81;
756-
cases=[c for c in all_cases if 'managed_service_query_tree' not in c.attrib['name']
766+
assert len(all_cases)==117;
767+
dispatch=[c for c in all_cases if c.attrib['classname'].endswith('test_dispatch_construction_source')];
768+
assert len(dispatch)==81;
769+
cases=[c for c in dispatch if 'managed_service_query_tree' not in c.attrib['name']
757770
and 'powershell_cold_readers' not in c.attrib['name'] and 'raw_powershell_cold_reader' not in c.attrib['name']
758771
and 'powershell_construction' not in c.attrib['name']];
759772
assert len(cases)==43;
@@ -798,19 +811,28 @@ jobs:
798811
assert len(reports)==2 and {(r['shell'],r['entry']) for r in reports}==
799812
{('powershell',e) for e in ('runtime-gate.ps1','bootstrap-check.ps1')};
800813
assert all(len(r['samples_seconds'])==2 and r['network']=='disabled' for r in reports)"
801-
- name: Qualify native generated units with platform-valid complex roots
802-
run: >-
803-
python tools/run-plugin-tests.py payload-invocation
804-
--test-file tests/test_service_unit_source.py --allow-explicit-tiers
805-
-k actual_unit_writer_is_accepted_by_daemon_admission
806-
--junit-dir qualification-evidence/windows-unit-writers
807814
- name: Require all three native generated-unit controls on Windows
808815
run: >-
809816
python -c "from pathlib import Path; import xml.etree.ElementTree as ET;
810-
cases=[c for p in Path('qualification-evidence/windows-unit-writers').rglob('*.xml')
811-
for c in ET.parse(p).iter('testcase')];
817+
cases=[c for p in Path('qualification-evidence/dispatch-managed-services').rglob('*.xml')
818+
for c in ET.parse(p).iter('testcase') if c.attrib['classname'].endswith('test_service_unit_source')];
812819
assert len(cases)==3;
813820
assert all(c.find(t) is None for c in cases for t in ('skipped','error','failure'))"
821+
- name: Require all Windows owner controls and repeated offline selections
822+
run: >-
823+
python -c "import json; from pathlib import Path; import xml.etree.ElementTree as ET;
824+
roots=[ET.parse(p) for p in Path('qualification-evidence/dispatch-managed-services').rglob('*.xml')];
825+
cases=[c for root in roots for c in root.iter('testcase')
826+
if c.attrib['classname'].endswith('test_codespaces_windows_owner_source')];
827+
assert len(cases)==33;
828+
assert all(c.find(t) is None for c in cases for t in ('skipped','error','failure'));
829+
reports=[json.loads(p.attrib['value']) for root in roots for p in root.iter('property')
830+
if p.attrib['name']=='codespaces_windows_owner_ingress'];
831+
assert len(reports)==2 and {r['shell'] for r in reports}=={'powershell','pwsh'};
832+
assert all(r['status']=='measured' and r['expected']==r['completed']==len(r['samples_seconds'])==4
833+
and r['selector_calls']==4 and r['phases']==['cold','cold','warm','warm']
834+
and all(v>0 for v in r['samples_seconds']) and r['network']=='no-downloads'
835+
and r['tail_qualification']=='insufficient samples' for r in reports)"
814836
- name: Require all thirteen Core cold controls, refusals and measurements
815837
run: >-
816838
python -c "import json; from pathlib import Path; import xml.etree.ElementTree as ET;

‎TESTING.md‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,24 @@ The original 33 Dispatch POSIX reader/index/construction controls also share
149149
runner preparation, retaining separate 18/10/5 case, no-skip and performance
150150
verifiers. Windows launch owns the unchanged Bridge 20 and Vault 14 service
151151
packets with independent verifiers; lifecycle retains its original 20
152-
construction/custody/readiness controls. The owner shares preparation for its
152+
construction/custody/readiness controls. The owner additionally runs the 33-control
153+
`test_codespaces_windows_owner_source.py` export: both PowerShell hosts execute
154+
the actual published owner entry with bound, offline UV against managed venvs
155+
over two cutover cycles. Missing preparation refuses before application Python;
156+
publisher idempotence, status/ensure routing, independent task registration,
157+
capability/scheduling holds and legacy/current task ownership have separate
158+
controls. Its no-skip and per-host timing-report verifiers are mandatory.
159+
This does not qualify a real task registration, installed-host adoption,
160+
selected-caller child migration or a latency tail.
161+
The owner shares preparation for its
153162
original 62 service/query/Core-cold controls and the 19 Windows PowerShell
154-
constructor/cold controls formerly on launch. Its 81-case total and separate
155-
43/6/13/6/13 counts, no-skip assertions and both hosts' performance reports remain
156-
mandatory. This rebalances measured deadline
163+
constructor/cold controls formerly on launch. Its original 81-case Dispatch
164+
packet and separate 43/6/13/6/13 counts, no-skip assertions and both hosts'
165+
performance reports remain mandatory. The same runner invocation also selects
166+
the original three generated-unit controls and all 33 Codespaces controls:
167+
117 total, with independent module counts and no-skip checks. This shares only
168+
preparation and retains separate per-file containment and every native launch.
169+
This rebalances measured deadline
157170
pressure without pooling native processes or adding workers, resource limits
158171
or job time.
159172
The original 11 Linux Budget index-context controls are exported by
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""Run native owner ingress controls without installing Codespaces dependencies."""
2+
from __future__ import annotations
3+
4+
import importlib.util
5+
from pathlib import Path
6+
import sys
7+
from typing import Any, cast
8+
9+
_source = (
10+
Path(__file__).resolve().parents[3]
11+
/ "plugins/agent-codespaces/tests/test_managed_owner_ingress_ps1.py"
12+
)
13+
_spec = importlib.util.spec_from_file_location("_codespaces_windows_owner_source", _source)
14+
assert _spec and _spec.loader
15+
_module = importlib.util.module_from_spec(_spec)
16+
sys.modules[_spec.name] = _module
17+
_spec.loader.exec_module(_module)
18+
_original = cast(Any, _module)
19+
pytestmark = _original.pytestmark
20+
windows_owner = _original.windows_owner
21+
owner_shell = _original.owner_shell
22+
test_windows_owner_keeps_managed_selection_streams_and_cutover = (
23+
_original.test_windows_owner_keeps_managed_selection_streams_and_cutover
24+
)
25+
test_windows_owner_missing_preparation_refuses_before_application = (
26+
_original.test_windows_owner_missing_preparation_refuses_before_application
27+
)
28+
test_windows_owner_publication_is_atomic_and_idempotent = (
29+
_original.test_windows_owner_publication_is_atomic_and_idempotent
30+
)
31+
test_windows_owner_status_and_selected_ensure_use_the_entry = (
32+
_original.test_windows_owner_status_and_selected_ensure_use_the_entry
33+
)
34+
test_owner_entry_preserves_scheduling_and_capability_holds = (
35+
_original.test_owner_entry_preserves_scheduling_and_capability_holds
36+
)
37+
test_owner_task_ownership_accepts_both_owned_entry_forms = (
38+
_original.test_owner_task_ownership_accepts_both_owned_entry_forms
39+
)
40+
41+
_query_source = _source.with_name("test_connection_owner_task_idempotent.py")
42+
_query_spec = importlib.util.spec_from_file_location("_codespaces_windows_owner_query", _query_source)
43+
assert _query_spec and _query_spec.loader
44+
_query_module = importlib.util.module_from_spec(_query_spec)
45+
_query_spec.loader.exec_module(_query_module)
46+
test_windows_owner_ensure_is_independent_of_existing_or_refused_task = cast(
47+
Any, _query_module,
48+
).test_windows_owner_ensure_is_independent_of_existing_or_refused_task
49+
test_owner_config_is_known_only_for_a_boolean_enabled = cast(
50+
Any, _query_module,
51+
).test_owner_config_is_known_only_for_a_boolean_enabled

‎plugins/agent-codespaces/README.md‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,24 @@ provisioning or falling back to PATH Python/UV. The selector retains native
6161
caller/deadline custody, while successful exec preserves the owner PID, streams,
6262
arguments, installation root and `Restart=on-failure` idle-exit behavior.
6363
Unknown configuration still leaves the existing unit unchanged; explicit
64-
disablement keeps the existing removal behavior. This does not migrate Windows
65-
task/config ingress, ordinary legacy CLI dispatch or selected-caller on-demand
66-
children, and does not establish installed-host adoption. This is the existing
64+
disablement keeps the existing removal behavior.
65+
66+
Windows owner task publication, the install-time owner status query and selected
67+
owner startup use `bin/codespaces-owner.ps1`. Explicit setup binds UV and publishes
68+
the native selector/capture helpers. Ordinary invocation resolves only completed
69+
slots and performs managed, no-download admission before application Python,
70+
without consulting PATH Python or PATH UV. The task retains its limited,
71+
interactive logon and headless host; preserved/disabled scheduling intent still
72+
precedes publication and startup. Enabled scheduling can replace its recognized
73+
legacy CLI task action with the runtime-local entry; task-only retirement
74+
recognizes both owned action forms without stopping an owner. The installer uses
75+
the same entry to reach the existing selected-runtime ensure API and durable
76+
spawn owner, independently of task registration success. Argument, standard-stream,
77+
exit-status and runtime-root behavior is retained on both PowerShell hosts.
78+
79+
These entries do not migrate ordinary legacy CLI dispatch, installation policy
80+
readers or selected-caller on-demand children, and do not establish installed-host
81+
adoption. This is the existing
6782
exact-runtime admission stage for legacy slots, not completion of the
6883
[project-owned launcher target](../../docs/install-contract.md#project-owned-managed-python):
6984
declared project/environment inputs and durable PATH UV exposure remain separate
19 KB
Binary file not shown.

0 commit comments

Comments
 (0)