Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs: correct the patch counts and bind them to the scripts directory

Yudhi Armyndharis845e0804daed
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 27d0fb08e..5ce59b8d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
+- `docs/29`'s architecture diagram counted four whatsapp-web.js patches and one Baileys patch while this release shipped a fifth and a second, and `πŸ”§β·` marked no cell, so the three whatsapp-web.js participant writes read as working against a stock library. The patch counts are now derived from `scripts/` by `docs-29-counts.spec.ts`, which bound only the interface figures before. `docs/09` Β§9.6 also omitted the two gates added to CI and described the release workflow as a lighter gate than the one it now runs.
- `check:sdk-coverage` no longer passes when a client drops a route entirely: a wildcard the client built for a path parameter β€” `contacts/${contactId}` β€” was read as a one-builder family and stood in for every concrete sibling under it, so removing `contacts/blocked` from a client left the gate green. A wildcard now counts as a family only where the contract publishes no route of that shape.
- The Go SDK no longer approves or rejects every pending join request when handed an empty participant list: `omitempty` dropped the empty slice, so `[]string{}` reached the gateway as the bodyless "act on every request" rather than the `400` the other four clients receive. A nil slice still means every request.
- Approving or rejecting a join request by bare phone number works on the whatsapp-web.js engine instead of answering `500`: the participant guard accepts a bare number and the three other participant writes qualify it, but these two routes handed it to the engine unqualified, so it reached the page as an unaddressable id. The same request already worked on Baileys. Refs #1220.
diff --git a/docs/09-testing-strategy.md b/docs/09-testing-strategy.md
index d60a24625..31b69a89a 100644
--- a/docs/09-testing-strategy.md
+++ b/docs/09-testing-strategy.md
@@ -234,17 +234,17 @@ on broad integration coverage.
Main CI is defined in `.github/workflows/ci.yml`.
-| Job | Checks |
-| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `lint` | backend ESLint, full-program TypeScript check, formatting, version consistency, .dockerignore context, OpenAPI snapshot, SDK routes and webhook events against the contract, SDK docs against the shipped client surface |
-| `audit` | dependency security audit |
-| `test` | backend coverage run, script unit tests (node:test), e2e smoke tests, Codecov upload |
-| `test-postgres` | real PostgreSQL 16 service, backend build, migration smoke, and PostgreSQL FTS provider spec |
-| `dashboard` | dashboard install, lint, formatting, type-check, i18n parity, build, unit tests |
-| `scripts-smoke` | shellcheck on `docker-entrypoint.sh` and every `scripts/*.sh`, plus the backup/restore smoke test |
-| `chart` | helm lint, helm template with default and fully-toggled values, kubeconform on both renders, actionlint on the workflows |
-| `build` | backend build after lint/audit/test/dashboard/scripts-smoke/chart jobs pass |
-| `docker` | multi-arch Docker build on pushes and pull requests; publishes to GHCR only on push, so fork pull requests validate both architectures without publishing |
+| Job | Checks |
+| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `lint` | backend ESLint, full-program TypeScript check, formatting, version consistency, .dockerignore context, OpenAPI snapshot, SDK routes and webhook events against the contract, contract coverage per SDK, SDK docs against the shipped client surface |
+| `audit` | dependency security audit |
+| `test` | backend coverage run, script unit tests (node:test), e2e smoke tests, Codecov upload |
+| `test-postgres` | real PostgreSQL 16 service, backend build, migration smoke, and PostgreSQL FTS provider spec |
+| `dashboard` | dashboard install, lint, formatting, type-check, i18n parity, build, unit tests |
+| `scripts-smoke` | shellcheck on `docker-entrypoint.sh` and every `scripts/*.sh`, plus the backup/restore smoke test |
+| `chart` | helm lint, helm template with default and fully-toggled values, kubeconform on both renders, the rendered-behaviour check, actionlint on the workflows |
+| `build` | backend build after lint/audit/test/dashboard/scripts-smoke/chart jobs pass |
+| `docker` | multi-arch Docker build on pushes and pull requests; publishes to GHCR only on push, so fork pull requests validate both architectures without publishing |
SDK CI is defined in `.github/workflows/sdk-ci.yml` and is path-filtered to SDK sources plus server
contract surfaces that SDKs mirror (`src/**/dto/**`, `src/**/*.controller.ts`, `src/**/*.service.ts`, and
@@ -257,9 +257,12 @@ re-runs the SDK suites. It runs:
- Java SDK tests with Maven.
- Go SDK formatting, `go vet`, and race-enabled tests at the declared Go floor.
-Release tags run `.github/workflows/release.yml`. The release gate verifies the tag matches
-`package.json`, checks documented version consistency, runs backend tests with coverage, builds the
-backend, and publishes the GitHub Release only after the Docker image has built and pushed successfully.
+Release tags run `.github/workflows/release.yml`, which mirrors the CI gate rather than running a
+lighter one: the same lint job (including all four SDK contract checks), the same test, PostgreSQL,
+dashboard, shell-script and chart jobs. It additionally verifies the tag matches `package.json`, and
+publishes the GitHub Release only after the Docker image has built and pushed successfully. Nothing in
+it packages or publishes the Helm chart β€” operators install that from the tagged ref, so the tag is the
+last gate the chart passes.
## 9.7 Testing Guidelines
diff --git a/docs/29-engine-capability-matrix.md b/docs/29-engine-capability-matrix.md
index a4fb8aac6..82b8ef173 100644
--- a/docs/29-engine-capability-matrix.md
+++ b/docs/29-engine-capability-matrix.md
@@ -48,8 +48,8 @@ flowchart LR
IF --> BA["BaileysAdapter"]
SVC --> STORE["OpenWA-side stores"]
end
- WA --> WLIB["whatsapp-web.js 1.34.7<br/>+ 4 OpenWA patches"]
- BA --> BLIB["@whiskeysockets/baileys 7.0.0-rc13<br/>+ 1 OpenWA patch"]
+ WA --> WLIB["whatsapp-web.js 1.34.7<br/>+ 5 OpenWA patches"]
+ BA --> BLIB["@whiskeysockets/baileys 7.0.0-rc13<br/>+ 2 OpenWA patches"]
WLIB --> WEB["WhatsApp Web<br/>headless Chromium"]
BLIB --> WAS["WhatsApp servers<br/>browser-free socket"]
WA -.->|"not-available"| E["EngineNotSupportedError<br/>HTTP 501"]
@@ -284,9 +284,9 @@ socket is caught by the transport instead. No REST route: the session watchdog p
| `getGroups` | βœ… | βœ… | βœ… |
| `getGroupInfo` | βœ… | βœ… | βœ… |
| `addParticipants` | βœ… | βœ… | βœ… |
-| `removeParticipants` | βœ… | βœ… | βœ… |
-| `promoteParticipants` | βœ… | βœ… | βœ… |
-| `demoteParticipants` | βœ… | βœ… | βœ… |
+| `removeParticipants` | βœ… | βœ…πŸ”§β· | βœ… |
+| `promoteParticipants` | βœ… | βœ…πŸ”§β· | βœ… |
+| `demoteParticipants` | βœ… | βœ…πŸ”§β· | βœ… |
| `approveGroupMembershipRequests` | βœ… | βœ… | βœ… |
| `rejectGroupMembershipRequests` | βœ… | βœ… | βœ… |
| `getGroupMembershipRequests` | βœ… | βœ… | βœ… |
diff --git a/scripts/check-sdk-docs.mjs b/scripts/check-sdk-docs.mjs
index 869fc76cc..698db357f 100644
--- a/scripts/check-sdk-docs.mjs
+++ b/scripts/check-sdk-docs.mjs
@@ -21,8 +21,10 @@
* - Compares the SET of names in each language's own idiom β€” Python snake_case, everyone else
* camelCase. It does NOT check signatures, descriptions or **OPERATOR** annotations, which carry
* information that exists nowhere else and cannot be derived from the source.
- * - One direction is enough to catch the drift that happened, but both are reported: a documented
- * method that does not ship is a false promise and worse than an omission.
+ * - ONE DIRECTION ONLY: shipped β†’ documented. Every failure it can report ends in "which the
+ * client ships". The reverse β€” a documented method that no client ships β€” is a false promise and
+ * arguably worse than an omission, but nothing here detects it; do not read a green run as
+ * evidence that the docs promise nothing extra.
*
* Lives in ci.yml's lint job rather than sdk-ci.yml for the same reason as the route and event
* guards: sdk-ci is path-filtered, so a docs-only PR runs none of it.
diff --git a/src/engine/docs-29-counts.spec.ts b/src/engine/docs-29-counts.spec.ts
index c7b8c1fbf..c343b4451 100644
--- a/src/engine/docs-29-counts.spec.ts
+++ b/src/engine/docs-29-counts.spec.ts
@@ -1,4 +1,4 @@
-import { readFileSync } from 'node:fs';
+import { readdirSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
/**
@@ -60,6 +60,60 @@ describe('docs/29 counts match the capability matrix', () => {
{ label: '29.8 REST view', re: /REST caller's view: \*\*(\d+)\*\* engine-neutral/, of: 'neutral' },
];
+ /**
+ * The patch counts are a SEPARATE source β€” `scripts/` β€” and were outside the claim list above, so
+ * they drifted exactly the way the interface figures used to: this release added a patcher to each
+ * library and the mermaid node kept saying 4 and 1. Derived from disk the same way
+ * `scripts/dockerfile-patchers.spec.js` derives its list, so adding a patcher updates the expected
+ * value rather than requiring someone to remember the prose.
+ */
+ const patchCounts = () => {
+ const files = readdirSync(join(__dirname, '..', '..', 'scripts')).filter(
+ f => f.startsWith('patch-') && f.endsWith('.js') && !f.endsWith('.spec.js'),
+ );
+ return {
+ total: files.length,
+ wwjs: files.filter(f => f.startsWith('patch-wwebjs-')).length,
+ baileys: files.filter(f => f.startsWith('patch-baileys-')).length,
+ };
+ };
+
+ it('states the install-time patch counts the scripts directory actually contains', () => {
+ const expected = patchCounts();
+ const doc = read('docs', '29-engine-capability-matrix.md');
+
+ // Guard the derivation: a renamed prefix would make every expectation below zero and pass.
+ expect(expected.total).toBeGreaterThan(4);
+ expect(expected.wwjs + expected.baileys).toBe(expected.total);
+
+ const claims: { label: string; re: RegExp; want: number }[] = [
+ { label: 'intro total', re: /(\d+) install-time patches \(29\.3\)/, want: expected.total },
+ { label: 'mermaid wwjs node', re: /whatsapp-web\.js [\d.]+<br\/>\+ (\d+) OpenWA patch/, want: expected.wwjs },
+ { label: 'mermaid baileys node', re: /baileys [\w.-]+<br\/>\+ (\d+) OpenWA patch/, want: expected.baileys },
+ { label: '29.8 total', re: /- \*\*(\d+)\*\* install-time patches/, want: expected.total },
+ { label: '29.8 split', re: /install-time patches \((\d+) whatsapp-web\.js/, want: expected.wwjs },
+ {
+ label: '29.8 split baileys',
+ re: /install-time patches \(\d+ whatsapp-web\.js \+ (\d+) Baileys\)/,
+ want: expected.baileys,
+ },
+ ];
+
+ const wrong: string[] = [];
+ for (const claim of claims) {
+ const found = doc.match(claim.re);
+ // A phrasing that stopped matching is drift too β€” the claim did not disappear, the check did.
+ if (!found) {
+ wrong.push(`${claim.label}: phrasing no longer found in the document`);
+ continue;
+ }
+ const actual = Number(found[1]);
+ if (actual !== claim.want) wrong.push(`${claim.label}: says ${actual}, scripts/ has ${claim.want}`);
+ }
+
+ expect(wrong).toEqual([]);
+ });
+
it('states the same figures everywhere it states them', () => {
const expected = recount();
const doc = read('docs', '29-engine-capability-matrix.md');