Skip to content

feat(tools): get_temporal_priority — 0-100 CVE urgency scorer + CLI subcommand - #186

Open
manus-use wants to merge 1 commit into
mainfrom
feat/temporal-priority
Open

feat(tools): get_temporal_priority — 0-100 CVE urgency scorer + CLI subcommand#186
manus-use wants to merge 1 commit into
mainfrom
feat/temporal-priority

Conversation

@manus-use

Copy link
Copy Markdown
Owner

Summary

Implements the get_temporal_priority tool and manus-agent temporal-priority CLI subcommand — a 0–100 CVE urgency scorer that combines six signals to answer: "given everything I know today, how urgent is this CVE?"

This was documented in the README with full usage examples but had zero implementation (no tool file, no CLI dispatch, no tests).

Signals & Scoring

Signal Weight Logic
CVSS base score 25 pts Linear: 0→0, 10→25
Current EPSS 25 pts Non-linear (√): amplifies mid-range probabilities
EPSS spike recency 15 pts Exponential decay (half-life 14d) from spike date
CISA KEV membership 20 pts Binary: in catalog = full points
Patch availability 10 pts Unpatched = +10 bonus; patched = −10 (reduces urgency)
CVE age 5 pts Exponential decay (half-life 180d) from publish date

Final score normalized to 0–100 with labels: CRITICAL (≥85), HIGH (≥70), MEDIUM (≥50), LOW (≥30), INFORMATIONAL (<30).

Usage

manus-agent temporal-priority CVE-2024-3094
manus-agent temporal-priority CVE-2024-3094 --output json | jq .score

Design Decisions

  • Zero new dependencies — uses only requests (already in deps)
  • Graceful degradation — if any data source is unavailable, remaining signals still produce a partial score
  • Retry/back-off on all HTTP calls (configurable via TEMPORAL_PRIORITY_MAX_RETRIES, TEMPORAL_PRIORITY_RETRY_DELAY)
  • NVD_API_KEY support for higher rate limits
  • Strands TOOL_SPEC interface — follows the module-based pattern used by other tools
  • Configurable weights via environment variables (TEMPORAL_PRIORITY_W_CVSS, etc.)

Test Coverage

90 new tests (100% mocked, no real HTTP):

  • TOOL_SPEC contract (4)
  • Input validation (7)
  • HTTP retry/back-off (5)
  • NVD data fetching (5)
  • CVSS extraction (5)
  • Patch reference detection (5)
  • EPSS data fetching (4)
  • Spike analysis (6)
  • KEV status checking (4)
  • Score computation (9)
  • Age calculation (6)
  • Urgency labels (5)
  • Text rendering (4)
  • Integration pipeline (3)
  • Handler (3)
  • CLI subcommand (5)
  • Safe float helper (5)
  • Edge cases (6)

Full suite: 1248 passed, 0 failures (baseline 1158 + 90 new)

Duplicate Check

Checked all 50 open PRs (#136#185) and 30 most recent merged PRs. No existing open or merged PR implements temporal-priority. Closest PRs:

Files Changed

  • src/manus_agent/tools/get_temporal_priority.py (new) — tool implementation
  • src/manus_agent/cli.py — added temporal-priority to _SUBCOMMANDS + parser/runner
  • tests/test_temporal_priority.py (new) — 90 tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant