feat: persist strict exec generations - #119
Merged
Merged
Conversation
myobie
force-pushed
the
agent/no-cas-strict-exec
branch
from
July 31, 2026 02:21
4205b44 to
3afefa0
Compare
myobie
marked this pull request as ready for review
July 31, 2026 02:40
myobie
force-pushed
the
agent/no-cas-strict-exec
branch
from
July 31, 2026 11:14
3a03ed0 to
d0666e8
Compare
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.
Summary
st2.exec-generation.v1JSONO_NOFOLLOW, retained-inode, content/metadata, end-path, and process-generation proofswaitpidWhy
PR #118 retained-predecessor Ding behavior proof needs a live strict generation after replacement, but its former base PR #116 mixed that narrow exec observation boundary with CAS catalog authoring and lifecycle policy. This PR extracts only the no-CAS exec writer/reader dependency onto PR #117.
No CAS, catalog lock, authoring policy, lifecycle flip, or live catalog/runtime mutation is included.
Impact
New exec spawns write strict JSON instead of a plain PID. Existing numeric records remain readable and are never rewritten during observation. Test fixtures that inspect exec PID files accept both forms so predecessor compatibility remains covered.
For owned children, the backend remembers only PIDs it spawned and successfully published.
waitpid(WNOHANG)is permitted only through that in-memory capability, allowing an owned Darwin zombie to become positive absence even whenproc_pidinfocan no longer return its start token. Restarted backends, foreign processes, malformed records, and token mismatches retain the same fail-closed observation and signal refusal at observation time.Exact retirement boundary
Generation v1 receipts authorize observation only. Exec kill still observes a generation and then separately signals its numeric process group; restart and final GC still remove the generation record by pathname. Those paths are not race-free across PID/PGID reuse or concurrent record replacement. This PR does not implement exact exec retirement and does not authorize production cutover. Issue #121 owns capability-pinned signaling, record retirement, and production cutover authority.
Verification
cargo test generation_observation_tests --lib -- --test-threads=1— 12 passed, including exact owned-zombie reap and non-child mismatch refusalcargo test --test exec_backend -- --test-threads=1— 6 passed, including restart/final cleanup and whole process-group teardowncargo test --test task_inventory_cli -- --test-threads=1— 8 passedcargo test --test nomad_survival -- --test-threads=1— 8 passedcargo test --test transport_isolation -- --test-threads=1— 2 passedcargo test --test targeted_reconcile -- --test-threads=1— 3 passedcargo test --test run -- --test-threads=1— 26 passedcargo test --workspace --all-targets -- --test-threads=1— greencargo clippy --workspace --all-targets -- -D warnings -A clippy::too_many_arguments -A clippy::type_complexity— green on Linux and macOS; the two allowances are pre-existing current-tool lints outside this diffgit diff --check— greend0666e840ac8852ca733d11611781f17a10adf98git diff --checkare green30626355901, job91142441191— success at exact restacked headd0666e840ac8852ca733d11611781f17a10adf98b778476ef13d6af52246ebdbf05d722ab6e3ce1eand binary delta SHA-25674b6385b7ce0d988d2df9980cab19abe2febce33b45e577400caf2ca10e427e5are identical before/aftergit diff --checkare green at the restacked headReview order
Review and merge the dependency stack base-to-tip: PR #117 → PR #119 → PR #118. Do not merge a child before its base. If a base merge rewrites ancestry, restack the child without semantic change and require a fresh exact-head hosted check before later merge handoff.
All required local and hosted product-code gates are green at the restacked head.