refactor(sends): the shared send guard, journal and recipient list - #257
Merged
Merged
Conversation
T6 item 3b. max-cli's src/sends/ twins are gone; src/sends.ts builds cli-messaging's sendGuard for a profile (with max's allow hint through allowFix) and wraps it so every journal line of one write carries the same operationId: minted at the check, a send's being its sendId. MaxClient journals the send identity as sendId (a string) instead of cid; the shared journal still reads old cid lines as sendId. The cid is now made before the guard's check, so the reservation names it too. src/bot/permissions.ts and src/bot-mcp/ change their imports only. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
T6 item 3b (plan
docs_ai/plans/2026-09-30-max-onto-services.md, corrected 2026-09-30).What changes
src/sends/(guard, journal, permissions, recipients) is deleted; max uses cli-messaging 0.62.0'ssendGuard,SendJournal,RecipientList, permissions.src/sends.tsbuilds the guard for a profile —command: "max", max's allow hint viaallowFix— and wraps it (operating) so every journal line of one write carries the sameoperationId, minted at the check; a send's is itssendId.MaxClientjournalssendId(string) instead ofcid; thecidis made before the check so the reservation names it. Oldcidlines are still read assendIdby the shared journal, so the hourly limit and the unknown-outcome retry keep counting them.src/app.ts: max'sAppIdentity, needed by the shared modules (and by the MAXMessenger, item 5).src/bot/permissions.ts,src/bot-mcp/*: import path only.User-visible (changelog)
max sends list --json:cid→sendId(string); every line gainsoperationId.Risk
This is the guard in front of the owner's real account (RISK-73). Covered: the full suite (1196 tests, incl. server/retry/limit/permissions), plus a new
src/sends.test.tsfor the operation id. The livetest-liverun on test chats happens before the next release, with the owner's yes.Checked:
pnpm lint && pnpm typecheck && pnpm test && pnpm test:matrix && pnpm docs:check.🤖 Generated with Claude Code