Repository navigation
fix(OMN-20873): bounded hook-process canary listing; a listing timeout is a typed canary-error - #2667
Merged
Merged
Conversation
…t is a typed canary-error - scripts/hook_process_canary.py: default_sampler reads the user's own pids without the command column, asks pgrep which are hook processes, and reads the command of only those pids, all inside one 30 s deadline - a listing timeout is a typed ListingTimeout (class canary-error, timeout seconds); the ledger row is state=CANARY-ERROR with class and timeout_s, never state=ALERT with NA counts; thresholds unchanged - tests/hooks_system/test_hook_canary_listing_omn20873.py has 8 tests; 6 failed before the change - contracts/OMN-20873.yaml binds AC1 and AC2
jonahgabriel
pushed a commit
to OmniNode-ai/onex_change_control
that referenced
this pull request
Oct 10, 2026
) * evidence(OMN-20873): author OCC companion for OmniNode-ai/omniclaude#2667 OCC companion by node_pr_lifecycle_fix_effect (OMN-13317 F1 / OMN-13990 / OMN-14285). Product PR head 664a83b72b53ce6824c76c4fd83838cde48778f2. * evidence(OMN-20873): self-bind OCC#13612 + rebind contract_sha256 --------- Co-authored-by: omnimarket-bot <bot@omninode.ai>
jonahgabriel
enabled auto-merge (squash)
October 10, 2026 23:34
Contributor
✅ Hostile Reviewer — PASSEDBlocking findings (critical/error): 0 Findings
Gate semantics (pilot phase)
Powered by omniintelligence.review_pairing.cli_review — node-based adversarial review via HandlerLlmCliSubprocess (OMN-8524) |
This was referenced Oct 12, 2026
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
Ticket OMN-20873. Before: scripts/hook_process_canary.py ran one
ps -axwwo pid=,ppid=,uid=,command=over every process of every user; on the loaded operator Mac it timed out after 30 s, so each run raised state=ALERT kinds=canary-error with every count NA (6 occurrences in the ledger). After: default_sampler reads (1)ps -x -U <uid> -o pid=,ppid=,uid=(user's own processes, no command column), (2)pgrep -U <uid> -f '/hooks/(scripts|lib)/', (3)ps -ww -p <pids> -o pid=,ppid=,uid=,command=for only the pgrep-selected pids. One 30 s deadline (the existing timeout, not raised) covers all three calls. pgrep/ps exit 1 with no match is a clean zero. measure() still re-applies the same hook regex, so counts and all thresholds (orphans>20, hook procs>150, user procs>60% of limit) are unchanged.Changes
state=CANARY-ERROR | ... | class=canary-error timeout_s=30 command=ps | detail=...with no NA count cells.Tests
uv run pytest tests -q -k hook_process_canary_bounded_listing) and AC2 (uv run pytest tests -q -k hook_process_canary_listing_timeout_typed) via dod_evidence ids dod-omn-20873-ac1 and dod-omn-20873-ac2.Lab
Lab: host omninode-pc (lab host h201), command
PATH=<planted slow ps>:$PATH python3 scripts/hook_process_canary.py --once(the stub ps sleeps 40 s), result: 30.1 s, exit 5,reading=none alarms=canary-error, ledger rowstate=CANARY-ERROR ... class=canary-error timeout_s=30 command=ps, no NA count. The operator Mac's real load cannot be reproduced on a lab host.ps -axwwo pid=,ppid=,uid=,command=took 0.10-0.14 s; new selectorsps -x -U 1000 -o pid=,ppid=,uid=0.04-0.05 s pluspgrep -U 1000 -f0.07-0.09 s (182 user processes, 20 pgrep-selected).canary hook=19 py=19 orphans=0 user=184 limit=348677 alarms=none, exit 0.pson PATH that sleeps 40 s),python3 scripts/hook_process_canary.py --once: took 30.1 s, exit 5, summaryreading=none alarms=canary-error, ledger rowSTATUS | lane=hook-process-canary | state=CANARY-ERROR | host=omninode-pc | kinds=canary-error | class=canary-error timeout_s=30 command=ps | detail=ps listing timed out after 30 seconds (class=canary-error), ALERT.json listing_timeout {command: ps, error_class: canary-error, timeout_seconds: 30}, reading null.ps -x -U <numeric uid>andpgrep -U -foption behaviour on macOS was not run (no Mac here); the choice of selectors is justified by narrowing the command-column read to the hook pids, not by a Mac measurement.Evidence-Ticket: OMN-20873
Evidence-Source: OCC#13612