Repository navigation
fix(lifecycle): share one root verdict and process census - #89
Closed
alphastorm wants to merge 17 commits into
Closed
alphastorm wants to merge 17 commits into
alphastorm wants to merge 17 commits into
Conversation
The preceding reproduction expected subsecond distinction from ps lstart. Pin the actual collision as the declared limit; native identity collection stays unchanged.
Guard both records without discarding attributable cleanup. Recheck census success before publishing stopped, resolve retained jobs before quiescence, and block install on any occupied port. Share structural stop admission with recovery advice and reject relative executable attribution.
Two termination doubles returned success while leaving every identity in later snapshots, encoding the false-success defect. Remove ended identities from their modeled census without changing any assertion or real sleeper cleanup. Supply the newly required install-record path in the pending-start fixture.
Owner
Author
|
Superseded; closing without merging. The branch is kept. After two review rounds this change was not admitted in either. It holds three mechanisms (the process-table reader, the verdict over records and census, the stop loop), and each round found defects in a different one; the model that guards the verdict takes the process table as given, so it could not see a table that is silently incomplete. It returns as three stacked pull requests, each one mechanism with its own finite model:
Every behaviour found in the two rounds is reproduced as a failing host-free test and fixed on exactly one of the three. The launcher change that was waiting on this pull request waits on the three instead. |
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.
Invariants
objects or known absent, no pending launch or unpublished child, no counted survivor, no different-profile
install and a free port. A retained job requires a stopped run whose
tree_verified_emptyequals itstree_token; quiescence permits another installed profile only after these other conditions hold:test_every_combination_lands_in_one_row_and_every_consumer_acts_on_itandtest_extended_product_preserves_all_three_propertiesandtest_every_interruption_preserves_a_nonidle_verdict_until_custody_is_resolved.descendants and executable-census members that status counts, including survivors outside a missing job,
remembers identities within the declared timestamp resolution, and fences delayed wrappers. There are at
most two termination passes; permission errors, timeouts and still-counted identities can prevent completion.
Success or a new empty-tree proof requires the last census to be read and empty, without filtering out
already-ended identities. A still-counted identity is reported as still alive, not claimed ended.
Initial or later unreadable evidence prevents completion; available attributable processes can still be
cleaned up, but an absent run record is not invented and unreadable run bytes are not overwritten:
test_stop_ends_a_surviving_tree_member_and_the_engine_running_under_it,test_an_unrecorded_engine_that_outlives_its_server_keeps_the_root_from_idle,test_stop_never_reports_stopped_while_a_reused_pid_is_still_counted,test_stop_requires_its_last_census_to_be_read_and_empty,test_missing_windows_job_does_not_hide_census_cleanup, and the delayed-wrapper interruption case.unresolved launch, an unproved job or an occupied configured port never admits start/install; unreadable
record evidence never reads as "not installed". On both platform flags, recovery advice offers stop or
reinstall only when that action's structural admission permits the same stable evidence and launch/job
state, not as a promise that later reads, native operations or installation will succeed:
test_failed_timed_out_or_empty_ps_is_unavailable_not_an_empty_censusandtest_record_faults_block_admission_but_preserve_available_cleanup,test_advice_on_both_platforms_including_healthy_stray_status,test_advice_table_reaches_every_row_on_both_platform_flags, andtest_install_does_not_advise_stop_when_the_verdict_requires_reconciliation_or_a_retry.Scope
Head
cb71401eis pushed and mergesmainat2db275e2; six changed paths:omp_strata/lifecycle.pyomp_strata/procs.pyomp_strata/cli.pytests/unit/test_lifecycle.pytests/unit/test_lifecycle_states.pytests/unit/test_experiment_loop.pyThis is the lifecycle part of #84 and its successor: one verdict for status, start, stop, candidate-generation
checks and install; explicit pending/abandoned launch labels; delayed-wrapper fencing; surviving and restarted
engines; unpublished-child and unproved-job states; occupied-port refusal with ownership unproved; and
stop-incomplete and unreadable-record labels. Each verdict reads the process table once, not once per command:
healthy status makes additional descendant/health observations and stop obtains later verdicts.
The experiment test file contains only lifecycle fixture/seam migrations.
HoldAndRootTestsis inherited once from main intests/unit/test_host_holds.py.Red then green
2eaa217: tests-only evidence/model extension, 16,128 combinations plus direct reproductions;40 assertion failures and four unguarded-install-read errors, exit 1. The read-only preflight test passed.
0ff258a: the unsupported subsecond-identity expectation is corrected in its own commit to pin the declaredPOSIX collision limit, without changing native identity collection.
2ac1c65: guards both records, checks every later census before success, requires job proof before quiescence,cleans census survivors after a missing Windows job, blocks occupied-port installs and shares stop admission
with recovery advice.
4bd2a22: the first focused run exposed two termination doubles that returned success while leaving theirprocesses in the census; the fixtures now remove ended identities, with every assertion retained.
A minimal pending-start fixture also supplies its install-record path.
92d001c: all twelve advice rows on each platform flag, with present/missing job seams and reinstalladmission, plus the real healthy-status stray branch and the extended evidence product.
aef71fa: four lifecycle reproductions, eight assertion failures, zero errors, exit 1.The red-only idle vocabulary comes verbatim from
47da43c:scripts/requalify.py:47;the final tests import
lifecycle.IDLE_STATES. All four test function bodies are byte-identical across the fix.0185ca9: verdict/census implementation, 3,920-combination model walk, P0–P8 real-process interruption walk,process-table failure tests and explicit census-residual test.
8b75d5c: install recovery test, three assertion failures, exit 1.0717e0f: install renders the verdict's refusal rather than unconditional stop advice.56f0db8: preserves the documented port-refusal phrase as contiguous source text without changing its renderedmessage; the existing troubleshooting-source test was red in the first full suite and green after this change.
19e7e5c→999535b: two PID-reuse tests, 18 failing assertions before the fix, both green afterward;the transition walk covers 24 schedules/88 snapshots and refuses continuing replacement after the second pass.
0defcd9→0072d96: two stale-snapshot attribution tests, two failing assertions before the fix, both greenafterward; the real Windows table function is exercised with fake observation seams, including the timestamp
boundary. Both added test classes remain byte-identical across their respective fixes.
Current merged-head verification
At
cb71401ebd2a906fbad7a2229447d9191fea08e6, withmain2db275e2merged, Python 3.13.18,2026-11-14 UTC:
failures); exit 0, 502.431 seconds.
Together, 20,048 evaluated cases in two products, plus the 192-case launch/job advice table and
48-case all-row/platform/job-presence table. These are overlapping enumerated products, not disjoint
observations; both advice-table counts were also observed while running the unchanged test methods.
Identity walk: 24 schedules / 88 snapshots / 0.051 seconds.
verifications passed; release/profile/route history is byte-identical to the merged base.
main. Post-unit sleeper scans found no matches.
its checks job and all ten suites on Ubuntu. These results do not qualify native Windows behavior.
Historical author verification before the latest main merge and push
At
92d001cb84a2cc4bd80e9530f20d8dc4b301098c, Python 3.13, 2026-11-14 UTC:failures); exit 0, 492.101 seconds. Final targeted regressions: 20 tests OK.
Together, 20,048 evaluated cases in two products, plus the 192-case launch/job advice table and 48-case
all-row/platform/job-presence table. These enumerations overlap; they are not disjoint observations.
identity walk: 24 schedules / 88 snapshots / 0.031 seconds.
164 manifest verifications: every exit 0. Release/profile/route bytes remain identical to merged main.
No existing test was removed and both native termination bodies remain byte-identical to main.
cb71401ehas since been pushed.Earlier historical verification
At
0072d968d5e5841f729e0d66dc5fea57a8bebdb3, directly onmain9dda9179, Python 3.13:OK (10 skipped, four expected failures); exit 0.
releases,profilesandrouteswere byte-identical to that historical main; process scans found noremaining started stub, interruption driver or dev-environment process.
Limits
The executable census requires an absolute executable path under the runtime. Relative or unreadable executable
names never acquire ownership from the caller's working directory; recorded processes and verified current
descendants retain their separate identity/ancestry rules.
test_relative_executable_never_acquires_ownership_from_cwdpins that boundary. Individual unreadable identitiesand malformed process-table rows can be omitted; an unreadable whole table is not an empty one.
An unrecorded process outside the runtime without a live verified ancestor is outside the census, including a
base interpreter behind a venv redirector.
test_an_unrecorded_process_outside_the_runtime_is_not_counted_or_stoppedpins the outside-runtime residual.A held configured port independently blocks start/install: it does not add the listener to the census, prove it
foreign or authorize stop to signal it. The refusal names listener PIDs when the platform query succeeds and
otherwise reports the PID unavailable; the operator must end the holder or change the port.
Stop makes at most two termination passes. Derived descendants and census members come before other recorded
processes, then server and wrapper; census members retain process-table order, so a census parent can be
signalled before its child. This is not a total deepest-first guarantee.
On the ordinary POSIX
pspath, creation stamps have one-second resolution: a PID reused by the same executablewithin that second is indistinguishable. If that identity remains counted after a termination pass, stop now
reports it still alive rather than filtering it out and reporting stopped. Finer identity is tracked in
#92. The existing fallback when
psis absent uses procfskernel ticks; this change introduces no finer
psclock.Native Windows Toolhelp, job and signaling behavior has not been exercised on a host. A read-only
statusis therecommended first step before native-host qualification, not an automatically enforced first-use sequence or
evidence that qualification has occurred. The Windows census excludes later-created identities before using a
snapshot PPID, tested with synthetic snapshot, identity and clock seams by
test_a_reused_pid_created_after_the_snapshot_is_not_attributed_to_the_old_parent, including before/equal/afterthe cutoff; native API and backward-adjusted UTC clock behavior remain unexercised.
The separate inherited signaling window remains
#91: both native termination implementations check identity
and then resolve the PID for signaling, so reuse between those operations can signal a replacement.
Handle-bound Windows verification is not implemented or natively exercised; neither native termination body
was changed here.
Malformed-record coverage is top-level object/null/type/IO/encoding handling, not validation of every nested
identity structure or every timing schedule. Separate commands do not share an atomic observation. The model's
measured times are not runtime ceilings.
The healthy-status path still has a pre-existing diagnostic gap: a key file's permission or encoding error can
escape rather than becoming a structured status problem. This is outside the verdict's idle/quiescent
admission reads and is not fixed here.
No GPU, physical-host, performance or upstream engine-lifetime claim follows from these host-free tests.