Repository navigation
docs: map tg's layers, seams, disk and wire; fix the adapter-test standard - #640
Merged
Merged
Conversation
…ndard docs/dev/ARCHITECTURE.md is rewritten in whatsapp-cli's shape: what cli-core owns, the layers and the lint rules that hold them, history from Telegram's servers, the adapter (Feature, send/write, flood waits, proxy), connections, logging in, the test seams, what is on disk and what goes on the wire. Every fact was read from the current code. It no longer points at the untracked HANDOFF.md or at max-cli; the adapter-method path is written out here. It says why tg has no one-connection lock: every process opens its own main connection by the owner's ruling NEED-600 A (session-sharing.md), the only lock is cli-core's serve lock, and AUTH_KEY_DUPLICATED is the signal that reopens it. agent-os/standards/testing/adapter-fake-client.md cited adapter.ts lines that no longer exist. It now describes the tests as they are, by symbol: the real mtcute module with only TelegramClient replaced (FakeClient, SeededClient, StatsClient), the storage mock, cli-core's contractCases, plain-object fakes for feature functions, and exported timing constants; and why tg fakes the client class where wa fakes its engine port. Implements items 14 and 15 of the tg/wa alignment audit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
leemour
force-pushed
the
docs/architecture-and-adapter-standard
branch
from
October 20, 2026 15:40
f73b6c7 to
e281d44
Compare
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
docs/dev/ARCHITECTURE.mdrewritten in whatsapp-cli's shape: what cli-core owns, the layers (with thebiome.jsonrules that hold them, and the one direction no rule checks yet), history from Telegram's servers, the adapter (Feature,send/write, flood waits, proxy), connections, logging in, the test seams, what is on disk, what goes on the wire, and the standards it follows. Each fact was read from the code onorigin/main(139062d). It no longer points at the untrackedHANDOFF.mdor at max-cli's architecture; the adapter-method path is written out on the page.docs/dev/session-sharing.md), thatTELEGRAMdoes not setconnection: "exclusive"and commands do not go throughserve, that the only lock is cli-core's serve lock, and thatAUTH_KEY_DUPLICATEDis the signal that reopens the question. wa's device lock and serve relay are not copied.agent-os/standards/testing/adapter-fake-client.mdcitedadapter.ts:2027-2040(the file has 625 lines) and gave no reason. It now describes the adapter tests as they are, by symbol: the real@mtcute/nodewith onlyTelegramClientreplaced (FakeClient,SeededClient,StatsClient), the./storage.jsmock, cli-core'scontractCases, plain-object fakes for feature functions, exported timing constants. Its Why says why tg fakes the client class while wa fakes its engine port: tg has no port below the adapter.agent-os/standards/index.ymlcarries the new title.No CHANGELOG line: developer docs only.
Rules touched
WC-ARCH-3, WC-TOOL-15, WC-LIFE-1 (described, not changed). Implements items 14 and 15 of the tg/wa alignment audit (report: leemour/cli-private
docs_ai/research/2026-10-20-whatsmeow-coverage-and-tg-alignment.md).Findings while checking
package.json;HANDOFF.mdandsession-sharing.mdstill say 0.32.3. Not changed here.src/telegram/from importing commands or the program (wa has one); today it imports neither. Noted on the page.How it was checked
initConnectiondefaults read innode_modules/@mtcute/core/network/network-manager.js.pnpm lint && pnpm typecheck && pnpm test: green, 73 files, 1567 passed, 6 skipped.markdownlint-cli2: 0 issues.🤖 Generated with Claude Code