@shieldaai/security-watch 0.1.0-alpha.0 → 1.0.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 (92) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/CONTRIBUTING.md +4 -2
  3. package/README.md +173 -48
  4. package/SECURITY.md +24 -9
  5. package/dist/assessment.d.ts +12 -1
  6. package/dist/assessment.js +223 -52
  7. package/dist/cli.js +340 -27
  8. package/dist/config.d.ts +62 -2
  9. package/dist/config.js +88 -5
  10. package/dist/coverage.d.ts +4 -0
  11. package/dist/coverage.js +11 -0
  12. package/dist/cve-now.d.ts +32 -2
  13. package/dist/cve-now.js +715 -126
  14. package/dist/cvss4.d.ts +3 -0
  15. package/dist/cvss4.js +39 -0
  16. package/dist/delivery.d.ts +34 -2
  17. package/dist/delivery.js +391 -98
  18. package/dist/ecosystems.d.ts +23 -0
  19. package/dist/ecosystems.js +88 -10
  20. package/dist/engine.d.ts +55 -1
  21. package/dist/engine.js +101 -20
  22. package/dist/everyday-words.d.ts +11 -0
  23. package/dist/everyday-words.js +256 -0
  24. package/dist/health.d.ts +7 -0
  25. package/dist/health.js +55 -3
  26. package/dist/http.d.ts +7 -0
  27. package/dist/http.js +31 -2
  28. package/dist/index.d.ts +22 -4
  29. package/dist/index.js +12 -4
  30. package/dist/inventory-evidence.d.ts +10 -0
  31. package/dist/inventory-evidence.js +206 -0
  32. package/dist/inventory.d.ts +273 -0
  33. package/dist/inventory.js +210 -17
  34. package/dist/maintenance.d.ts +5 -0
  35. package/dist/maintenance.js +73 -5
  36. package/dist/matching.d.ts +29 -0
  37. package/dist/matching.js +537 -0
  38. package/dist/models.d.ts +17 -4
  39. package/dist/models.js +359 -29
  40. package/dist/pilot-cases.d.ts +171 -0
  41. package/dist/pilot-cases.js +330 -0
  42. package/dist/pilot-input.d.ts +16 -0
  43. package/dist/pilot-input.js +125 -0
  44. package/dist/pilot-recall.d.ts +166 -0
  45. package/dist/pilot-recall.js +231 -0
  46. package/dist/pilot-report.d.ts +113 -0
  47. package/dist/pilot-report.js +279 -0
  48. package/dist/pilot-responses.d.ts +111 -0
  49. package/dist/pilot-responses.js +159 -0
  50. package/dist/python-version.d.ts +3 -0
  51. package/dist/python-version.js +30 -0
  52. package/dist/rehearsal.d.ts +440 -0
  53. package/dist/rehearsal.js +372 -0
  54. package/dist/sbom.d.ts +13 -0
  55. package/dist/sbom.js +193 -0
  56. package/dist/source-error.d.ts +17 -1
  57. package/dist/source-error.js +18 -3
  58. package/dist/sources.d.ts +2 -2
  59. package/dist/sources.js +699 -45
  60. package/dist/store.d.ts +38 -13
  61. package/dist/store.js +325 -23
  62. package/dist/types.d.ts +159 -2
  63. package/dist/util.d.ts +23 -0
  64. package/dist/util.js +81 -1
  65. package/dist/vendor/cvss4-reference.d.ts +2 -0
  66. package/dist/vendor/cvss4-reference.js +789 -0
  67. package/dist/word-filter.d.ts +3 -0
  68. package/dist/word-filter.js +3291 -0
  69. package/docs/alert-outcome-evaluation.md +150 -0
  70. package/docs/compatibility.md +35 -0
  71. package/docs/configuration.md +289 -29
  72. package/docs/cvss-v4-support.md +41 -0
  73. package/docs/offline-advisory-preview.md +114 -0
  74. package/docs/offline-rehearsal.md +44 -0
  75. package/docs/pilot-cases.md +58 -0
  76. package/docs/pilot-recall.md +124 -0
  77. package/docs/pilot-report.md +52 -0
  78. package/docs/validation/alert-outcome-evaluation-2026-11-05.json +2935 -0
  79. package/docs/validation/cvss-v4-reference-parity-2026-11-05.json +93 -0
  80. package/docs/validation/rehearsal-accepted-2026-11-05.json +175 -0
  81. package/docs/validation/rehearsal-unknown-2026-11-05.json +175 -0
  82. package/docs/vendor/cvss-v4-LICENSE.txt +22 -0
  83. package/docs/vendor/cvss-v4-provenance.json +38 -0
  84. package/examples/agent-advisories-2026.json +145 -0
  85. package/examples/agent-advisory-cases-2026.json +397 -0
  86. package/examples/libraries.example.txt +4 -2
  87. package/examples/libraries.example.yaml +2 -0
  88. package/examples/offline-advisory-preview.mjs +42 -0
  89. package/examples/rehearsal.json +75 -0
  90. package/examples/systems.example.yaml +4 -0
  91. package/package.json +23 -7
  92. package/docs/quality-review.md +0 -104
@@ -1,104 +0,0 @@
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.