Repository navigation
Conversation
Fleet review (qwen38)Lens: evidence. The PR closes the single blocking acceptance criterion of issue #364: doctorTargetOwnership already classified an unreadable or undecodable prior state as invalid (#438), and this change propagates that classification into the exit code, so an invalid ownership now sets exitConflict (3) instead of exiting 0. The rewritten test asserts the conflict exit independently for both invalid variants (undecodable garbage and a mode-000 state file), checks stdout prints ownership=invalid and stderr is empty, which directly reproduces and now refutes the issue's failure scenario. The help text and docs/operating.md were updated to state the conflict-3 behavior, matching the PR's verification claims (root/QA help tests, go vet, go test). Evidence caveats: the mode-000 subtest skips when the runner is uid 0, so on a root CI only the undecodable path proves the new exit logic — acceptable because both classifications funnel through the same ownership == "invalid" check; local go test -race timed out at 360s and defers to exact-head CI, honestly disclosed. No concrete failure scenario found; verdict ready to merge. Suggestion (1)
Question (1)
Verdict: ready to merge |
Fleet review (glmflash)Lens: adversarial. The fix correctly propagates the existing invalid-ownership classification from doctorTargetOwnership (verified at the reviewed head: ErrNotExist -> unowned, any other read error or decode failure -> invalid) into the directory-doctor conflict exit. Every non-invalid path (absent, unowned, owned, unwritable) keeps its prior exit code, so the change is confined to the requested behavior. The rewritten test now asserts exit 3 independently for undecodable and mode-000-unreadable state in separate subtests, directly closing the acceptance scenario of issue #364 (mode-000 state file no longer reported as unowned with exit 0). Documentation (docs/operating.md) and the root help string were updated consistently. Boundary probes found no blocking defect: unwritable+invalid is idempotent (both set exitConflict), ENOTDIR on .cortex falls into invalid and exits conflict conservatively, and the root-skip for the mode-000 case is documented. Minor suggestion below is non-blocking. Suggestion (1)
Verdict: ready to merge |
Fleet review (mimo)Lens: requirements. Issue #364 has a single acceptance criterion — unreadable prior state must not be certified as a clean first install with exit 0 — and the diff satisfies it: internal/cli/doctor.go:156-159 maps ownership=invalid to exitConflict (3), consistent with the docs update (docs/operating.md:100-101) and the new help line (internal/cli/doctor.go:275), where exitConflict=3 matches every existing conflict site (unwritable dir, presence=unreadable, host prior-state blocker, install ownership/schema conflicts). The pre-existing assertions visible in the diff show the base already classified mode-000 and undecodable state as ownership=invalid but exit 0 (that label half came from #438), so this PR closes the remaining exit-code half of the quoted scenario: at this head the criterion's scenario prints ownership=invalid and exits 3 instead of ownership=unowned/exit 0, so it no longer reproduces. The restructured subtests assert exitConflict with exact stdout for both undecodable and unreadable state, while absent/unowned/owned stay exit 0 (their tests are untouched and only invalid triggers the new conflict); the rootHelp change breaks no test, since no test asserts the replaced doctor help string. One testability note below; no blocking findings. Suggestion (1)
Verdict: ready to merge |
Fleet review (glm)Lens: requirements + adversarial. The diff satisfies the single acceptance criterion of correction issue #364: a directory target whose .cortex/install-state.json exists but cannot be read (mode 000) or decoded is reported as ownership=invalid and now exits with conflict code 3 instead of 0, so unreadable prior state can no longer be certified as a clean first install. The ownership conflict propagation sits inside the presence=present branch (absent targets keep exit 0), composes correctly with the existing writability=unwritable conflict, and the host-probe doctor path already returns exitConflict for prior-state blockers, so the rewritten help line 'probe host/target; conflicts exit 3' is accurate for both doctor modes. Tests assert exitConflict independently for the undecodable and unreadable (mode-000, non-root) cases, and the root-skip on the unreadable subtest is backstopped by the undecodable subtest, which exercises the same invalid-to-conflict path. No contradicting, missing, or unverifiable criterion found; no boundary or failure-path defect found in the changed code. No findings. Verdict: ready to merge |
Fleet review (deepseek)Lens: evidence + test design. The change is small and correct for the linked acceptance criterion: doctorTargetOwnership (internal/cli/doctor.go:172) already returned Suggestion (1)
Question (1)
Verdict: ready to merge |
Linked Issue
Closes #364
PR Type
type:bugBug fixSummary
Directory doctor already classified unreadable prior state as invalid after #438, but still exited successfully. Return conflict code 3 when prior ownership is invalid so unreadable state cannot be certified as a clean first install.
Changes
Focused Tests
go vet ./...: pass.go test ./...: pass./usr/bin/python3 -m unittest tests.test_community_policy tests.test_github_policy tests.test_runtime_adapter_contract: 16 tests pass.git diff --check: pass.go test -race ./...exceeded the 360-second timeout; exact-head CI remains the required race proof.Runtime Harness
The CLI regression invokes the doctor command dispatcher against real temporary directory targets. Mode-000 prior state reports presence=present writability=writable ownership=invalid and exits 3; stderr is empty. Existing directory-state tests pass.
Rollback
Revert this commit to restore the prior directory-doctor exit behavior, tests, and documentation together. No stored data changes or migration.
Chain Dependencies / Out of Scope
One focused PR, no chain dependencies. Runtime-probed doctor, installation behavior, and ownership decoding are unchanged.
Risk: none; the change is confined to the requested directory-doctor conflict result.
Checklist
status:approved.type:*label is applied.