fix(workspace): count an IDE pin and this client's manifest as binding evidence

Merged
SA
2mo ago
+99-6

Issue for this PR

No GitHub issue. Follow-up to #1374, from review comments that arrived after it merged.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

#1374 stays quiet when a binding lookup fails in a project that shows no sign of having a workspace. Without that check, being offline produced a warning in every opted-in repo, including repos never linked. The check missed two cases.

An IDE pin now counts. The extension can choose a workspace with ALTIMATE_PINNED_WORKSPACE_*. That choice is never written to disk. If the pinned workspace was inaccessible, or offline on its first check, the sync said nothing — including in the IDE's Refresh report. A pin for this folder now counts as evidence. A malformed pin counts too, because the extension set it and resolution fails closed on it everywhere.

Only this client's manifest counts. Previously any _workspace folder counted, including one the user or another tool created. Now only the manifest this client writes counts.

Interaction with #1373. #1373 landed while this was open. It removes the skill snapshot when a pin cannot be honoured. That removal deletes the manifest before the evidence check runs, so the pin has to count on its own. The user loses the skills and is told why. Both checks now use the same resolveWithinRoot to decide which folders a pin applies to, so they always agree. One test covers the two together.

How did you verify your code works?

  • 5 new tests:
    • a user-created _workspace folder does not count
    • a pin for this project does count
    • a malformed pin does count
    • an unhonourable pin both removes the skills and reports why
    • an unlinked project stays quiet
  • Mutation-checked: dropping the pin rule fails both pin tests, and going back to "any folder" fails the folder test.
  • Tested on top of #1373. Workspace, skill, plugin and route suites: 1833 pass. One test fails, flushPendingSyncs … would abandon (a 5s timeout); it fails the same way on main.
  • Typecheck clean.

Screenshots / recordings

N/A. No UI change beyond when the existing warning appears.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code


Summary by cubic

Fixes the workspace binding evidence check in skill sync so a failed lookup warns the user in two cases it previously missed.

  • An IDE pin (ALTIMATE_PINNED_WORKSPACE_*) now counts as evidence. Pins are never written to disk, so an inaccessible pin was silent before; a malformed pin counts too.
  • Only this client's manifest counts as evidence, so a _workspace folder the user or another tool created no longer triggers the warning.
  • Pin evidence is scoped with the same resolveWithinRoot as the pin purge from #1373, so after the purge removes the manifest, the warning still fires and the user is told why.

Summary by CodeRabbit

  • Bug Fixes
    • Improved workspace checks when the server is unavailable: an unmanaged workspace folder no longer triggers an error, while a configured project workspace that cannot be verified is reported.
    • Corrected handling of invalid workspace pins, including removal of previously synced skills when a pin cannot be honored.