mailsec: make the command surface discoverable - #353
Merged
Conversation
`limacharlie help discover` is how an operator or an agent finds out a command exists at all, and none of the ~27 mailsec verbs appeared in any profile, so the whole Email Security surface was invisible to it. Add an `email_security` profile enumerating every current mailsec verb, and cross-list the response-relevant ones into `threat_response` the way the `case` verbs already are. Pin it: `TestMailsecCoverage` walks the live click group and fails in both directions — a new verb that no profile lists, and a profile entry that no longer resolves to a real command. This mirrors the existing `test_cli_command_map_lint.py` lint over `_COMMAND_MODULE_MAP`. Also lists `cases` and `email_security` in `test_all_profiles_exist`, whose hand-maintained expectation had drifted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lcbill
approved these changes
Sep 2, 2026
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.
What
limacharlie help discover(the only consumer ofdiscovery.PROFILES) is how an operator — or an agent driving the CLI — finds out a command exists at all. None of the ~27mailsecverbs appeared in any profile, so the entire Email Security surface was invisible to it. Pre-existing gap, flagged while reviewing #352.email_securityprofile enumerating all 27 current mailsec verbs, enumerated by walking the live click group rather than by hand.threat_response(message list|get|action|bulk-action,campaign action,hunt create|remediate) — the same convention thecaseverbs already follow.TestMailsecCoveragepins it in both directions: a verb the profiles do not list, and a profile entry that no longer resolves to a real command. Modelled on the existingtest_cli_command_map_lint.pylint over_COMMAND_MODULE_MAP.test_all_profiles_existnow listscasesandemail_security; its hand-maintained expectation had drifted (caseswas already missing).Schema left exactly as-is (
{description, commands: [str]}), matching howcases— the closest precedent, one noun, full verb enumeration — is represented.Verification
Pin verified by mechanism, not just outcome: renaming one entry to
bulk-statuzmade both tests fail with the intended messages; restoring made them pass.Full CI suite (
tests/unit/ tests/microbenchmarks/), Python 3.13: 4085 passed, 5 skipped (the 5 skips are pre-existing: 2 platform-gated, 2 pre-existing-docstring, 1 Windows-only).Pre-existing gaps found, deliberately NOT fixed here
Kept narrow to mailsec. Each of these is a separate change:
32 of 58 top-level commands are absent from
PROFILESentirely — includingcloudsecandhive, so there was no comparable surface to mirror. Full list:ai-cost-model, ai-memory, ai-skill, app, arl, artifact, auth, cloud-adapter, cloudsec, completion, config, exfil, extension, external-adapter, feedback, help, hive, ingestion-key, integrity, job, logging, lookup, note, payload, playbook, schema, secret, sop, spotcheck, usp, vulnerability(+mailsec, fixed here).20 existing profile entries point at commands that do not exist: the 10
rule *entries,fp create,org config get|set,search interactive,search saved *(4),sensor online,sync diff. This is why the new lint is scoped to mailsec — a repo-wide version fails on day one.→ Now fixed in discovery: repair the 20 rotted PROFILES entries and lint them #355, stacked on this branch. (That PR re-derived the replacements from the live command tree and corrected this list: there are 10
rule *entries, not 11, and they map todr *, notdr rule *.)Doc drift:
doc/cli/README.md,doc/cli/other-commands.mdanddoc/getting-started.mddocumentlimacharlie discoverandlimacharlie cheatsheetas top-level commands (they arelimacharlie help discover/limacharlie help cheatsheet), and reference a--profile incident_responsethat does not exist (the profile isthreat_response).🤖 Generated with Claude Code