612456334f
- mattermost-dashboard-mode: list channels from bridge - mattermost-channel-mode: view history and send messages - Interactive connection prompt (password in memory only) - Fix JSON array parsing (vectors → lists) in protocol layer - Add mattermost-reset-state for clean reconnects - Add dev-check.sh for quick Rust validation - Verified end-to-end: Emacs → Bridge → Mattermost → back
5.2 KiB
5.2 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.
- 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 file per server, private mode.
- Explicit CA configuration, verification stays enabled.
- Automated dependency resolution, no manual version pins.
Phase 0 — repository bootstrap
- Repository tree script.
- README.
- .gitignore / .dockerignore.
- architecture / protocol / docker / tls / mattermost notes docs.
- MVP checklist.
Phase 1 — minimal Rust bridge
- Cargo workspace, five crates.
- mm-core: ids, errors, models.
- JSONL protocol parse/validate/encode.
- TCP listener, line-based handling.
- ping, status, unknown_method, invalid_json.
- Unit tests.
- dev-check.sh, smoke-ping.sh.
Phase 2 — Docker and web status UI
- mm-web with axum.
- /health, /status, HTML index.
- Shared BridgeStatus between TCP and web.
- Config from environment (listen addresses).
- Dockerfile with Nexus builder and internal CA.
- compose.yaml, docker helper scripts.
- Non-root runtime user.
- smoke-web.sh with proxy bypass.
- MSRV-aware Cargo.lock, committed after green build.
- Local bridge + web smoke verified.
- Docker Compose bridge + web smoke verified.
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)
- mm-client: HTTP client with explicit CA support.
- login/password against Mattermost 10.9.3, read Token header.
- Save session token via TokenStore.
- Load saved token on connect.
- Support PAT token.
- Implement connect.
- Implement me.
- Map Mattermost errors to normalized error codes.
- Ensure tokens/passwords are never logged.
Phase 4a — self-DM backend vertical slice
- Implement teams.
- Resolve current user.
- Create/get self direct channel.
- Implement open_self_dm.
- Implement get_history with ascending post order.
- Implement send_post.
- Bridge methods verified via smoke tests.
- Post model includes file_ids.
Phase 4b — Emacs UI
- Connect Emacs to bridge over TCP.
- Interactive connection prompt (password in memory only).
- Dashboard buffer with channel list (
mattermost-dashboard-mode). - Open channel buffer from dashboard.
- Display raw message history in channel buffer.
- Send message from channel buffer (
C-c C-s). - Refresh channel history (
g). - Reset connection state (
mattermost-reset-state). - Receive own message online (WebSocket fan-out).
- Resolve DM channel display names (currently shows empty).
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.
- Thread buffer.
- mattermost-thread-display option.
- Default separate-buffer.
- Keep inline mode future-compatible.
- Server/team context in thread buffer names.
Phase 7 — channels
- Implement list_channels (Rust backend).
- Channel list buffer (Emacs UI).
- Open channel buffer, load history, send message.
- Channel events online (WebSocket fan-out).
- Implement mark_read.
- Resolve DM channel display names.
- Forced refresh with g (basic refresh works, full recovery pending).
Phase 8 — TLS/self-signed support
- MM_CA_FILE configuration for bridge to Mattermost.
- Same CA policy for REST and WebSocket.
- Document Docker CA mount.
- Clear tls_error messages.
Phase 9 — hardening
- Request timeouts.
- Rate-limit handling.
- Integration smoke tests.
- Emacs Lisp tests.
- Log review for secret leaks.
- Cache permission review.
- Multiserver-ready naming review.
Next atomic step
Phase 5: WebSocket client implementation in mm-client.