Repository navigation
fix(process): validate complete saved ss users fields - #12
Merged
Merged
Conversation
Signed-off-by: stacknil <219124580+stacknil@users.noreply.github.com>
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.
Fixes #11
Problem
At the pinned base,
PROCESS_RE.finditercan admit the valid fragment of a malformed saved users list. Both member orders lose the malformed reference without an error. In a synthetic before/after comparison this can becomesocket_link_removedfor previously represented context; it does not establish a real socket closure.For example,
users:(("worker-a",pid=120,fd=3),("worker-b",pid=bad,fd=4))succeeds with only worker-a. Reversing the members has the same result. The evidence and controls are in #11.Invariant
Validate the entire supported nonempty users field before constructing any process reference. Reject the whole malformed declared list through the existing line-numbered
ValueErrorpathway.Design decision
Add a full-field guard before the existing extraction. Keep PID conversion, quoted name contents, ordering,
(pid, name)deduplication, FD omission and absent-users behavior. The exact accepted contribution changes only the parser, parser tests, CLI tests and lab README: four files, +192/-2.Failure model
The input is a saved local artifact. A matching substring does not establish structural completeness. Snapshot parsing must fail before discarded context can become a successful partial snapshot and then a misleading link disappearance. This adds no source authentication, collection atomicity, execution-instance attribution or real-world observation-completeness claim.
Rejected alternatives
Compatibility
Canonical single/multiple references, both orders, exact/FD-only duplicates, quoted spaces/commas/parentheses, decimal PID conversion and missing users remain supported. Numeric FD text, complete wrappers and full consumption intentionally tighten admission. Empty lists, malformed members, truncated fields and unsupported nonempty tails fail closed.
Thread attributes, alternate key order, quote escapes, fd-less references and extra tail metadata are outside the documented bounded grammar. Universal iproute2/native-variant compatibility is not claimed. Existing nonblank-line numbering is unchanged. Schema, identity, snapshot, diff, report and telemetry contracts and all seven original golden files remain unchanged.
Validation
input=ssstderr, and expose no traceback.Rollback considerations
There is no artifact migration: valid output bytes and consumer contracts are unchanged. Reversing the admission guard would restore silent partial acceptance, so a future rollback must retain the malformed-list witnesses when assessing that behavior.