Repository navigation
fix(cli): mark commands that change only this computer as local writes - #360
Merged
Merged
Conversation
`config set|unset`, `chats rules set|unset`, `recipients add|remove|clear`, and the bot's `auth set|remove` and `recipients add|remove|clear` were marked `mutates` like a send, so the commands pages of tg-cli and max-cli said they change Telegram or MAX. They write the config file, the group-rules file, the recipient lists and the keyring, nothing else. They now carry `local: true` from cli-core 0.15.0 beside `mutates: true`, so `commands --json` still shows `writes: yes`. `chats moderate` keeps the messenger label: it deletes messages and removes people. The peer range widens to cli-core <0.16.0; an older cli-core ignores `local`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
leemour
force-pushed
the
fix/local-writes
branch
from
October 1, 2026 21:10
5cab0a2 to
9ff0115
Compare
leemour
added a commit
that referenced
this pull request
Oct 1, 2026
bin/release: 0.97.0 is already on npm. Released early: tg-cli and max-cli: their command pages label config set, chats rules set and the recipient lists as changing the messenger; the fix (#360) needs this release, owner approved the early release (NEED-513)
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
tg-cli's command page says "Changes something in Telegram" under commands that change only local files. (max-cli builds its own versions of these commands and never showed the label; it gets its own fix.)
Why
mutates: truewas on commands that write to the messenger and on ones that write only the config file, the group-rules file, the recipient lists or the keyring.What
Every
mutates: trueinsrc/classified. These 12 change only this computer and now carrylocal: true(cli-core 0.15.0, leemour/cli-core#37):config set,config unset— the config filechats rules set,chats rules unset— the group-rules file (src/moderation/rules.ts)recipients add|remove|clear— the recipient list file (addreads the messenger to resolve the chat, changes nothing there)auth set|remove— the keyring (auth setchecks the token with the messenger, a read)recipients add|remove|clear— the bot's recipient listEvery other one stays a messenger write, including
chats moderate(deletes messages, removes people).mutatesstays on all of them, socommands --jsonkeepswrites: yes. cli-core devDependency 0.15.0; peer range widened to<0.16.0(an older cli-core ignoreslocaland shows the old line).Decision: a second annotation (
local) instead of droppingmutates— agents readwritesto tell reads from writes, and a local write is still a write.Not released: under
## Unreleased, per the one-release-a-day rule (0.97.0 shipped today).Testing
pnpm lint && pnpm typecheck && pnpm test && pnpm docs:check— all pass. Checked against tg-cli with a local build of this branch:pnpm generateswaps exactly these 12 labels to "Changes something on this computer only.";chats moderateandsession endkeep the Telegram line;commands --jsonshows all 12 withmutates: true;pnpm parity:checkpasses.🤖 Generated with Claude Code