Repository navigation
test(forecast): drop the seed count from the period_label guard's prose - #1309
Merged
Merged
Conversation
…se (#1282) The comment above the `period_label` uniqueness guard in `test/forecast-seeds.test.ts` explained the property with a number: "these eight authored records must not collide with EACH OTHER, so the demo shows eight distinct periods". The `crm_forecast` seed holds seven. The file already disagreed with itself — the anti-vacuity block eleven assertions further down reads "the card's measurement was seven rows, six of them settled" — and seven is pinned independently in three places: five `closedPeriod('…')` rows plus two `seed_key: 'demo_…'` rows in `src/data/revenue.seed.ts`, a browser measurement of `GET /api/v1/data/crm_forecast?top=20`, and this file's own floor `expect(records.length).toBeGreaterThanOrEqual(7)`. Nothing below the comment ever read the number: the assertion derives its list from `records`. So the guard stayed green while the sentence above it drifted, and no reader had a reason to doubt it. The numerals are removed rather than corrected, and no guard that counts the seeds is added. The property being defended does not depend on a count — these authored records must not collide with each other, so the demo shows distinct periods — so a corrected "seven" is only the next number to go stale, and a guard asserting it would be one more hand-maintained fact with a lock on it. The assertion body is unchanged, byte for byte. Seed data is unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
test/forecast-seeds.test.tsdisagrees with itself about how many forecast seedsthere are, and you do not need any evidence outside the file to see it:
Line 375 is right.
crm_forecastholds seven authored records, and seven ispinned in three independent places:
src/data/revenue.seed.ts(fiveclosedPeriod('…')rows plus twoseed_key: 'demo_…'rows), a browsermeasurement of
GET /api/v1/data/crm_forecast?top=20, and this file's ownanti-vacuity floor quoted above.
Nothing below the comment ever read that number — the assertion derives its list
from
records— so the guard stayed green the whole time the sentence above itwas drifting, and no reader had a reason to doubt it.
This comment is its own best argument. It opens:
A comment written to correct an earlier stale comment, which then went stale
itself on a different axis. A hand-maintained fact in prose has no producer, and
no amount of care at the moment of writing gives it one.
So the fix removes the numerals rather than correcting them, and deliberately
adds no guard that counts the seeds. The property being defended does not depend
on a count — these authored records must not collide with each other, so the
demo shows distinct periods — it is complete and correct once the number is
gone. A corrected "seven" would only be the next number to go stale, and a guard
asserting it would be one more hand-maintained fact with a lock on it
(ADR-0049 axis ③).
Type of Change
Related Issues
Closes #1282
Changes Made
test/forecast-seeds.test.tslines 138–139 — dropped both numerals from theperiod_labeluniqueness guard's comment:The assertion body is unchanged, byte for byte. The diff is
2 insertions, 2 deletions, both on//comment lines; every non-comment line of the file isidentical to base (verified by diffing the file with all comment lines stripped,
before and after).
Line 375 was left alone — it is already correct.
No seed data changed.
src/data/revenue.seed.tsis untouched.Testing
Run at commit
56fb271d, the head of this branch:pnpm test— 140 test files passed, 2969 passed | 1 skipped (2970), 165s.pnpm exec vitest run test/forecast-seeds.test.ts --reporter=verbose— 23/23,including the two guards this PR's prose describes:
ci.ymlandcode-quality.ymlrun, locally, all green:check-stackblitz-lock.mjs·check-source-hygiene.mjs(✓ source hygiene clean) ·check-source-token-ratchet.mjs(✓ source token ratchet clean; authored total~135,002 of ~140,000) ·
pnpm validate(✓ Validation passed) ·pnpm lint·pnpm lint:i18n-gate·pnpm typecheck·pnpm build.Checklist below reflects those runs.
pnpm test)pnpm lint,pnpm lint:i18n-gate)pnpm build)Screenshots
Not applicable — no user-visible surface changes.
Checklist
.changeset/forecast-seed-count-not-in-prose.md,with empty frontmatter. Of the two lawful exemptions in
.github/workflows/changeset-check.yml, this PR uses the empty-frontmatterchangeset, not the
skip-changesetlabel. It counts as a changeset forboth steps of that gate and releases nothing.
documentation change
why a counting guard is the wrong answer here
Additional Notes
Scope was held to one file and, within it, to those two numerals.
Three cards run in parallel this round and none of their files are touched here:
#1188 (same family and the same fix shape, deliberately not folded in), #1307,
#1236 — all three remain open and unaffected by this branch.
Generated by Claude Code