Repository navigation
feat(lint): report a command cli-core reserves that the CLI built itself - #727
Merged
Merged
Conversation
Add the lint rule reserved-shared-command (WC-CMD-34). It reads the CLI's commands --json and reports each of session start|status|end|list, doctor, mcp, account remove, mirrors and complete whose command lacks cli-core's origin mark, once per path, with the cli-core helper to mount instead. Why: audits found own sessions in zoom, drive, gcal, ydisk, notion and the CRM CLIs, an own mirrors in ydisk and an own doctor and MCP server in memo. assertSharedContracts only checks commands cli-core already marked, so a hand-built group passed every check. The rule ships as a warning in cli-dev lint and the family audit. Measured on 20 CLIs it flags 17 (only tg, max and wa pass), partly because cli-core 1.0.0 does not mark tokenSessionCommand, oauthSessionCommand, fileMirrorsCommand and accountRemoveCommand. It becomes an error in a later release after cli-core marks them, planned 2027-01-15. An exception is a lint/overrides.json entry, which already requires a reason, an owner and review_after. A lint/baseline entry for this rule is refused, and --write-baseline writes none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task
Stop a WireCat CLI from building its own command at a path that must come from cli-core.
Why
Audits on 25.11.2026 found own
session start|status|end|listin zoom, drive, gcal, ydisk, notion and the CRM CLIs, an ownmirrorsin ydisk, and an owndoctorand MCP server in memo.assertSharedContractschecks only the commands cli-core already marked, so a hand-built group has no mark and passes every check.What
reserved-shared-command(WC-CMD-34). It readscommands --jsonand reports each of these root paths whose command has noorigin: "cli-core":session start,session status,session end,session list,doctor,mcp,account remove,mirrors,complete. It reports once per path (sessiononce for its four leaves) and names the cli-core helper to mount. A group is judged by its own node, so a subcommand a CLI adds to a shared group stays allowed.cli-dev lintprints it and passes. The family audit counts it in the scorecard and never blocks on it. It becomes an error in a later release, planned for 2027-01-15, after cli-core markstokenSessionCommand,oauthSessionCommand,fileMirrorsCommandand the standaloneaccountRemoveCommand. They have no mark in cli-core 1.0.0, so a CLI that mounts them is reported too.lint/overrides.json. Its schema already needs a reason, an owner andreview_after, and an entry more than 14 days past its date fails. Alint/baseline/entry for this rule fails the lint because it has neither, and--write-baselinewrites none.docs/standards/commands.md, a pointer from WC-ARCH-6, and a changelog fragment under Added. It is a minor change:LINT_RULESis experimental and the rule fails nothing.Measured today
The rule ran on 20 CLIs. mail, gcal and drive were built from origin/main. The others are local builds, and for ydisk, linear, wordpress, attio, amo and b24 the local head was not origin/main. A grep of origin/main sources agrees with the split below.
tokenSessionCommand)appDoctorCommand,appMcpCommandandappCompleteCommand. Cause not known yet.max replaces
doctorandsessionthroughcustomizeSharedCommand, which keeps the mark, so it needs no exception. braze-cli was not measured.Testing
pnpm typecheck,pnpm lint,pnpm docs:check,pnpm docs:lint,pnpm docs:spell,cli-dev changelog fragments,cli-dev api-report --check: pass.vitest run: 1357 pass. 6 inscripts/release-checks.test.tsfail on this machine only:python3there is an asdf shim that exits 126 under the test's throwaway HOME. The file is unchanged, and Main validation is green on the base commit.🤖 Generated with Claude Code