Repository navigation
feat(desktop): repo-aware reader — branch/tag + contributor matching (#6003 selective) - #298
Conversation
Selectively ports the block#6003 reader improvements: the managed local read now tries every advertised clone URL instead of assuming cloneUrls[0], a selected tag fails closed instead of serving branch-tip data as the tag, and ambiguous git-author matches prefer the pubkeys the repository announcement itself names. Upstream Projects sidebar navigation is intentionally not ported (channel-first IA, #278). Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Oscar Le <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Runtime E2E verification (desktop mock bridge, full-viewport)Built the desktop E2E bundle on this branch and on a Tag selected → local source becomes "Local unavailable" and disabled:
Programmatic labels from the same run — this branch: Whole-app context — channel-first IA preserved (upstream block#6003 navigation not ported): Sidebar still shows Channels/Forums/DMs + Inbox/Pulse/Wiki/Agents/Workflows; no Projects rail, no Workbench nav. Files with a tag selected, Contributors, Commits: No console errors from the reader changes (one pre-existing mock-Inbox fixture error appears on both builds). Committed Playwright suite: 1322 tests, 70 failures on this branch — every failing Not proven at runtime: the multi-clone-URL fallback (the mock repository advertises a single clone URL) and the "unverified match" label (the fixture renders 0 such rows). Both are covered by unit tests; making them runtime-provable needs a second announced clone URL and an unverified contributor in the mock fixture. |






Summary
Selectively absorbs the upstream block#6003 reader/backend improvements for repository reads, without the persistent Projects sidebar navigation.
Three behaviour changes, all in the desktop project reader:
Managed local reads try every advertised clone URL.
readProjectLocalRepoSnapshottook a singlecloneUrl(alwayscloneUrls[0]) andlocalRepoCandidatesderived checkout names from that one URL. A NIP-34 announcement can advertise several clone URLs (relay mirror beside canonical host), and the checkout's origin may be any of them, so both now walk the whole list in announced order and stop at the first URL that resolves:A selected tag fails closed on the local read. The native local reader only resolves branches, so with a tag selected the local snapshot was branch-tip data labelled as the tag.
readProjectLocalRepoSnapshotnow returnsnullwhenselectedTagis set (before the exact linked-workspace path too),useProjectLocalRepoSnapshotQueryis disabled and keyed on the tag, andlocalWorkspaceSourceState({ isTagSelected: true })reportsLocal unavailableinstead ofLocal. Loading states are unchanged otherwise: a pending read still reportsLocal checking.Contributor matching is repository-aware. Git author strings are unauthenticated, so matching stays exact-equality-only and remains labelled "unverified match"; the change is only candidate ordering.
repositoryParticipantPubkeys(repository)returns owner → maintainers → contributors, andprofileForContributor/profileForCommittry those pubkeys first, then the remaining profiles in a stable (sorted) order — so an ambiguous author (two profiles with the same display name) resolves to the repo's own participant, and identical input no longer depends on profile-lookup iteration order. It never turns a non-match into a match; the signed PR-event mapping still wins over any heuristic.Divergence from upstream
Upstream block#6003 also introduces persistent Projects sidebar navigation. That is not ported: Crew's channel-first IA is preserved per #278 and the decision in #223 removing the Projects rail / Workbench chrome. No
AppSidebar/AppShell/navigation files are touched — the diff is confined todesktop/src/features/projects.Related issue
Fixes #273. Part of the Buzz 0.5.18 sync stack (#285); sibling scopes (#270) untouched.
Testing
TDD: tests written first against unmodified
main(7 failing), then implementation (all green).main+ new tests)pnpm --filter buzz checkcheck:channel-first-ia)pnpm --filter buzz typecheckpnpm --filter buzz testmain, so it includes the new channel-first IA contract test from #297)just test-unitbuzz-cli(3) +buzz-db(1) fail identically on an unmodifiedmainworktree — pre-existing, and this PR changes no Rustjust check-compileNew/extended tests:
project-repo-aware-reader-contract.test.mjs(all-clone-URL search, first-resolving-URL short circuit, tag fail-closed on managed and exact linked reads, source-label honesty, multi-URL checkout matching) andprojectContributorMatching.test.mjs(participant ordering, ambiguous-match resolution, determinism without repo scope, no invented matches). The 19 exact-local-workspace scenarios fromdocs/crew/verification/0004-exact-local-workspace-reader.mdstill pass inside the full desktop suite.Runtime E2E evidence (desktop mock bridge, full-viewport)
The desktop E2E bundle was built on this branch and on a
mainworktree, driven through the Playwright mock bridge at/#/projects, and compared for a branch vs a tag selection.Tag selected → local source is "Local unavailable" and disabled (after), vs "Local" (before):
main)Programmatic labels from the same run — this branch:
BRANCH_LOCAL_LABEL=Local,TAG_LOCAL_LABEL=Local unavailable (disabled);main:BRANCH_LOCAL_LABEL=Local,TAG_LOCAL_LABEL=Local.Whole-app context — channel-first IA preserved (no Projects rail, no Workbench nav):
Files with a tag selected, Contributors, Commits (after):
No console errors from the reader changes (one pre-existing mock-Inbox fixture error appears on both builds).
Committed Playwright suite: 1322 tests, 70 failures on this branch — every failing
spec:linereproduces identically on amainworktree (project specs 34/34; agents + thread-pr-hub + responsive-matrix + channel-mute + profile 23/23; video/voice/crew-wiki/relay-backed 12/12), plus one 30s-timeout flake inthread-reply-anchor-roleplay.spec.tsthat moved to a sibling case on re-run. No failure is attributable to this PR, but the suite is not green in this sandbox on either branch (the relay-backed specs need a live relay).Not proven at runtime: the multi-clone-URL fallback (the mock repository advertises a single clone URL) and the "unverified match" label (the fixture renders 0 such rows). Both are covered by the unit tests; making them runtime-provable would need a second announced clone URL and an unverified contributor in the mock fixture.
Link to Devin session: https://app.devin.ai/sessions/8a9cb06786df4b48972b207fa9288fc9
Requested by: @oscarlehuu