Skip to content

test(file-refs): cover unverified/stale state transitions - #68

Merged
7vignesh merged 1 commit into
mainfrom
test/file-refs-state-transitions
Oct 20, 2026
Merged

7vignesh merged 1 commit into
mainfrom
test/file-refs-state-transitions

Conversation

@7vignesh

Copy link
Copy Markdown
Owner

What this adds

Follow-up to #66 / #67. Those tests check the three file-ref states in isolation; they never check a memory moving between states, which is where a regression would hide (the upsert flipping tracked, and the stale-vs-unverified classification staying mutually exclusive as git status changes).

Suggested in the #66 discussion. Adds two transition regression cases:

  • untracked -> committed -> verified: a named path with no file reads back as unverified; after the file is committed and the note is re-recorded, it becomes tracked = 1, drops the unverified marker, and from then on participates in drift detection. (A commit alone does not touch stored refs — the write path is what re-records, so the test models that step explicitly.)
  • deleted tracked file stays distinct: a tracked file that is deleted and committed surfaces as stale (its row is still tracked = 1) and is never reclassified as unverified.

Unchanged

Test-only. No source change, no ranking impact, so no bench run.

npm run ci green; 274 tests pass (was 272).

The existing tests check the three file-ref states in isolation but never
a memory moving between them, which is where the regressions would hide.
Add two transition cases (suggested in the #66 discussion):

- an untracked path reads as unverified, then becomes tracked and
  drift-checked once the file is committed and the note re-recorded
  (a commit alone does not touch stored refs);
- a deleted tracked file stays classified as stale, never silently
  reclassified as unverified.

Test-only; no source change.
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fossel Ready Ready Preview Oct 20, 2026 8:37pm UTC

@7vignesh 7vignesh self-assigned this Oct 20, 2026
@7vignesh
7vignesh merged commit 1ad5aeb into main Oct 20, 2026
6 checks passed
@7vignesh
7vignesh deleted the test/file-refs-state-transitions branch October 20, 2026 20:39
@7vignesh 7vignesh mentioned this pull request Oct 27, 2026

This branch was successfully deployed

1 active deployment
Preview — ebb798fe Deployed Oct 20, 2026 by vercel[bot]
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.

1 participant