Skip to content

Support status and risk query aliases in scanner filtering#10

Merged
rekurt merged 2 commits into
masterfrom
feat/improve-user-interface-and-stability
May 3, 2026
Merged

Support status and risk query aliases in scanner filtering#10
rekurt merged 2 commits into
masterfrom
feat/improve-user-interface-and-stability

Conversation

@rekurt

@rekurt rekurt commented May 3, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Allow users to filter tracked entries using human-friendly status aliases like new, gone, unchanged, and active as well as risk aliases risk:high and suspicious.

Description

  • Added a helper matches_status_alias to map query tokens like new, gone, unchanged, and active to EntryStatus checks.
  • Updated matches_term to recognize status aliases and to treat risk:high and suspicious as checks for non-empty suspicious reasons.
  • Extended matches_field_query to support the risk field ("risk" => value == "high" && !e.suspicious.is_empty()) and the status field ("status" => matches_status_alias(e, value)).
  • Added the filter_status_and_risk_aliases unit test to cover the new aliases and their combinations with entry data.

Testing

  • Ran the test suite with cargo test and the new filter_status_and_risk_aliases test executed and passed.
  • Existing scanner-related tests continued to pass under the same run.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +176 to +178
if matches_status_alias(e, term) {
return true;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@rekurt rekurt merged commit 0cadda8 into master May 3, 2026
3 checks passed
@rekurt rekurt deleted the feat/improve-user-interface-and-stability branch May 3, 2026 15:37
rekurt pushed a commit that referenced this pull request Jun 12, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant