@shieldaai/security-watch 0.0.0-stage → 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 (110) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/CONTRIBUTING.md +92 -0
  3. package/LICENSE +202 -0
  4. package/README.md +394 -2
  5. package/SECURITY.md +62 -0
  6. package/dist/assessment.d.ts +16 -0
  7. package/dist/assessment.js +569 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +1105 -0
  10. package/dist/config.d.ts +302 -0
  11. package/dist/config.js +381 -0
  12. package/dist/coverage.d.ts +4 -0
  13. package/dist/coverage.js +11 -0
  14. package/dist/cve-now.d.ts +35 -0
  15. package/dist/cve-now.js +1002 -0
  16. package/dist/cvss4.d.ts +3 -0
  17. package/dist/cvss4.js +39 -0
  18. package/dist/delivery.d.ts +58 -0
  19. package/dist/delivery.js +687 -0
  20. package/dist/ecosystems.d.ts +48 -0
  21. package/dist/ecosystems.js +332 -0
  22. package/dist/engine.d.ts +80 -0
  23. package/dist/engine.js +388 -0
  24. package/dist/everyday-words.d.ts +11 -0
  25. package/dist/everyday-words.js +256 -0
  26. package/dist/health.d.ts +24 -0
  27. package/dist/health.js +122 -0
  28. package/dist/heartbeat.d.ts +13 -0
  29. package/dist/heartbeat.js +74 -0
  30. package/dist/http.d.ts +15 -0
  31. package/dist/http.js +280 -0
  32. package/dist/index.d.ts +36 -0
  33. package/dist/index.js +23 -0
  34. package/dist/inventory-evidence.d.ts +10 -0
  35. package/dist/inventory-evidence.js +206 -0
  36. package/dist/inventory.d.ts +276 -0
  37. package/dist/inventory.js +336 -0
  38. package/dist/lock.d.ts +3 -0
  39. package/dist/lock.js +112 -0
  40. package/dist/maintenance.d.ts +48 -0
  41. package/dist/maintenance.js +295 -0
  42. package/dist/matching.d.ts +29 -0
  43. package/dist/matching.js +537 -0
  44. package/dist/models.d.ts +33 -0
  45. package/dist/models.js +932 -0
  46. package/dist/operations.d.ts +17 -0
  47. package/dist/operations.js +117 -0
  48. package/dist/pilot-cases.d.ts +171 -0
  49. package/dist/pilot-cases.js +330 -0
  50. package/dist/pilot-input.d.ts +16 -0
  51. package/dist/pilot-input.js +125 -0
  52. package/dist/pilot-recall.d.ts +166 -0
  53. package/dist/pilot-recall.js +231 -0
  54. package/dist/pilot-report.d.ts +113 -0
  55. package/dist/pilot-report.js +279 -0
  56. package/dist/pilot-responses.d.ts +111 -0
  57. package/dist/pilot-responses.js +159 -0
  58. package/dist/providers.d.ts +209 -0
  59. package/dist/providers.js +459 -0
  60. package/dist/python-version.d.ts +3 -0
  61. package/dist/python-version.js +30 -0
  62. package/dist/rehearsal.d.ts +440 -0
  63. package/dist/rehearsal.js +372 -0
  64. package/dist/sbom.d.ts +13 -0
  65. package/dist/sbom.js +193 -0
  66. package/dist/setup.d.ts +113 -0
  67. package/dist/setup.js +100 -0
  68. package/dist/source-error.d.ts +38 -0
  69. package/dist/source-error.js +71 -0
  70. package/dist/sources.d.ts +3 -0
  71. package/dist/sources.js +1725 -0
  72. package/dist/store.d.ts +96 -0
  73. package/dist/store.js +953 -0
  74. package/dist/types.d.ts +404 -0
  75. package/dist/types.js +1 -0
  76. package/dist/util.d.ts +29 -0
  77. package/dist/util.js +94 -0
  78. package/dist/vendor/cvss4-reference.d.ts +2 -0
  79. package/dist/vendor/cvss4-reference.js +789 -0
  80. package/dist/vendor-sources.d.ts +24 -0
  81. package/dist/vendor-sources.js +56 -0
  82. package/dist/word-filter.d.ts +3 -0
  83. package/dist/word-filter.js +3291 -0
  84. package/docs/alert-outcome-evaluation.md +150 -0
  85. package/docs/compatibility.md +35 -0
  86. package/docs/configuration.md +666 -0
  87. package/docs/cvss-v4-support.md +41 -0
  88. package/docs/offline-advisory-preview.md +114 -0
  89. package/docs/offline-rehearsal.md +44 -0
  90. package/docs/pilot-cases.md +58 -0
  91. package/docs/pilot-recall.md +124 -0
  92. package/docs/pilot-report.md +52 -0
  93. package/docs/validation/alert-outcome-evaluation-2026-11-05.json +2935 -0
  94. package/docs/validation/cvss-v4-reference-parity-2026-11-05.json +93 -0
  95. package/docs/validation/rehearsal-accepted-2026-11-05.json +175 -0
  96. package/docs/validation/rehearsal-unknown-2026-11-05.json +175 -0
  97. package/docs/vendor/cvss-v4-LICENSE.txt +22 -0
  98. package/docs/vendor/cvss-v4-provenance.json +38 -0
  99. package/examples/advisories.json +17 -0
  100. package/examples/agent-advisories-2026.json +145 -0
  101. package/examples/agent-advisory-cases-2026.json +397 -0
  102. package/examples/common-systems.yaml +243 -0
  103. package/examples/libraries.example.txt +18 -0
  104. package/examples/libraries.example.yaml +40 -0
  105. package/examples/library-watch.example.yaml +27 -0
  106. package/examples/offline-advisory-preview.mjs +42 -0
  107. package/examples/rehearsal.json +75 -0
  108. package/examples/security-watch.example.yaml +86 -0
  109. package/examples/systems.example.yaml +35 -0
  110. package/package.json +85 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,170 @@
