Skip to content

Correct documentation drift against the current implementation - #94

Merged
dmccoystephenson merged 3 commits into
mainfrom
feature/documentation-accuracy-sweep
Aug 7, 2026
Merged

Correct documentation drift against the current implementation#94
dmccoystephenson merged 3 commits into
mainfrom
feature/documentation-accuracy-sweep

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

A repo-wide documentation accuracy sweep was performed: every claim in the documentation sources of truth was checked against the code, config, and commands it documents, and the claims that no longer held were corrected. No production code was changed — where the code was found to be at fault, an issue was filed instead (see below).

Corrections made:

  • CONFIG.md — three option descriptions did not match the code. assignmentAlertEnabled was described as notifying a player when a message is sent to them, but it gates the "You have been assigned a mailbox" alert emitted the first time a mailbox is created (MailboxService.assignMailboxToPlayerIfNecessary). welcomeMessageEnabled was described as a message shown on join, but a welcome message is delivered to the mailbox only when one is first created. quotesEnabled was described as displaying random quotes; it wraps message content in double quotes when a message is opened (Message.sendContentToPlayer).
  • COMMANDS.md / USER_GUIDE.md/m open, /m delete, and /m archive were listed without their required message-ID argument, and /m config was listed without its show / set <option> <value> sub-commands. The accepted /m list types (active, archived, unread) and the double-quote requirement on /m send are now stated.
  • API.mdgetMessage(int) was documented as returning null when not found; a non-null wrapper around null is always returned, so the documented null guard never fires. The same applies to getMailbox(Player). It is also now recorded that getMessage(int) searches active messages only, that the two sendListOf... methods send only the first page, and that the eight M_Mailbox mutators exist — they were entirely absent from the reference.
  • ATTACHMENTS.md — a "max attachments" config option was claimed; no such option exists, only maxAttachmentStackSize.
  • API.md / QUICKSTART.md — dependency examples pinned 1.2.0 while pom.xml is at 1.3.0.
  • CHANGELOG.md — an entry was added under [Unreleased].

Issues filed rather than fixed here

Per the docs-sweep rule that code must not be silently changed under a documentation cycle, three code-level findings were filed:

Backlog deferred this cycle

  • Allow plugins to send messages to each other #74 (plugin-to-plugin messaging over a REST API) — deferred. The scope is a new transport plus a producer/consumer model, far beyond the size ceiling for a single cycle, and the issue leaves the transport an open design question that the maintainer should settle.
  • Implement a caching system for message lookups. #44 (caching for message lookups) — deferred. The maintainer has commented that it may not be wanted at all ("I'm not sure if I want to do this, actually"), so it is treated as awaiting a decision rather than as ready work.

Test plan

  • mvn test — 41 tests, 0 failures, 0 errors, BUILD SUCCESS
  • Every corrected claim traced to its source: MailboxService, Message.sendContentToPlayer, CommandInterpreter, the commands/ usage strings, ConfigService, MailboxesAPI, M_Mailbox, Mailbox, PersistentData, SendCommand, and pom.xml
  • Not covered by automation: this PR is documentation-only, so a green build confirms nothing about the Markdown content. The correctness of these edits rests on the source-tracing above.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

dmccoystephenson and others added 3 commits August 7, 2026 03:08
Verified every documented claim against source and fixed the ones that no
longer held:

- CONFIG.md: assignmentAlertEnabled, welcomeMessageEnabled, and quotesEnabled
  described behavior the code does not have
- COMMANDS.md, USER_GUIDE.md: /m open, /m delete, and /m archive require a
  message ID; /m config takes show or set
- API.md: getMailbox and getMessage always return a wrapper, getMessage only
  searches active messages, and the M_Mailbox mutators were undocumented
- ATTACHMENTS.md: no max-attachments option exists, only a stack size cap
- API.md, QUICKSTART.md: dependency examples referenced 1.2.0, not 1.3.0

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The getMessage example caught an NPE to detect a missing message, which
teaches integrating plugins a bad pattern. It now shows the direct call
alongside M_Mailbox.getActiveMessage, which does return null when absent.

