Repository navigation
feat(procs): read the process table whole or report it unavailable - #93
Merged
Merged
Conversation
- Replace generated self-comparisons with four frozen-baseline structural tests. - Pin unreadable executable guards, empty live stamps, and the reboot collision limit. - Clarify counter clocks and the POSIX split-read limit without changing runtime logic.
- Restrict another-process evidence to different stamps in one canonical counter clock. - Bracket procfs image reads with start-time checks and validate localized ps field shapes. - Cover unlinked-image records and skip POSIX observation boundaries on Windows.
This was referenced Nov 14, 2026
- State common host/namespace provenance, repeated-tick and calendar-shape limits. - Cover clock arity, ASCII components and denied-link confirmation boundaries. - Preserve production behavior and the frozen main baseline.
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.
Accounted process-table reader
Every enumerated PID is either identified or explicitly unidentified, and the reader's own identity must be readable; otherwise the table is unavailable. The table has no production caller in this piece. Every function that exists on
mainkeeps its results and exceptions.Unchanged behaviour
The proof of unchanged behaviour for this piece is structural: every baseline line remains in order, insertions bind neither baseline names nor previously unbound globals read by baseline functions on either platform branch, and all 18 original function bodies plus
ProcInfostay identical, so exception messages are covered by identical bodies rather than by a test that compares them. A later piece that deliberately changes an older function adds the behavioural comparison it needs.The four tests are in
tests/unit/test_process_table.py, underLegacyStructureTests:test_baseline_lines_are_preserved_in_ordertest_insertions_do_not_rebind_baseline_namestest_insertions_do_not_bind_unbound_legacy_globalstest_every_original_function_body_is_byte_identicaltests/unit/frozen_procs_main.pyis an unchanged, test-only copy ofmainat2db275e2c08bbb2717504b9af2352c6f0f5a2529, never imported by the runtime package. The generated differential is removed: comparing identical bodies against the same globals added no independent evidence.One comparison
Malformed records give “cannot say”. For a valid record, an unidentified PID gives “cannot say”, and a PID that was not enumerated gives “not enumerated”. Only an identified row reaches executable comparison, where an unreadable path on either side gives “cannot say”. After those exits, the comparison is:
A process can replace its program in place while retaining its PID and creation time. Its calendar stamp can also be re-rendered after a clock or time-zone change, or be replaced by procfs text when the available source changes. Neither a different executable nor both of those text changes proves another process. A missing live stamp is likewise unrecognised and gives “cannot say”.
Windows FILETIME and procfs start ticks are counter clocks; procfs ticks count from boot. Under the same-host, PID-namespace and time-namespace precondition, two different counter stamps for one PID prove another process, including across a reboot, because the recorded process did not survive it. Equal stamps and an equal executable after a reboot cannot be distinguished from the same process; this is already a limit of the comparison on
main.ComparisonCells.test_equal_procfs_stamp_after_reboot_is_indistinguishabledocuments that behaviour without claiming to exercise a real reboot.A recognised counter stamp is canonical unsigned decimal (
0, or digits without leading zeros), bare for FILETIME and prefixed bystarttime:for procfs. Other spellings and calendar text are unordered. Executables compare without case on Windows; POSIX strips the kernel's(deleted)suffix on both sides. Surrogate escapes are lossless, U+FFFD is lossy, and a marker without a path is unreadable on POSIX.On a host whose stamps are calendar text, this comparison never proves that a PID was reused: it says “cannot say”. What a refusal offers the operator belongs to the piece that consumes this table, not this reader.
Sources, ancestry and limits
psexecutable text is used.pspath retains its separate stamp/link window.psrow is checked only for the shape of five tokens: alphabetic weekday and month, a one- or two-digit ASCII day, three two-digit ASCII clock components, and a four-digit ASCII year; date-shaped impossible values and a missing year supplied by a four-digit command token still pass. Fields that fail this token-shape check leave a readable PID unidentified. No English names or changed locale are assumed. Because calendar stamps never prove another process, such a mis-read row gives “cannot say” or, only when its stamp text and normalised executable equal the record, “the same”. A limit follows: under a locale whosepsprints these fields in another order, or with punctuation in the weekday or month, no row has the shape, the reader's own row is unidentified, and the table is unavailable; the readers onmain, which take the five tokens as they come, are unaffected._WINDOWS_CREATION_MARGIN_100NS = 10_000_000(one second). The inclusive margin covers ordinary clock granularity differences, not backward clock changes. It clears uncertain parent edges without hiding readable identities, and can also clear a genuine young edge.pspath with procfs, the stamp and parent come fromps, while the executable link is read later. Reuse of a PID between those reads by a process with the same executable path can leave the earlier stamp and parent in the row. Closing this gap needs an identity whose stamp procfs provides in the same read as the executable link; that requires a new record format and belongs to a later piece.psretains its one-second identity collision. Existing termination keeps its check-then-signal limit. Native Windows and backward clock changes are not qualified by these host-free tests.Unlinked images
The unchanged POSIX
info()onmainstarts with the command text frompsand reads the kernel link only ifos.path.exists(link)is true. The host-free unlinked-image test makes that existence check false, so the recorded executable stays the command text; the table still reads/runtime/engine (deleted)directly. It models both a full-path command and a basename, without running or unlinking a real binary./runtime/engineengineNo case says “another process”.
ProcfsExecutableTests.test_unlinked_image_comm_record_is_conservativeexercises the actual unchangedinfo()body against fake OS boundaries.Finite test domains
These domains overlap; they are not additional
unittesttest counts.psshape: fourteen rejected rows and two valid locale/spacing controlsBoth executable alphabets in the comparison partition contain U+FFFD and marker-only text. The partition retains five disjoint stamp/path combinations, but its two unordered combinations now share the “cannot say” result. The source walks retain changed calendar stamp/path cases as uncertainty controls, not evidence of reuse. POSIX-only observation classes and the POSIX parent-clock method are skipped on Windows; Windows-independent comparisons and fake Windows clock tests remain active.
Reverted mutations
Each row below names one source line and a mutation that produced a failing test.
ComparisonCellsis intest_process_observation.py; the other classes are intest_process_table.py.omp_strata/procs.pyif not valid_identity(recorded):RecordedIdentityShapeWalk.test_malformed_records_are_never_absent_reused_or_an_exceptionif pid in self.unidentified:intonot inSnapshotBoundaryTests.test_enumerated_unreadable_pid_is_not_reported_absentif live is None:is Nonetois not NoneRecordedObservationWalk.test_four_recorded_outcomes_and_self_readability_on_both_sourcesnot _readable_executable(live_exe) orComparisonCells.test_comparison_cells_partition_the_generated_domainor not _readable_executable(recorded_exe)ProcessTextTests.test_lossy_recorded_executable_never_claims_pid_reuseandComparisonCells.test_comparison_cells_partition_the_generated_domain==to!=ComparisonCells.test_equal_stamp_equal_executable_is_sameSAMEtoUNKNOWNComparisonCells.test_equal_stamp_equal_executable_is_sameandComparisonCells.test_equal_procfs_stamp_after_reboot_is_indistinguishableUNKNOWNtoOTHERComparisonCells.test_equal_stamp_changed_executable_is_unknownlive_clock is not None andComparisonCells.test_comparison_cells_partition_the_generated_domainrecorded_clock is not None andComparisonCells.test_comparison_cells_partition_the_generated_domain==to!=ComparisonCells.test_distinct_counter_stamps_prove_reuseOTHERtoUNKNOWNComparisonCells.test_distinct_counter_stamps_prove_reuseUNKNOWNtoOTHERComparisonCells.test_different_unordered_stamps_same_executable_are_unknownandComparisonCells.test_different_unordered_stamps_changed_executable_are_unknown; also the calendar replacement, mixed-source, missing-live-stamp and unlinked-image testsAdditional source mutations fail these tests in
test_process_observation.py:procs.py:585-588ProcfsSnapshotTests.test_procfs_identity_rechecks_start_stamp_after_linkprocs.py:587ProcfsSnapshotTests.test_procfs_identity_rechecks_start_stamp_after_linkprocs.py:587ProcfsSnapshotTests.test_procfs_identity_rechecks_start_stamp_after_linkprocs.py:548PsRowShapeTests.test_ps_creation_tokens_have_lstart_shapeprocs.py:526PsRowShapeTests.test_ps_creation_tokens_have_lstart_shapeprocs.py:527PsRowShapeTests.test_ps_creation_tokens_have_lstart_shapeObservationPortabilityTests.test_posix_boundaries_are_skipped_on_windowsprocs.py:528PsRowShapeTests.test_ps_creation_tokens_have_lstart_shapeprocs.py:529PsRowShapeTests.test_ps_creation_tokens_have_lstart_shapeprocs.py:585if TrueProcfsSnapshotTests.test_denied_procfs_executable_link_is_unidentified_without_confirmationThe three targeted guard mutations now fail: removing clock arity gives one assertion failure; removing clock ASCII validation gives one assertion failure; bypassing the readable-identity guard raises
AttributeErrorin the denied-link test. Each mutation was reverted in memory. The two known-limit tests also fail under mutations that reject a repeated-tick match or impose semantic day validation. Receipt:remediation-r1b-mutations.log.Added limit tests
ProcfsSnapshotTests.test_known_limit_same_tick_reuse_can_match_a_dead_recordmodels two lifetimes sharing a tick; it is a stated limitation, not a safety guarantee.ProcfsSnapshotTests.test_denied_procfs_executable_link_is_unidentified_without_confirmationsupplies readable stat values but denies the link; the PID is unidentified without raising or attempting confirmation.PsRowShapeTests.test_known_limit_date_shapes_and_digit_prefixed_commands_can_be_identifiedpins two ambiguous row shapes and eight comparison outcomes, none “another process”.PsRowShapeTests.test_ps_creation_tokens_have_lstart_shapealso rejects12:34and12:ab:56.Source checkpoint and evidence
Commit
15b459a2da96f080a0ec1f33def0895732def551is signed and immediately verified (U); this batch was not amended or pushed. Only docstrings change inomp_strata/procs.pyagainst139d62d04c6ca229d11ffd4da35fa55e5a268442: both docstring-stripped syntax trees have SHA256a6df7f61311829c8f84507b94fb42effb9db006aa4b6fef98ee144938d8e5a2band compare identically. Againstmain, the module remains 328 added lines and zero removed lines; the frozen baseline is untouched and matchesmain.Receipts:
remediation-r1b-mutations.log,remediation-r1b-source-evidence.logandremediation-r1b-signature.log.Verification
The two focused modules passed once through the limiter: 49 tests in 1.594 seconds, no failures or skips, exit zero, including all four structural tests. Public hygiene passed before the signed commit. Receipt:
remediation-r1b-focused.log.The full suite passed once through the limiter at
15b459a2da96f080a0ec1f33def0895732def551: 1,294 discovered, 1,287 run in 460.750 seconds, ten skips, four expected failures, no failures or errors, exit zero. It used Python 3.13.18 and the retained stock OMP/Strata environment for profilewin11-rtx5090-coder-iq1m-131k-strata0.1.30-omp18.4.6, with the pinned Strata commit and OMP size/hash checked before discovery. Finished at 2026-11-14T10:15:14Z; receipt:remediation-r1b-full.log.