[PR #4250] [GUI] record child absence before publishing managed host state #4974

Open
opened 2026-11-07 16:31:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4250
Author: @zapabob
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: codex/runtime-before-child-record


📝 Commits (1)

  • 743a533 [GUI] record child absence before publishing managed host state

📊 Changes

2 files changed (+88 additions, -21 deletions)

View changed files

📝 strata_control/runtime.py (+33 -21)
📝 tests/terminal/test_runtime.py (+55 -0)

📄 Description

Problem and result

The managed host publishes its state before entering the child-launch path. If it is killed whilst planning, the state can survive without any child ownership record. Recovery then correctly refuses to proceed, leaving the profile unavailable for subsequent loads.

This records an explicit private no_child phase before publishing host state. Recovery recognises only the exact record for that host token, after taking the existing state lease. The launch path still writes launching before spawning a child, so an uncertain spawn remains blocked.

Approach and safety limits

The existing owned-child, identity and private-file checks remain. Missing markers, mismatched tokens and incomplete launch records are not treated as proof that a child is absent. This prevents the publication gap for future hosts; it deliberately does not delete or fabricate ownership records for profiles already stranded by an older version.

Validation

Windows, based on upstream 4b9e05a2a806a3fe24f7b2560d98626c37dade35.

Passed:

  • uv run --no-project --with pytest --with regex --with jinja2 python -m pytest tests/terminal/test_runtime.py -k 'killed_host_before_launch or missing_marker_still or no_child_marker_failure or recovery_refuses_a_still_present_child' -q: 4 passed, 47 deselected, 27.20 seconds. The new cases kill a real host during planning, refuse a missing record, and inject a marker-write failure before state publication. The existing live-child refusal case also passes.
  • git diff --check.

Failed or corrected during preparation:

  • The first test environment lacked regex; temporary uv test dependencies were supplied without changing repository metadata.
  • The new forced-termination test initially raced Windows file-lease release. It now waits at most five seconds for the actual lease to become available; production lease checks were not weakened.
  • The existing test_a_marker_left_by_a_killed_app_is_cleaned_up_when_its_number_belongs_to_a_later_program fails with startup_wait_expired / ready_file_not_matched both with this patch and with the unchanged upstream runtime in the same environment. This is unresolved; no full-suite success is claimed.

Not run: full terminal suite, Linux/macOS execution, installed desktop integration, or GPU inference. No real user profile or service was changed.

Kept as a draft because the broader startup check and cross-platform lifecycle verification remain outstanding.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4250 **Author:** [@zapabob](https://github.com/zapabob) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/runtime-before-child-record` --- ### 📝 Commits (1) - [`743a533`](https://github.com/Niko1221/Strata/commit/743a53344c606a3d8508c8102b9330833c7764df) [GUI] record child absence before publishing managed host state ### 📊 Changes **2 files changed** (+88 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `strata_control/runtime.py` (+33 -21) 📝 `tests/terminal/test_runtime.py` (+55 -0) </details> ### 📄 Description ## Problem and result The managed host publishes its state before entering the child-launch path. If it is killed whilst planning, the state can survive without any child ownership record. Recovery then correctly refuses to proceed, leaving the profile unavailable for subsequent loads. This records an explicit private `no_child` phase before publishing host state. Recovery recognises only the exact record for that host token, after taking the existing state lease. The launch path still writes `launching` before spawning a child, so an uncertain spawn remains blocked. ## Approach and safety limits The existing owned-child, identity and private-file checks remain. Missing markers, mismatched tokens and incomplete launch records are not treated as proof that a child is absent. This prevents the publication gap for future hosts; it deliberately does not delete or fabricate ownership records for profiles already stranded by an older version. ## Validation Windows, based on upstream `4b9e05a2a806a3fe24f7b2560d98626c37dade35`. Passed: - `uv run --no-project --with pytest --with regex --with jinja2 python -m pytest tests/terminal/test_runtime.py -k 'killed_host_before_launch or missing_marker_still or no_child_marker_failure or recovery_refuses_a_still_present_child' -q`: 4 passed, 47 deselected, 27.20 seconds. The new cases kill a real host during planning, refuse a missing record, and inject a marker-write failure before state publication. The existing live-child refusal case also passes. - `git diff --check`. Failed or corrected during preparation: - The first test environment lacked `regex`; temporary uv test dependencies were supplied without changing repository metadata. - The new forced-termination test initially raced Windows file-lease release. It now waits at most five seconds for the actual lease to become available; production lease checks were not weakened. - The existing `test_a_marker_left_by_a_killed_app_is_cleaned_up_when_its_number_belongs_to_a_later_program` fails with `startup_wait_expired` / `ready_file_not_matched` both with this patch and with the unchanged upstream runtime in the same environment. This is unresolved; no full-suite success is claimed. Not run: full terminal suite, Linux/macOS execution, installed desktop integration, or GPU inference. No real user profile or service was changed. Kept as a draft because the broader startup check and cross-platform lifecycle verification remain outstanding. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4974
No description provided.