Repository navigation
fix: close the ICM onboarding findings - #17
Merged
Merged
Conversation
Resolves the advisories that need no range change: axios 1.20.0 (runtime), handlebars, brace-expansion and the rest of the development tree. npm audit goes from 37 vulnerabilities (1 critical, 31 high, 5 moderate) to 34 (29 high, 5 moderate), all of them braces and sprintf-js under jest 29. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
braces <= 3.0.3 (GHSA-vfj7-8cjw-p6xm, high) has no patched release; jest 29 reaches it through micromatch, jest 30 does not. Development dependencies only: jest ^29.7.0 -> ^30.5.2, jest-util ^29.7.0 -> ^30.5.1, @types/jest ^29.5.14 -> ^30.0.0. ts-jest 29.4 already accepts jest 30. All 99 tests pass and coverage stays above the floor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sprintf-js <= 1.1.3 (GHSA-hp3w-g68c-fv3c, moderate) has no patched release. The only path to it is jest's coverage instrumentation: babel-plugin-istanbul -> @istanbuljs/load-nyc-config -> js-yaml 3 -> argparse 1 -> sprintf-js. load-nyc-config calls only js-yaml's load(), which js-yaml 4 keeps (safe by default), so an override to js-yaml ^4.1.0 removes argparse 1 and sprintf-js. Development tree only. npm audit --audit-level=moderate now reports 0 vulnerabilities. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
socket.io-client is an optional peer dependency, but src/index.ts
re-exported WebSocketClient and src/ws-client.ts imported
socket.io-client at module load, so require('@alteriom/webhook-client')
failed with MODULE_NOT_FOUND for a REST-only consumer.
WebSocketClient now imports only the Socket type statically and
requires socket.io-client inside connect(); without it, connect()
throws an error that says to install it. The root export and every
existing import path are unchanged.
tests/optional-peer.test.ts loads src/index in a plain Node process
where socket.io-client cannot be resolved (fails before this change
with Cannot find module 'socket.io-client'), and checks connect()'s
error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An 18-line patch committed with the first release. Nothing reads it: no script, config, test or document references it, tsc compiles only .ts files, and it is not in the published files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sparck75
marked this pull request as ready for review
October 15, 2026 17:23
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
sparck75
added a commit
that referenced
this pull request
Oct 15, 2026
#17 merged before this branch, so main was merged in and the facts it listed under "ICM facts after #16 merges" are updated: the optional peer now loads on connect() (gotchas, architecture), tests/optional-peer.test.ts is where that is tested, the audit gotcha names the jest 30 move and the js-yaml override, and the changelog gotcha names the [Unreleased] section. npm audit at moderate is clean on this tree; 101 tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sparck75
added a commit
that referenced
this pull request
Oct 15, 2026
* docs(icm): make webhook-client ICM-ready AGENTS.md becomes the entry (routes, pipelines, rules) with a one-line CLAUDE.md pointer; the repository had no instruction file before. .github/icm/ adds the fix, endpoint and release pipelines and five shared facts that point at the owning files. The ICM check job and generator are vendored from standard 1.1.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(icm): repoint the facts #17 changed #17 merged before this branch, so main was merged in and the facts it listed under "ICM facts after #16 merges" are updated: the optional peer now loads on connect() (gotchas, architecture), tests/optional-peer.test.ts is where that is tested, the audit gotcha names the jest 30 move and the js-yaml override, and the changelog gotcha names the [Unreleased] section. npm audit at moderate is clean on this tree; 101 tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
sparck75
added a commit
to Alteriom/repository-metadata-manager
that referenced
this pull request
Oct 15, 2026
npm audit at moderate fails the required Test & Lint and Security Summary checks, on main since 2026-10-13: jest 30's babel-plugin-istanbul -> @istanbuljs/load-nyc-config -> js-yaml 3 -> argparse -> sprintf-js, which has no patched release. js-yaml 4 drops argparse 1 and sprintf-js; load-nyc-config only calls yaml.load. Same override as Alteriom/webhook-client#17. npm audit: 0 vulnerabilities; 175 tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
This closes the clear defects the ICM onboarding (#16) found but did not fix. The owner decided on 2026-10-15 to fix them in one PR per repository. Anything that needs the owner's decision is listed below and left unchanged. The PR is based on
mainat3e2e8fe. #16 is not merged yet, so this PR touches no.github/icm/file (see "ICM facts after #16 merges").Nothing here publishes: no version bump, no tag.
package.json's version stays1.2.0.Findings
Security Auditis red:npm audit --audit-level=moderateonmain's lockfile reports 37 vulnerabilities (1 critical, 31 high, 5 moderate), including runtime axios <= 1.19.0. The advisories were published aftermain's last green run.found 0 vulnerabilities.socket.io-client, which is declared an optional peer.src/index.ts:126re-exportsWebSocketClient, andsrc/ws-client.ts:1importssocket.io-clientwhen the module loads, so a REST-only consumer getsMODULE_NOT_FOUND.socket.io-clientis now loaded insideconnect(). Existing imports are unchanged. Test:tests/optional-peer.test.ts.src/client.ts.patchlistAllcode it patches no longer exists insrc/client.ts.v1.1.0andv1.2.0point at feature-branch commits (392a6c3,fc6ab66), not atmainCHANGELOG.mdstops at 1.1.0## [Unreleased]section now records only this PR's changes, which is true and trivial.subscription_id:unknownwhen there is no aggregate (src/receiver.ts:80)1. Advisories (route
advisory)Reproduction:
npm ci && npm audit --audit-level=moderateon3e2e8fereports37 vulnerabilities (5 moderate, 31 high, 1 critical). The packages are axios, handlebars (critical, through ts-jest), brace-expansion, braces and sprintf-js.41f3f0erunsnpm audit fixwithin the declared ranges. It changes only the lockfile. It resolves axios 1.20.0 (runtime), handlebars 4.7.10, brace-expansion and the rest. That leaves 34 vulnerabilities, all from two packages:braces <= 3.0.3(GHSA-vfj7-8cjw-p6xm, high): no patched release exists (3.0.3 is the latest). jest 29 reaches it throughmicromatch.sprintf-js <= 1.1.3(GHSA-hp3w-g68c-fv3c, moderate): no patched release exists. It is reached only through jest's coverage instrumentation:babel-plugin-istanbul→@istanbuljs/load-nyc-config→js-yaml@3→argparse@1→sprintf-js.584ea64raises three ranges, all development-only, because braces has no fixed version and jest 30 no longer depends on it:jest^29.7.0→^30.5.2jest-util^29.7.0→^30.5.1@types/jest^29.5.14→^30.0.0ts-jest29.4 already accepts jest 30, so its range stays. All tests pass and coverage stays above the floor.c2ea5a7adds anoverridesentry:@istanbuljs/load-nyc-config→js-yaml ^4.1.0. Even jest 30 still reaches sprintf-js (babel-plugin-istanbul@8keepsload-nyc-config@1.1.0, which pins js-yaml 3).load-nyc-configcalls onlyjs-yaml.load()(index.js:80), and js-yaml 4 keeps that call, safe by default. With the override,argparse@1andsprintf-jsleave the tree. This also affects the development tree only.The runtime range for
axiosstays^1.7.9. A fresh consumer install already resolves 1.20.0. Raising the floor would stop a consumer's old lockfile from keeping a vulnerable axios, but it changes what this package declares, so it is listed for the owner.2. The optional peer
Reproduction, before the fix:
3e2e8fe, packed and installed into an empty project, so onlyaxiosandzodare present:node -e "require('@alteriom/webhook-client')"fails withError: Cannot find module 'socket.io-client'.npx jest tests/optional-peer.test.tsagainst the oldsrc/ws-client.tsfails both tests withCannot find module 'socket.io-client', and the stack ends atsrc/ws-client.ts:1:1←src/index.ts:126.The fix, in
src/ws-client.ts:Sockettype is imported statically. TypeScript erases it, so no runtimerequireremains.loadSocketIo()requiressocket.io-clienton the firstconnect().socket.io-clientitself cannot be found,connect()throwsWebSocketClient needs the optional peer dependency socket.io-client: npm install socket.io-client. Any other load error is re-thrown unchanged.The other option was a separate subpath export (
@alteriom/webhook-client/websocket). I did not choose it: it would removeWebSocketClientfrom the root, which breaks every currentimport { WebSocketClient } from '@alteriom/webhook-client'. The lazy require keeps the root export, the constructor,connect()'s signature (still synchronous) and the declaration files. The emitteddist/ws-client.d.tsholds nosocket.io-clientreference. When the peer is installed, behaviour does not change.The test,
tests/optional-peer.test.ts:src/indexin a plain Node process (ts-node, transpile-only), where resolvingsocket.io-clientfails as it does for a consumer. It runs outside jest's module registry and outside coverage. It asserts that the REST client, receiver, adapters andWebSocketClientall load.jest.doMockthrowingMODULE_NOT_FOUND) checksconnect()'s error.src/guards.tsandsrc/adapters.ts, which no suite loads today, into the coverage report. Becauserootsistests/, unloaded files are not counted. Global branch coverage would then fall to 49.8%, under the 54% floor, for reasons unrelated to this fix.After the fix, the packed build installed without the peer gives
root loaded: function function, andconnect()throws the message above. Withsocket.io-client@4installed,connect()opens a socket as before: against a closed local port it emitserrorwithxhr poll error.README.mdalready says "REST-only consumers don't need it", and that is now true, so it is unchanged.Credentials
None found. The onboarding found none either: the secret-looking strings in
tests/andREADME.mdare placeholders.Checks run (locally, Node 24 / npm 11, after a clean
npm ci)npm audit --audit-level=moderatefound 0 vulnerabilities(was 37)npm test -- --coveragenpm run lintanywarningsnpm run builddist/108,389 bytes, under the 110 KB limit inci.ymlnpm pack --dry-rundist/+ README + LICENSEnpm ls --allCI on this PR (Node 22, head
314bac8): Lint, Test (22) (6 suites, 101 tests), Build (bundle 108,389 bytes), Security Audit (found 0 vulnerabilities), CodeQL and Analyze all pass.Left for the owner
v1.1.0andv1.2.0are not onmain. Nothing is broken, and moving a published tag would change what it names. Options: (a) leave them and tag future versions onmainafter the merge, as ICM: make webhook-client ICM-ready #16'srelease.mdsays; (b) re-point them. Recommendation: (a).CHANGELOG.mdhas no 1.2.0 section, and its 1.1.0 entry omits AgentSubscriptions (feat: v1.1.0 — AgentSubscriptions client + fix delivery_mode types (#9, #10) #11). Options: (a) back-fill both from feat: v1.1.0 — AgentSubscriptions client + fix delivery_mode types (#9, #10) #11 and feat: v1.2.0 — agentSubscriptions.poll() helper for on_demand mode #12 at the next release; (b) leave the history as is. Recommendation: (a), in the next release PR, because that release needs a changelog edit anyway. This PR only adds[Unreleased]for its own changes.subscription_id:unknown(src/receiver.ts:80): with no aggregate, two different signed deliveries to one subscription count as duplicates. The Python SDK does the same (ICM: make alteriom-webhook-client-python ICM-ready alteriom-webhook-client-python#3), so this is a design shared by both SDKs. Options: key on a delivery id if the connector sends one, or skip duplicate detection when there is no aggregate. Recommendation: decide it once for both SDKs, from what the connector sends.axiosfrom^1.7.9to^1.20.0makes every consumer resolve a patched axios, even one whose lockfile pins an older 1.x. Recommendation: do it in the next release (a patch-level change for consumers).ICM facts after #16 merges
#16 adds
.github/icm/, which is not onmainyet, so these fact updates wait for its merge. Each getsverified_commitset to the new tip:_shared/gotchas.md"The optional peer is loaded by the package root" becomes false: the root no longer needs the peer. Remove the section, or reduce it to "loaded onconnect()", and repointsrc/ws-client.ts:1._shared/architecture.md:18citessrc/ws-client.tswrappingsocket.io-client(still true); add "loaded on firstconnect()"._shared/build-and-test.md"Where a test belongs" should listtests/optional-peer.test.ts. "Audit at moderate fails CI" ingotchas.mdshould mention theoverridesentry._shared/gotchas.md"The changelog lags the tags": still true for 1.2.0; mention the[Unreleased]section.🤖 Generated with Claude Code