Conversation
Add a read-only `mem doctor` CLI command that checks server reachability, credential presence, workspace selection, and CLI/server version skew. Supports --format text|json output. Performs no writes and installs no dependencies. All error paths fail closed without leaking URLs, tokens, or raw error values.
- Always exit 0 per Approved Scope; findings reported in output only - Add code and hint fields to each check result (AC-001) - Hints name the deploy/compose/ path for first-run guidance (REQ-002) - Add mem.doctor/v1 schema_version and golden file (AC-003) - Add write-guard transport test proving no non-GET requests (AC-002) - Replace all "not logged in" hints with errNotLoggedIn() helper - 16 doctor tests covering all finding classes and security constraints
|
Closing under the fork-workflow decision recorded on 2026-09-03: repository #112, with #131 as the organization-branch candidate. Both branches add the same surface — The state of that replacement, so nobody leaves here assuming #112 is covered: The commits are not lost. A closed fork PR keeps its head ref: git fetch https://github.com/bytefolk/mem.git refs/pull/149/head:pr-149Every file in this branch was therefore available to the re-doing work, whether |
Summary
mem doctorread-only CLI diagnostic command that checks server reachability, credential presence, workspace selection, and CLI/server version skew--format text|jsonoutput withmem.doctor/v1schema version; always exits 0 per Approved Scopename,code,status,message, andhintfields (AC-001)deploy/compose/path (REQ-002)Closes #112
Acceptance Criteria Coverage
TestDoctorServerUnreachable,TestDoctorNoCredentials,TestDoctorNoWorkspace,TestDoctorVersionSkew— each asserts named check, code, and hintTestDoctorPerformsNoWriteRequests— stub transport fails test on any non-GET callTestDoctorNoSecretsInTextOutput,TestDoctorMalformedServerURL,TestDoctorServerReturnsNon200Healthz— assert no token/URL/error body leakageTestDoctorJSONMatchesGoldenFilevalidates againsttestdata/doctor-golden.jsonTest plan
go test ./cmd/mem/ -run TestDoctor— 16 doctor tests passgo test ./cmd/mem/— full CLI suite passes (no regressions)go vet ./cmd/mem/— cleango build ./cmd/mem/— builds successfully