Skip to content

test(forecast): drop the seed count from the period_label guard's prose - #1309

Merged
hotlong merged 1 commit into
mainfrom
claude/issue-1282-forecast-seed-count-prose
Aug 26, 2026
Merged

hotlong merged 1 commit into
mainfrom
claude/issue-1282-forecast-seed-count-prose

Conversation

@hotlong

@hotlong hotlong commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

test/forecast-seeds.test.ts disagrees with itself about how many forecast seeds
there are, and you do not need any evidence outside the file to see it:

:138   // What survives is a much narrower property: these eight authored records
:139   // must not collide with EACH OTHER, so the demo shows eight distinct
:375   // each of them. The card's measurement was seven rows, six of them settled.
:376   expect(records.length, 'the forecast seed is empty').toBeGreaterThanOrEqual(7);

Line 375 is right. crm_forecast holds seven authored records, and seven is
pinned in three independent places: src/data/revenue.seed.ts (five
closedPeriod('…') rows plus two seed_key: 'demo_…' rows), a browser
measurement of GET /api/v1/data/crm_forecast?top=20, and this file's own
anti-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 it
was drifting, and no reader had a reason to doubt it.

This comment is its own best argument. It opens:

Restated deliberately. This once read "period_label values are unique (they
are the upsert identity)", and both halves have since become false…

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update — comment prose in a test file; no executable line changes
  • Code refactoring
  • Performance improvement
  • CI/CD update

Related Issues

Closes #1282

Changes Made

  • test/forecast-seeds.test.ts lines 138–139 — dropped both numerals from the
    period_label uniqueness guard's comment:

    -    // What survives is a much narrower property: these eight authored records
    -    // must not collide with EACH OTHER, so the demo shows eight distinct
    +    // What survives is a much narrower property: these authored records
    +    // must not collide with EACH OTHER, so the demo shows distinct
  • 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 is
    identical 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.ts is 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:
    ✓ period_label values are unique AMONG THE SEEDS — not a table invariant (#613)
    ✓ the guard has rows to judge — anti-vacuity
    
  • Every gate ci.yml and code-quality.yml run, 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.

  • Unit tests pass (pnpm test)
  • Linting passes (pnpm lint, pnpm lint:i18n-gate)
  • Build succeeds (pnpm build)
  • Manual testing completed — not applicable; no runtime behaviour changes
  • New tests added — deliberately none, see Description

Screenshots

Not applicable — no user-visible surface changes.

Checklist

  • I have added a changeset — .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-frontmatter
    changeset, not the skip-changeset label. It counts as a changeset for
    both steps of that gate and releases nothing.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation — n/a, this is the
    documentation change
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective — n/a; see Description for
    why a counting guard is the wrong answer here
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

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

…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.
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 26, 2026 5:50am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline

Projects

None yet

2 participants