The CHANGELOG entry is also split into readable bullets.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…bsent

Mailbox.removeActiveMessage(int) and removeArchivedMessage(int) look the
message up first and pass null through to List.remove when nothing matches,
so neither throws.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric

  • Scope: PASSgit diff --name-only origin/main...HEAD lists exactly seven files, all of them documentation sources of truth: API.md, ATTACHMENTS.md, CHANGELOG.md, COMMANDS.md, CONFIG.md, QUICKSTART.md, USER_GUIDE.md. No source file, pom.xml, or plugin.yml is touched, and no unrelated reformatting is present.
  • Tests-new: N/A — no public method is added or changed by this PR; it is documentation-only.
  • Tests-fix: N/A — no bug fix is included. The three code-level defects surfaced by the sweep were filed as In-game help and usage strings don't match actual command syntax #91, MailboxesAPI.getMailbox and getMessage return wrappers around null instead of null #92, and New message IDs can collide with archived message IDs #93 rather than patched here, so there is nothing to stash-and-run against.
  • Sibling structure: PASS — the new M_Mailbox subsections mirror the accessor/mutator split that M_Mailbox.java already marks with its own // accessors and // mutators comments, and every new entry uses the same ##### \signature`` + description shape as the entries around it.
  • Sibling renames: PASS#### Methods was renamed to #### Accessors in the same commit that introduced its #### Mutators sibling, so the pair is consistent.
  • Docs: PASS — every row of the documentation sources-of-truth table was walked against source. README.md was re-checked and left unmodified (see the note below); plugin.yml needed no change.
  • Issue resolution: N/A — no Closes #N is claimed. This cycle was a proactive documentation sweep with no pre-existing tracking issue, which is stated in the PR body.
  • CI: PASS — the build check passed on head 48c0d4d, and mvn test was run locally before the first push (41 tests, 0 failures, 0 errors).
  • Permissions: PASS — no permission node is added or changed. The USER_GUIDE.md permission table was re-verified against src/main/resources/plugin.yml: all nine nodes and their defaults match.
  • API surface: PASSAPI.md is the main file corrected by this PR, and no class it documents was modified, so the contract and the code agree at head.

Findings folded in from the diff read

  • API.md:249 — the first pushed revision of the getMessage(int) example caught a NullPointerException to detect a missing message. Recommending exception-catching as control flow in the cross-plugin integration contract is a bad pattern to hand to integrators, and it was corrected in 028e362: the example now shows the direct call for a known-good ID alongside M_Mailbox.getActiveMessage(int), which genuinely returns null when absent.
  • API.md:315,324removeActiveMessage(int) and removeArchivedMessage(int) were documented without stating what happens for an unknown ID. Mailbox resolves the ID first and passes null through to List.remove, so neither throws; the no-op behavior is now documented (48c0d4d).
  • CHANGELOG.md:14 — the first revision recorded the sweep as one very long bullet, out of step with the short entries around it. It was split into four bullets in 028e362.
  • README.md — deliberately left unmodified, flagged as a judgment call. Its "Server admins can configure attachment limits" line is vague but not false, and its wiki links point at dmccoystephenson/Mailboxes rather than Dans-Plugins/Mailboxes. Those links still resolve through GitHub's owner redirect, and CommandInterpreter prints the same URL in-game, so changing one without the other would introduce a new inconsistency. A separate pass covering both is the better home for it.
  • Not verifiable by CI — the build check compiles and tests Java, so a green run says nothing about Markdown content. Every corrected claim was instead traced to the source that produces the behavior, which is enumerated per claim in the PR body.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

@dmccoystephenson
dmccoystephenson merged commit 3f8fb18 into main Aug 7, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/documentation-accuracy-sweep branch August 7, 2026 09:16
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