Repository navigation
feat(lifecycle): share one verdict for runtime status and admission - #96
Merged
Merged
Conversation
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.
One verdict for runtime admission
Status and admission share one read-only verdict over runtime records, the accounted process census, retained launch/job custody and the configured port. This piece is not dormant: its consumers change as soon as it lands.
Qualification
Head
94fc9f1760fce482950c88d8a2d18b5b74b96492has 36 signed commits overafc2d420; eight paths, source +363/-52, tests +1,846/-18. At this head, 48 focused tests pass in 11.398s; nineteen source-injection inputs yield seventeen kills, two deliberately out-of-scope survivors and zero test errors. The whole-suite result is carried from276135ec03a869549eed7a524d98a2272a04eac1: 1,341 tests in 492.690s, ten skips and four expected failures, no unexpected failures or errors. The complete delta from that commit is confined totests/unit/test_lifecycle_states.py, +40/-19; no production file changes, and no whole-suite run at the new head is claimed. All repository checks passed at the new head, including hygiene, compatibility, documented-route/document-reader checks, profile/route and manifest validation, and the release/profile/route diff check.Consumers: the behavior change on landing
The individual reader on
mainreturns no match when either creation text or executable differs. In particular, a changed calendar rendering together with a changed executable can disappear from its result even though neither change proves that the old process exited. This piece instead consumes the table's closed comparison: only different stamps of one counter clock prove another process; every other disagreement is cannot-say. Records and tables are comparable only on the same host and in the same PID namespace and time namespace; the code does not check that precondition.Line references below are on pre-verdict
mainatafc2d420; lifecycle callers usedrunning()at1284-1291. “Not this recorded identity” is not permission to admit: another identified process under the runtime, other recorded roles, custody, records or ports can still block.start,lifecycle.py:1781-1868running()and could pass the root-process gate; launch, installation, key, port and GPU gates still applied.idle_generation,lifecycle.py:1294-1308— controller and optionally fenced start/install/keygenstatus,lifecycle.py:1978-2022ensure_healthystill run.cli.cmd_install,cli.py:100-110stop,lifecycle.py:2048,2070-2094— comparison unchangedEvery active-role cannot-say refusal says that absence or PID reuse cannot be proven, names each role and PID, and directs the operator to inspect those PIDs and reconcile custody; only a confirmed-stale run record may then be cleared by hand, at the named record path, before retrying
status. The controller keeps its closed public reasonprior_candidate_generation_unproved, and writes this detail to the existing private<root>/evidence/experiments/<time_ns>.errconvention under root/output directory fences. There is no stale-record acknowledgement/reset command or documented PID-checked clearing procedure to name, and this piece adds no override.VerdictConsumerInventorypins the four direct consumers and inventories individual-reader and census-entry references across the package and scripts by owner, count and retention reason. Reader-module star imports are rejected outright. The two permitted census entries are exactly oneprocs.table()reference inlifecycle.process_tableand oneprocess_table()reference inlifecycle.verdict; neither permits a separate admission decision. Ten negative controls cover an independent fifth decision, imported/module aliases, the retiredrunningname, a reader-module escape, a star-imported reader, and both census entry spellings. This inventory is syntactic; reflection, an edited allowlist and a differently expressed semantic duplicate are outside it. Advice andstopshare_stop_custody_refusal;stopkeeps its target selection, native termination and completion proof, and no new stop loop is introduced. One thingstopitself does differently: it raises that structural refusal before any write, so on a host that is not Windows a record with a job token is refused with the Windows-host reason before the record is rewritten, wheremainfirst rewrote it tostop_incompleteand then failed in the job lookup, or, for a verified-stopped record, refused with another message without writing.Three invariants
What evidence means
unreadable_roleslists malformed active roles. Uniqueengine: null, omitted roles andserver_tree: []retain released meanings. An inactive launcher's shape is not consulted; duplicated role keys still invalidate the entire record.live; unavailable census invents none.Records state which roles a run recorded, not which processes exist. A never-recorded process is found, if at all, by the runtime-root census. Only engine has a deliberately nullable identity producer; wrapper/server producers require an identity, launcher is omitted rather than written null, and server-tree is a list.
Writer change and launcher relevance
startcallsprocs.info(os.getpid())while holding the root publication lock and, if it gets an identity, writeslauncher.as_dict()into the launching run record before detached dispatch; otherwise the key is omitted. The identity is retained after handover. Launcher relevance is determined when reading the record: shape/comparison matters only during launching or when no positively owned process already precludes quiescence. This supports retained records without changing the handover writer or requiring a publication migration. A non-launching identified server reaches authenticated checks regardless of launcher outcome. A stopped otherwise-empty root with an uncertain retained launcher still refuses: launch evidence is not discarded to prove quiescence.Recovery advice sweep
status; authenticated status's stray advice uses the same helper.Ownership and limits
ProcessTable.observe. The verdict does not compare table identities itself or use individualmatchesas proof of absence.ps, including Linux, uses calendar stamps; procfs ticks are the fallback whenpsis absent, and native Windows uses FILETIME. Active calendar disagreement never proves reuse. #95 tracks an operator acknowledgement mechanism; none or documented PID-checked clearing procedure is added here.scripts/realhost_gates.pyremains on the old comparison, outside this piece's paths. Itsserver_treeat214-217returns an empty tree for no-match; G20'sleftoversat1532drops such recorded identities fromorphans_after_stop, andnot leftoverscontributes topass_observedat1560. Other G20 conditions still apply; no-match alone is not a passing gate. This cleanup-evidence limit is tracked in #94.tool_argvuses the current interpreter, which may be outside that boundary. No wrapper-specific exclusion is added.Finite models
Products overlap; their sizes are not distinct native situations. All new boundaries are host-free. The fake native seam calls the unchanged individual comparison with only
infosubstituted; it is not another table comparator. These models do not qualify native cleanup or termination completion.