feat: add creed doctor command (COD-387) - #44
Conversation
Add generated Doctor operation to service.Service that produces a structured diagnostic report: project root, .creed/manifest presence, canonical validation summary, configured target state, git availability (never a sync blocker, only a remote-operation prerequisite), and source-type/remote detection. Credentials embedded in remote URLs are redacted while preserving the username and host. WithGitToken values never appear in the report. Includes generated CLI/MCP/HTTP surfaces, codegen Doctor case with concise CLI formatting, and comprehensive service tests covering healthy/missing/invalid setups and credential redaction.
🤖 Automated Review PanelGPT-5.6 (openai/gpt-5.6-terra)Verdict: Request changes — one critical security bug found and fixed. 🔴 Critical (FIXED): ✅ Verified:
🟡 Minor: Validation warnings are invisible in CLI output (only errors printed). The structured MCP/HTTP surface includes them. Nice-to-have, not blocking. Gemini 3 Flash (google/gemini-3-flash-preview)Verdict: Block merge on the ✅ Strengths:
Cross-referenced: |
Auto-Merge Gate ApprovalConfidence: 0.92 RationaleThe PR fully satisfies all five acceptance criteria in COD-387:
Review Panel OutcomeBoth reviewers (GPT-5.6, Gemini 3 Flash) identified a credential-leak bug in Checks Observed
Scope12 files changed (+597, -1). New Auto-merged by CodeFold Auto-Merge Gate (confidence ≥ 0.80) |
Summary
Implements COD-387:
creed doctor— a diagnostic command for resolving common setup failures.Changes
internal/service/doctor.go(new):DoctorReporttype +Doctor()implementation that produces a structured diagnostic report covering:.creed/directory presencemanifest.yamlpresenceValidate()logic)internal/service/service.go: AddedDoctor(ctx) (DoctorReport, error)to the Service interfaceinternal/codegen/main.go: AddedDoctorcase to the CLI handler generator with concise formatting +boolMarkhelpercmd/gen/doctor.go), MCP (internal/mcp/gen/doctor.go), HTTP handler, operation descriptor — all produced bygo generate ./....creedis a file not a directory)Review Panel
Both reviewers (GPT-5.6, Gemini 3 Flash) flagged a critical credential-leak bug:
SourceRemotewas set verbatim from the manifest, leaking embedded URL passwords. Fixed before PR:redactRemoteURL()now strips passwords while preserving username and host. Reviewers also confirmed all CI gates pass and the hexagonal/codegen flow is correct.Verification
All gates pass:
go generate ./...✅scripts/check-generated.sh— "generated code is current" ✅go build ./...✅go test -race -count=1 ./...✅ (all 15 packages)go vet ./...✅gofmt -l .✅creed doctoron fresh dir → exit 1 with errors; aftercreed init→ exit 0 with "All checks passed" ✅Closes COD-387