1
+ # Changelog
2
+
3
+ Versions follow [semantic versioning](https://semver.org/). What counts as a compatible change is defined in the [compatibility policy](docs/compatibility.md).
4
+
5
+ ## 1.0.0
6
+
7
+ First stable release, published under the default `latest` tag. Not yet published at the time of writing.
8
+
9
+ ### Upgrading from 0.1.0-alpha.0
10
+
11
+ 1. Use Node.js 24.10.0 or newer (the alpha accepted 24.0).
12
+ 2. Stop the old worker and take a backup: `security-watch backup --output PATH`.
13
+ 3. Install the new version, then run `security-watch scan` or `security-watch start` once. This migrates the database to schema 7. Read-only commands refuse to run until that has happened. There is no downgrade path other than restoring the backup with the old version. Findings that did not change keep their revision, their delivered alerts and their acknowledgements: the upgrade does not send them again.
14
+ 4. Run `security-watch doctor`. It now reports an SMTP address it cannot use, a verification model identical to the analysis model, and inventory entries that were left out (`import_warnings`) and npm names that may be a typing mistake (`name_notices`). It exits with status 2 whenever it prints `ok: false`.
15
+
16
+ Behaviour that changes for an existing installation:
17
+
18
+ - **AI dismissals are reviewed by default.** News that a model classifies as general news or as not affecting you goes to a local review queue and the digest instead of being recorded silently. Set `policy.ai_dismissals: record` to keep the old behaviour.
19
+ - **Models receive less.** Each model defaults to the `minimal` disclosure profile: package and product names and versions only.
20
+ - **`models.verification` must differ from `models.analysis`.** A pair that reaches the same model at the same address is rejected at start-up, however each one is written (a spelled-out default endpoint, a trailing slash, different letter case, a compatible-endpoint profile pointing at the same service).
21
+ - **`models.daily_token_limit` defaults to 1,000,000** (was 100,000), and a request now reserves one token per three bytes instead of one per byte. The old defaults allowed about four requests a day.
22
+ - **Plain `http://` endpoints** (models and the external heartbeat) are accepted only for local or private hosts, even with `allow_private_endpoint: true`. An address is judged by its range; addresses that wrap a public IPv4 address (NAT64, 6to4) count as public for this rule, and HTTPS requests to them are refused. A name is accepted when it has no public form (`ollama`, `ollama.ml-tools`, `*.internal`, `*.ts.net`, `*.test`, `*.home` and similar), and the request is refused if the name resolves to a public address.
23
+ - **Inventory text is one line.** System `id`, `name`, `owner`, `environment`, keywords, product names and every `note` are rejected when they contain a control character (tabs and line breaks included) or a Unicode line separator. These values are printed in notifications.
24
+ - **News is matched to packages by stricter rules.** A package whose name is an English word (`express`, `moment`, `request`) no longer matches a story by the word alone; it needs to be named as a package ("the request package", "npm install send", "the npm package next"), a release, or to be written as a name. An existing news finding that rested on such a word becomes inactive at the first scan after the upgrade. Advisories, which are matched by structured package claims, are not affected. The word "module" no longer counts as package context.
25
+ - **A capitalised package name typed by hand is pointed out** (npm, RubyGems, Hex, Pub). `npm:Lodash` is accepted, because some packages from before 2017 keep their capitals (`MD5`, `CSSselect`), but it matches only advisories for exactly that spelling. `doctor` lists such entries under `name_notices` and every scan report carries them in `notices`. A notice is not a fault: the scan is not degraded, no health alert is sent, and the heartbeat is not withheld. Names imported from a lockfile or SBOM, and `JSONStream`, `Base64`, `JSONPath` and `JSONSelect`, are taken as published.
26
+ - **cve.now reads one week past its checkpoint** on every scan (about 45 listing requests at the current rate of some 600 records a day, under a minute) to find records the service ingested after their publication date.
27
+ - **The first cve.now scan looks back one day** (was seven). A week meant about 4,500 detail requests and 80 to 90 minutes before the first result. Exact npm package matches still cover all of history.
28
+ - **Recipient domains are compared in lower case.** Email to `Ops@Example.ORG` was delivered but recorded as uncertain.
29
+
30
+ ### Added
31
+
32
+ - **Notes that say where to look.** Systems, libraries and products accept a `note`; library list lines accept `# note`. A notification about a system carries a `Where to look:` line with the system name, owner and notes, and one about a library or product also an `Affected item:` line. Notes are never sent to sources or models.
33
+ - CycloneDX 1.4 to 1.6 import, per-source coverage receipts, inventory drift, declared artifact and remediation evidence.
34
+ - CVSS v4 base-vector scoring for OSV and GitHub records.
35
+ - Local review queue for AI dismissals (`reviews`, `review`).
36
+ - Offline rehearsal (`rehearse`) and pilot measurement commands (`pilot-report`, `pilot-cases`, `pilot-score`, `pilot-recall`, `pilot-response-template`).
37
+ - `acknowledge --revision N` refuses to acknowledge a revision newer than the one that was read.
38
+ - Library exports: `safeHttp`, `acquireLock`, `notificationText`, `sendEmail`, `smtpProblem`, `attachLocation`, `SCHEMA_VERSION`, and the types `HealthReport`, `ExternalHeartbeat`, `MaintenanceRun`, `EmailSender`, `EmailMessage`, `EmailReceipt`, `DeliveryOptions`, `FindingLocation`. `deliverPending` accepts an options object.
39
+
40
+ ### Fixed: alerts that were wrong or lost
41
+
42
+ - A validated AI "affected" verdict on a news finding could be recorded silently while an uncertain one alerted. It is now never quieter than the uncertain route.
43
+ - A news finding matched by keyword or package name disappeared when an advisory record arrived for the same CVE without a package claim this application can use (no claims at all, an ecosystem it does not know such as GitHub Actions or Debian, or a name it cannot normalise). It now stays and takes on the advisory's severity and exploitation status.
44
+ - While a source was incomplete, an excluded finding flipped between "not affected" and "unknown" on every scan and sent a new alert each time. Only the advisory source that supplied the excluding version range counts: a linked news article that could not be read no longer turns an exclusion into an urgent "unknown".
45
+ - After the monitor had been stopped for longer than two poll intervals, the first scan briefly stored excluded findings as "unknown" and queued urgent alerts for them before refreshing the evidence. Stored evidence is now judged as of the last collection until it has been refreshed.
46
+ - With a model enabled, editing a note (or the owner) created new revisions, a new review beside a dismissed one, and a second digest or immediate alert. Notes, the owner and the `Where to look` text are now left out of everything that decides revisions, reviews, analysis reuse and alerts.
47
+ - Upgrading from 0.1.0-alpha.0 gave every active finding a new revision and a new alert and dropped acknowledgements, because the stored fingerprint gained fields. A finding unchanged in what the earlier release compared keeps its revision.
48
+ - CISA KEV evidence was not attached to news about a CVE that had no advisory record yet, so the known-exploitation override did not fire.
49
+ - npm ranges using grammar that advisory sources do not use (`^`, `~`, hyphen ranges, `> 1.2`) could produce a false "not affected". They now give "unknown".
50
+
51
+ ### Fixed: sources that stalled
52
+
53
+ - The set of stored cve.now records re-read at every scan grew without bound and eventually failed the source. Records without a package match now take turns, 200 per scan.
54
+ - A backlog larger than one scan reads (cve.now, GitHub) was never drained. Collection now resumes from the last record processed.
55
+ - One package name that could not be normalised discarded the whole advisory and held back the checkpoint.
56
+ - A stored OSV record that no longer exists stopped the refresh of the records after it.
57
+ - Feed entries that appeared after their own timestamp were dropped silently.
58
+ - cve.now changed its response formats: the package lookup is now a JSON Feed and the listing pages with `next_cursor`. Both the earlier and the current formats are read; before, the package lookup failed and only the first listing page was read.
59
+ - A cve.now record stamped later than the scan's start time (for example one updated while a long first scan was still running) made the whole source incomplete. Such a record is now collected with its earlier timestamp; only a record with no usable time is refused. A listing record with a publication date ahead of the clock is collected and never ends paging.
60
+ - cve.now records ingested after their publication date were never collected: the listing is ordered by publication date, so they appear below the checkpoint. The listing is now read one week past the checkpoint and a record counts as new when it was first seen inside the window. A record ingested more than a week late is found only through an exact npm match or a news citation.
61
+ - One cve.now record could stop the source for good: a stored record the service no longer serves (HTTP 404) failed every scan, and a record that cannot be parsed held back the resume point of a backlog. A new record that cannot be read is asked for again until its requests have failed three times and, since the first failure, one day has passed when the service answers with a refusal or with content that cannot be used, or three days when the request itself fails. Then it is reported and given up on. Only the scan of its first failure holds the checkpoint, and not even that one when it listed more than 200 new records; after that the record is remembered by its identifier and the checkpoint moves on, so no scan has to read the same listing again because of it. A service that allows only so many requests per scan no longer makes a catch-up read the same records on every scan. A listing entry with no usable identifier holds the checkpoint for at most a day. A stored record the service no longer serves keeps its last known content and counts as checked, so a result that rests on it does not turn into `unknown`. A bad item in the package lookup is reported and no longer holds the listing checkpoint.
62
+ - One record that could not be read, or one failed package lookup, turned every version exclusion drawn from that source into `unknown`, with an alert, until the next clean scan. An exclusion now rests on its own advisory records: it holds while they were read in this scan or within the last two poll intervals, and becomes `unknown` only when one of them has not been read for longer. The gap is still reported. The cve.now receipt says with `package_results: complete` when everything for your packages was read.
63
+ - One failed cve.now package lookup ended the whole poll: no listing, no records, and the checkpoint held. A failed lookup is now reported and repeated on a later poll while the rest of the poll goes on.
64
+ - A listed cve.now record that was already stored and failed when read again held the checkpoint again; it is reported but not owed.
65
+ - A CVE cited by a stored news story that cve.now does not have was requested on every scan. It is now asked for once a day.
66
+ - Import warnings from SBOMs and lockfiles are limited to 200 single-line messages of at most 400 characters, with a count of the rest. (Lockfile warnings used to stop at 50 without a count.)
67
+ - `doctor` reports a Slack webhook address that delivery would refuse, and exits with status 2.
68
+ - A Slack request refused before any connection was made (the resolver answered with a private address) was recorded as an uncertain receipt and never retried. It is retried.
69
+ - A version cited from a range written with a hyphen ("versions 2.0-2.4") was refused. Either end of such a range is now a valid citation; a number joined to an identifier (`1.0.0-1`, `CVE-2026-40001`) is not.
70
+ - A verification model was not recognised as the analysis model when its address was written with a trailing dot on the host, doubled slashes, percent-encoding or different letter case.
71
+ - A few cve.now records whose requests kept failing (four in one batch, eight in a scan, or one answering "too many requests") ended every scan before the other records were read. Records whose requests failed are now asked for after the records that have not failed on later scans (owed new records before the stored records re-read in turn), until a request for them succeeds.
72
+ - A failed request for a stored cve.now record kept only for a product, a keyword or a citation withdrew every version exclusion drawn from cve.now and sent an alert. It no longer affects any exclusion.
73
+ - A stored cve.now record that the service files under a new identifier, with the old one as an alias, is kept current under both.
74
+ - A record given up on after three days of failed requests was reported as "could not be used"; it is now reported as "could not be read for three days and were given up on".
75
+ - Technology a story names as what something is built with ("built with React", "written in TypeScript", "Electron apps") no longer counts as naming that package.
76
+ - An SMTP address pointing at a service that is not SMTP (a mistyped port) recorded every alert as an uncertain receipt. Nothing was handed over, so it is retried.
77
+ - A CycloneDX document listing the same package twice without a reference of its own was rejected. It is imported once.
78
+ - `doctor` reports a heartbeat address the heartbeat would refuse, and exits with status 2.
79
+ - More than 1,000 npm package versions switched cve.now off on every scan, and the exclusions drawn from it then became urgent `unknown` results. The lookups now take turns over several scans, the one tried longest ago first, so every version is looked up in turn; the listing and the records are read on every scan.
80
+ - A version range in prose ("7.0.0 through 7.0.16") counted as a release of an npm package named `through`, `from` or `until`, which could send an urgent alert. Those words take a version only as `through@2.3` or `through v2.3`.
81
+ - A failed package lookup re-read its records without the matched version, so a finding that rested on the lookup flipped and alerted again. What an earlier lookup matched now stands until the lookup answers, and lookups that keep failing are sent after the others.
82
+ - Lookups that failed were sent again in their usual order, so four that kept failing could end the lookups of every second scan. Of the versions a scan looks up, those whose last lookup failed are now sent after the others.
83
+ - A long message could lose its `Affected item`, applicability and summary lines while keeping three long source links. Those lines now always stay; the links go first, the last first, and then the inventory notes.
84
+ - The fix line hid every shorter fixed version after one longer than 120 characters, and OSV and GitHub fixed versions were cut at 100 characters without a mark. Versions are stored whole; one too long to show is counted, and the shorter ones after it are shown.
85
+ - An npm package named like a joining word (`that`, `which`, `from`) counted as named in a list such as "the npm packages foo, that and bar". In a list such a name now has to be quoted.
86
+ - GitHub records were never re-read, so two poll intervals after one was first collected every exclusion resting on it became an urgent `unknown` alert while GitHub answered normally. A stored GitHub record for an inventory package that is not among the records modified since it was read is confirmed as current at each complete GitHub scan. A stored OSV record that OSV no longer serves keeps its last known content, as a cve.now record does. A GitHub checkpoint ahead of the clock no longer stops the source.
87
+ - An exclusion withdrawn only because its advisory evidence is out of date (an outage of more than two poll intervals) sent an urgent alert for every excluded version, on every outage. It now goes to the review digest; the source's own health finding reports the outage.
88
+ - With a service that allows only so many requests per poll, or fails now and then, owed cve.now records waited behind re-reads of records already stored and were given up on after one request or none. Listed records that are already stored are not read again, owed records come before the records re-read in turn, the ones tried least first, and a record is given up on only after three failed requests.
89
+ - A record named by a package lookup whose request failed was asked for again only when that lookup's turn came round, many polls later for large inventories. The lookups that named it are now sent first on the next poll.
90
+ - More than about 5,000 stored cve.now records for inventory packages stopped the listing from being read at all. At most 4,000 records other than new ones from the listing are read per poll (records named by the package lookups included), the stored ones longest unread first, so that 1,000 requests always stay for the listing.
91
+ - A record that gained a GHSA alias, or was re-filed under one, retired its finding and raised the same vulnerability again as a new one. An event keeps the identifier it was first reported under.
92
+ - Cutting a value could turn "@channels" into a bare "@channel…"; the mention break is now added after the cut, and a source link with a group mention in it is left out. Once the inventory notes gave way in a long message, a source link could come back; it no longer does, and the summary is cut as a last resort, so a message never exceeds one Slack section.
93
+ - A model's product or prerequisite claim was accepted when it was part of a word in the quote ("express" in "expressive-forms", "authenticated" in "unauthenticated"). It must now appear as whole words.
94
+ - Matching: "chalk, debug and 16 other npm packages" names them; "Send 2.5 BTC" is not a release of `send`; English words ending in -ied, -ier or -iest (`prettier`) count as English words; a Maven library is also matched by an artifact name that is not an English word (`jackson-databind`, `snakeyaml`). Comparing stored news with a large inventory looks up the words of a story first, which is faster (two to four times in measurements on synthetic inventories; there is no benchmark in the repository).
95
+ - A GitHub catch-up no longer stops stored records from being confirmed afterwards; records named by the package lookups no longer take the room kept for the listing; a stale exclusion goes to the digest also for an exploited or malicious advisory; stored OSV records are re-read only while their package is in the inventory; two separately reported events merged by one advisory keep each finding's identifier; a model claim must not be part of a longer name joined by `+`, `/`, `@` or `#` (a version after the name is allowed, see below), and a decomposed accent counts as the letter; characters that show as nothing no longer count against a length limit (a fixed version padded with them was cut short of its last digit); and a job taken back while it was being sent is tested to end as an uncertain receipt.
96
+ - One GitHub advisory that could not be read held the GitHub checkpoint for good: every later scan was partial, nothing was confirmed, and once the window held more than one scan reads, new advisories were missed. Such a record is now remembered by its identifier, as cve.now remembers the records it owes, and asked for again on later scans while the checkpoint moves on; only its own stored copy is withheld from confirmation. It is given up on after three failed reads in scans that read other records and a day after it was first met, and its stored copy is then never confirmed until it is read. A scan that can read nothing (a format outage) counts no attempt, and records that cannot be read count as progress through a backlog.
97
+ - Records named by the package lookups could still take all of a scan's requests, leaving none for new records from the listing. Everything other than new listed records now shares 4,000 requests, and a lookup whose records did not all fit is sent first on the next scan.
98
+ - A model claim could still be part of a longer name joined by a non-ASCII hyphen or a full-width mark ("Confluence" in "Confluence‑Cloud", "Notepad" in "Notepad++"), which could turn into a false urgent alert or a silent dismissal; claims and version citations now read the Unicode hyphens and full-width forms as their plain forms. A version written right next to Chinese, Japanese, Korean or Thai text, before or after it ("2.4.1以前", "版本2.4.1") was refused as a citation, and a name followed by its own version ("Apache/2.4.58", "lodash@4.17.20", "node-18") was refused as a product claim; both are accepted. A token after the hyphen that only starts with a digit ("vue-3d-model") and a name inside a path ("github.com/apache/struts") are still refused, and superscripts and circled digits are not read as the digits they resemble.
99
+ - A GitHub format outage now holds the checkpoint and counts no failed reads, so the whole window is listed again when it ends, instead of more than 2,000 records being given up on at once; once a record is read again by identifier, the listing is read again from the oldest still remembered; identifiers are requested in GitHub's own spelling; requests by identifier are limited to two per scan without a token and stop on a rate limit; a record given up on is never forgotten while its stored copy exists. A claim preceded by a single letter at the very start of a quote ("XStruts") was accepted as "Struts"; it is refused.
100
+ - A quote the model wrote itself, rather than one taken from a supplied excerpt, could begin or end inside a word and so support a fragment ("2.4.1" out of "12.4.1", "express" out of "expressive-forms"). Each quote is now read with the rest of the words it cuts from the evidence. A product followed by its version and a package revision or qualifier ("openssl-3.0.7-r0", "Tomcat-9.0.80-beta") is accepted; ":", "~" and look-alike dots, slashes and "@" join a name; a version ending in a dot is not cited by a longer one; `localhost.` is refused like `localhost`.
101
+ - The health check reported a running worker as failing two minutes after start, although the first scan takes 15 to 20 minutes: a worker that has not yet recorded a scan of its own is healthy for up to an hour. A failed request for a single GitHub record is reported instead of being swallowed. `--fixture` previews and `npm run demo` treat the synthetic records as read now, and a `--fixture --dry-run` preview also counts the inventory as current (a fixture scan that saves its results does not), so the documented preview keeps working with the fixed-date examples; the production example keeps the 7-day limit.
102
+ - A quote the model wrote itself was widened over the raw text, so a look-alike or invisible joiner ("Confluence‑Cloud" with a non-breaking hyphen, "2.4\u200b.1") still let a fragment through. Quotes are now read over the evidence itself, by whole characters. Letter releases and `.x` after a version are accepted ("openssl-1.1.1w", "node-18.x"); a package revision must look like one.
103
+ - With 2,000 remembered GitHub records and a long listing, the GitHub checkpoint could stop moving for good. Up to 10,000 records are now remembered; beyond that the ones first met more than a day ago are given up on first, so the checkpoint always moves. A format outage holds the checkpoint only while some of the unreadable records listed were first met within the last day. A version after a label colon ("Version:2.5.32") or at either end of a tilde range ("2.0.0~2.5.32", common in Chinese and Korean advisories) is now cited.
104
+ - A GitHub record given up on after a long partial format change was never asked for again: such records are now asked for again in turn when the request budget allows (see below), and found once GitHub serves them readably. A worker restarted after downtime is given an hour to catch up, counted from when catching up began, until it records a scan of its own.
105
+ - Model claims are now checked in the evidence text and must lie inside one of the model's quotes; a quote that begins or ends inside a word, an amount or a unit ("45" out of "45%", "8.0.3" out of "8.0.3㎳") or a claim next to a quote but outside it supports nothing. Small-form and other look-alike punctuation ("﹒", "﹢", "➕", "∖", "∶") joins a name or version, and any other mark or an apostrophe written straight between a name and more of a word does too (the punctuation of a sentence, brackets and quotation marks of any script such as "Intel(R)", "Struts(CVE-…)" and "Struts【CVE-…】", an ellipsis and a possessive "'s" do not). Quotes that meet in the evidence, or are apart only by spaces, count as one stretch, so a name split across two cited excerpts is still inside them. Version labels in Chinese, Japanese, Korean, Spanish, German, Portuguese and Russian ("版本:", "バージョン:", "버전:", "Versión:", "Versionen:", "Versão:", "Версия:") and "fixed in:" are read as labels; Docker tags ("nginx:1.25.3", as a product followed by its version; the version itself is not taken from a tag, which cannot be told from "timeout:2.5.32"), RHEL and Fedora revisions ("-12.el8_9", "-2.fc39", "8.7p1") and Debian revisions ("+deb12u5", "~jammy") follow a name as its own version. A property test checks that a cut quote never supports what the whole text does not, including amounts and look-alike characters.
106
+ - The restart grace in `health` let a worker that kept being restarted before finishing a scan look healthy, and the external heartbeat kept receiving success pings. The grace is now reported as `starting` (no ping is sent), and its hour is counted from when the worker began catching up, which a restart does not renew until a scan is recorded; only running time counts, so the time a worker was stopped does not use up the hour (after a crash, the minute after its last heartbeat counts as running), and a crash loop cannot renew it. Given-up GitHub records are asked for again in turn, one record with a stored copy and one other per scan when the budget allows, so neither kind can take every turn.
107
+ - Claims are read with one reading of the text everywhere (normalised, lower case, composed again, a final sigma as a sigma), so lowering the case cannot shift positions between finding a quote and checking a claim in it. Excerpts are no longer cut before a combining mark (also one outside the basic plane) or a Hangul vowel or final consonant written apart. The 20-character minimum of an excerpt is counted in characters, as the quote contract counts it (the 480 maximum stays in UTF-16 units), so an excerpt ending in emoji can be cited.
108
+ - A given-up GitHub record that GitHub listed again was remembered and still waited for a turn among those given up on, so it could be asked for twice in one run and its failed reads were never counted; it now leaves the given-up list. A catch-up start that is not a time string is ignored.
109
+ - A GitHub row with no usable `ghsa_id` could not be remembered, so the checkpoint moved past it and a newer version of a stored record could be lost while the stored copy was confirmed again. A row whose `ghsa_id` is missing or reshaped is now read by the identifier its own links end with. A row with no identifier at all is reported; stored records for the packages it names (normalised as stored claims are; any package, if it names none) read before the row was first seen and older than its update are not confirmed as current until each is read again by identifier, which scans do in turn with one request kept for them, and later scans list again from such a row for a day after its update, so one that regains its identifier is read (without a token, not for windows of more than 300 records); a listing that can read nothing while such a row was updated within the last day is a format outage. An answer to a request by identifier that carries no identifier is a failed read of the record asked for.
110
+ - A worker that died within seconds of each start could renew its catch-up grace, because its whole short life counted as downtime. Downtime now counts in full only after a clean stop; after a crash, the minute after the last heartbeat counts as running time.
111
+ - "American Express" and "Federal Express" no longer name the `express` library: a library written second in a sentence counts only after an article or a word of severity or novelty ("The", "New", "Critical") and before a word about software (such as "team", "library", "runner", "SDK", "patch"), possibly after a word saying what kind ("The Mocha test runner"); a server, app, application or client only after such a word ("The Puma web server"); or a flaw after up to three words naming its kind ("Critical Struts remote code execution flaw", "The Express XSS bug"). "Community", "components", "devs", "issues" and "security team/advisory/release/update/fix/patch" count only in a sentence that speaks of a library (a registry, an install command, "package", "library", "framework", "module", "plugin", "open source", "maintainers" or a version written as one: "v1.2", "version 1.2", "@1.2", "1.2.3"), or before a sentence that names a registry or an install command; a CVSS version in any common form, an IP address or a date with a four-digit year is not one; "e.g." does not end a sentence, "etc." and initials before a capital do, and a cue word joined by a hyphen counts only before a few suffixes ("plugin-based", "package-lock"), not in "npm-themed" or "package-delivery". "Users", "code", "servers", "updates", "exploits", "source" and "apps" alone no longer count. Every word, kind, cue and abbreviation is listed in `docs/configuration.md` (matching), as in `src/matching.ts`, including which capitalised forms are matched.
112
+ - A version qualifier after "+" or "~" in a model's product claim ("-1+deb12u5") could be read many ways, so a crafted article could make the claim check backtrack exponentially (CodeQL js/redos). A dot there is now followed only by digits or a commit hash, which keeps every real Debian, Ubuntu and git-snapshot suffix tested before.
113
+ - `releaseTag` treated a hyphen in build metadata (`1.0.0+build-5`) as a prerelease.
114
+ - The release check (`prepublishOnly`) had no test. Its checks moved into `releaseChecks` in `scripts/release-tag.mjs`; each refusal is tested, and the script itself is run in a throwaway git repository with a stand-in for npm.
115
+ - A cve.now package lookup that timed out or lost its connection ended the whole poll; only HTTP errors were tolerated. Every failed lookup is now reported and repeated on a later poll.
116
+ - A record owed through an outage could be given up on in a poll that read nothing, and lost without a report when the listing failed too. It is given up on only in a poll in which other records were read, and always reported.
117
+ - Model lists in a message (affected products, reported versions, prerequisites) were cut in the middle of an entry, and reasons after the fourth were dropped without a note. Entries are shown whole with a count of the rest, a cut value ends with "…", and every reason is shown unless the message is too long. A link with an invisible character is left out rather than shown as another address.
118
+ - The commonest words no longer count as named by "the X package" unless quoted or followed by the registry ("which package was affected", "the standard library"), the word "module" is not package context again, and an install command counts only for its own ecosystem.
119
+ - `npm run release` and the release check also refuse a scoped registry for `@shieldaai` configured in an `.npmrc`.
120
+ - A failed cve.now listing request discarded the records the exact-package lookup had named, and withdrew every version exclusion drawn from cve.now. The records are now read and assessed, exclusions hold, and the listing failure is reported.
121
+ - A news story containing `CVE-` followed by an over-long number made every cve.now scan fail for as long as the story was stored.
122
+ - A cve.now checkpoint ahead of the clock failed every scan with a request to reset it. It is treated like a new installation's.
123
+ - A stored cve.now record whose new revision was stamped ahead of the clock was read with an older timestamp and then dropped as outdated, so a widened affected range did not reach the finding. What cve.now serves now is taken as at least as new as the stored revision, also when the service moves a modification time back.
124
+ - A stored cve.now record about one of your packages that the service serves in a form that cannot be used is reported, and no longer counts as checked.
125
+ - A configuration with only `vendor_feeds` was reported as having every source disabled.
126
+ - A version cited with a "v" ("v2.4.1"), from a range of whole numbers ("versions 12-16"), from a list ("2.4.1, 2.4.2") or after a name ("exampledb2-2.4.52", "node-18") was refused. A number that is visibly part of something else was accepted: "4" in "4,200", "$5", "5€", "45%", "10:30", "14/11/2026", "3/4", "443/tcp", "example.com:443" or "CVSS:3.1", and "2.4.1" in "2.4.1-rc.1", "2.4.1.RELEASE" or "1.2" in "1.2.x". Hyphens, en dashes and minus signs count as hyphens ("CVE‑2026‑40001" with non-breaking hyphens), in the quote and in the version the model copied alike; an em dash is punctuation. A file name is not a qualifier: "2.17.1" is cited by "log4j-2.17.1.jar". The check is about how the text is written: a number that stands alone ("30 days", a year, "port 8080") cannot be told from a version and is still accepted.
127
+ - A verification model was not recognised as the analysis model through a `models/` or `library/` prefix, a `:latest` suffix, or another way of writing this machine (`localhost`, `127.0.0.1`, `[::1]`, `0.0.0.0`, a `.localhost` name). Two different endpoints of one service (for example the Responses and Chat Completions addresses of one provider) are still taken as different. The comparison ignores letter case in the path and any query string.
128
+ - Requests identify themselves as `Shielda-Security-Watch/1.0` (was `/0.1`).
129
+ - A message cut could split an emoji in two, and the 2,900-character limit could remove the `Rule:` line and the source links. A message that is too long now loses whole lines from the end of its body (reasons first, then the model's analysis) and says `(Message shortened; run explain for the full finding.)`; the fix, the rule and the time are always shown whole, a source link is shown whole or left out, and a message that fits is not marked. A fix line with many fixed versions shows as many whole versions as fit and says how many more there are. The summary has its own `Summary:` label. A run of blank characters inside a value (spaces of any kind, including ones separated by any character that shows as nothing, and fillers that show as a blank) is reduced to one space, and half of a surrogate pair is replaced. A source link is shown exactly as it is, and one with a group mention in it is left out; a link longer than 320 characters is left out instead of being cut. The mention guard now applies only to group mentions (`@channel`, `@here`, `@everyone`, `@group`): `express@4.21.2` in an alert can be copied and searched for.
130
+ - Capitalised RubyGems, Hex and Pub names typed by hand are pointed out like npm ones; at most 200 name notices are listed, with a count of the rest. A library list with thousands of repeated entries no longer takes seconds to load.
131
+ - The deprecated IPv4-compatible IPv6 form (`::127.0.0.1`) counted as a public destination.
132
+ - After a long stop, cve.now could list more than one scan pages through, and every later scan failed with "pagination limit reached". One scan now pages through about 60,000 records (some three months); beyond that it reads what was listed, reports the period it could not read, and moves on.
133
+ - CVEs cited by stored news were re-read from cve.now at every scan without limit. Once stored they take turns with the other tracked records. Requests left out by the 5,000-per-scan limit are reported as incomplete coverage instead of being dropped silently.
134
+ - Package names that are English words matched unrelated advisory and news text (`send`, `buffer`, `request`, and equally `entities`, `scheduler`, `immediate`, `address`). A name that is an English word, a term of security writing or a given name now needs a story about packages, a named release (`send@0.19.0`, `Requests 2.32.0`, `Rails 7.2`, `Next.js`) or, for a word that is not among the commonest, to be written as a name ("a flaw in Express lets", "Rails releases patches"). A bare decimal ("send 1.5 million requests"), an IP address and a lower-case file name (`config.js`) are not a release. A name that is not an English word (`axios`, `lodash`, `django`, `webpack`) matches wherever it is written; a hyphenated name that prose writes with the hyphen (`one-time`, `stack-trace`) counts as an English word, while a library's compound (`body-parser`) does not. English words are recognised with a built-in filter of about 197,000 dictionary words and given names from Webster's Second International (1934, copyright lapsed) and the BSD name list; the rules and their limits are in [the configuration guide](docs/configuration.md#sources-and-coverage). The filter adds about 270 kB to the packed package.
135
+ - Comparing a large inventory with a large evidence store blocked the process for many seconds. A story that cites many advisories is compared with each component once, and a story is linked to the first 100 identifiers it cites.
136
+
137
+ ### Fixed: delivery, storage and import
138
+
139
+ - An SMTP address with an unencoded `%` was recorded as an uncertain receipt. Failures that provably happen before the message is handed over (connection, TLS, greeting, a dropped session before `MAIL FROM`) are retried instead of being marked uncertain. A rejected sign-in (response code 535) is a configuration fault and fails at once; a temporary refusal (4xx) is retried. Once `MAIL FROM` has been written, a dropped connection or timeout is recorded as uncertain and never retried automatically.
140
+ - Text from an advisory (title, fixed version), a model or the inventory could contain a line break and so add forged `Rule:`, `Finding:` or `Where to look:` lines to a notification. Every value is now placed on one line.
141
+ - `backup --output` left a file at the destination when verification failed.
142
+ - Two processes opening an old database at the same moment could leave it unopenable.
143
+ - A job superseded while it was being sent stayed `pending` after a failed attempt.
144
+ - A send displaced by a second database handle stopped the worker.
145
+ - A legacy npm name (`JSONStream`) or one unreadable lockfile or SBOM entry rejected the whole inventory; CycloneDX documents without `dependsOn`, with an unencoded npm scope, with `v`-prefixed Go versions, with an empty `version`, with an upper-case package type (`pkg:NPM/…`), or with a Python version written two equal ways (`1.0` and `1.0.0`) were rejected. A component with an unreadable package URL or a non-text version is left out with a warning. Two genuinely different versions for one component, duplicate references and malformed hashes still reject the document.
146
+ - A version citation that only matched a digit inside another number (`4` inside `4.2` or a CVE number) satisfied model validation; news evidence without a content status was treated as a fully read article.
147
+ - `doctor` printed feed addresses after variable substitution, and exited with status 0 while reporting an unusable SMTP address.
148
+ - With `models` left out of the configuration, `daily_token_limit` defaulted to 100,000 instead of the documented 1,000,000.
149
+ - A setup without an AI model reported every scan as degraded: exit code 2, a standing health finding and alert, and withheld external heartbeat pings. "AI is disabled" is now a `notices` entry in the scan report.
150
+
151
+ ### Changed
152
+
153
+ - The published `Store` type no longer declares the worker's internal methods (`claimDue`, `completeJob`, `recoverSending`, `setMeta`, `reserveBudget` and others). They still exist at run time and are not part of the public API. `ModelAnalyzer` accepts the published `Store`, or a caller's own state described by the exported type `ModelState`.
154
+ - A replacement `emailSender` can no longer signal "nothing was sent" through an error's `code` or `command`: such labels do not prove it. Its failures are retried only on an SMTP 4xx response code, recorded as failed on a 5xx code, and otherwise recorded as uncertain.
155
+ - Publishing goes through `npm run release`, which chooses the tag from the version, accepts only `--dry-run` and `--otp=CODE`, and refuses to start when npm is set to ignore scripts or to use another registry. A bare `npm publish` is refused, because `npm publish --tag latest` cannot be told apart from it inside a lifecycle script. The release check also refuses a package that would contain a file that is not in git. These checks guard against mistakes; `npm publish --ignore-scripts` skips them, as it skips every lifecycle script.
156
+ - Types are exported by name instead of `export *`.
157
+ - Dependency: `fast-xml-parser` 5.12.1 (GHSA-474x-hrwr-fgx4).
158
+
159
+ ### Not verified in this release
160
+
161
+ - No human-labelled evaluation: the prepared 120-case pilot has not been reviewed.
162
+ - No representative deployment period, and no real Slack or email message has been sent.
163
+ - Hosted CI passed on 4e4e063 (pull request #13: Ubuntu with Node 24 and 26, macOS with Node 26, the packed consumer on Node 24.10.0, dependency review and CodeQL). Windows is untested.
164
+ - Only OpenAI and Anthropic were ever checked against live APIs, on 2026-10-24; the other provider profiles are covered by simulated responses.
165
+ - The cve.now listing order (publication date, newest first) and its `limit` parameter were checked against the live service on 2026-11-14 with a handful of requests. How often the service ingests a record more than a week after its publication date is not known.
166
+ - `npm run release -- --dry-run` was rehearsed on 2026-11-15 on commit 3128e66 (tag `latest`, 110 files, 576 kB packed, nothing uploaded); the commit that records it changes only this changelog. A real publish has not been run.
167
+
168
+ ## 0.1.0-alpha.0
169
+
170
+ First public alpha: inventories for 12 ecosystems, cve.now, OSV, GitHub, KEV and feed sources, optional model analysis, Slack and SMTP delivery from one host.
@@ -0,0 +1,92 @@
1
+ # Contributing
2
+
3
+ Security Watch uses TypeScript and requires Node.js 24.10 or newer. Keep source evidence, version applicability, contextual priority and notification policy separate when adding features.
4
+
5
+ ## Local development
6
+
7
+ ```sh
8
+ npm ci
9
+ npm run check
10
+ ```
11
+
12
+ `npm run build` cleans generated `dist` output and compiles with strict unused-code checks. `npm test` builds and runs the Node test suite. `npm run check` also checks formatting and verifies the packed package in a clean consumer. Use `npm run format` for consistent formatting; `npm pack` performs a fresh build. Tests should use synthetic data and injected HTTP/email clients; they must not require production model credentials, bill a provider or send Slack/email messages.
13
+
14
+ For an offline synthetic demonstration:
15
+
16
+ ```sh
17
+ npm run demo
18
+ ```
19
+
20
+ The demo loads `examples/systems.example.yaml` and `examples/advisories.json`, refreshes the synthetic timestamps, and makes no network, model or notification requests. For the fixture CLI itself, use `node dist/cli.js scan --config examples/security-watch.example.yaml --fixture examples/advisories.json --dry-run` after building. Dry runs disable models; tests of actual provider calls must retain budget accounting.
21
+
22
+ Do not commit `node_modules`, `dist`, generated tarballs, local configuration, real inventories, credentials or SQLite files. The project ignores common local paths, but inspect your diff before committing.
23
+
24
+ ## Live provider checks
25
+
26
+ The regular suite uses simulated provider responses, including real loopback HTTP tests for every provider profile. Live checks are separate and may incur provider charges. They send a short fictional bulletin through the production request, parsing and evidence-validation code, with no private inventory, tools or notifications.
27
+
28
+ Create a private `.env.live` file with the keys for the providers you want to test. Add exact model IDs available to your account:
29
+
30
+ ```dotenv
31
+ OPENAI_API_KEY=your-key
32
+ ANTHROPIC_API_KEY=your-key
33
+ SECURITY_WATCH_SMOKE_OPENAI_MODEL=your-openai-model-id
34
+ SECURITY_WATCH_SMOKE_ANTHROPIC_MODEL=your-claude-model-id
35
+ ```
36
+
37
+ ```sh
38
+ chmod 600 .env.live
39
+ npm run build
40
+ node --env-file=.env.live scripts/check-models.mjs --live --providers openai,anthropic
41
+ ```
42
+
43
+ If the variables are already exported, use `npm run check:models -- --live --providers openai,anthropic`. Omitting `--live` makes no requests. Each selected provider gets at most one request per invocation, with no automatic retry, a 30-second timeout and 1,024 output tokens by default. `--timeout-seconds` accepts 1–60 and `--max-output-tokens` accepts 128–2,048. Reservations are held in memory for this one-shot check; it does not use or change a monitor's persisted daily budget.
44
+
45
+ For other providers, use `SECURITY_WATCH_SMOKE_<PROVIDER>_MODEL`, replacing hyphens in the uppercase provider ID with underscores. `_ENDPOINT` selects a full endpoint, `_OUTPUT_FORMAT` selects an explicit format, and `_ALLOW_PRIVATE=1` permits an operator-selected private endpoint. Local profiles require an endpoint. Credential names come from `security-watch providers`.
46
+
47
+ The result reports passed, failed and skipped providers without raw model output or credentials. A pass confirms that one response met the application's schema and evidence checks; it does not measure general model accuracy. Exit status is 0 when at least one provider passes and none fail, 1 for failures, 2 for invalid options, and 3 when every provider is skipped. Missing credentials or configuration are reported as skips. Do not enable paid checks in routine CI.
48
+
49
+ ## Code layout
50
+
51
+ | Area | Responsibility |
52
+ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
53
+ | `src/config.ts`, `src/inventory.ts` | Configuration validation, path resolution and metadata-only inventory import |
54
+ | `src/http.ts`, `src/sources.ts`, `src/cve-now.ts` | Network restrictions, source collection, checkpoints and incomplete-source reporting |
55
+ | `src/assessment.ts` | Identity/version evidence, advisory grouping, per-deployment assessment and deterministic policy |
56
+ | `src/models.ts`, `src/providers.ts` | Provider protocols, bounded requests, evidence attribution, budgets and visible model failure |
57
+ | `src/store.ts`, `src/delivery.ts` | Transactional history/outbox, deduplication, acknowledgement, suppression and delivery status |
58
+ | `src/engine.ts`, `src/cli.ts` | Orchestration, persistent monitoring, useful health status and installation/operator workflows |
59
+
60
+ Keep provider and source schemas explicit. Do not accept a new service's response as trustworthy merely because it is syntactically valid. Unsupported affected-range formats must remain unknown. New inventory adapters must describe what their data actually establishes about deployment.
61
+
62
+ `src/word-filter.ts` is generated: a filter of English dictionary words that the news matcher uses to tell `entities` from `axios`. Regenerate it with `node scripts/build-word-filter.mjs` on macOS or a BSD, where `/usr/share/dict/web2` and `/usr/share/dict/propernames` exist; the output is committed and no build needs the word lists. Words of security writing that the 1934 dictionary lacks, the commonest words and the well-known library names are lists in `src/everyday-words.ts`.
63
+
64
+ ## Pull requests
65
+
66
+ For behavioral changes, include a concise reproduction, before/after behavior, relevant tests and any change to coverage or privacy. Tests should exercise outcomes rather than mirror implementation details.
67
+
68
+ `main` and release branches require a pull request, resolved review conversations and passing CI against the latest base branch, including CodeQL. A sole maintainer may merge their own checked pull request; a second person's approval is not required. Direct pushes, force pushes, deletion and administrator bypass are blocked.
69
+
70
+ CI checks out source without saving its GitHub token and installs dependencies without lifecycle scripts. Pull requests also receive a dependency review. The CodeQL workflow scans TypeScript, JavaScript and GitHub Actions without building the project; Dependabot checks npm packages and pinned Actions weekly. New workflow checks must pass on GitHub before they become required merge checks.
71
+
72
+ Protect these invariants:
73
+
74
+ 1. Source-critical library/product findings cannot disappear because a model downgrades them or is unavailable.
75
+ 2. Missing configuration, stale versions, unsupported backports and no advisory matches never produce an unsupported safe result.
76
+ 3. Deployment-specific affected/fixed outcomes remain distinct; articles about multiple vulnerabilities must not merge unrelated advisories.
77
+ 4. Older source revisions cannot undo newer withdrawals or version evidence. Inventory changes reassess stored evidence.
78
+ 5. Malicious article/model text cannot change recipients, use tools or cause arbitrary network requests.
79
+ 6. Save findings and delivery jobs in the same transaction. If delivery may have succeeded, record it as uncertain and require a receipt check before retrying.
80
+ 7. Reserve model budget before each call, including verification. Restarting the process or receiving an error must not reset the budget.
81
+
82
+ Use fixture-based affected/fixed pairs, conflicting sources, malformed input, source/model failures and delivery interruption where relevant. Never publish real private inventory or a working credential in a test fixture.
83
+
84
+ ## Releases
85
+
86
+ The package is `@shieldaai/security-watch`. Stable versions publish under `latest` and prereleases (release candidates) under `next`. The one supported publish command is `npm run release` (rehearse with `npm run release -- --dry-run`): it chooses the tag from the version and passes it to `npm publish` explicitly. Do not run `npm publish` yourself and do not pass `--tag`. npm hands a command-line option to lifecycle scripts only when it differs from the default, so `prepublishOnly` cannot tell `npm publish --tag latest` from a bare `npm publish`, while npm lets that option override `publishConfig.tag`. `prepublishOnly` therefore refuses a publish that does not carry the tag statement `npm run release` sets, and any tag that is wrong for the version. `npm run release` accepts only `--dry-run` and `--otp=CODE`. These checks prevent mistakes; they are lifecycle scripts, so `npm publish --ignore-scripts` or setting `SECURITY_WATCH_RELEASE_TAG` by hand bypasses them, and neither is ever the right thing to do. `npm run release` and the release check refuse to run when npm is set to ignore scripts or to use another registry (`--ignore-scripts` or `--registry` typed before the `--`, a line in `.npmrc`, or an `npm_config_` environment variable), including a scoped `@shieldaai:registry` line in `.npmrc`. A scoped registry typed as an option before the `--` is not passed on by npm at all, so the publish goes to the official registry. The release check also refuses a package that would contain a file that is not in git, such as an ignored file left in `docs/` or `examples/`. The version is defined in `package.json`; `test/public-api.test.mjs` checks that the lockfile, `compose.yaml`, `CHANGELOG.md`, the README, `docs/offline-advisory-preview.md` and `scripts/check-docker.mjs` agree with it and that the exported names match `scripts/public-api.json`. A change to that list is a compatibility decision: record it in the changelog and follow the [compatibility policy](docs/compatibility.md). Before publishing, commit the reviewed changes, run `npm run check`, and inspect the output of `npm pack --dry-run`. The check command installs the tarball in a clean consumer and verifies the CLI, types and runtime exports. `prepublishOnly` repeats the checks and requires a clean checkout.
87
+
88
+ Only repository administrators can create `v*` release tags. These tags cannot be changed or deleted, including by administrators.
89
+
90
+ Update package metadata, CLI version output, the lockfile and release documentation together. Release notes should name the runtimes and provider protocols tested, and distinguish mocked checks from live integrations. Record any checks that could not run.
91
+
92
+ Security-sensitive reports should follow [SECURITY.md](SECURITY.md) rather than a public issue containing exploit details or secrets. Contributions use the repository's Apache-2.0 license.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 ShieldaAI contributors
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.