Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"comment": "Route Windows Connection Owner task, status and startup through the prepared managed-UV entry.",
"changes": [
{
"plugin": "agent-codespaces",
"type": "patch"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"comment": "Include the declared seasoned Codespaces YAML typing prerequisites in shared source validation.",
"changes": [
{
"plugin": "worktree-manager",
"type": "patch"
}
]
}
46 changes: 34 additions & 12 deletions .github/workflows/python-selection-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ on:
- libs/payload-invocation/tests/test_codespaces_owner_source.py
- libs/payload-invocation/tests/test_budget_index_source.py
- plugins/agent-codespaces/scripts/install.sh
- plugins/agent-codespaces/scripts/install.ps1
- plugins/agent-codespaces/scripts/windows-scheduled-task.ps1
- plugins/agent-codespaces/scripts/codespaces-owner.ps1
- plugins/agent-codespaces/scripts/bootstrap-uv.ps1
- plugins/agent-codespaces/scripts/bootstrap-capture.ps1
- plugins/agent-codespaces/scripts/bootstrap-capture.exe
- plugins/agent-codespaces/tests/test_managed_owner_ingress_ps1.py
- libs/payload-invocation/tests/test_codespaces_windows_owner_source.py
- plugins/agent-codespaces/scripts/codespaces-owner.sh
- plugins/agent-codespaces/scripts/bootstrap-uv.sh
- plugins/agent-codespaces/scripts/native_owned.sh
Expand Down Expand Up @@ -739,21 +747,26 @@ jobs:
uv python install --no-bin --no-registry cpython@3.13.12 cpython@3.11.18 cpython@3.10.20
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
"UV_PYTHON_INSTALL_DIR=$env:UV_PYTHON_INSTALL_DIR" >> $env:GITHUB_ENV
- name: Qualify managed Windows services, queries and both cold-reader hosts
- name: Qualify managed Windows services, owner ingress and generated units
env:
PYTEST_ADDOPTS: "-x -vv --durations=12"
run: >-
python tools/run-plugin-tests.py payload-invocation
--test-file tests/test_dispatch_construction_source.py --allow-explicit-tiers
-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)"
--test-file tests/test_codespaces_windows_owner_source.py
--test-file tests/test_service_unit_source.py
-k "test_codespaces_windows_owner_source.py or actual_unit_writer_is_accepted_by_daemon_admission or
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)"
--junit-dir qualification-evidence/dispatch-managed-services
- name: Require all forty-three service, wheel, snapshot, description, producer and stable-entrypoint controls
run: >-
python -c "import json; from pathlib import Path; import xml.etree.ElementTree as ET;
roots=[ET.parse(p) for p in Path('qualification-evidence/dispatch-managed-services').rglob('*.xml')];
all_cases=[c for root in roots for c in root.iter('testcase')];
assert len(all_cases)==81;
cases=[c for c in all_cases if 'managed_service_query_tree' not in c.attrib['name']
assert len(all_cases)==117;
dispatch=[c for c in all_cases if c.attrib['classname'].endswith('test_dispatch_construction_source')];
assert len(dispatch)==81;
cases=[c for c in dispatch if 'managed_service_query_tree' not in c.attrib['name']
and 'powershell_cold_readers' not in c.attrib['name'] and 'raw_powershell_cold_reader' not in c.attrib['name']
and 'powershell_construction' not in c.attrib['name']];
assert len(cases)==43;
Expand Down Expand Up @@ -798,19 +811,28 @@ jobs:
assert len(reports)==2 and {(r['shell'],r['entry']) for r in reports}==
{('powershell',e) for e in ('runtime-gate.ps1','bootstrap-check.ps1')};
assert all(len(r['samples_seconds'])==2 and r['network']=='disabled' for r in reports)"
- name: Qualify native generated units with platform-valid complex roots
run: >-
python tools/run-plugin-tests.py payload-invocation
--test-file tests/test_service_unit_source.py --allow-explicit-tiers
-k actual_unit_writer_is_accepted_by_daemon_admission
--junit-dir qualification-evidence/windows-unit-writers
- name: Require all three native generated-unit controls on Windows
run: >-
python -c "from pathlib import Path; import xml.etree.ElementTree as ET;
cases=[c for p in Path('qualification-evidence/windows-unit-writers').rglob('*.xml')
for c in ET.parse(p).iter('testcase')];
cases=[c for p in Path('qualification-evidence/dispatch-managed-services').rglob('*.xml')
for c in ET.parse(p).iter('testcase') if c.attrib['classname'].endswith('test_service_unit_source')];
assert len(cases)==3;
assert all(c.find(t) is None for c in cases for t in ('skipped','error','failure'))"
- name: Require all Windows owner controls and repeated offline selections
run: >-
python -c "import json; from pathlib import Path; import xml.etree.ElementTree as ET;
roots=[ET.parse(p) for p in Path('qualification-evidence/dispatch-managed-services').rglob('*.xml')];
cases=[c for root in roots for c in root.iter('testcase')
if c.attrib['classname'].endswith('test_codespaces_windows_owner_source')];
assert len(cases)==33;
assert all(c.find(t) is None for c in cases for t in ('skipped','error','failure'));
reports=[json.loads(p.attrib['value']) for root in roots for p in root.iter('property')
if p.attrib['name']=='codespaces_windows_owner_ingress'];
assert len(reports)==2 and {r['shell'] for r in reports}=={'powershell','pwsh'};
assert all(r['status']=='measured' and r['expected']==r['completed']==len(r['samples_seconds'])==4
and r['selector_calls']==4 and r['phases']==['cold','cold','warm','warm']
and all(v>0 for v in r['samples_seconds']) and r['network']=='no-downloads'
and r['tail_qualification']=='insufficient samples' for r in reports)"
- name: Require all thirteen Core cold controls, refusals and measurements
run: >-
python -c "import json; from pathlib import Path; import xml.etree.ElementTree as ET;
Expand Down
21 changes: 17 additions & 4 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,24 @@ The original 33 Dispatch POSIX reader/index/construction controls also share
runner preparation, retaining separate 18/10/5 case, no-skip and performance
verifiers. Windows launch owns the unchanged Bridge 20 and Vault 14 service
packets with independent verifiers; lifecycle retains its original 20
construction/custody/readiness controls. The owner shares preparation for its
construction/custody/readiness controls. The owner additionally runs the 33-control
`test_codespaces_windows_owner_source.py` export: both PowerShell hosts execute
the actual published owner entry with bound, offline UV against managed venvs
over two cutover cycles. Missing preparation refuses before application Python;
publisher idempotence, status/ensure routing, independent task registration,
capability/scheduling holds and legacy/current task ownership have separate
controls. Its no-skip and per-host timing-report verifiers are mandatory.
This does not qualify a real task registration, installed-host adoption,
selected-caller child migration or a latency tail.
The owner shares preparation for its
original 62 service/query/Core-cold controls and the 19 Windows PowerShell
constructor/cold controls formerly on launch. Its 81-case total and separate
43/6/13/6/13 counts, no-skip assertions and both hosts' performance reports remain
mandatory. This rebalances measured deadline
constructor/cold controls formerly on launch. Its original 81-case Dispatch
packet and separate 43/6/13/6/13 counts, no-skip assertions and both hosts'
performance reports remain mandatory. The same runner invocation also selects
the original three generated-unit controls and all 33 Codespaces controls:
117 total, with independent module counts and no-skip checks. This shares only
preparation and retains separate per-file containment and every native launch.
This rebalances measured deadline
pressure without pooling native processes or adding workers, resource limits
or job time.
The original 11 Linux Budget index-context controls are exported by
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""Run native owner ingress controls without installing Codespaces dependencies."""
from __future__ import annotations

import importlib.util
from pathlib import Path
import sys
from typing import Any, cast

_source = (
Path(__file__).resolve().parents[3]
/ "plugins/agent-codespaces/tests/test_managed_owner_ingress_ps1.py"
)
_spec = importlib.util.spec_from_file_location("_codespaces_windows_owner_source", _source)
assert _spec and _spec.loader
_module = importlib.util.module_from_spec(_spec)
sys.modules[_spec.name] = _module
_spec.loader.exec_module(_module)
_original = cast(Any, _module)
pytestmark = _original.pytestmark
windows_owner = _original.windows_owner
owner_shell = _original.owner_shell
test_windows_owner_keeps_managed_selection_streams_and_cutover = (
_original.test_windows_owner_keeps_managed_selection_streams_and_cutover
)
test_windows_owner_missing_preparation_refuses_before_application = (
_original.test_windows_owner_missing_preparation_refuses_before_application
)
test_windows_owner_publication_is_atomic_and_idempotent = (
_original.test_windows_owner_publication_is_atomic_and_idempotent
)
test_windows_owner_status_and_selected_ensure_use_the_entry = (
_original.test_windows_owner_status_and_selected_ensure_use_the_entry
)
test_owner_entry_preserves_scheduling_and_capability_holds = (
_original.test_owner_entry_preserves_scheduling_and_capability_holds
)
test_owner_task_ownership_accepts_both_owned_entry_forms = (
_original.test_owner_task_ownership_accepts_both_owned_entry_forms
)

_query_source = _source.with_name("test_connection_owner_task_idempotent.py")
_query_spec = importlib.util.spec_from_file_location("_codespaces_windows_owner_query", _query_source)
assert _query_spec and _query_spec.loader
_query_module = importlib.util.module_from_spec(_query_spec)
_query_spec.loader.exec_module(_query_module)
test_windows_owner_ensure_is_independent_of_existing_or_refused_task = cast(
Any, _query_module,
).test_windows_owner_ensure_is_independent_of_existing_or_refused_task
test_owner_config_is_known_only_for_a_boolean_enabled = cast(
Any, _query_module,
).test_owner_config_is_known_only_for_a_boolean_enabled
21 changes: 18 additions & 3 deletions plugins/agent-codespaces/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,24 @@ provisioning or falling back to PATH Python/UV. The selector retains native
caller/deadline custody, while successful exec preserves the owner PID, streams,
arguments, installation root and `Restart=on-failure` idle-exit behavior.
Unknown configuration still leaves the existing unit unchanged; explicit
disablement keeps the existing removal behavior. This does not migrate Windows
task/config ingress, ordinary legacy CLI dispatch or selected-caller on-demand
children, and does not establish installed-host adoption. This is the existing
disablement keeps the existing removal behavior.

Windows owner task publication, the install-time owner status query and selected
owner startup use `bin/codespaces-owner.ps1`. Explicit setup binds UV and publishes
the native selector/capture helpers. Ordinary invocation resolves only completed
slots and performs managed, no-download admission before application Python,
without consulting PATH Python or PATH UV. The task retains its limited,
interactive logon and headless host; preserved/disabled scheduling intent still
precedes publication and startup. Enabled scheduling can replace its recognized
legacy CLI task action with the runtime-local entry; task-only retirement
recognizes both owned action forms without stopping an owner. The installer uses
the same entry to reach the existing selected-runtime ensure API and durable
spawn owner, independently of task registration success. Argument, standard-stream,
exit-status and runtime-root behavior is retained on both PowerShell hosts.

These entries do not migrate ordinary legacy CLI dispatch, installation policy
readers or selected-caller on-demand children, and do not establish installed-host
adoption. This is the existing
exact-runtime admission stage for legacy slots, not completion of the
[project-owned launcher target](../../docs/install-contract.md#project-owned-managed-python):
declared project/environment inputs and durable PATH UV exposure remain separate
Expand Down
Binary file not shown.
Loading
Loading