docs(plugin-api): make the §8 exports table exhaustive (#457)#467
Merged
Conversation
§8 closed with "See each plugin's source for the full exported surface", so it read as a contract but was a 7-row sample. During #447 PR 6 that made "not in §8" look like evidence of a dead export and cost a full re-derivation. Re-derived the real surface from source: - 19 plugins return an export table; 15 have a public (bare-name) surface, 4 (cmd_gag, etc_blocklist, etc_whitelist, hub_runtime) export only `_`-prefixed unit-test / migration seams. - 4 of the 7 previously-listed rows were themselves incomplete (bot_opchat missing `bot`, cmd_ban missing `del`/`bans_path`, etc_hubcommands missing `has`/`list`, etc_report missing `broadcast`). - Live doc bug fixed: cmd_ban exports `bans` as a TABLE by reference (mutated in place, per the #238/#239 idiom), not the callable `ban.bans()` the old table showed. Verified against importers (cmd_accinfo, etc_prometheus). Documented `ban.bans` + `ban.bans_path`. Table is now exhaustive (15 rows), states the completeness contract, and documents the `_`-prefix convention, so absence from §8 provably means "exports nothing public". Signatures mirror each plugin's own advertised export contract (a few exports carry extra optional impl params the plugin author does not advertise - e.g. cmd_ban.add's 6th `permanent` arg is absent from cmd_ban's own export comment - and are deliberately left out of a quick-reference table). Docs-only, no code change. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Closes #457.
docs/PLUGIN_API.md§8 closed with "See each plugin's source for the full exported surface", so it read as a contract but was a 7-row sample. In #447 PR 6 that made "not in §8" look like evidence of a dead export and cost a full re-derivation. This makes §8 the exhaustive enumeration it reads as.What changed (re-derived from source, not from the issue)
cmd_gag,etc_blocklist,etc_whitelist,hub_runtime) export only_-prefixed unit-test / migration seams. (The issue said "18 exporting plugins" and missedcmd_gag/etc_whitelist/hub_runtime.)bot_opchatmissingbot,cmd_banmissingdel/bans_path,etc_hubcommandsmissinghas/list,etc_reportmissingbroadcast.cmd_banexportsbansas a table by reference (mutated in place, per the etc_msgmanager.tbl re-read from disk on every accinfo / GET /v1/registered/{nick} #238/cmd_ban exportedbanstable goes stale after cleanbans() rebind #239 idiom), not the callableban.bans()the old table showed. Verified against importers (cmd_accinfo.lua:198local bans_tbl = ban.bans,etc_prometheus.lua:111pairs( ban.bans )). New row documentsban.bans+ theban.bans_pathload-on-demand alternative._-prefix convention, so absence from §8 provably means "exports nothing public" - the exact ambiguity that burned Dead-code audit: findings + cleanup tracker #447 PR 6.Deliberate altitude decision (so it is not read as an oversight)
The fact-check pass flagged that three exports carry extra optional impl params the plugin author does not advertise:
cmd_ban.add's 6thpermanentarg (absent from cmd_ban's own export comment even post-#444),etc_trafficmanager.add/del's trailinguser, andetc_hubcommands.add'sminlevel/opts. §8 mirrors each plugin's own advertised export contract; these undocumented optionals are left out of a quick-reference table. Documentingpermanenthere would also couple this docs PR to #444's not-yet-promoted state.Review (§1a.6)
Two independent read-only reviewers on disjoint axes (fact-check vs source / editorial + consistency), main-thread synthesis. Fact-check: no BLOCKER - completeness, the four-seam-only claim, every method name, spot-checked signatures, and the whole
ban.bans-by-reference claim all verified. Editorial: table renders (3 cells/row),#10-common-pitfallslink valid and §10.8 genuinely covers #238/#239, no em/en-dashes. Both NITs folded in: import-column inner-spacing aligned to the doc-widehub.import( "..." )convention, and theban.bansnote reworded for clarity.Docs-only, no code change. 3.2.x only.
🤖 Generated with Claude Code