Skip to content

fix: stop diagnosing what is inside a nested workspace - #32

Merged
a-tokyo merged 2 commits into
mainfrom
fix/no-nested-workspace-content-claims
Aug 10, 2026
Merged

a-tokyo merged 2 commits into
mainfrom
fix/no-nested-workspace-content-claims

Conversation

@a-tokyo

@a-tokyo a-tokyo commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Follow-up to #30. Intended for #31, which merged while I was writing it — so it lands here instead.

The bug I shipped in #30

The boundary reporter didn't stop at naming the boundary. It also scanned <repo>/root-config/.claude/skills/ inside the nested workspace and printed, for each per-skill symlink it found:

⚠ …/root-config/.claude/skills/refactor was planted there by an older setup — safe to delete

Both halves of that are wrong.

The cause was a guess. Those links are the ordinary artifact of the skills CLI: skills:add and skills:update run it with cwd set to root-config/ (add-skill.mjs), and the CLI writes its own tool symlinks into the directory it runs in. That is exactly the shape the old walk would also have planted — which is the real point: the two causes are indistinguishable from the link alone. Naming either one is a guess dressed as a diagnosis.

The cleanup advice was unnecessary. The owning workspace's own setup() already removes them — cleanCliArtifacts(ROOT_CONFIG).

Measured on a real nested workspace before changing anything:

  • 27 such links, all sharing one mtime (Jun 18 10:21:01) — a single CLI run, months before fix: stop the project walk at nested workspace boundaries #30's code existed. Outer-setup pollution would not arrive in one batch at a timestamp predating the code.
  • Running that workspace's own setup-skills.mjs --ensure on a copy cleared all 27 and removed the directory.

So the message named a cause the evidence contradicts, and asked for a manual cleanup that happens by itself. In this repo's own parent root it fired for two unrelated nested workspaces on the first run.

The fix

Report the boundary — a fact — and say nothing about the contents. strayLinksInForeignRootConfig is deleted; reportForeignWorkspace now emits one line.

⏭ agent-skills-workspace/production-grade/study/ has its own workspace (workspace/root-config/) — leaving its subtree to it

The docblock records why, so the hint doesn't get reinvented: the shape is a CLI artifact, the owning workspace clears it, and the causes can't be told apart.

Tests

The two tests that asserted the stray claim are replaced by:

  • names the boundary it skips — the report itself.
  • says nothing about what is inside the boundary, and changes none of it — plants both shapes that legitimately live in a nested repo's root-config/.claude/skills/ (a CLI-created symlink and a real tool-written skill dir), then asserts the output contains none of "planted" / "stray" / "safe to delete" and that both survive untouched.

309 pass, lint clean. Verified on the real tree: two boundaries named, no diagnosis, the nested workspace's 27 links still at 27.

The boundary reporter added in #30 also listed per-skill symlinks under
`<repo>/root-config/.claude/skills/` as "planted there by an older setup — safe
to delete". Both halves were wrong.

They are the ordinary artifact of the skills CLI, which skills:add and
skills:update run with cwd set to root-config, and the owning workspace's own
setup already deletes them: cleanCliArtifacts(ROOT_CONFIG). Measured on a real
nested workspace — 27 such links, all sharing one mtime from a single CLI run
months before this code existed, and its own `setup --ensure` cleared all 27 and
removed the directory. So the message named a cause the evidence contradicts and
asked for a manual cleanup that happens by itself.

The two possible causes are indistinguishable from the link alone, which is the
point: report the boundary, which is a fact, and say nothing about the contents.
Drops strayLinksInForeignRootConfig entirely.
@a-tokyo a-tokyo self-assigned this Aug 10, 2026
@a-tokyo
a-tokyo requested a lite review from Copilot August 10, 2026 21:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an incorrect “diagnosis” emitted when the skills setup walk encounters a nested workspace: it now reports only the workspace boundary being skipped and no longer inspects or comments on what’s inside that boundary.

Changes:

  • Remove nested-workspace “stray link” scanning and the associated advisory output.
  • Update reportForeignWorkspace to emit a single boundary line (and document why it must not editorialize).
  • Replace/strengthen tests to assert the boundary is named and that no “planted/stray/safe to delete” claims are emitted, while ensuring nested contents remain unchanged.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/skills/setup-skills.mjs Stops reporting on nested workspace contents; logs only the boundary skip line and documents the rationale.
test/setup.test.mjs Updates tests to assert boundary-only reporting and verify nested workspace artifacts are left untouched.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@a-tokyo
a-tokyo merged commit d191784 into main Aug 10, 2026
1 check passed
@a-tokyo
a-tokyo deleted the fix/no-nested-workspace-content-claims branch August 10, 2026 22:03
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.

2 participants