You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
schemaVersion: requirement-record.v1revision: R3status: readypriority: P2productOwner: "@PeterGuy326"technicalOwner: "@waterbro-8"userOutcome: "A first-time user who is missing a prerequisite is told which one, by the CLI, and is pointed at the documented container path instead of at a bare-metal install they cannot complete."requirements:
- REQ-001
- REQ-002
- REQ-003acceptanceCriteria:
- AC-001
- AC-002
- AC-003parent: "https://github.com/bytefolk/mem/issues/109"dependencies:
- "https://github.com/bytefolk/mem/issues/109 at R2"supersedes:
- "#109 R1 REQ-003 / AC-003"lastDecisionAt: "2026-09-04T06:30:41Z"
Context and why this is a separate issue
Split out of #109 by technical-owner adjudication on 2026-08-30: #109 is a documentation repositioning (README/onboarding lead with deploy/compose), while its REQ-003 asked for a CLI surface that does not exist in this repository at all. Verified at main @ 419a420: the strings doctor and first-run appear nowhere in the tree — no command, no messaging, no flag. Shipping it is net-new Go code with its own output contract and tests, which cannot share a reviewable PR with a README rewrite, and which kept #109 mislabelled type:feature for a docs problem.
#109's own open decision asked whether doctor-level container-path detection belongs there or in a shared doctor surface. Answer: the shared surface, which is this issue.
Requirements
REQ-001: A read-only mem doctor command reporting, per check and with --format json per SPEC.md:579: server reachability for the configured URL, credential presence, selected workspace, and CLI/server version skew. Exit codes follow SPEC.md:582 (0 ok · 2 not_found · 3 auth · 4 plan/quota · 5 provider/timeout).
REQ-002: First-run guidance on the existing fail-closed paths. Every command that currently returns newCliError(3, "not logged in", "run mem auth login first") (e.g. server/cmd/mem/cmds_file.go:45) must, when no credential exists at all, additionally name the documented deployment path from docs(onboarding): make deploy/compose the primary onboarding path #109 — so the hint matches the path the docs now recommend.
REQ-003: Diagnosis only. Zero writes, zero auto-remediation, zero dependency installation. An auto-installer would re-create the exact bare-metal burden (brew install postgresql@17 pgvector, server/.env authoring, MinIO, Ollama) that made the container path the recommended entry in the first place (docs/RUN_LOCAL.md:24, scripts/dev_up.sh:31,117,208).
Acceptance criteria
AC-001: Fixture per finding class — unreachable server, no credential, no workspace selected, version skew — each producing its named check result, its code, and a hint that names the documented path; asserted at the HTTP-contract level following the cmds_ingest_test.go stub pattern.
AC-002: mem doctor performs no write request of any kind — a stub transport fails the test on any non-read call — and never prints a secret, token value, or DSN.
AC-003: mem doctor --format json output validates against a checked-in schema or golden file, so ops tooling can consume it without parsing prose.
Non-goals and forbidden shortcuts
Not an environment-certification matrix: it does not validate Go/Python/protoc versions, install anything, or manage Docker/compose (no start, stop, or compose up from the CLI).
No detection of host container runtimes in v1 — "is the stack container-hosted?" is unverifiable from inside a container and must not be guessed into a reported fact.
No TTY wizard; text output is a fixed ordered list of findings.
Open decisions: (1) command name and shape (mem doctor vs mem doctor env vs a mem auth status --doctor mode) — tech adjudication at kickoff; (2) whether memd logs an equivalent readiness line at startup so a compose operator sees the same facts without an exec; (3) whether the check set is a registry that mem-mcp and the web setup screen can reuse.
Evidence plan
E2 available now: source-level — the absence of any doctor/first-run surface at main @ 419a420, and the not logged in hint sites that REQ-002 must extend.
E3/E4 at delivery: deterministic fixtures per finding class plus one real run against a stopped and a healthy stack.
Decisions
R2 owner decision (requirement-decision:v1, decidedAt 2026-09-01T02:54:08Z, approver @PeterGuy326): see #112#issuecomment-5488211237. Approved scope: fixed four checks, fixed ordered text + versioned JSON v1, read-only GET probes only, fail-closed secret handling. This record is append-only; the comment is canonical and this body mirrors it.
Resolved by R3 (requirement-decision:v1, decidedAt 2026-09-04T06:30:41Z, approver @PeterGuy326): see #112#issuecomment-5536659086. The doctor's exit-code contract is the SPEC.md §7.1 mapping (0 ok · 2 not_found · 3 auth · 4 plan/quota · 5 provider/timeout); R2's "returns exit code 0 while reporting findings" sentence is replaced. All other R2 scope and security criteria stand.
R2 (2026-09-01): owner decision approved the secure read-only doctor scope (see Decisions). Body synchronized to the decision comment on 2026-09-04; REQ-001 text left verbatim, with its exit-code conflict against R2's approved scope recorded as an open owner adjudication.
Context and why this is a separate issue
Split out of #109 by technical-owner adjudication on 2026-08-30: #109 is a documentation repositioning (README/onboarding lead with
deploy/compose), while its REQ-003 asked for a CLI surface that does not exist in this repository at all. Verified atmain @ 419a420: the stringsdoctorandfirst-runappear nowhere in the tree — no command, no messaging, no flag. Shipping it is net-new Go code with its own output contract and tests, which cannot share a reviewable PR with a README rewrite, and which kept #109 mislabelledtype:featurefor a docs problem.#109's own open decision asked whether doctor-level container-path detection belongs there or in a shared doctor surface. Answer: the shared surface, which is this issue.
Requirements
mem doctorcommand reporting, per check and with--format jsonper SPEC.md:579: server reachability for the configured URL, credential presence, selected workspace, and CLI/server version skew. Exit codes follow SPEC.md:582 (0ok ·2not_found ·3auth ·4plan/quota ·5provider/timeout).newCliError(3, "not logged in", "runmem auth loginfirst")(e.g.server/cmd/mem/cmds_file.go:45) must, when no credential exists at all, additionally name the documented deployment path from docs(onboarding): make deploy/compose the primary onboarding path #109 — so the hint matches the path the docs now recommend.brew install postgresql@17 pgvector,server/.envauthoring, MinIO, Ollama) that made the container path the recommended entry in the first place (docs/RUN_LOCAL.md:24,scripts/dev_up.sh:31,117,208).Acceptance criteria
cmds_ingest_test.gostub pattern.mem doctorperforms no write request of any kind — a stub transport fails the test on any non-read call — and never prints a secret, token value, or DSN.mem doctor --format jsonoutput validates against a checked-in schema or golden file, so ops tooling can consume it without parsing prose.Non-goals and forbidden shortcuts
compose upfrom the CLI).Lifecycle, status, priority, blockers, and open decisions
@waterbro-8; independent reviewer: aCODEOWNERSowner (not the author).mem doctorvsmem doctor envvs amem auth status --doctormode) — tech adjudication at kickoff; (2) whethermemdlogs an equivalent readiness line at startup so a compose operator sees the same facts without an exec; (3) whether the check set is a registry thatmem-mcpand the web setup screen can reuse.Evidence plan
main @ 419a420, and thenot logged inhint sites that REQ-002 must extend.Decisions
0ok ·2not_found ·3auth ·4plan/quota ·5provider/timeout); R2's "returns exit code 0 while reporting findings" sentence is replaced. All other R2 scope and security criteria stand.Revision history
需要 maintainer 打标(本账号无 label 写权限):建议
type:feature、area:cli、priority:p2、evidence:e2-source、status:needs-triage。