Skip to content

feat(desktop): repo-aware reader — branch/tag + contributor matching (#6003 selective) - #298

Merged
oscarlehuu merged 3 commits into
mainfrom
devin/issue-273-repo-aware-reader
Aug 22, 2026
Merged

oscarlehuu merged 3 commits into
mainfrom
devin/issue-273-repo-aware-reader

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

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:

  1. Managed local reads try every advertised clone URL. readProjectLocalRepoSnapshot took a single cloneUrl (always cloneUrls[0]) and localRepoCandidates derived 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:

    for (const cloneUrl of input.cloneUrls ?? [input.cloneUrl]) {
      const result = await dependencies.getLocalSnapshot({ ...input, cloneUrl });
      if (result) return result;
    }
    return null;
  2. 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. readProjectLocalRepoSnapshot now returns null when selectedTag is set (before the exact linked-workspace path too), useProjectLocalRepoSnapshotQuery is disabled and keyed on the tag, and localWorkspaceSourceState({ isTagSelected: true }) reports Local unavailable instead of Local. Loading states are unchanged otherwise: a pending read still reports Local checking.

  3. 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, and profileForContributor / profileForCommit try 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 to desktop/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).

Gate Result
RED (worktree at main + new tests) 7 failed / 1 passed
GREEN (focused, this branch) 20 tests, 20 pass
pnpm --filter buzz check pass (incl. check:channel-first-ia)
pnpm --filter buzz typecheck pass
pnpm --filter buzz test 5548 tests, 5547 pass, 1 skipped, 0 fail (re-run after merging main, so it includes the new channel-first IA contract test from #297)
just test-unit 6 suites pass; buzz-cli (3) + buzz-db (1) fail identically on an unmodified main worktree — pre-existing, and this PR changes no Rust
just check-compile n/a (no Rust changes)

New/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) and projectContributorMatching.test.mjs (participant ordering, ambiguous-match resolution, determinism without repo scope, no invented matches). The 19 exact-local-workspace scenarios from docs/crew/verification/0004-exact-local-workspace-reader.md still 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 main worktree, 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):

Before (main) After (this branch)
before-06-tag-source-menu after-06-tag-source-menu

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):

after-01-home

Files with a tag selected, Contributors, Commits (after):

after-05-files-tag
after-07-contributors
after-08-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 spec:line reproduces identically on a main worktree (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 in thread-reply-anchor-roleplay.spec.ts that 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

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-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Author

Runtime E2E verification (desktop mock bridge, full-viewport)

Built the desktop E2E bundle on this branch and on a main worktree, drove the app through the Playwright mock bridge (/#/projects), and compared the repository source-control state for a branch vs a tag.

Tag selected → local source becomes "Local unavailable" and disabled:

Before (main) After (this branch)
before-06-tag-source-menu after-06-tag-source-menu

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. The tag state no longer presents branch-labelled local data.

Whole-app context — channel-first IA preserved (upstream block#6003 navigation not ported):

after-01-home

Sidebar still shows Channels/Forums/DMs + Inbox/Pulse/Wiki/Agents/Workflows; no Projects rail, no Workbench nav.

Files with a tag selected, Contributors, Commits:

after-05-files-tag

after-07-contributors

after-08-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 spec:line reproduces identically on a main worktree (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 in thread-reply-anchor-roleplay.spec.ts that 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 unit tests; making them runtime-provable needs a second announced clone URL and an unverified contributor in the mock fixture.

devin-ai-integration Bot added a commit that referenced this pull request Aug 22, 2026
@oscarlehuu
oscarlehuu merged commit 80e5004 into main Aug 22, 2026
8 of 14 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.

upstream(sync): Repo-aware reader — branch/tag + contributor matching (#6003 selective)

1 participant