Skip to content

fix(workspace): guard root sentinel-URL collision with a workspace/ descendant - #1210

Closed
detail-app[bot] wants to merge 6 commits into
mainfrom
detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd
Closed

detail-app[bot] wants to merge 6 commits into
mainfrom
detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd

Conversation

@detail-app

@detail-app detail-app Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Report a discovery error instead of replacing a descendant package when its URL collides with the root package. Preserve discovered coordinates in the shared resolution map and use that map for reverse lookup, while retaining noncolliding workspace-root package URIs. Add focused regressions for collision handling and URI compatibility.


Note

Medium Risk
Changes workspace discovery and package coordinate indexing used for package:// URIs; mis-handling could affect multi-package repos with path-based URLs, though behavior is tightened with explicit errors and tests.

Overview
Fixes a bug where a descendant package named workspace/ could be overwritten by the local root sentinel URL workspace, and where resolution could later stomp discovered coordinates when building package roots.

Workspace discovery now treats a root-package URL collision with an already-discovered descendant as a discovery error (suggesting [workspace].repository), while keeping the descendant package in the map.

Resolution uses or_insert for the workspace fallback root so indexed coordinates are not replaced, and adds package_url_for_package_root to reverse-map a canonical package directory to its coordinate (stdlib, workspace members, sentinel, and cached dependency roots). Regressions cover collision reporting, dependency-root lookup, and round-trip package:// behavior when a workspace/ folder exists.

Reviewed by Cursor Bugbot for commit be2ff30. Bugbot is set up for automated code reviews on this repo. Configure here.

@detail-app
detail-app Bot requested a review from LK September 6, 2026 02:25
@detail-app detail-app Bot assigned LK Sep 6, 2026
@detail-app detail-app Bot added the detail label Sep 6, 2026

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

cursor[bot]

This comment was marked as resolved.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot skipped and reported one unresolved finding, and this is a functional workspace-discovery change rather than a small fixup, so human review is needed. Cursor Security Agent completed successfully with no security findings.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@akhilles
akhilles force-pushed the detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd branch from 676caa6 to 06fa8d7 Compare September 7, 2026 04:22

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot passed with no unresolved findings, and Cursor Security Agent was not running; this is a functional workspace-discovery change rather than a small fixup, so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@akhilles
akhilles force-pushed the detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd branch from e2d1a53 to 127d05b Compare September 7, 2026 14:25

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot passed with no unresolved findings, and Cursor Security Agent was not running; this is a functional workspace-discovery change rather than a small fixup, so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@akhilles
akhilles force-pushed the detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd branch from 127d05b to 35066a3 Compare September 7, 2026 15:21

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot passed with no unresolved findings, and Cursor Security Agent was not running; this is a functional workspace-discovery change rather than a small fixup, so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@akhilles
akhilles force-pushed the detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd branch from 35066a3 to 50dedb4 Compare September 7, 2026 16:04

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot passed with no unresolved findings, and Cursor Security Agent was not running; this is a functional workspace-resolution change rather than a small fixup, so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@detail-app
detail-app Bot force-pushed the detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd branch from 50dedb4 to e4523e0 Compare September 27, 2026 04:50
devin-ai-integration[bot]

This comment was marked as resolved.

@detail-app

detail-app Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

Re: #1210 (review) — Addressed in e4523e0: the workspace-root fallback in build_package_roots now uses entry().or_insert_with so the sentinel URL is not re-bound over a colliding descendant (crates/pcb-zen-core/src/resolution.rs:247), and package_url_for_package_root resolves roots via the prebuilt indexes.package_roots (crates/pcb-zen-core/src/resolution.rs:807), so a descendant owning the workspace coordinate is preserved. Covered by resolution::tests::workspace_fallback_does_not_replace_discovered_coordinates.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot passed with no unresolved findings, and Cursor Security Agent was not running; this is a functional workspace-resolution change rather than a small fixup, so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot passed with no unresolved findings, and Cursor Security Agent was not running; this is a functional workspace-resolution change rather than a small fixup, so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@detail-app
detail-app Bot force-pushed the detail/bug-fix/fix-workspace-guard-root-sentinel-url-collision-wi-65a9cd branch from c45f9e1 to be2ff30 Compare October 4, 2026 08:07

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a non-blocking comment; not approved, and no reviewers were assigned. Cursor Bugbot passed with no unresolved findings, and Cursor Security Agent was not running; this is a functional workspace-resolution change rather than a small fixup, so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@detail-app

detail-app Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing this pull request because it has had no human activity in 29 days (since 2026-09-07) and was opened 31 days ago. Detail closes its pull requests once they are more than 30 days old and have had no human activity for 14 days.

If this change is still useful, reopen the pull request and Detail won't close it again. To keep a Detail pull request open, add the detail-keep-open label to it.

@detail-app detail-app Bot closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants