Repository navigation
fix(channels): point every channel's docs field at a page that exists - #784
Merged
Merged
Conversation
Every shipped channel declared `docs: "docs/guide/channels-<id>.md"`, and none of those fourteen files were ever created — there is no `channels-telegram.md`, no `channels-signal.md`, no per-channel page at all. The value is user-facing: it is what `future channel list --json` reports as the channel's documentation. So the product advertised a link for each channel that led nowhere, and the documentation that does exist (a section per channel in `docs/guide/channels-providers.md`, and the configuration blocks for the self-bridged pair in `docs/guide/channels-config.md`) was reachable only by knowing to look for it. Each definition now points at the section that documents it: * the twelve framework channels → `docs/guide/channels-providers.md#<channel>` (`cli` → `#terminal`, `imessage` → `#imessage-macos`); * Feishu and DingTalk → `docs/guide/channels-config.md#feishu` / `#dingtalk`. Enforced from now on by `every_channel_documents_itself_somewhere_that_exists`, which walks `providers::all_definitions()` and resolves each target: the file must exist and, when the value names an anchor, some heading in that file must produce it (GitHub's slug rule). The crate's tests are the right home for this because the documentation gate is deliberately run by hand and not wired into CI — a Rust test is what actually fails a pull request. Verified as a real guard rather than a restatement, by breaking it both ways: pointing Telegram at the old `channels-telegram.md` fails with "which cannot be read … expected a file at …", and `#telegram-typo` fails with "no such heading". Both messages name the channel, so the next person to hit it knows what to fix. The provider contract now says where `docs` should point, since nothing said so and that is why fourteen of them were written this way.
huichen
enabled auto-merge (squash)
September 22, 2026 17:09
huichen
added a commit
that referenced
this pull request
Sep 22, 2026
…vered (#785) The invariant added in #784 carried four uncovered lines: its three `assert!` messages and the `panic!` arm only materialise when the check fails, so a passing suite never executes them. Worse, the negative controls that did exercise them were throwaway edits — I confirmed the check works by breaking it by hand and then put the file back, which leaves nothing behind that keeps working. Both problems have one fix: take the definitions as an argument and give each failure mode a test that sees it fail. * `docs_problem(root, docs)` returns why a target leads nowhere, or `None`; * `undocumented(definitions, root)` collects them — parameterised, so a definition can be built per case; * `a_docs_target_is_rejected_when_it_cannot_be_followed` covers all four shapes: a resolvable path, a resolvable path with a valid anchor, a file that is not there, an anchor that is not there, and an empty value. The assertions name the channel in the message, which is what makes the failure actionable. The three remaining uncovered lines were the multi-line `assert!` format arguments, evaluated only on failure; hoisting each into a binding ahead of the assert closes them. `an_anchor_is_the_slug_github_makes` pins the slug rule directly, including the two real cases that make it non-obvious (`### \`feishu\`` → `feishu`, `### iMessage (macOS)` → `imessage-macos`), so the anchor half of the check does not depend on the page staying the way it is today. `providers/mod.rs` is back to zero uncovered lines and the crate's total is unchanged at 47 (22 framework, 25 in the older Feishu/DingTalk bridges and gRPC client), which is the number `docs/architecture/channels-test-coverage.md` records.
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.
fix(channels): point every channel's docs field at a page that exists
Every shipped channel declared
docs: "docs/guide/channels-<id>.md", and noneof those fourteen files were ever created — there is no
channels-telegram.md,no
channels-signal.md, no per-channel page at all. The value is user-facing:it is what
future channel list --jsonreports as the channel's documentation.So the product advertised a link for each channel that led nowhere, and the
documentation that does exist (a section per channel in
docs/guide/channels-providers.md, and the configuration blocks for theself-bridged pair in
docs/guide/channels-config.md) was reachable only byknowing to look for it.
Each definition now points at the section that documents it:
docs/guide/channels-providers.md#<channel>(
cli→#terminal,imessage→#imessage-macos);docs/guide/channels-config.md#feishu/#dingtalk.Enforced from now on by
every_channel_documents_itself_somewhere_that_exists, which walksproviders::all_definitions()and resolves each target: the file must exist and,when the value names an anchor, some heading in that file must produce it
(GitHub's slug rule). The crate's tests are the right home for this because the
documentation gate is deliberately run by hand and not wired into CI — a Rust
test is what actually fails a pull request.
Verified as a real guard rather than a restatement, by breaking it both ways:
pointing Telegram at the old
channels-telegram.mdfails with "which cannot beread … expected a file at …", and
#telegram-typofails with "no such heading".Both messages name the channel, so the next person to hit it knows what to fix.
The provider contract now says where
docsshould point, since nothing said soand that is why fourteen of them were written this way.