Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) returned404: project not found: hash=…for every external (GitHub) project.client.encodeProjectPathalways wrapped the identity inlocal:{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 setsMachineID; hash external identifiers bare. Verified the CLI now emits the server's stored hash (ed5aabb72e927702forgithub.com/MythicalGames/pf3-backend@main). Addsencode_test.go.CLI-only; server unchanged. Release as
cli/v0.7.1.🤖 Generated with Claude Code