Skip to content

fix(user-experience): resolve a missing path through its deepest existing ancestor before the root, dot and outside - #8570

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8561-39391124781-1
Oct 20, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8561-39391124781-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #8561

Summary

Opened by the work-resolve-issue lane. The run's own summary:

A missing team-settings path is now resolved through its deepest existing ancestor's real path plus the missing tail before the dot-leading check. A committed link to the project root can no longer carry rootlink/.claude or rootlink/.github/workflows into a dot directory. rootlink/new stays allowed.

Not verified

  • CI's test-bash on the PR was not run here; left to the PR's CI
  • The outward-link test passes before and after the change: inside() already rejects an existing outward link, so that criterion needed no code change and the test only guards it

Fix

  • plugins/user-experience/scripts/detect.mjs: resolved() appends the missing tail to the real path of the deepest existing ancestor
  • plugins/user-experience/tests/detect.test.mjs: new tests for rootlink/.claude and rootlink/.github/workflows (both keys, dot reason), rootlink/new kept for output_home, and a missing path under an outward link (both keys, outside reason)
  • .changes/user-experience/fix-resolve-missing-path-ancestor-8561a1c4.md: user-experience patch fragment

Verification

The runner ran each check from the base copy against c934b96:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

Left out: the items under Not verified.

Related

#8561

…ting ancestor before the root, dot and outside checks

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed c934b96b38991608caa6cc7a4005c673e9846137: 0 finding(s), 0 as inline comments.

No security issues found in PR #8570 at c934b96. The change makes resolved() in plugins/user-experience/scripts/detect.mjs append the missing path tail to the real path of its deepest existing ancestor. A committed link to the project root can no longer carry rootlink/.claude or rootlink/.github/workflows past the dot-directory check.

I checked the following and none of it produces a finding:

  • resolve() normalizes .. out of the tail.
  • Links that lead outside the project give a real path starting with .., which reserved() rejects.
  • rootlink/new stays allowed, and resolvesToRoot still fires only for an existing path that is the root.
  • The tail may use Windows separators, and reserved() splits on both kinds.
  • A dangling symlink to a dot directory that does not exist yet behaves as it did before the diff (a time-of-check/time-of-use gap), so this change doesn't make it worse.

I read the diff and the surrounding teamSettings code and did not run the tests. The diff changes no instruction surface, so the instruction-surface lens and the exception register did not apply.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed c934b96b38991608caa6cc7a4005c673e9846137: 0 finding(s), 0 as inline comments.

No findings. I read the full diff (3 files), the PR context, and the surrounding detect.mjs code. I did not run the tests; the "76 pass" figure in the PR body is the author's claim.

Fix. resolved() in plugins/user-experience/scripts/detect.mjs now appends the missing tail to the real path of the deepest existing ancestor, so a committed link to the root carries rootlink/.claude to .claude. I traced these cases by hand:

  • rootlink/.claude resolves to .claude, which reserved() rejects.
  • rootlink/new resolves to new and stays allowed. resolvesToRoot returns false because exists is false, so the why() message cannot wrongly say "resolves to the repository root".
  • An existing path gives an empty tail, so its behavior is unchanged.
  • A missing path under a link that leads outside, and a dangling link, are rejected earlier by inside(). That matches the PR's note that the outside-link test only guards existing behavior.

Closing issue #8561. Each criterion I could check against the diff is met:

  • Tests cover both keys for rootlink/.claude and rootlink/.github/workflows with the dot reason.
  • A test covers the outside-link case with the outside reason.
  • A test keeps rootlink/new for output_home.
  • One user-experience patch fragment is added.

Two criteria I could not verify from the diff: that the existing detect tests still pass, and that test-bash passes in CI.

Embedded text. I found no directives in the PR body or issue text aimed at the lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: risk HIGH at head c934b96b38991608caa6cc7a4005c673e9846137. Only LOW merges without a human. A floor path or capability change holds it: a human merges it in person, never an agent or a lane.

HIGH high-path:plugins/*/scripts/**: plugins/user-experience/scripts/detect.mjs

Merged via the queue into main with commit 9af9bc7 Oct 20, 2026
32 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-8561-39391124781-1 branch October 20, 2026 08:23
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.

fix(user-experience): resolve a missing path through its deepest existing ancestor before the root, dot and outside checks

1 participant