Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(29): make 29.8 summarise the tables it actually summarises

Yudhi Armyndharisf110d73a09b9
diff --git a/docs/29-engine-capability-matrix.md b/docs/29-engine-capability-matrix.md
index a05b768ee..9b138f6e5 100644
--- a/docs/29-engine-capability-matrix.md
+++ b/docs/29-engine-capability-matrix.md
@@ -914,17 +914,18 @@ Recomputed from `engine-capability-matrix.ts`, `upstream-surface.snapshot.json`,
adapter sources — re-derive the same way when anything changes:
- **112** interface methods → **224** adapter cells: **199 ✅** / **25 ❌** (2 adapter-gaps, 23
- library-limitations, 0 uncertain), spanning **23** methods.
-- Of the 199 ✅ cells, **6 wwjs cells carry an explicit patch dependency** (4 × 🔧² status send,
- 1 × 🔧³ channel link preview, 1 × 🔧⁴ ready-sync) and the whole wwjs column additionally
+ library-limitations, 0 uncertain), spanning **24** methods.
+- Of the 199 ✅ cells, **9 wwjs cells carry an explicit patch dependency** (4 × 🔧² status send,
+ 1 × 🔧³ channel link preview, 1 × 🔧⁴ ready-sync, 3 × 🔧⁷ participant arity) and one baileys cell
+ does (1 × 🔧⁶ newsletter-create parse); the whole wwjs column additionally
depends on 🔧¹, the whole Baileys column on 🔧⁵ — so every row rests on a patch on each side,
even though no row carries a row-level mark on both.
- REST caller's view: **90** engine-neutral (88 + 2 store-backed status reads), **12** Baileys-only,
**9** wwjs-only, **1** unavailable on both (`sendCatalog`).
- Full engine inventory (29.5), split by the exposure legend rather than lumped: Baileys **152**
socket methods — 49 wired into interface methods, 5 internal wiring, 29 plumbing, **69 ❌ not
- exposed** (incl. the whole 23-method community cluster); wwjs **81** Client methods — 47 wired,
- 2 internal wiring, 1 class plumbing, **31 ❌ not exposed** (23 real capabilities + 8
+ exposed** (incl. the whole 23-method community cluster); wwjs **81** Client methods — 46 wired,
+ 2 internal wiring, 1 class plumbing, **32 ❌ not exposed** (24 real capabilities + 8
session/transport settings that are not WhatsApp capabilities). The backlog is the ❌ rows minus
those 8 settings; 🔩 plumbing is correctly never exposed.
- Events: Baileys **34** (15 consumed / 19 dropped), wwjs **31** (16 consumed / 15 dropped).
diff --git a/src/engine/docs-29-counts.spec.ts b/src/engine/docs-29-counts.spec.ts
index 7b0808aa2..4270d9538 100644
--- a/src/engine/docs-29-counts.spec.ts
+++ b/src/engine/docs-29-counts.spec.ts
@@ -131,6 +131,63 @@ describe('docs/29 counts match the capability matrix', () => {
expect([...wrongProse, ...wrong]).toEqual([]);
});
+ /**
+ * The figures below restate something the DOCUMENT itself contains rather than the matrix, so a
+ * matrix-derived check cannot see them drift — and they did: demoting one cell moved the
+ * not-available span, marking three rows moved the patch-dependency count, and the 29.5.2 prose
+ * split kept the pre-demotion numbers. Each is recounted from the table it summarises.
+ */
+ it('summarises its own tables with the numbers those tables contain', () => {
+ const doc = read('docs', '29-engine-capability-matrix.md');
+ const wrong: string[] = [];
+
+ const section = (from: RegExp, to: RegExp): string => {
+ const start = doc.search(from);
+ const end = doc.slice(start + 1).search(to);
+ return end < 0 ? doc.slice(start) : doc.slice(start, start + 1 + end);
+ };
+
+ // 29.8's not-available span must match 29.4's, which the matrix-derived test already pins.
+ const spanning = doc.match(/0 uncertain\), spanning \*\*(\d+)\*\* methods/);
+ const across = doc.match(/0 uncertain\) across (\d+) methods/);
+ if (!spanning || !across) wrong.push('not-available span: one of the two phrasings no longer matches');
+ else if (spanning[1] !== across[1])
+ wrong.push(`not-available span: 29.8 says ${spanning[1]}, 29.4 says ${across[1]}`);
+
+ // 29.8's wwjs patch-dependency count must match the ✅🔧ⁿ marks 29.4 actually carries. 🔧⁶ is the
+ // one baileys row-level mark, so it is excluded from the wwjs figure.
+ const contract = section(/^## 29\.4 /m, /^## 29\.5 /m);
+ const marks = [...contract.matchAll(/✅🔧([¹²³⁴⁵⁶⁷])/g)].map(m => m[1]);
+ const wwjsMarks = marks.filter(m => m !== '⁶').length;
+ const claimed = doc.match(/\*\*(\d+) wwjs cells carry an explicit patch dependency\*\*/);
+ if (!claimed) wrong.push('patch dependency count: phrasing no longer found');
+ else if (Number(claimed[1]) !== wwjsMarks) {
+ wrong.push(`patch dependency count: says ${claimed[1]}, 29.4 carries ${wwjsMarks}`);
+ }
+
+ // 29.8's wwjs inventory split must match the 29.5.2 table it summarises.
+ const inventory = section(/^### 29\.5\.2 /m, /^### 29\.5\.3 /m);
+ const wired = (inventory.match(/^\| `[^|]+\| *✅/gm) ?? []).length;
+ const unexposed = (inventory.match(/^\| `[^|]+\| *❌/gm) ?? []).length;
+ const split = doc.match(
+ /wwjs \*\*\d+\*\* Client methods — (\d+) wired,[\s\S]{0,60}?\*\*(\d+) ❌ not\s+exposed\*\*/,
+ );
+ if (!split) wrong.push('29.5.2 split: phrasing no longer found');
+ else {
+ if (Number(split[1]) !== wired) wrong.push(`29.5.2 wired: says ${split[1]}, the table has ${wired}`);
+ if (Number(split[2]) !== unexposed)
+ wrong.push(`29.5.2 not-exposed: says ${split[2]}, the table has ${unexposed}`);
+ }
+
+ // Guard every selector: a reworded table would make all four comparisons vacuous.
+ expect({ marks: marks.length > 0, wired: wired > 0, unexposed: unexposed > 0 }).toEqual({
+ marks: true,
+ wired: true,
+ unexposed: true,
+ });
+ expect(wrong).toEqual([]);
+ });
+
it('states the same figures everywhere it states them', () => {
const expected = recount();
const doc = read('docs', '29-engine-capability-matrix.md');