Skip to content

cli/v0.7.1: fix external-project -n search (404)#66

Merged
dvcdsys merged 1 commit into
mainfrom
develop
Jun 3, 2026
Merged

cli/v0.7.1: fix external-project -n search (404)#66
dvcdsys merged 1 commit into
mainfrom
develop

Conversation

@dvcdsys
Copy link
Copy Markdown
Owner

@dvcdsys dvcdsys commented Jun 3, 2026

Ships the CLI fix for external-project single-project search.

Bug: cix search -n github.com/owner/repo@branch (and def/refs/symbols/files/summary) returned 404: project not found: hash=… for every external (GitHub) project. client.encodeProjectPath always wrapped the identity in local:{machineID}:, but the server hashes external projects from the bare host_path → guaranteed hash mismatch. Workspace search was unaffected (resolves server-side by ID).

Fix: namespace only absolute filesystem paths (filepath.IsAbs) — exactly when the server sets MachineID; hash external identifiers bare. Verified the CLI now emits the server's stored hash (ed5aabb72e927702 for github.com/MythicalGames/pf3-backend@main). Adds encode_test.go.

CLI-only; server unchanged. Release as cli/v0.7.1.

🤖 Generated with Claude Code

Single-project search/def/refs/symbols/files/summary against an EXTERNAL
project (GitHub repo attached server-side) returned
"API error (404): project not found: hash=..." for every `-n
github.com/owner/repo@branch` lookup.

Root cause: client.encodeProjectPath unconditionally wrapped the identity
key as "local:{machineID}:{path}". The server only namespaces LOCAL
projects (projects.Create wraps the key when MachineID != ""); external
projects are stored with path_hash = hashPath(bare host_path). So the CLI
computed sha1("local:{machine}:github.com/...@main") while the server had
sha1("github.com/...@main") — guaranteed mismatch → 404. Workspace search
was unaffected because it resolves projects server-side by ID, not via the
client hash.

Fix: namespace only ABSOLUTE filesystem paths (filepath.IsAbs), which is
exactly when the server sets MachineID; hash non-absolute identifiers
(external IDs) bare. Verified the CLI now emits the same hash the server
stores (ed5aabb72e927702 for github.com/MythicalGames/pf3-backend@main).

Adds encode_test.go pinning external-bare vs local-namespaced against the
server's documented formula.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dvcdsys dvcdsys merged commit fe229fa into main Jun 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant