name: help-files-per-command description: leveva HELP serves embedded per-command help pages from leveva/help/; adding a command means adding its help page metadata: node_type: memory type: project originSessionId: 584f406d-814e-418e-aff3-ca55d8b3c162#
leveva's HELP command (P11 slice 30) serves plain-text help pages embedded from
leveva/help/ via rust-embed (HelpFiles in [[leveva-command-folder]]'s
command/help.rs): bare HELP → help/index.md, HELP <CMD> → help/<CMD>.md
(upper-folded, sanitized to [A-Z0-9] so path traversal misses), unknown → a not-found
NOTICE. Pages are delivered as :<server> NOTICE <nick> :<line> wrapped in
*** … *** header/footer.
Convention (user instruction, 2026-06-09): adding a new command means adding its
leveva/help/<CMD>.md page. Two test invariants in command/help.rs enforce both
directions: shipped_help_files_name_real_commands (no orphan page documents a
non-existent command) and every_command_has_a_help_page (every command in the test-only
COMMANDS list has a shipped page). So a new command without a help file fails
cargo test -p leveva.
Why: help text is part of the user-facing command surface, kept honest by tests so it can't silently drift from the real handler set.
How to apply: when you add a command handler + its dispatch arm, add it to the
COMMANDS list in command/help.rs AND write leveva/help/<CMD>.md (match the house
style: usage synopsis line, blank, prose grounded in the real numerics/gating, optional
Examples + "See also"; plain text, ~76-col wrap). Update index.md if it should be listed
there.
Topic pages (P11 slice 53, 2026-06-10): HELP also serves non-command reference
topics — HELP USER_MODES / HELP CHANNEL_MODES (table-formatted mode catalogues that
MODE.md delegates to; markdown tables render nicely on web/websocket clients). To support
them sanitize() now allows _ (still no path traversal — _ can't form / or ..), and
a test-only TOPICS allowlist in command/help.rs lets shipped_help_files_name_real_commands
accept a page whose stem is a command or a topic; reference_topics_are_served checks
they render. Add a topic by: write help/<TOPIC>.md, add the stem to TOPICS, list it under
"Reference topics" in index.md. Topics are NOT in COMMANDS (no every_command_has_a_help_page
obligation, and no dispatch arm).