discovery: repair the 20 rotted PROFILES entries and lint them - #355
Merged
Conversation
lcbill
previously approved these changes
Sep 2, 2026
maximelb
force-pushed
the
profiles-fix-stale-entries
branch
from
September 2, 2026 16:16
20a9f21 to
0254238
Compare
`limacharlie help discover` prints profile entries verbatim as `limacharlie <entry>`, so an entry naming a command that no longer exists is advice that cannot be followed. 20 of them were in that state. Corrections, each re-derived by walking the live click tree rather than by guessing: the 10 `rule *` entries are `dr *` (not `dr rule *`); `rule create` and `rule update` both collapse into the single `dr set`, which is create-or-update; `fp create` is likewise `fp set`; `org config get|set` and the four `search saved *` are hyphenated, not subgroups. Three are genuinely gone and are dropped: `sensor online` and `sync diff` became flags (`sensor list --online`, `sync push --dry-run`) and `search interactive` has no successor. Widen the lint so every entry in every profile must resolve. This is deliberately one-directional -- it does not demand that every command be profiled, since which commands are worth surfacing is a curation call and 32 top-level groups are still unprofiled. Add a CLAUDE.md telling anyone changing the command surface to update `_COMMAND_MODULE_MAP`, `PROFILES` and `doc/cli/` together, and to look for a renamed command before deleting a profile entry -- most of the 20 were renames. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
maximelb
marked this pull request as ready for review
September 2, 2026 16:27
maximelb
enabled auto-merge (squash)
September 2, 2026 16:27
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 discoverprints eachPROFILESentry verbatim as alimacharlie <entry>invocation. 20 entries named commands that no longer exist, so the CLI's own discovery surface was handing out advice that cannot be followed. This is a pure correction PR: it fixes rotted entries and pins them. It adds no new surfaces.Every replacement was re-derived by walking the live click tree, not from the earlier inventory — which was wrong in two ways worth flagging: there are 10
rule *entries (not 11), and they map todr *, notdr rule *(thedrgroup holds the verbs directly).Per-entry disposition
rule listdr listdrrule getdr getdrrule createdr setcreate;dr setis create-or-updaterule updatedr set)rule create— two entries become onerule deletedr deletedrrule testdr testdrrule replaydr replaydrrule validatedr validatedrrule exportdr exportdrrule importdr importdrfp createfp setcreate;fp setis "Create or update a false positive rule"org config getorg config-getconfigsubgrouporg config setorg config-setconfigsubgroupsearch saved listsearch saved-listsavedsubgroupsearch saved getsearch saved-getsearch saved createsearch saved-createsearch saved deletesearch saved-deletesearch interactivesensor onlinesensor list --online.sensor listis already profiledsync diffsync push --dry-run.sync pushis already profiledNet: 17 corrected (16 entries, since
rule create/rule updatemerge), 3 dropped.dr convert-ruleswas already correct; it moved next to the otherdrentries for readability.Widened lint
TestProfileEntriesResolvenow requires every entry in every profile to resolve against the live click tree. The mailsec both-directions pin from #353 is unchanged.Deliberately one-directional: it does not require that every command be profiled. Which commands are worth surfacing is a curation call, and 32 top-level groups are unprofiled — that is curation debt, not a correctness bug, and forcing it here would be a different PR.
Verified by mechanism: stashing the
discovery.pyfix makes the new test fail listing exactly the 20 entries with actionable reasons (it prints the group's real subcommands); restoring makes it pass.CLAUDE.md
The repo had none. Added a short one covering the thing that caused this rot: the command surface is described by three hand-maintained maps (
_COMMAND_MODULE_MAP,PROFILES,doc/cli/) and none updates itself, so a rename must touch all three. It points at both lints and at the MCP-mirroring expectation, and says to look for a renamed command before deleting a profile entry — 17 of the 20 were renames, so "delete until the lint passes" would have been the wrong fix.MCP reconciliation (
NEW_CLI.md§1.1)Not checkable in this repo — the profile list lives in the separate
lc-mcp-serverrepo (configs/profiles.yaml), so nothing here can enforce it. Reconciled by hand for the record; the claim "matching MCP server profiles" is now only partly true:historical_data,live_investigation,threat_response,fleet_management,detection_engineering,platform_admin,ai_powered.sensor_management≈ MCPcore; CLIcases≈ MCPinvestigation_management.email_security(added in mailsec: make the command surface discoverable #353) — the MCP server has no email-security profile.core,historical_data_readonly,investigation_management,api_access,cloud_security,cloud_security_readonly.Renaming CLI profiles to converge would be a user-visible break to
--profile, so it is not done here. Flagging it as a decision for a follow-up.Remaining debt (not this PR)
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 in mailsec: make the command surface discoverable #353). Notably the MCP server does shipcloud_securityprofiles while the CLI has nocloudseccoverage at all.dr enable|disable,fp enable|disable,fp tag add|rm|set,search saved-run|queries|limits|checkpoints|checkpoint-show, and much oforg.doc/cli/README.md,doc/cli/other-commands.md,doc/getting-started.mddocumentlimacharlie discoverandlimacharlie cheatsheetas top-level commands (they live underhelp), and reference a--profile incident_responsethat does not exist (it isthreat_response).Tests
Full CI suite (
tests/unit/ tests/microbenchmarks/, matchingcloudbuild_pr.yaml), clean venv: 4086 passed, 5 skipped — up from 4085 on #353 (+1 new test), and 4083 onmaster. The 5 skips are pre-existing and unrelated (3 platform-gated, 2 pre-existing-docstring gates).🤖 Generated with Claude Code