Skip to content

feat: rewrite mattermost-cli in Go - #1

Merged
ardasevinc merged 119 commits into
mainfrom
feat/go-v2-rewrite
Jul 17, 2026
Merged

feat: rewrite mattermost-cli in Go#1
ardasevinc merged 119 commits into
mainfrom
feat/go-v2-rewrite

Conversation

@ardasevinc

Copy link
Copy Markdown
Owner

what changed

  • replaces the TypeScript implementation with a native Go v2 CLI
  • makes all remote mutations stage-first and exact-revision apply-only
  • preserves the frozen v1 safety and retrieval contracts through differential coverage
  • adds durable SQLite staging, crash recovery, retention, and replay semantics
  • adds deterministic native archives, npm platform packages, Homebrew formula generation, and OIDC publication
  • removes the Bun/Vitest implementation after closing the parity ledger

why

Immediate message mutation was too sharp for humans and agents. Go v2 makes intent inspectable and durable before any real Mattermost effect while retaining the accumulated failure-mode guarantees of v1.

verification

  • just gate
  • just docker-e2e
  • deterministic double-build and checksum verification
  • exact five-package npm install smoke
  • isolated Homebrew formula install/test
  • TypeScript removal ledger covering all 34 frozen test files

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 308 files, which is 208 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 830d3ffd-5e49-44fd-a957-f10ff4d2ba39

📥 Commits

Reviewing files that changed from the base of the PR and between eccfc50 and 3a004c8.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (384)
  • .github/workflows/ci.yml
  • .github/workflows/publish.yml
  • .github/workflows/release.yml
  • .gitignore
  • AGENTS.md
  • README.md
  • biome.json
  • cmd/conformance/main.go
  • cmd/mm/main.go
  • cmd/mm/signal_other.go
  • cmd/mm/signal_unix.go
  • cmd/mm/signal_unix_test.go
  • conformance/README.md
  • conformance/pair.schema.json
  • conformance/scenario.schema.json
  • conformance/scenarios/pairs/invalid-limit.json
  • conformance/scenarios/pairs/teams.json
  • conformance/scenarios/pairs/whoami.json
  • conformance/scenarios/v1/whoami.json
  • docs/SPEC.md
  • docs/V1_PARITY_MATRIX.md
  • docs/V1_TEST_DISPOSITION.md
  • docs/V2_CONTRACT.md
  • go.mod
  • internal/api/client.go
  • internal/api/client_test.go
  • internal/apply/post.go
  • internal/apply/post_test.go
  • internal/apply/reaction.go
  • internal/apply/service.go
  • internal/apply/service_test.go
  • internal/buildinfo/buildinfo.go
  • internal/cli/apply.go
  • internal/cli/apply_test.go
  • internal/cli/channel.go
  • internal/cli/channel_test.go
  • internal/cli/config.go
  • internal/cli/config_test.go
  • internal/cli/dms.go
  • internal/cli/dms_test.go
  • internal/cli/doctor.go
  • internal/cli/doctor_test.go
  • internal/cli/group_dms.go
  • internal/cli/group_dms_test.go
  • internal/cli/identity.go
  • internal/cli/identity_test.go
  • internal/cli/mentions.go
  • internal/cli/mentions_test.go
  • internal/cli/read.go
  • internal/cli/root.go
  • internal/cli/root_test.go
  • internal/cli/runtime.go
  • internal/cli/runtime_test.go
  • internal/cli/search.go
  • internal/cli/search_test.go
  • internal/cli/stage_create.go
  • internal/cli/stage_create_test.go
  • internal/cli/stage_inspect.go
  • internal/cli/stage_inspect_test.go
  • internal/cli/stage_manage.go
  • internal/cli/stage_manage_test.go
  • internal/cli/store.go
  • internal/cli/store_test.go
  • internal/cli/thread.go
  • internal/cli/thread_test.go
  • internal/cli/unread.go
  • internal/cli/unread_test.go
  • internal/cli/watch.go
  • internal/cli/watch_test.go
  • internal/config/config.go
  • internal/config/config_test.go
  • internal/config/paths.go
  • internal/config/secure_other.go
  • internal/config/secure_unix.go
  • internal/config/secure_unix_test.go
  • internal/conformance/buffer.go
  • internal/conformance/process_other.go
  • internal/conformance/process_unix.go
  • internal/conformance/process_unix_test.go
  • internal/conformance/runner.go
  • internal/conformance/runner_test.go
  • internal/conformance/scenario.go
  • internal/conformance/scenario_test.go
  • internal/conformance/server.go
  • internal/cursor/cursor.go
  • internal/cursor/cursor_test.go
  • internal/doctor/doctor.go
  • internal/doctor/doctor_test.go
  • internal/mattermost/channels.go
  • internal/mattermost/channels_test.go
  • internal/mattermost/conversation_mutations.go
  • internal/mattermost/conversation_mutations_test.go
  • internal/mattermost/file_mutations.go
  • internal/mattermost/file_mutations_test.go
  • internal/mattermost/mutations.go
  • internal/mattermost/mutations_test.go
  • internal/mattermost/post_presentation_test.go
  • internal/mattermost/posts.go
  • internal/mattermost/posts_test.go
  • internal/mattermost/reaction_mutations.go
  • internal/mattermost/reaction_mutations_test.go
  • internal/mattermost/teams.go
  • internal/mattermost/teams_test.go
  • internal/mattermost/users.go
  • internal/mattermost/users_test.go
  • internal/mattermost/watch.go
  • internal/mattermost/watch_ready.go
  • internal/mattermost/watch_ready_e2e.go
  • internal/mattermost/watch_test.go
  • internal/messageinput/input.go
  • internal/messageinput/input_test.go
  • internal/normalization/post.go
  • internal/normalization/post_test.go
  • internal/output/bounded_json_test.go
  • internal/output/date.go
  • internal/output/date_test.go
  • internal/output/identity_machine.go
  • internal/output/identity_machine_test.go
  • internal/output/machine.go
  • internal/output/machine_convert.go
  • internal/output/machine_convert_test.go
  • internal/output/machine_test.go
  • internal/output/markdown.go
  • internal/output/markdown_test.go
  • internal/output/model.go
  • internal/output/model_test.go
  • internal/output/pretty.go
  • internal/output/pretty_test.go
  • internal/output/threading.go
  • internal/output/threading_test.go
  • internal/output/unread.go
  • internal/output/unread_test.go
  • internal/output/watch.go
  • internal/output/watch_test.go
  • internal/presentation/credential.go
  • internal/presentation/fuzz_test.go
  • internal/presentation/patterns.go
  • internal/presentation/patterns_test.go
  • internal/presentation/sanitize.go
  • internal/presentation/sanitize_test.go
  • internal/retrieval/channel.go
  • internal/retrieval/channel_test.go
  • internal/retrieval/dms.go
  • internal/retrieval/dms_test.go
  • internal/retrieval/group_dms.go
  • internal/retrieval/group_dms_test.go
  • internal/retrieval/hydration.go
  • internal/retrieval/mentions.go
  • internal/retrieval/mentions_test.go
  • internal/retrieval/search.go
  • internal/retrieval/search_test.go
  • internal/retrieval/thread.go
  • internal/retrieval/thread_test.go
  • internal/retrieval/unread.go
  • internal/retrieval/unread_test.go
  • internal/schema/apply_semantic.go
  • internal/schema/apply_test.go
  • internal/schema/identity_test.go
  • internal/schema/read_test.go
  • internal/schema/registry.go
  • internal/schema/registry_test.go
  • internal/schema/stage_test.go
  • internal/schema/unread_test.go
  • internal/schema/watch_test.go
  • internal/serverurl/url.go
  • internal/serverurl/url_test.go
  • internal/stagecontent/content.go
  • internal/stagecontent/content_test.go
  • internal/stagecursor/cursor.go
  • internal/stagecursor/cursor_test.go
  • internal/stageinput/doc.go
  • internal/stageinput/fifo_other_test.go
  • internal/stageinput/fifo_unix_test.go
  • internal/stageinput/file_darwin.go
  • internal/stageinput/file_linux.go
  • internal/stageinput/file_other.go
  • internal/stageinput/file_unix.go
  • internal/stageinput/file_unix_test.go
  • internal/stageinput/input.go
  • internal/stageinput/input_test.go
  • internal/stageinput/space_other.go
  • internal/stageinput/space_unix.go
  • internal/stageinput/spool.go
  • internal/stageoutput/output.go
  • internal/stageoutput/output_test.go
  • internal/stagerequest/request.go
  • internal/stagerequest/request_test.go
  • internal/stagestore/apply.go
  • internal/stagestore/apply_test.go
  • internal/stagestore/doc.go
  • internal/stagestore/doctor.go
  • internal/stagestore/domain.go
  • internal/stagestore/domain_test.go
  • internal/stagestore/fs_darwin.go
  • internal/stagestore/fs_linux.go
  • internal/stagestore/fs_types.go
  • internal/stagestore/lock_hook_e2e.go
  • internal/stagestore/lock_hook_unix.go
  • internal/stagestore/migrations.go
  • internal/stagestore/paths.go
  • internal/stagestore/recovery.go
  • internal/stagestore/retention.go
  • internal/stagestore/retention_test.go
  • internal/stagestore/schema.go
  • internal/stagestore/secure_other.go
  • internal/stagestore/secure_unix.go
  • internal/stagestore/store.go
  • internal/stagestore/store_test.go
  • internal/staging/conversation.go
  • internal/staging/conversation_stage.go
  • internal/staging/conversation_stage_test.go
  • internal/staging/intent.go
  • internal/staging/intent_test.go
  • internal/staging/post.go
  • internal/staging/post_test.go
  • internal/staging/revision.go
  • internal/staging/revision_test.go
  • internal/staging/service.go
  • internal/staging/service_test.go
  • internal/staging/types.go
  • internal/staging/validation.go
  • internal/transport/websocket.go
  • internal/transport/websocket_test.go
  • justfile
  • npm/README.md
  • npm/bin/mm.js
  • package.json
  • schemas/embed.go
  • schemas/v2/apply-receipt.schema.json
  • schemas/v2/apply-request.schema.json
  • schemas/v2/channel.schema.json
  • schemas/v2/channels.schema.json
  • schemas/v2/config.schema.json
  • schemas/v2/dms.schema.json
  • schemas/v2/doctor.schema.json
  • schemas/v2/error.schema.json
  • schemas/v2/examples/apply-receipt.json
  • schemas/v2/examples/apply-request.json
  • schemas/v2/examples/channel-empty.json
  • schemas/v2/examples/channel.json
  • schemas/v2/examples/channels.json
  • schemas/v2/examples/config.json
  • schemas/v2/examples/dms-empty.json
  • schemas/v2/examples/dms.json
  • schemas/v2/examples/doctor.json
  • schemas/v2/examples/error.json
  • schemas/v2/examples/group-dms-empty.json
  • schemas/v2/examples/group-dms.json
  • schemas/v2/examples/mentions-empty.json
  • schemas/v2/examples/mentions.json
  • schemas/v2/examples/search-empty.json
  • schemas/v2/examples/search.json
  • schemas/v2/examples/stage-cancel-request.json
  • schemas/v2/examples/stage-preview.json
  • schemas/v2/examples/stage-prune-request.json
  • schemas/v2/examples/stage-prune-result.json
  • schemas/v2/examples/stage-receipt.json
  • schemas/v2/examples/stage-request.json
  • schemas/v2/examples/stage-revise-request.json
  • schemas/v2/examples/stage.json
  • schemas/v2/examples/stages.json
  • schemas/v2/examples/store-doctor.json
  • schemas/v2/examples/store-migrations.json
  • schemas/v2/examples/teams.json
  • schemas/v2/examples/thread.json
  • schemas/v2/examples/unread.json
  • schemas/v2/examples/users.json
  • schemas/v2/examples/watch-diagnostic.json
  • schemas/v2/examples/watch-event.json
  • schemas/v2/examples/whoami.json
  • schemas/v2/group-dms.schema.json
  • schemas/v2/mentions.schema.json
  • schemas/v2/search.schema.json
  • schemas/v2/stage-cancel-request.schema.json
  • schemas/v2/stage-preview.schema.json
  • schemas/v2/stage-prune-request.schema.json
  • schemas/v2/stage-prune-result.schema.json
  • schemas/v2/stage-receipt.schema.json
  • schemas/v2/stage-request.schema.json
  • schemas/v2/stage-revise-request.schema.json
  • schemas/v2/stage.schema.json
  • schemas/v2/stages.schema.json
  • schemas/v2/store-doctor.schema.json
  • schemas/v2/store-migrations.schema.json
  • schemas/v2/teams.schema.json
  • schemas/v2/thread.schema.json
  • schemas/v2/unread.schema.json
  • schemas/v2/users.schema.json
  • schemas/v2/watch-diagnostic.schema.json
  • schemas/v2/watch-event.schema.json
  • schemas/v2/whoami.schema.json
  • scripts/check-version.mjs
  • scripts/e2e/main.go
  • scripts/e2e/main_test.go
  • scripts/install.sh
  • scripts/install_test.go
  • scripts/licenses/main.go
  • scripts/licenses/main_test.go
  • scripts/npm-package/main.go
  • scripts/npm-package/main_test.go
  • scripts/release/main.go
  • scripts/release/main_test.go
  • scripts/test-e2e.mjs
  • skills/mattermost-cli/SKILL.md
  • src/api/channels.ts
  • src/api/client.ts
  • src/api/index.ts
  • src/api/posts.ts
  • src/api/url.ts
  • src/api/users.ts
  • src/api/websocket.ts
  • src/cli.ts
  • src/config.ts
  • src/cursor.ts
  • src/doctor.ts
  • src/formatters/index.ts
  • src/formatters/json.ts
  • src/formatters/markdown.ts
  • src/formatters/pretty.ts
  • src/formatters/watch.ts
  • src/index.ts
  • src/input.ts
  • src/preprocessing/credential.ts
  • src/preprocessing/index.ts
  • src/preprocessing/patterns.ts
  • src/preprocessing/pipeline.ts
  • src/preprocessing/post.ts
  • src/preprocessing/sanitize.ts
  • src/preprocessing/secrets.ts
  • src/types.ts
  • src/utils/colors.ts
  • src/utils/date.ts
  • src/utils/index.ts
  • src/utils/threading.ts
  • src/utils/unread.ts
  • src/validation.ts
  • staticcheck.conf
  • tests/api/channels.test.ts
  • tests/api/client.test.ts
  • tests/api/messages.test.ts
  • tests/api/paths.test.ts
  • tests/api/posts.test.ts
  • tests/api/retrieval.test.ts
  • tests/api/url.test.ts
  • tests/api/websocket.test.ts
  • tests/channels-type-validation.test.ts
  • tests/cli-empty-reads.test.ts
  • tests/cli-failure-propagation.test.ts
  • tests/cli-metadata.test.ts
  • tests/cli-output.test.ts
  • tests/cli-retrieval.test.ts
  • tests/config-doctor.test.ts
  • tests/cursor-cli.test.ts
  • tests/cursor-commander.test.ts
  • tests/cursor.test.ts
  • tests/e2e/go-concurrent-live_test.go
  • tests/e2e/go-conversation-live_test.go
  • tests/e2e/go-lifecycle-live_test.go
  • tests/e2e/go-live_test.go
  • tests/e2e/go-read-live_test.go
  • tests/e2e/go-unknown-live_test.go
  • tests/e2e/go-watch-live_test.go
  • tests/e2e/send-live.e2e.ts
  • tests/fixtures/markdown.ts
  • tests/formatters/headers.test.ts
  • tests/formatters/watch.test.ts
  • tests/group-dms.test.ts
  • tests/helpers/fake-fetch.ts
  • tests/identity-teams.test.ts
  • tests/input.test.ts
  • tests/preprocessing/post.test.ts
  • tests/preprocessing/sanitize.test.ts
  • tests/preprocessing/secrets.test.ts
  • tests/send-commander.test.ts
  • tests/send.test.ts
  • tests/setup.ts
  • tests/users.test.ts
  • tests/utils/date.test.ts
  • tests/utils/threading.test.ts
  • tests/utils/unread.test.ts
  • tests/validation.test.ts
  • tsconfig.json
  • vitest.config.ts
  • vitest.e2e.config.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/go-v2-rewrite

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ardasevinc
ardasevinc merged commit 17ad658 into main Jul 17, 2026
3 checks passed
@ardasevinc
ardasevinc deleted the feat/go-v2-rewrite branch July 17, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant