test(workspace): pin that linking clears the memoized lookup miss
Issue for this PR
Closes #1466
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
Adds one test to test/altimate/workspace/skill-sync.test.ts: "linking just after an unbound turn clears the memoized miss".
The existing test next to it passes on the link's validation stamp alone. Inside the revalidation window the row is trusted without a lookup, so the memoized "no binding here" is never read, and the test passes with or without clearLookupMiss in recordApprovedBinding.
The new test takes the same unbound turn and link, then expires the validation stamp (expireValidationForTests, the existing test seam) so the next sync has to look the binding up. It asserts that the lookup reaches the server once, the row survives and the skill is synced. Without the memo clear, the stale miss answers the lookup, the server is never asked, and the row is deleted.
No product code changes, and the existing test is unchanged.
How did you verify your code works?
- Real code: both tests pass; the whole file passes (124 tests).
- With
clearLookupMiss(directory, key)commented out: the new test fails (lookupsis 0, expected 1) and the existing test still passes. tsgo --noEmitfor opencode passes.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
🤖 Generated with Claude Code
https://claude.ai/code/session_0174HUYiaceApqHP7EKMNgnb
Summary by cubic
Adds a regression test ensuring linking clears the memoized lookup miss in the workspace skill sync.
The existing test passed on the link's validation stamp alone, so it never exercised the memo clear path. The new test expires the validation stamp so the next sync performs a real lookup, and fails without the memo clear.
Summary by CodeRabbit
- Tests
- Added coverage confirming that syncing after a cached unbound result checks the server again, preserves the binding, and installs the skill.