Support status and risk query aliases in scanner filtering#10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39b9f89ad4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if matches_status_alias(e, term) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Treat status aliases as exclusive filter terms
When a user enters a status alias term like new, gone, unchanged, or active, entries that do not have that status can still match via matches_plain_query because a failed matches_status_alias check falls through instead of returning false. For example, a Gone entry with process name containing active will match the active query, which breaks the intended alias semantics and returns incorrect filter results.
Useful? React with 👍 / 👎.
…t, model health Auto-reconnect (#1,#2,#3,#8): - Backoff now actually grows for unreachable hosts. The reset was tied to a 'successful' 150ms spawn, which an unreachable host passes (it blocks on TCP timeout), so the delay never increased. Growth now happens on every attempt and is reset only after a tunnel stays Alive for STABLE_THRESHOLD (30s), via refresh_health. - reconnect uses a new non-blocking restart_async() (no 150ms sleep in the render thread); failures are caught on the next tick. Manual restart() stays blocking for immediate feedback. - After MAX_RETRIES attempts without recovery a tunnel is marked permanently failed (auto_reconnect=false); drop_failed() now prunes only those, so 'save' no longer discards a tunnel that's mid-reconnect. auto_reconnect is now a meaningful flag. Listener health in the model (#4,#5): - New TunnelStatus::Unhealthy (process alive, local port not listening). Decision extracted to a pure, unit-tested decide_status(); a HEALTH_GRACE window and a scan_usable flag suppress false 'no listener' right after start and while auto-refresh is paused. cleanup() now takes the listening port set; the view no longer reaches into the scan. Cleanups: - command_string() shell-quotes args via shlex (#6). - uptime column reuses prt-core format_duration (#7). - private from_parts() constructor removes spawn duplication (#9). - cross-reference comments between PROXY_PORTS and known_ports (#10). New unit tests: decide_status, next_backoff, command_string quoting.
Motivation
new,gone,unchanged, andactiveas well as risk aliasesrisk:highandsuspicious.Description
matches_status_aliasto map query tokens likenew,gone,unchanged, andactivetoEntryStatuschecks.matches_termto recognize status aliases and to treatrisk:highandsuspiciousas checks for non-emptysuspiciousreasons.matches_field_queryto support theriskfield ("risk" => value == "high" && !e.suspicious.is_empty()) and thestatusfield ("status" => matches_status_alias(e, value)).filter_status_and_risk_aliasesunit test to cover the new aliases and their combinations with entry data.Testing
cargo testand the newfilter_status_and_risk_aliasestest executed and passed.Codex Task