Found by Codex review on PR #88.
Bug 1: deps command uses wrong JSON field
scripts/codedb-cli line 121 does:
_get "/explore/deps?path=$(_urlencode "$1")" | jq -r '.dependents[]'
But the server (src/server.zig) returns the list under imported_by, not dependents. With set -euo pipefail, this makes deps fail on every call.
Fix: Change .dependents[] to .imported_by[]
Bug 2: Root mismatch when daemon already running
_ensure_server returns immediately if /health succeeds, regardless of what [root] was requested. If a daemon is already running for repo A, calling codedb-cli /repo-b tree silently returns repo A's results.
Fix: Check the running daemon's root (via /status or similar) and restart if it doesn't match the requested root.
Origin
Both found by Codex automated review on #88. The core fixes in #88 (stack overflow + codesign) are unaffected — these are CLI wrapper issues only.
Found by Codex review on PR #88.
Bug 1:
depscommand uses wrong JSON fieldscripts/codedb-cliline 121 does:But the server (
src/server.zig) returns the list underimported_by, notdependents. Withset -euo pipefail, this makesdepsfail on every call.Fix: Change
.dependents[]to.imported_by[]Bug 2: Root mismatch when daemon already running
_ensure_serverreturns immediately if/healthsucceeds, regardless of what[root]was requested. If a daemon is already running for repo A, callingcodedb-cli /repo-b treesilently returns repo A's results.Fix: Check the running daemon's root (via
/statusor similar) and restart if it doesn't match the requested root.Origin
Both found by Codex automated review on #88. The core fixes in #88 (stack overflow + codesign) are unaffected — these are CLI wrapper issues only.