Skip to content

Add fail-closed diagnostic task inventory - #117

Merged
myobie merged 2 commits into
mainfrom
agent/no-cas-task-inventory
Jul 31, 2026
Merged

Add fail-closed diagnostic task inventory#117
myobie merged 2 commits into
mainfrom
agent/no-cas-task-inventory

Conversation

@myobie

@myobie myobie commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add st2 tasks --json with the versioned st2.task-inventory.v1 envelope
  • join host-filtered desired PTY and exec tasks to exact or conservatively proven runtime generations
  • fail closed on declaration drift, duplicate IDs, malformed or timed-out PTY evidence, PID reuse, unreadable state, and otherwise unprovable generations
  • document the command as read-only diagnostics and automation, never reconciliation or control-plane cutover authority

Safety boundary

This branch is directly based on current main and has no PR #106 ancestry or dependency. It adds no catalog lock, publisher, incomplete-apply state, lifecycle flip, CAS protocol, or cutover procedure.

The existing exec writer remains a plain PID record. Spawn, list, kill, reap, remove, and all lifecycle behavior are unchanged. Inventory observes legacy PID state without rewriting it, verifies the live PID against its kernel start token and PID-file mtime, and reports indeterminate when that proof is unavailable. Missing PTY and exec roots remain absent.

Catalog discovery runs before and after runtime observation. Semantic drift makes the receipt incomplete; this detects observed change without claiming writer serialization or a transactional snapshot.

Verification

  • 7 task-inventory model tests
  • 4 conservative exec-generation observation tests
  • 4 PTY observation unit tests
  • 8 CLI/E2E tests, including real PTY generation replacement, catalog drift, timeout, malformed evidence, and byte-level immutability
  • existing exec backend, Nomad survival, and Linux transport-isolation suites
  • full cargo test --workspace --all-targets -- --test-threads=1
  • scoped Clippy with warnings denied
  • workspace doctests
  • invariant proof-reference gate
  • changed-source rustfmt checks and git diff --check

Hosted Nix and independent macOS verification are pending.

@myobie
myobie marked this pull request as ready for review July 31, 2026 00:17
@myobie
myobie merged commit 1cfabab into main Jul 31, 2026
1 check passed
@schickling schickling added area:doctor doctor, validate, and task inventory diagnostics · Set: manual area:exec Exec backend and process-group management · Set: manual area:pty PTY sessions and terminal integration · Set: manual type:feature New user-visible or system capability · Set: manual labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:doctor doctor, validate, and task inventory diagnostics · Set: manual area:exec Exec backend and process-group management · Set: manual area:pty PTY sessions and terminal integration · Set: manual type:feature New user-visible or system capability · Set: manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants