@shieldaai/security-watch 0.0.0-stage → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CONTRIBUTING.md +90 -0
  2. package/LICENSE +202 -0
  3. package/README.md +269 -2
  4. package/SECURITY.md +47 -0
  5. package/dist/assessment.d.ts +5 -0
  6. package/dist/assessment.js +398 -0
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +792 -0
  9. package/dist/config.d.ts +242 -0
  10. package/dist/config.js +298 -0
  11. package/dist/cve-now.d.ts +5 -0
  12. package/dist/cve-now.js +413 -0
  13. package/dist/delivery.d.ts +26 -0
  14. package/dist/delivery.js +394 -0
  15. package/dist/ecosystems.d.ts +25 -0
  16. package/dist/ecosystems.js +254 -0
  17. package/dist/engine.d.ts +26 -0
  18. package/dist/engine.js +307 -0
  19. package/dist/health.d.ts +17 -0
  20. package/dist/health.js +70 -0
  21. package/dist/heartbeat.d.ts +13 -0
  22. package/dist/heartbeat.js +74 -0
  23. package/dist/http.d.ts +8 -0
  24. package/dist/http.js +251 -0
  25. package/dist/index.d.ts +18 -0
  26. package/dist/index.js +15 -0
  27. package/dist/inventory.d.ts +3 -0
  28. package/dist/inventory.js +143 -0
  29. package/dist/lock.d.ts +3 -0
  30. package/dist/lock.js +112 -0
  31. package/dist/maintenance.d.ts +43 -0
  32. package/dist/maintenance.js +227 -0
  33. package/dist/models.d.ts +20 -0
  34. package/dist/models.js +602 -0
  35. package/dist/operations.d.ts +17 -0
  36. package/dist/operations.js +117 -0
  37. package/dist/providers.d.ts +209 -0
  38. package/dist/providers.js +459 -0
  39. package/dist/setup.d.ts +113 -0
  40. package/dist/setup.js +100 -0
  41. package/dist/source-error.d.ts +22 -0
  42. package/dist/source-error.js +56 -0
  43. package/dist/sources.d.ts +3 -0
  44. package/dist/sources.js +1071 -0
  45. package/dist/store.d.ts +71 -0
  46. package/dist/store.js +651 -0
  47. package/dist/types.d.ts +247 -0
  48. package/dist/types.js +1 -0
  49. package/dist/util.d.ts +6 -0
  50. package/dist/util.js +14 -0
  51. package/dist/vendor-sources.d.ts +24 -0
  52. package/dist/vendor-sources.js +56 -0
  53. package/docs/configuration.md +406 -0
  54. package/docs/quality-review.md +104 -0
  55. package/examples/advisories.json +17 -0
  56. package/examples/common-systems.yaml +243 -0
  57. package/examples/libraries.example.txt +16 -0
  58. package/examples/libraries.example.yaml +38 -0
  59. package/examples/library-watch.example.yaml +27 -0
  60. package/examples/security-watch.example.yaml +86 -0
  61. package/examples/systems.example.yaml +31 -0
  62. package/package.json +69 -4
@@ -0,0 +1,406 @@
1
+ # Configuration
2
+
3
+ Configuration is strict YAML or JSON: unknown fields and invalid values fail validation. The configuration file is limited to 1 MiB. `${VARIABLE}` substitution is supported in parsed string values; an undefined variable is an error. Credential settings contain the **name** of an environment variable, never its secret value.
4
+
5
+ Pass `--credentials-file ./watch/.env` to load credentials and configuration variables from a dotenv file. It is read as data, with no shell commands or variable expansion. Existing environment values take precedence. The file must be a regular file of at most 128 KiB; symlinks are rejected. On Unix, run `chmod 600` first. Shell, Node.js and TLS runtime settings belong in the service manager and are rejected in this file. Without this flag, the CLI uses only its environment and does not search for `.env` files.
6
+
7
+ `inventory` and `database` resolve relative to the configuration file. Inventory `lockfile` paths resolve relative to the inventory file. Configuration is read once per process; restart the worker after changing it. Inventory is loaded again on each scheduled scan. In the supplied Docker Compose setup, use `inventory: /config/systems.yaml`, `database: /data/watch.db`, and a root-level `.env` file copied from `.env.example`. Set `SECURITY_WATCH_UID`/`SECURITY_WATCH_GID` to your host user/group IDs; this preserves mode-0600 configuration/inventory access without widening host permissions. Compose initializes ownership of its `watch-data` named volume before starting the application. SQLite remains on Docker's native filesystem, while the VM must have access to the read-only configuration/inventory bind mounts. Retain the named volume when recreating containers.
8
+
9
+ ## Minimal setup
10
+
11
+ `security-watch init --directory ./watch --systems nodejs,python --yes` creates a starter configuration, private inventory and `.env.example`. It selects a 30-minute polling interval and a 40-minute news window. Add `--provider NAME --model ID` to configure analysis, or use interactive `init` to choose a provider and notification routes. `--poll-minutes` and `--lookback-minutes` set timing during setup. Run `security-watch templates` for system names and `security-watch providers` for provider IDs. Selected systems have no assumed installed version; edit the inventory before assessing deployment impact.
12
+
13
+ Add `--notifications slack` to configure Slack routes, or `--notifications email --email-from alerts@example.com --email-to security@example.com` for email. Both channels can be selected with `--notifications slack,email`; email recipients are comma-separated. Setup writes credential variable names to `.env.example` and enables the selected channels for library, product, news and monitoring-health findings. It sends nothing. Without a notification choice, routes remain disabled. `doctor` reports the routes so this is visible before starting the worker.
14
+
15
+ For an existing monitor, edit the category `channels` and `health_channels` below and add the matching destination settings. After loading the private credentials file, run `test-notification --channel slack` or `test-notification --channel email` with your `--config` and `--credentials-file` paths. This attempts one test, reports its status and failure reason, and does not write to the monitor database or retry automatically.
16
+
17
+ The following example uses the schema defaults of 15 and 60 minutes and enables Slack explicitly:
18
+
19
+ ```yaml
20
+ version: 1
21
+ inventory: ./systems.yaml
22
+ database: ./data/watch.db
23
+ poll_interval_minutes: 15
24
+ news_lookback_minutes: 60
25
+ inventory_stale_days: 7
26
+ digest_interval_hours: 24
27
+
28
+ sources:
29
+ cve_now: true
30
+ hacker_news: true
31
+ osv: false
32
+ github: false
33
+ github_token_env: GITHUB_TOKEN
34
+ kev: false
35
+ feeds: []
36
+
37
+ models:
38
+ enabled: false
39
+
40
+ policy:
41
+ library:
42
+ levels: [critical]
43
+ basis: source_severity
44
+ channels: [slack]
45
+ product:
46
+ levels: [high, critical]
47
+ basis: priority
48
+ channels: [slack]
49
+ news:
50
+ levels: [high, critical]
51
+ basis: priority
52
+ channels: [slack]
53
+ urgent_unknown: true
54
+ exploited_override: true
55
+ malware_override: true
56
+ health_channels: [slack]
57
+
58
+ notifications:
59
+ slack:
60
+ webhook_url_env: SLACK_WEBHOOK_URL
61
+ max_attempts: 3
62
+ ```
63
+
64
+ Set `SLACK_WEBHOOK_URL` through your shell, service manager or secret manager. Its value must be an HTTPS `hooks.slack.com/services/…` incoming webhook. The webhook chooses the channel; the model never chooses it. No credential value is needed in this file. See [Slack incoming webhooks](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/).
65
+
66
+ ## Scan schedule and news window
67
+
68
+ The worker's scan interval and its news discovery window are separate settings. For a scan every 30 minutes covering the last 40 minutes:
69
+
70
+ ```yaml
71
+ poll_interval_minutes: 30
72
+ news_lookback_minutes: 40
73
+ ```
74
+
75
+ Run `security-watch start --config security-watch.yaml` to keep the worker running. `scan` performs one scan and exits. Both commands use the configured news window; restart `start` after changing the configuration. Poll intervals accept 1–1,440 minutes and news windows accept 1–10,080 minutes. The defaults are 15 and 60 minutes respectively.
76
+
77
+ The 10-minute overlap in this example catches stories that arrive late in a feed. Stable evidence and finding IDs prevent the overlap from creating duplicate notifications. After downtime or a source failure, discovery reaches back to the last successful checkpoint, with up to five minutes of additional overlap. Catch-up can therefore cover more than 40 minutes. Feed history and existing collection limits still constrain what can be recovered.
78
+
79
+ The window applies to discovery of news in The Hacker News and additional RSS/Atom feeds. Previously tracked relevant stories can still be refreshed, and stored findings and evidence remain available. Older CVEs, exact package matches, withdrawals and tracked advisory updates are checked independently of this news window.
80
+
81
+ Stories without usable publication/update dates remain reviewable, with a monitoring-health warning because their age cannot be established. Repeated scans retain their stable revision unless the source content changes.
82
+
83
+ To add email, configure it and add `email` to the desired category or health channel arrays:
84
+
85
+ ```yaml
86
+ notifications:
87
+ slack:
88
+ webhook_url_env: SLACK_WEBHOOK_URL
89
+ email:
90
+ smtp_url_env: SMTP_URL
91
+ from: security-watch@example.com
92
+ to: [security@example.com]
93
+ max_attempts: 3
94
+ ```
95
+
96
+ `SMTP_URL` must name an `smtp:` or `smtps:` endpoint. STARTTLS/TLS is required, certificates are verified, and URL query options are rejected. SMTP destinations are operator-selected and may be internal. Up to 20 recipients are supported. Partial acceptance produces `unknown`, since automatically repeating the whole message could duplicate delivery to accepted recipients.
97
+
98
+ ## System inventory
99
+
100
+ ```yaml
101
+ systems:
102
+ - id: production-api
103
+ name: Production API
104
+ environment: production
105
+ owner: platform
106
+ exposure: internet
107
+ criticality: critical
108
+ updated_at: '2026-10-24T12:00:00Z'
109
+ components:
110
+ - id: parser
111
+ ecosystem: npm
112
+ name: example-parser
113
+ version: 1.2.0
114
+ lockfile: ./api/package-lock.json
115
+ products:
116
+ - name: PostgreSQL
117
+ version: '16.4'
118
+ keywords: [Postgres]
119
+ keywords: [our-runtime-name]
120
+ ```
121
+
122
+ Replace the example names and timestamp with verified deployment information. `updated_at` is required; use an ISO timestamp with a timezone. Inventory freshness comes from this value, not file modification time. `id` and `name` are required; other lists default to empty, `environment` defaults to `unknown`, and exposure/criticality default to `unknown`.
123
+
124
+ | Field | Meaning |
125
+ | ------------------------------------- | ------------------------------------------------------------------------------------------------------ |
126
+ | System `id` | Stable, unique deployment identity; keep it unchanged when upgrading a package |
127
+ | `environment`, `owner` | Inventory context; owner is metadata and does not route notifications in this alpha |
128
+ | `exposure` | `internet`, `internal` or `unknown` |
129
+ | `criticality` | `unknown`, `low`, `medium`, `high` or `critical`; business importance, separate from advisory severity |
130
+ | Component `id` | Unique within its system; keep stable across upgrades |
131
+ | Component `ecosystem` | One of the 12 supported ecosystems or a recognized alias |
132
+ | Component `name` | Registry package identity; npm scopes and Maven coordinates are significant |
133
+ | Component `version` | Optional exact installed version; omit unknown versions rather than supplying constraints |
134
+ | Product `name`, `version`, `keywords` | Product context and matching terms; not a supported vendor version/backport decision |
135
+ | System `keywords` | Explicit terms for news matching |
136
+
137
+ Lockfiles must be package-lock v2/v3 with a `packages` map. Imports include transitive, development and optional entries and skip workspace links. They read metadata only. Import IDs follow `lock:node_modules/…` paths. Imported and manual component IDs must be unique. The inventory is bounded to 2 MiB, individual lockfiles to 20 MiB, and each system to 20,000 components. Duplicate system IDs or product names within a system are rejected; YAML aliases are rejected.
138
+
139
+ Use longer explicit keywords for short product names: matching ignores terms shorter than three characters. Whole-name matching reduces substring/scope collisions but cannot disambiguate every product name. Inventory changes trigger reassessment of stored evidence. A removed finding becomes inactive; disappearance is not proof of remediation.
140
+
141
+ ### Library lists and ecosystem groups
142
+
143
+ Library matching does not require AI. Enable `sources.osv` to query the supported registry ecosystems: npm, PyPI, Packagist, Go, Maven, crates.io, RubyGems, NuGet, Hex, Pub, Hackage and SwiftURL. `security-watch ecosystems` lists these names. Aliases include `nodejs`, `python`, `php`, `java`, `rust`, `ruby`, `dotnet`, `elixir`, `dart`, `haskell` and `swift`.
144
+
145
+ A system can have a grouped `libraries` field instead of manually assigned component IDs:
146
+
147
+ ```yaml
148
+ libraries:
149
+ npm:
150
+ - express
151
+ - '@types/node'
152
+ python:
153
+ - requests
154
+ - name: urllib3
155
+ version: '2.2.3'
156
+ php:
157
+ - symfony/http-foundation
158
+ maven:
159
+ - org.apache.logging.log4j:log4j-core
160
+ ```
161
+
162
+ The versions above illustrate syntax; use your installed versions. Arrays also accept explicit prefixes, such as `libraries: [python:requests, npm:express]`. Empty lines and `#` comment lines are ignored in text lists. Entries can be `python:requests`, `python:requests==2.32.3`, `npm:express@4.21.2`, or a package name followed by one exact version separated by whitespace. `latest`, wildcards and dependency constraints are rejected. Names without versions still produce advisory candidates, with applicability unknown.
163
+
164
+ ```sh
165
+ security-watch normalize-libraries --input examples/libraries.example.txt
166
+ security-watch normalize-libraries --input php-libraries.txt --ecosystem php --output components.json
167
+ security-watch init --directory ./watch --yes --libraries examples/libraries.example.txt
168
+ ```
169
+
170
+ Normalization is local and does not install packages, call providers or overwrite an existing output file. Its output is a component array suitable for an inventory's `components` field. Setup creates one application system and enables OSV; it cannot combine `--libraries` with `--systems`. Lists are capped at 2 MiB and 20,000 entries. Generated library IDs include ecosystem, package and version; use explicit component IDs when you need the same identity across upgrades. See the [grouped example](../examples/libraries.example.yaml) and [library-only configuration](../examples/library-watch.example.yaml).
171
+
172
+ Only npm affected ranges are evaluated locally. For other ecosystems, an exact positive OSV query or an explicitly listed affected version establishes a match; unsupported ranges and empty search results do not establish exclusion. OSV receives the ecosystem, name and optional version. Use the registry's published package spelling, especially for NuGet; arbitrary casing is not a discovery guarantee. A language/runtime product name is not a library package.
173
+
174
+ ## Sources and coverage
175
+
176
+ | Setting | Default and behavior |
177
+ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
178
+ | `sources.cve_now` | `true`; collect recent CVE entries, revisit inventory-relevant tracked/news-cited IDs and query exact npm package/version pairs through cve.now's stack endpoint |
179
+ | `sources.hacker_news` | `true`; collect The Hacker News security feed and bounded article text for system news analysis |
180
+ | `sources.osv` | `false`; optional package queries across supported ecosystems, with or without versions, full advisory records and tracked-advisory refreshes |
181
+ | `sources.github` | `false`; optional reviewed and malware advisories, tracking modifications and withdrawals; local range evaluation remains npm-only |
182
+ | `sources.github_token_env` | `GITHUB_TOKEN`; optional authentication for the GitHub API |
183
+ | `sources.kev` | `false`; optional matching-CVE enrichment with CISA known-exploitation evidence; KEV alone does not invent a product finding |
184
+ | `sources.vendor_feeds` | `[]`; opt-in official Node.js, Python and PHP feeds with bounded article extraction |
185
+ | `sources.feeds` | `[]`; up to 30 selected public HTTPS RSS 2.0/Atom URLs, without URL credentials |
186
+
187
+ `hacker_news` means **The Hacker News** at `thehackernews.com`, the cybersecurity publication, not Y Combinator's Hacker News. Its feed is [The Hacker News RSS](https://feeds.feedburner.com/TheHackersNews). The bot fetches bounded article text only from allowed The Hacker News hosts, without executing scripts: at most 50 articles per scan, four concurrently, with a 2 MB HTML response cap and 16,000 characters of extracted text per article. Evidence records whether full article content, a feed excerpt or unavailable content was used. A failed or capped article fetch retains the feed excerpt and cannot support a new confident AI-only dismissal. Incomplete articles relevant to the inventory create a `hacker_news:articles` monitoring-health finding; the successful RSS collection and its checkpoint are still retained.
188
+
189
+ Set `sources.vendor_feeds: [nodejs, python, php]`, or choose those names with `init --vendor-feeds`, to enable the official Node.js vulnerability feed, Python release blog and PHP announcements. Each adapter fetches at most 20 eligible articles per scan from its fixed vendor origin, with bounded HTML parsing and 16,000-character text limits. Unsupported links or failed extraction retain an excerpt; relevant incomplete articles produce a health warning. PHP announcements are extracted by their feed anchor so unrelated releases do not become one article. Vendor release dates and later advisory-index publication dates do not prove first vulnerability disclosure.
190
+
191
+ Additional `feeds` supply titles and summaries/content present in their RSS/Atom response; their article links are not fetched. The bot does not search the web or obtain paywalled content. Choose feed URLs deliberately. Public destinations, DNS results, redirects, response sizes and request durations are checked; a failing source retains its previous checkpoint and cached evidence and produces degraded status.
192
+
193
+ Malformed individual records are skipped while valid neighboring records continue through collection and assessment. Incomplete collection keeps the previous checkpoint, including when valid records have already been saved. Authentication failures, rate limits, invalid pagination and request bounds can stop the affected source; other sources and notification delivery continue. Cancellation stops further requests.
194
+
195
+ cve.now's first recent-entry collection looks back seven days; later scans use one hour of checkpoint overlap. Collection is bounded to 200 listing pages and 5,000 advisory records per scan. Historical refreshes are limited to cached records relevant to the current inventory and CVE/GHSA IDs in relevant cached/current news, so unrelated global history does not expand the refresh set forever.
196
+
197
+ The stack endpoint is queried separately for each deduplicated exact npm package/version pair, at most 1,000 pairs per scan and four requests concurrently. Separate requests preserve matches that cve.now would deduplicate in a multi-package request. Only those pairs are sent, not a lockfile or system/deployment metadata. Limits and request failures report incomplete collection and retain the previous checkpoint. Valid cve.now records collected before a failure are still assessed, so a failed listing request does not discard successful exact-package matches. Recent-entry pagination cannot guarantee discovery of every update to an older, previously unseen CVE. Structured affected ranges and original advisory descriptions are used as evidence; generated summaries do not establish affectedness. Unsupported statuses, including supersession without verified withdrawal semantics, fail visibly instead of being treated as a resolved vulnerability. This is not exhaustive historical product coverage.
198
+
199
+ Optional GitHub collection first looks back seven days of modifications; later scans use checkpoint overlap. Optional OSV queries supply existing advisory matches for the declared library inventory. Versionless queries discover candidates but cannot establish installed-version impact. The per-scan limit is 10,000 unique ecosystem/package/version queries. GitHub-only operation is not a full historical vulnerability scan. Pagination and collection have explicit caps; reaching a cap reports an incomplete source rather than an all-clear.
200
+
201
+ For an existing installation, configuration fields set to `true` stay enabled. To switch to cve.now and The Hacker News only, add the two new fields as shown above, explicitly set `osv`, `github` and `kev` to `false`, clear any unneeded additional feeds, and restart the worker. Omitting the old fields now defaults them to `false`; omitting the new fields defaults them to `true`. To run without any network sources, explicitly disable all five source switches and keep both `feeds: []` and `vendor_feeds: []`. Existing cached evidence and history are retained.
202
+
203
+ References: [cve.now machine-readable API guide](https://cve.now/llms.txt), [The Hacker News](https://thehackernews.com/), [OSV batch queries](https://google.github.io/osv.dev/post-v1-querybatch/), [GitHub global advisory API](https://docs.github.com/en/rest/security-advisories/global-advisories), [CISA KEV data](https://github.com/cisagov/kev-data).
204
+
205
+ ## Model configuration
206
+
207
+ Models are disabled by default. To classify system news and assess impact, configure an analysis model and its credentials. Without a model, name/keyword matches remain candidates for review. Use an exact model ID supported by the provider. The model must support the structured JSON response and output limit required by this adapter.
208
+
209
+ ```yaml
210
+ models:
211
+ enabled: true
212
+ analysis:
213
+ provider: openai
214
+ model: '${ANALYSIS_MODEL}'
215
+ api_key_env: OPENAI_API_KEY
216
+ verification:
217
+ provider: anthropic
218
+ model: '${VERIFICATION_MODEL}'
219
+ api_key_env: ANTHROPIC_API_KEY
220
+ daily_request_limit: 100
221
+ daily_token_limit: 100000
222
+ max_input_chars: 12000
223
+ max_output_tokens: 1500
224
+ timeout_seconds: 45
225
+ ```
226
+
227
+ The `verification` entry is optional. It runs for every news analysis, source-critical, exploited, unknown/conflicting findings or when the first model proposes critical priority. It receives the evidence independently; disagreement leaves the result uncertain. Verification failure, exhausted budget or disagreement retains the highest validated proposed priority with an explicit unavailable/conflicting state. `scan --dry-run` disables models and does not spend model budget. Use a normal `scan` without `--notify` to test actual model behavior while persisting budget reservations and findings.
228
+
229
+ For matched system news, analysis records two distinct conclusions:
230
+
231
+ - News classification: `new_vulnerability`, `known_vulnerability_update`, `general_news` or `unknown`. A report about an existing CVE, exploitation or a patch is distinct from a newly reported vulnerability; a product announcement or a passing mention is general news.
232
+ - Claimed impact on the declared system: `affected`, `not_affected`, `unknown` or `not_applicable`, with cited evidence and an explanation. This is the model's contextual conclusion, separate from authoritative version-range `applicability`; it does not certify the system safe or establish general product-version support.
233
+
234
+ The model also records affected product names, affected versions and prerequisites from its supporting article quotes. A decisive `affected` or `not_affected` claim requires a known installed target version and source product/version evidence; missing deployment details stay uncertain. The quoted product must match the configured product name. Keywords help find candidate articles but cannot establish product identity, even when two products share a vendor.
235
+
236
+ For noncritical system news, a validated complete analysis of general news/no applicable vulnerability or no claimed system impact records the article without a vulnerability notification. Generic product findings retain this news analysis even when a cited CVE has been collected; deterministic library applicability remains separate. A new vulnerability or known-vulnerability update with claimed impact follows the configured news/product severity policy. Unknown, conflicting, disabled or unavailable analysis goes to review. Incomplete article/context evidence and stale inventory cannot support a new confident AI-only dismissal. Initial news candidates are held for analysis before notification routing; source-critical and enabled exploitation safeguards still apply.
237
+
238
+ Completed `general_news`/`not_applicable` classifications remain in history after an article leaves RSS. Changes to the article, inventory, models, prompt or input settings trigger reassessment. This retention rule applies only to general news; `affected` and `not_affected` impact claims still require fresh evidence.
239
+
240
+ | `ModelSpec` field | Meaning |
241
+ | ------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
242
+ | `provider` | One of the profiles below; use the same fields for analysis and verification |
243
+ | `model` | Required model ID available to your account, or an Azure deployment name; there is no default |
244
+ | `api_key_env` | Optional environment-variable name; defaults to the profile's key variable, never a literal API key |
245
+ | `endpoint` | Complete API request URL; required for Azure, generic compatible endpoints and local profiles |
246
+ | `output_format` | `auto` by default; choose `json_schema`, `json_object` or `prompt` when supported |
247
+ | `allow_private_endpoint` | `false` by default; permits private destinations and HTTP for the configured model request |
248
+ | `input_usd_per_million`, `output_usd_per_million` | Optional operator-supplied prices, each between 0 and 10,000 |
249
+
250
+ `auto` uses the profile's default format below. Profiles select API protocols and defaults; they do not establish that every model on a service supports those settings.
251
+
252
+ | Provider | API | Default key variable | Default format |
253
+ | ------------------- | ---------------- | ---------------------- | -------------- |
254
+ | `openai` | Responses | `OPENAI_API_KEY` | `json_schema` |
255
+ | `azure-openai` | Azure Responses | `AZURE_OPENAI_API_KEY` | `json_schema` |
256
+ | `anthropic` | Messages | `ANTHROPIC_API_KEY` | `json_schema` |
257
+ | `gemini` | GenerateContent | `GEMINI_API_KEY` | `json_schema` |
258
+ | `cohere` | Chat v2 | `COHERE_API_KEY` | `json_schema` |
259
+ | `groq` | Chat Completions | `GROQ_API_KEY` | `json_object` |
260
+ | `deepseek` | Chat Completions | `DEEPSEEK_API_KEY` | `json_object` |
261
+ | `xai` | Responses | `XAI_API_KEY` | `json_schema` |
262
+ | `mistral` | Chat Completions | `MISTRAL_API_KEY` | `json_schema` |
263
+ | `together` | Chat Completions | `TOGETHER_API_KEY` | `json_object` |
264
+ | `fireworks` | Chat Completions | `FIREWORKS_API_KEY` | `json_object` |
265
+ | `openrouter` | Chat Completions | `OPENROUTER_API_KEY` | `json_object` |
266
+ | `cerebras` | Chat Completions | `CEREBRAS_API_KEY` | `json_object` |
267
+ | `nvidia` | Chat Completions | `NVIDIA_API_KEY` | `prompt` |
268
+ | `sambanova` | Chat Completions | `SAMBANOVA_API_KEY` | `json_object` |
269
+ | `huggingface` | Chat Completions | `HF_TOKEN` | `prompt` |
270
+ | `perplexity` | Agent API | `PERPLEXITY_API_KEY` | `json_schema` |
271
+ | `openai-compatible` | Chat Completions | `OPENAI_API_KEY` | `json_schema` |
272
+ | `ollama` | Chat Completions | `OLLAMA_API_KEY` | `json_schema` |
273
+ | `lmstudio` | Chat Completions | `LM_STUDIO_API_KEY` | `json_schema` |
274
+ | `vllm` | Chat Completions | `VLLM_API_KEY` | `json_schema` |
275
+ | `litellm` | Chat Completions | `LITELLM_API_KEY` | `json_object` |
276
+
277
+ Authentication uses `Authorization: Bearer` except Azure (`api-key`), Anthropic (`x-api-key` with an API-version header) and Gemini (`x-goog-api-key`). `api_key_env` changes the variable read, not the authentication protocol. Credentials are sent only to the configured endpoint; choose overrides deliberately. Endpoints must use HTTPS unless private access is enabled, and cannot contain URL credentials, a query string or a fragment. Supply the full request path, not a base URL.
278
+
279
+ `json_schema` requests provider-side schema constraints. `json_object` requests JSON without schema constraints. `prompt` includes the schema in the instructions without a provider-specific format parameter. Every mode still parses and validates the response locally, including evidence IDs and exact quotes. Refusals, incomplete output and provider format rejections leave analysis unavailable; there is no automatic format fallback. Anthropic defaults to [native structured output](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) through `output_config.format`; choose `prompt` explicitly for a model without that capability. DeepSeek accepts `json_object` or `prompt`; Perplexity accepts `json_schema` or `prompt`. Other profiles expose all three modes, but support still depends on the selected model. OpenRouter requests compatible upstream routing when a JSON mode is selected. Perplexity uses the Agent API with tools disabled, not the legacy Sonar chat endpoint.
280
+
281
+ For Azure, set the full Responses endpoint and your deployment name in the environment:
282
+
283
+ ```yaml
284
+ models:
285
+ enabled: true
286
+ analysis:
287
+ provider: azure-openai
288
+ endpoint: '${AZURE_OPENAI_ENDPOINT}'
289
+ model: '${AZURE_OPENAI_DEPLOYMENT}'
290
+ ```
291
+
292
+ `AZURE_OPENAI_ENDPOINT` must be the complete request URL supported by your Azure deployment. The key is read from `AZURE_OPENAI_API_KEY` unless overridden. Endpoints requiring query parameters are outside this adapter's endpoint rules.
293
+
294
+ Local profiles require both an explicit endpoint and `allow_private_endpoint: true`. For example, with an Ollama server and a model you have already installed:
295
+
296
+ ```yaml
297
+ models:
298
+ enabled: true
299
+ analysis:
300
+ provider: ollama
301
+ endpoint: http://127.0.0.1:11434/v1/chat/completions
302
+ model: '${LOCAL_MODEL}'
303
+ allow_private_endpoint: true
304
+ output_format: json_schema
305
+ ```
306
+
307
+ The local profiles and `openai-compatible` may omit the actual key when private access is enabled; all named hosted profiles still require a key. A local model must support the selected format. In a container, `127.0.0.1` refers to that container, so use the reachable server address. Private access applies only to the model endpoint, not feeds or article links.
308
+
309
+ See the [provider registry](https://github.com/ShieldaAI/security-watch/blob/main/src/providers.ts) for endpoint defaults and official API references. `doctor` validates configuration; a live analysis is needed to check account access and the selected model's compatibility. From a source checkout, `node scripts/check-models.mjs --help` describes a bounded synthetic test with separate passed, failed and skipped results. A missing key or model is a skip, never a successful live test.
310
+
311
+ Set `daily_budget_usd` only after configuring both prices for **every** selected model. Without prices, dollar cost is unknown; request and token allowances still apply. Model calls reserve conservative input/output allowances before the request. Reservations are not provider invoices, are not refunded after a timeout or malformed response, and include verification calls. Daily counters use UTC days. Adding a dollar cap after unpriced calls prevents further billed requests for that UTC day because the prior spend is unknown. There are no automatic model retries or provider fallbacks. Cache hits reuse validated results without a new request reservation. Provider usage and billing remain authoritative.
312
+
313
+ The analysis includes relevant components/products/keywords from the matched system and its deployment context, with up to six bounded evidence excerpts. Authoritative and urgent evidence is prioritized, and omitted/truncated context is explicit. Selection is capped at 20 components and 20 products; excess or oversized context fails with an explicit model-context health finding. Partial context or stale inventory cannot support an AI dismissal; unknown relevance enters review. Models receive no tools or notification credentials. The adapter checks that evidence IDs exist and quotes match the source text, but these checks cannot establish whether the model interpreted the source correctly.
314
+
315
+ ## Policy and scheduling
316
+
317
+ Each `library`, `product` and `news` rule has `levels`, `basis` and `channels`. Malware uses the library rule's destinations. Category defaults select critical libraries and high/critical products/news, but all channel arrays default to empty. A referenced channel requires matching notification configuration.
318
+
319
+ - `basis: source_severity` filters on source severity. `basis: priority` filters on the higher of source severity and contextual priority. Levels are explicit memberships, not numeric minimums: use `[high, critical]` for both.
320
+ - Source severity cannot be lowered by AI. Known exploitation raises contextual priority to at least high; a high advisory affecting an internet-exposed, business-critical system also receives critical contextual priority.
321
+ - `urgent_unknown: true` sends potentially critical unknown/conflicting findings immediately, even before affectedness can be established. Other uncertain findings go to a review digest, including uncertainty below the category's immediate levels.
322
+ - `exploited_override: true` and `malware_override: true` notify immediately even without a matching severity level. They do not override an empty channel list or a supported `not_affected` decision.
323
+ - Confirmed exclusions and all-source withdrawals are retained without new vulnerability notifications. Withdrawal alone does not prove a system safe. Withdrawal disagreement remains conflicting.
324
+ - AI distinguishes noncritical system news from vulnerability reports and evaluates claimed system impact before routing; general news and supported AI-only exclusions are recorded without vulnerability alerts. Generic product reports with linked CVEs use this analysis too. Uncertain analysis goes to review. AI cannot suppress source-critical news, an enabled exploitation override or deterministic package urgency by declaring it irrelevant. Advisory-linked package news uses library policy. Multi-advisory articles retain unmatched CVE/GHSA subjects separately until authoritative alias evidence joins them.
325
+ - `health_channels` routes monitoring failures independently from vulnerability thresholds. If every destination fails, inspect local status/logs; the bot cannot notify through an unavailable channel.
326
+
327
+ `poll_interval_minutes` is an integer from 1 to 1,440, default 15. `inventory_stale_days` is 1–365, default 7; timestamps more than five minutes in the future are also invalid for assessment. `digest_interval_hours` is an integer from 1 to 168, default 24. Digest boundaries are aligned to the Unix epoch in UTC, not a user's timezone. Each Slack/email digest contains at most five findings; additional groups are sent separately.
328
+
329
+ `notifications.max_attempts` is 1–10, default 3. Explicit Slack rate-limit/server rejections, transient SMTP rejections and DNS/connection failures known to occur before sending retry with bounded backoff. Timeouts after connecting, interrupted delivery and partial email acceptance become `unknown` instead of automatically risking a duplicate. `retry DELIVERY_ID` requires an operator to check receipt first. `accepted` means destination acceptance, not human acknowledgement. A one-shot `scan --notify` reports remaining backlog and leaves rate-limited, retry-delayed and future-digest jobs pending; use `start` to drain them when due.
330
+
331
+ Slack digest groups also respect the message size limit. Entries that do not fit wait for another batch without consuming a send attempt. A malformed saved notification is marked failed while healthy queued work continues. A failed destination does not block another destination. Database errors that prevent reliable queue updates remain fatal; the worker must not claim successful delivery without durable state.
332
+
333
+ Acknowledgement applies to the current finding revision. Material changes create a new revision. Suppression requires a reason and expiry and remains active until that expiry. `explain FINDING_ID` shows the current policy decision together with acknowledgement and suppression controls, so policy eligibility can be distinguished from an active operator hold. Existing pending deliveries are superseded when the assessment or policy changes. Cosmetic article/model wording does not create a fresh alert. Rare new advisory aliases can change canonical finding identity; this alpha does not migrate historical identities automatically.
334
+
335
+ ## Persistence and recovery
336
+
337
+ Use one local SQLite database per worker. A worker lock prevents concurrent scans; inspection and control commands can run alongside it. The database contains source evidence/checkpoints, assessment history, model caches and reservations, and notification state. It is operationally sensitive. Retention and scheduled backups are disabled until configured.
338
+
339
+ Keep the database in a trusted local data directory. Database, SQLite sidecar and worker-lock database files must be regular files without links. On Unix systems, they must have no group or other permissions. New files are created privately. If a permission check fails, stop the worker and correct the named file’s permissions before restarting; the application does not change permissions on an active SQLite file.
340
+
341
+ Database schema 5 adds timestamps and current-evidence hashes for retention without deleting existing data. Legacy cache ages begin at migration time because their original write times are unknown. Stop an older worker and run `scan` or `start` to migrate before using read-only commands from this version. Back up before upgrading operational databases.
342
+
343
+ `health` checks a worker heartbeat no older than 90 seconds, a completed scan no older than twice the polling interval (at least two minutes), and actionable failed, uncertain or more-than-five-minutes-overdue delivery. A new worker has a two-minute first-scan grace period. Suppressed/acknowledged findings, canceled routes and a valid Slack retry timer are excluded from actionable delivery health. `health --scan-only` omits the worker requirement for externally scheduled scans. Neither command writes data or calls external services; unhealthy monitoring returns exit code 2. A healthy monitor can still have critical affected systems.
344
+
345
+ `explain` includes each cited source's modification and fetch timestamps. Cached conclusions during a source outage reflect historical evidence; degraded health does not imply those sources were refreshed. Source revisions more than five minutes in the future are rejected without advancing their checkpoint.
346
+
347
+ Use `backup --output PATH` for a consistent backup at a new destination; the command also verifies a temporary restored copy. Use `verify-backup --input PATH` to inspect an existing standalone snapshot without loading monitor configuration. Do not copy a live SQLite file without its write-ahead log. To restore, stop the worker, preserve the old database and its sidecars, put the verified backup at the configured database path with private permissions, and restart. An interrupted in-flight delivery becomes `unknown` on worker recovery. `unlock` removes stale informational metadata only after acquiring the SQLite worker lock; it never deletes the lock database or interrupts a running worker.
348
+
349
+ ## External heartbeat
350
+
351
+ ```yaml
352
+ monitoring:
353
+ heartbeat_url_env: HEARTBEAT_URL
354
+ interval_seconds: 60
355
+ allow_private_endpoint: false
356
+ ```
357
+
358
+ This is optional; `init --heartbeat` adds the default environment-variable name to the configuration. Store the endpoint URL in the private credentials file, and configure its service to alert on missed pings. The worker sends a bodyless GET only after a completed scan and while local monitoring health is healthy. Unhealthy scans, delivery problems and maintenance failures withhold success pings; a startup grace period is not a successful scan. The receiver gets request metadata, but no inventory, findings or logs.
359
+
360
+ Intervals may be 30–3,600 seconds. Requests have a five-second timeout, no redirects and a 4 KiB response cap. Public HTTPS is required unless `allow_private_endpoint: true` explicitly permits a trusted private/local HTTP(S) destination. The URL is not included in recorded status or errors. `status` exposes the last external-heartbeat outcome independently of the local worker heartbeat. An external ping cannot itself notify you that it was never sent; the receiving service must detect that absence.
361
+
362
+ ## Retention and verified backups
363
+
364
+ Nothing is pruned or backed up automatically unless `maintenance` is configured. For example:
365
+
366
+ ```yaml
367
+ maintenance:
368
+ interval_hours: 24
369
+ retention:
370
+ analysis_cache_days: 30
371
+ evidence_history_days: 180
372
+ finding_history_days: 180
373
+ accepted_delivery_days: 180
374
+ inactive_findings_days: 365
375
+ unreferenced_evidence_days: 365
376
+ batch_size: 1000
377
+ backup:
378
+ directory: ./backups
379
+ keep: 7
380
+ max_bytes: 536870912
381
+ ```
382
+
383
+ Choose periods for your deployment rather than copying this policy blindly. Omit individual retention fields to leave that category untouched; omit `retention` or `backup` to disable it. Retention periods are 1–3,650 days. `interval_hours` is 1–168, default 24. Once configured, `start` performs scheduled maintenance, including retention; preview the policy before restarting the worker:
384
+
385
+ ```sh
386
+ security-watch prune --config ./watch/security-watch.yaml
387
+ security-watch prune --config ./watch/security-watch.yaml --apply
388
+ ```
389
+
390
+ The first command opens the database read-only and reports a plan. `--apply` recomputes eligibility and deletes one batch atomically. Every deleted row, including dependent history and assessment-basis metadata, counts toward `batch_size` (1–10,000, default 1,000). `more_available` indicates further eligible work. Pruning does not compact the database file; freed pages remain available for SQLite reuse.
391
+
392
+ Analysis-cache age is measured from its last write. Current evidence revisions are retained unless old evidence is explicitly eligible for unreferenced-evidence cleanup. Active findings, affected or uncertain inactive findings, and pending, sending, unknown or failed delivery records protect their associated history and evidence. Source checkpoints and budget records are never pruned. An inactive finding expires only after supported exclusion, withdrawal or confirmed general-news classification, and only when its audit dependencies are also eligible. Removing a component from inventory alone does not make its finding resolved. These protections can leave data older than the configured periods.
393
+
394
+ Backup paths are relative to the configuration file. The destination directory must be private. Scheduled backups are verified before older managed snapshots are rotated, and before retention runs when both are enabled. `keep` defaults to 7 and allows 1–365 snapshots. Rotation leaves files outside the application's backup filename pattern untouched. A failed backup or verification prevents cleanup during that maintenance attempt and is recorded as a monitoring problem.
395
+
396
+ Verification copies a standalone snapshot into a private temporary directory in a separate process. It checks SQLite integrity, supported schema and migrations, foreign-key relationships, saved JSON and scan metadata, then deletes the temporary copy. It never overwrites the source or restores over a live database. It rejects live sidecars, links, oversized inputs and unsupported schemas. This checks structural restorability, not the truth or semantic correctness of saved vulnerability assessments.
397
+
398
+ The default verification size limit is 512 MiB. Configured backup verification permits up to 20 GiB through `max_bytes`; standalone `verify-backup` uses the default. Verification has a 60-second process limit and needs writable temporary space as well as room for the new backup. For a container with a read-only root filesystem, provide a writable `/tmp` tmpfs with enough capacity. Protect backups as carefully as the live database. Before an actual restore, stop the worker, retain the old database and sidecars, and place a verified snapshot at the configured path with private permissions.
399
+
400
+ ## Model evaluation
401
+
402
+ From a source checkout, `npm run evaluate:models -- --help` lists the available options. Without `--live`, the script makes no network requests and reports skipped cases; exit code 3 means no cases were attempted. A live run requires provider credentials and exact `SECURITY_WATCH_EVAL_<PROVIDER>_MODEL` environment variables. EVAL settings can fall back to matching SMOKE settings; there is no default model.
403
+
404
+ The default cap is 20 total requests, 45 seconds per request and 2,048 output tokens. Select cases/providers to fit the cap. Optional verification uses up to two requests per case. Provider charges may apply; a token/request cap is not a dollar budget. Evaluation sends no notifications and uses fictional inventory against source-derived synthetic text.
405
+
406
+ The versioned corpus includes source references, but its labels remain `pending_human_review`. Reports separate accepted output, attempted coverage, reference-label agreement, false exclusions, rejected outputs and conflicting results. Acceptance measures the production schema/evidence checks, not accuracy. Treat label agreement as a comparison with provisional references; it does not establish production performance. Rejected, skipped and conflicting cases remain visible rather than disappearing from the report.
@@ -0,0 +1,104 @@
1
+ # Release review
2
+
3
+ Review date: 2026-10-24. Package: `@shieldaai/security-watch`, `0.1.0-alpha.0`.
4
+
5
+ The alpha supports small installations with library inventories across 12 ecosystems, cve.now/OSV advisories, security and vendor news, optional model analysis, and Slack/SMTP delivery from one host. The checks below cover that scope. Product backports, runtime reachability, large fleets and distributed workers are outside it.
6
+
7
+ ## Changes covered
8
+
9
+ ### Sources and assessment
10
+
11
+ - New configurations use cve.now and The Hacker News. OSV, GitHub, CISA KEV and RSS/Atom adapters remain optional. Official Node.js, Python and PHP feeds can be selected explicitly; article extraction stays within fixed vendor hosts and content limits.
12
+ - Library lists accept ecosystem aliases and optional exact versions across npm, PyPI, Packagist, Go, Maven, crates.io, RubyGems, NuGet, Hex, Pub, Hackage and SwiftURL. Only npm has range ordering/exclusion support; other ecosystems need exact positive OSV or listed-version evidence. Missing versions and unsupported constraints remain uncertain. Library checks do not require a model.
13
+ - cve.now uses original descriptions and structured affected ranges. Its model-generated summaries are excluded from evidence. Separate exact npm queries preserve matches that the provider would deduplicate in a combined request.
14
+ - cve.now requests start at least 1.1 seconds apart. A supplied `Retry-After` on HTTP 403/429 delays later requests, with a one-hour cap. Isolated detail failures preserve other records; batch and failure limits bound collection. An incomplete source keeps its previous checkpoint and reports degraded health.
15
+ - Malformed source items are isolated across feeds, GitHub, KEV, cve.now and OSV. Valid neighboring records survive, incomplete checkpoints stay unchanged, and cancellation still stops collection.
16
+ - Relevant tracked CVEs and identifiers found in news are refreshed. Recent-entry collection does not establish exhaustive historical coverage for every product.
17
+ - Multi-CVE articles keep unmatched subjects as separate review candidates until advisory aliases establish that they describe the same vulnerability.
18
+ - OSV event ordering and independent limit events follow the [OSV schema algorithm](https://ossf.github.io/osv-schema/).
19
+ - News text comes from an inert HTML parser, excluding scripts, styles, templates, comments and attributes. Parsing and traversal have input, depth and node limits. An article needs an explicit closing wrapper to be considered complete; malformed or over-limit pages retain the feed excerpt.
20
+ - Newer source revisions take precedence. Future timestamps fail collection, and unchanged KEV records retain their content revision when the catalog changes.
21
+ - The scan interval and news discovery window are independent. RSS/Atom and The Hacker News filter new stories by publication or modification time before fetching articles. Successful checkpoints allow catch-up after downtime; tracked findings and authoritative package matches remain in scope. Undated entries produce a health warning, and unchanged undated content does not create duplicate revisions or model calls.
22
+
23
+ ### Model analysis
24
+
25
+ - A shared catalog defines 22 provider profiles: 17 cloud services, four local/gateway profiles and a generic Chat Completions adapter. Provider-specific authentication, request formats, output limits and response validation cover six protocol families. The CLI can list the catalog without configuration or network access. Models select source excerpt IDs; the application resolves them to exact quotations and rejects unsupported claims. Installed-version constraints apply to fresh responses and cached results.
26
+ - Structured output defaults follow each provider's API, including native JSON Schema for OpenAI and Anthropic, with explicit overrides for model-specific capabilities. Incomplete, refused, asynchronous and unexpected tool/code responses are rejected. Model failures do not silently switch providers or weaken evidence validation.
27
+ - System news has separate classifications for new vulnerabilities, known-vulnerability updates, general coverage and uncertainty. Claimed system impact is recorded separately from deterministic package applicability.
28
+ - Product identity, installed versions, supporting quotes, article completeness and evidence freshness constrain impact conclusions. Linked CVEs preserve product-news analysis without weakening package matching.
29
+ - Both affected and excluded impact claims must cite the configured product name. Search keywords, including a shared vendor name, cannot establish product identity. An exclusion quoted for another product remains uncertain and goes to review. The analysis version changed so stored conclusions are reassessed.
30
+ - Critical-source severity and configured exploitation overrides survive model dismissals. Missing, truncated or stale context leaves the assessment uncertain.
31
+ - Failed or conflicting verification retains the highest validated priority proposal and records the failure or disagreement.
32
+ - General coverage remains historical when its article, inventory and model settings are unchanged. Current affected or excluded impact claims require fresh evidence.
33
+ - `evaluate:models` runs source-derived synthetic scenarios through the production analyzer. Reports separate acceptance, coverage, reference-label agreement, false exclusions and disagreements. The corpus labels remain `pending_human_review`; this is not an independently labeled production benchmark. Live provider calls require explicit opt-in, credentials, model IDs and bounded request settings.
34
+
35
+ ### Setup and operations
36
+
37
+ - `init` accepts common-system templates or a library list, provider/model selection, vendor feeds, external heartbeat setup and independent scan/news timing. The default generated schedule is 30 minutes with a 40-minute news window. Templates do not invent installed versions or deployment details.
38
+ - `--credentials-file` explicitly loads dotenv data with existing environment values taking precedence. Reads are bounded to 128 KiB; Unix permissions, file type and runtime-variable checks happen before environment changes. The flag avoids Node’s startup handling of `--env-file`.
39
+ - Inventory exclusions, withdrawals, removed components and changed routes are reconciled before delivery. Dispatch checks the current policy again before sending.
40
+ - Notification setup supports explicit Slack/email routes, and doctor reports disabled routing. Known preconnection failures retry with bounded backoff. Slack digests split within the message limit; malformed queued messages do not block healthy jobs. Genuine database claim failures still stop delivery.
41
+ - Immediate alerts take priority over old digests. Pending messages receive updated wording and citations without resetting their schedule or attempt count.
42
+ - Early delivery failures appear in the final one-shot scan result and return exit code 2. Invalid command/flag combinations fail before activity.
43
+ - Database and worker-lock file checks reject links and insecure permissions without opening and closing existing SQLite files. This preserves SQLite’s process locks during concurrent inspection and repeated lock attempts. Backups are published atomically without replacing an existing destination.
44
+ - Shutdown cancels source/model requests and active Slack/SMTP sends, closes SMTP sockets, and leaves queued messages untouched. An interrupted send keeps an unknown receipt and is not retried automatically. Worker heartbeat, scan freshness and actionable delivery failures are available through a read-only health command.
45
+ - External heartbeat pings are opt-in and withheld until monitoring is healthy. The receiver must alert on missing pings; local health and external heartbeat state are separate.
46
+ - Opt-in retention has a read-only preview and atomic batches that count dependent history rows. Active, affected or uncertain findings and unresolved deliveries stay protected; inventory removal alone does not authorize deletion.
47
+ - Backups are restored and migrated only in a private temporary copy, then checked for SQLite integrity, relationships, schema and readable saved JSON. Automatic rotation and retention follow successful verification. Verification establishes structural restorability, not the semantic accuracy of saved security claims.
48
+ - Builds clean `dist` before compiling. Package checks install the tarball in a fresh consumer and verify the CLI version, public types and runtime exports.
49
+
50
+ ## Validation
51
+
52
+ All **639 tests** pass on Node 26.12.0 and Node 24.22.1 in the Linux Docker test stage. They cover news windows, source recovery, package identity/version boundaries, model evidence validation, notification retries, concurrent SQLite readers and worker-lock contention. Maintenance tests cover read-only previews, bounded atomic pruning, protected records, migration, temporary restore verification and damaged-backup rejection. Provider protocol tests use real loopback HTTP with simulated responses; they do not establish hosted-model accuracy. `npm run check` also passes formatting, strict compilation and clean-package consumer checks.
53
+
54
+ Hosted CI for the release branch must pass at its final commit before merge. The sole-maintainer workflow requires a pull request, passing checks and resolved review conversations, without a mandatory second-person approval. Branch and release-tag protections remain enabled.
55
+
56
+ The runtime image passes checks with a non-root user, a read-only root filesystem, disabled network access, private configuration and a native SQLite volume. Repeated scans, deduplication, monitoring health and verified backup pass. The packed CLI, public types and exports also pass on the minimum supported Node 24.0.0. The production dependency audit reports no known vulnerabilities at review time.
57
+
58
+ A local SQLite load check used 10 deployments, 1,000 components, 100 advisories and 1,000 findings. Three scans took 355, 197 and 191 ms with about 184 MiB peak process RSS and no duplicate revisions. Network requests, model calls and delivery were excluded; this was not an endurance test.
59
+
60
+ Earlier live source checks on 2026-10-24 included:
61
+
62
+ - An exact query for `lodash@4.17.20` returned eight advisories without source errors, including five historical package matches.
63
+ - A broad 24-hour scan initially hit HTTP 403 during detail collection. After pacing was added, a new scan of the 24-system sample completed all 157 public requests successfully: eight complete news articles and 143 advisories (134 published in the window and nine older records cited by news), with no source errors. The window was 2026-10-23 15:55 UTC through 2026-10-24 15:55 UTC. These are records returned by the configured sources, not a claim of exhaustive CVE coverage.
64
+ - After the HTML parser change, a fresh live check completed nine public requests and returned the same eight complete article extracts. All eight text bodies were identical to the model evaluation sample. A further check after the recovery changes again completed nine requests and read eight full articles without source errors.
65
+ - Against one live feed snapshot, a 40-minute news window returned zero stories and a one-day window returned eight. All eight fell within that window. Public requests still occur in dry-run mode; models and notifications do not.
66
+
67
+ Earlier live model checks on 2026-10-24 used a fictional security bulletin through the production analyzer and HTTP client:
68
+
69
+ | Provider | Model | Result | Requests | Duration |
70
+ | --------- | ------------------ | ---------------------------------------------- | -------- | ------------ |
71
+ | OpenAI | `gpt-6-luna` | HTTP 200; schema and evidence quotes validated | 1 | 10.0 seconds |
72
+ | Anthropic | `claude-haiku-5-5` | HTTP 200; schema and evidence quotes validated | 1 | 4.8 seconds |
73
+
74
+ Each request had a 2,048-output-token cap and a 60-second timeout. No private inventory, tools, verification calls or notifications were involved. Both model IDs were checked against the providers' current documentation: [OpenAI](https://developers.openai.com/api/docs/models/gpt-6-luna) and [Anthropic](https://platform.claude.com/docs/en/models/haiku-5-5/overview). These checks establish compatibility for the tested models and credentials at review time, not general model accuracy. The remaining 20 provider profiles have simulated transport coverage only. No real Slack/email messages were sent.
75
+
76
+ ### Expanded source checks, 2026-10-24
77
+
78
+ A public sample with exact versions from all 12 ecosystems, plus name-only Python and PHP entries, completed 129 OSV requests and retained 128 advisory records without coverage errors. Every exact-version sample returned at least one advisory. Both name-only samples produced candidates with unknown applicability and no affected or unaffected conclusions. Advisory aliases can refer to the same underlying vulnerability, so these record counts are not unique CVE counts.
79
+
80
+ Live checks exposed OSV spelling differences for Rust, NuGet and Swift that simulated responses had missed. Queries now preserve the published spelling and use bounded equivalent alternatives. A legitimate Swift host/path entry in a mixed Go/Swift advisory is also accepted. Regression tests cover each case; arbitrary package spelling is still not a discovery guarantee.
81
+
82
+ The official Node.js, Python and PHP feeds completed 11 requests over a seven-day window and returned eight full article extracts with no source errors: one Node.js article, one Python article and six PHP articles. PHP's historical feed needs its own bounded entry allowance. Updated vendor articles can be shorter than an older feed excerpt; the extractor verifies the complete article wrapper, title and body instead of treating length alone as completeness.
83
+
84
+ ### Expanded model evaluation, 2026-10-24
85
+
86
+ A later run of `evaluate:models` made 20 requests against the source-derived synthetic corpus. OpenAI `gpt-6-luna` produced accepted output for all ten cases and matched both provisional classification and impact labels in seven; the other three answers were more uncertain. No false exclusions were recorded against those reference labels.
87
+
88
+ All ten Anthropic `claude-haiku-5-5` requests returned HTTP 401 with the credentials supplied for this run. That is an authentication failure, not a model-quality result, and it does not invalidate the earlier successful compatibility smoke check. A new comparison requires working credentials.
89
+
90
+ The corpus labels are still `pending_human_review`. These figures describe a small synthetic exercise, not production accuracy or an independently reviewed benchmark.
91
+
92
+ ## Before deployment
93
+
94
+ A real-article evaluation used the sample inventory of 24 common systems with no installed versions. The initial run completed only two of 19 assessments. The final test used the same 19 target/event pairs from the successful paced source scan, with native JSON Schema output from OpenAI and Anthropic. Nine assessments completed, seven had conflicting classifications, and three were rejected for unsupported extracted claims. All 36 API requests returned HTTP 200; there were no JSON-format or quotation-reference failures. The clock was fixed at the source capture time for this evaluation. This is a small operational sample, not an accuracy benchmark.
95
+
96
+ These results support using model analysis as a review aid. They do not establish reliable automatic classification across arbitrary articles. Disagreement, failed validation and missing installed versions remain visible and cannot establish that a system is safe. No real notifications were sent.
97
+
98
+ - Merge through a checked pull request and verify the release commit before publishing.
99
+ - Repeat the synthetic live check when selecting other model IDs or provider accounts, and validate notification destinations separately. Mocked protocol tests do not cover hosted model behavior or destination credentials.
100
+ - Observe scheduled operation, source outages and delivery failures in a representative deployment before relying on the monitor operationally.
101
+ - Plan storage and retention before increasing the installation size. Retention is opt-in, and protected unresolved records can continue growing. Current evidence and findings are loaded into memory during a scan.
102
+ - Treat cached conclusions during source outages as historical. New advisory aliases can change a finding's canonical identity; this alpha does not migrate those identities automatically.
103
+
104
+ Schema 5 adds cache timestamps and evidence/finding age metadata for retention. Unknown legacy cache ages start at migration time so they are not immediately deleted. Before upgrading an operational database, take a backup and stop the old worker. Run `scan` or `start` to migrate, then use the read-only commands from the new version.
@@ -0,0 +1,17 @@
1
+ [
2
+ {
3
+ "id": "DEMO-NOT-A-REAL-ADVISORY",
4
+ "source": "fixture",
5
+ "kind": "advisory",
6
+ "title": "Fictional example-parser vulnerability for the offline demonstration",
7
+ "url": "https://example.com/security/demo",
8
+ "description": "This is synthetic test data, not a report about a real package or vulnerability. Example versions below 1.3.0 match this demonstration advisory.",
9
+ "aliases": [],
10
+ "severity": "critical",
11
+ "modified_at": "2026-10-23T00:00:00Z",
12
+ "fetched_at": "2026-10-23T00:00:00Z",
13
+ "packages": [
14
+ { "ecosystem": "npm", "name": "example-parser", "range": ">=1.0.0 <1.3.0", "fixed": "1.3.0" }
15
+ ]
16
+ }
17
+ ]