Skip to content

docs(plugin-api): make the §8 exports table exhaustive (#457)#467

Merged
Aybook merged 1 commit into
devfrom
feat/457-plugin-api-exports
Jul 18, 2026
Merged

docs(plugin-api): make the §8 exports table exhaustive (#457)#467
Aybook merged 1 commit into
devfrom
feat/457-plugin-api-exports

Conversation

@Aybook

@Aybook Aybook commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

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)

  • 19 plugins return a top-level 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. (The issue said "18 exporting plugins" and missed cmd_gag / etc_whitelist / hub_runtime.)
  • 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 etc_msgmanager.tbl re-read from disk on every accinfo / GET /v1/registered/{nick} #238/cmd_ban exported bans table goes stale after cleanbans() rebind #239 idiom), not the callable ban.bans() the old table showed. Verified against importers (cmd_accinfo.lua:198 local bans_tbl = ban.bans, etc_prometheus.lua:111 pairs( ban.bans )). New row documents ban.bans + the ban.bans_path load-on-demand alternative.
  • Intro now states the completeness contract and the _-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 6th permanent arg (absent from cmd_ban's own export comment even post-#444), etc_trafficmanager.add/del's trailing user, and etc_hubcommands.add's minlevel/opts. §8 mirrors each plugin's own advertised export contract; these undocumented optionals are left out of a quick-reference table. Documenting permanent here 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-pitfalls link valid and §10.8 genuinely covers #238/#239, no em/en-dashes. Both NITs folded in: import-column inner-spacing aligned to the doc-wide hub.import( "..." ) convention, and the ban.bans note reworded for clarity.

Docs-only, no code change. 3.2.x only.

🤖 Generated with Claude Code

§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>
@Aybook
Aybook merged commit fa0b3d6 into dev Jul 18, 2026
8 checks passed
@Aybook
Aybook deleted the feat/457-plugin-api-exports branch July 18, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant