5.1 KiB
5.1 KiB
MVP Checklist
Fixed decisions
- Emacs Lisp UI.
- Rust bridge.
- Docker Compose as primary bridge runtime.
- Emacs does not start Docker.
- TCP JSONL transport.
- Web status UI planned.
- Mattermost 10.9.3 target.
- Mattermost server is source of truth.
- Emacs buffers are display-only.
- MVP starts with self-DM.
- Raw message text, no Markdown rendering.
- Threads separate buffers by default, configurable.
- g means forced refresh and connection recovery.
- Multiserver architecture planned, not implemented in MVP.
- Typing not in MVP.
- Reactions not in MVP.
- Login/password and session/PAT token only.
- Plain token cache file for MVP.
- Explicit CA configuration for self-signed/internal CA.
Phase 0 — repository bootstrap
- Create repository tree script.
- Create README.
- Create .gitignore.
- Create .dockerignore.
- Create architecture doc.
- Create protocol doc.
- Create Docker doc.
- Create TLS doc.
- Create Mattermost 10.9.3 notes.
- Create MVP checklist.
Phase 1 — minimal Rust bridge
- Add Cargo workspace.
- Add crate manifests.
- Add minimal mm-core types.
- Add JSONL protocol types.
- Add TCP listener.
- Implement ping.
- Implement status.
- Add smoke test for ping/status.
Phase 2 — Docker and status web UI
- Add Dockerfile.
- Add compose.yaml.
- Add bridge config from environment.
- Add /health.
- Add /status JSON.
- Add simple HTML status page.
- Add Docker helper scripts.
- Add web smoke script.
- Verify local bridge + web smoke.
- Verify Docker Compose bridge + web smoke.
Phase 3a — storage foundation (no network)
- mm-core: User model.
- mm-core: ServerConfig model.
- mm-core: ServerSummary.has_token.
- mm-store: TokenStore (load/save/delete/list).
- Atomic token writes via temp file + rename.
- Private file mode 0600 on Unix.
- server_id validation against path traversal.
- mm-store: ServerStore for non-secret config.
- MM_DATA_DIR config with host default.
- App state carries data_dir.
- status reads persisted stores, never exposes secrets.
- Unit tests for stores and status.
- Verify cargo test locally.
- Verify status shows a stored server without leaking the token.
Phase 3b — authentication (network)
3b-1: HTTP client foundation
- mm-client crate skeleton.
- reqwest dependency with rustls-tls-native-roots (for system CA) + explicit CA support.
- Client struct with base_url and optional ca_file.
- login(login_id, password) -> Result<String, Error> (extracts Token header).
- get_me(token) -> Result<User, Error>.
- Unit/integration tests for client construction.
3b-2: Bridge integration
- Implement connect method in bridge.
- Implement me method in bridge.
- Save session token via TokenStore on successful connect.
- Load saved token on startup (future: auto-reconnect).
- Support PAT token (same flow, just skip login).
- Map Mattermost API errors to normalized error codes.
- Ensure tokens/passwords are never logged.
Phase 4 — self-DM vertical slice
- Implement teams.
- Resolve current user.
- Create/get self direct channel.
- Implement open_self_dm.
- Implement get_history.
- Implement send_post.
- Connect Emacs to bridge.
- Open self-DM buffer.
- Display raw messages.
- Send message from Emacs.
- Receive own message online.
Phase 5 — WebSocket online updates
- Open Mattermost WebSocket.
- Authenticate with authentication_challenge.
- Handle hello.
- Handle posted.
- Handle post_edited.
- Handle post_deleted.
- Fan out normalized events to Emacs.
- Update open self-DM buffer online.
- Add reconnect loop.
- Implement forced refresh path for g.
Phase 6 — replies/threads
- Implement reply_post.
- Add thread buffer.
- Add mattermost-thread-display.
- Default to separate thread buffers.
- Keep inline mode as future-compatible option.
- Show server/team context in thread buffer names.
Phase 7 — channels
- Implement list_channels.
- Add channel list buffer.
- Open channel buffer.
- Load channel history.
- Send channel message.
- Receive channel events online.
- Implement mark_read.
- Forced refresh with g.
Phase 8 — TLS/self-signed support
- Add explicit CA file configuration.
- Document Docker CA mount.
- Document Emacs CA settings separately.
- Do not disable certificate verification by default in Rust bridge.
- Add clear error message for TLS failures.
Phase 9 — hardening
- Add structured errors.
- Add request timeouts.
- Add rate-limit handling.
- Add basic integration smoke tests.
- Add Emacs Lisp tests.
- Review logs for secret leaks.
- Review cache file permissions.
- Review multiserver-ready identifiers and naming.
Next atomic step
Verify Phase 2 locally and in Docker Compose.
After that:
Implement authentication foundation: connect, me, login/password, token cache.