Skip to content

chore(post-#168): tsc-hygiene round 2 — d3 types + tuple-mock + fixture catch-up#169

Merged
jukka-matti merged 5 commits into
mainfrom
post-168-tsc-hygiene
May 14, 2026
Merged

chore(post-#168): tsc-hygiene round 2 — d3 types + tuple-mock + fixture catch-up#169
jukka-matti merged 5 commits into
mainfrom
post-168-tsc-hygiene

Conversation

@jukka-matti
Copy link
Copy Markdown
Owner

Summary

Closes the 4 pre-existing tsc errors deferred into docs/investigations.md by PR #168. All mechanical, no design decisions, zero runtime change.

  • T1 (3b02e15d)fix(hooks): resolve d3 module type imports. @types/d3-transition was incorrectly placed in dependencies (commit 07add8a4) instead of devDependencies. Moved to align with siblings. Note: original investigations.md hypothesis ("missing hoisting entry") was wrong; empirical --prod install reproduction was not run, fix accepted on semantic grounds (type packages belong in devDeps).
  • T2 (aa921381)fix(hooks): type vi.fn fetch mock. vi.fn<typeof fetch>(...) (vitest 4.x single-type-param form) at 3 sites in useHubCommentStream.test.ts. Resolves TS2493 + TS2339 from .mock.calls[N] being typed as empty tuple.
  • T3 (d0dad59c)test(core): catch up SustainmentRecord fixtures. 5 missing required fields (status, title, consecutiveOnTargetTicks, hasOverride, lastEvaluatedSnapshotId) added across processHub.test.ts, processState.test.ts, sustainment.test.ts. recordFor builder improved in place; no as casts.
  • T4 (d898e1d9)test(core): catch up ProcessMap fixtures. Local makeMap builder (matches sibling mapOf / mkMap patterns); 4 fixture sites in stampStepCapabilities.test.ts; ctqColumn: null removed (type is string | undefined).
  • T5 (8e6816e4)docs(investigations): close items 1, 2, and fixture-shape half of 4. Vitest worker-timeout concern stays open for PR B (tracked at .claude/rules/testing.md:18 + feedback_pr_ready_check_retry_on_grep_test).

Plan: ~/.claude/plans/how-should-we-handle-generic-sonnet.md (PR A section).

Test plan

  • pnpm --filter @variscout/core exec tsc --noEmit — 0 errors
  • pnpm --filter @variscout/hooks exec tsc --noEmit — 0 errors
  • pnpm --filter @variscout/ui exec tsc --noEmit — 0 errors
  • pnpm --filter @variscout/core test — 3402/3402 pass
  • pnpm --filter @variscout/hooks test — 1213/1213 pass
  • No as any / as unknown as / // @ts-ignore introduced (per-task + final reviewer verified)
  • No --no-verify on any commit
  • Final-branch review (Opus) — approved with one resolved follow-up (spec divergence)

Pre-existing issues surfaced during review (PR B candidates)

Final-branch review surfaced more pre-existing tsc errors in other packages (NOT in scope for PR A):

  • @variscout/storesFinding.evidenceType missing in wallSelectors.test.ts:41,127 (same RPS-era fixture-shape drift as item 4); 2 cast errors in projectStore.test.ts:291,297; beforeEach global in setup.ts:22
  • @variscout/dataImportMeta.env access from core source seen transitively; suggests vite-env.d.ts placement / cross-package tsconfig issue

To be logged as a fresh docs/investigations.md entry in PR B.

Spec workaround handled

A bfc4bdab workaround commit was needed mid-flight to satisfy the dead-link pre-commit hook (PR #168 introduced a roadmap.md link to an untracked spec). Discovered the user had already authored the canonical Sessions A+B+C version of that spec on local main (1e201e2a, unpushed). That commit was pushed to main first; PR A then rebased to drop the workaround. PR A's diff is now clean (8 files, 78/20 lines).

🤖 Generated with ruflo

jukka-matti and others added 5 commits May 14, 2026 18:00
@types/d3-transition was accidentally placed in dependencies instead of
devDependencies in commit 07add8a; d3 type errors do not appear once
pnpm install correctly wires the devDependency symlinks.

Move @types/d3-transition to devDependencies alongside @types/d3-selection
and @types/d3-zoom; all four @types/d3-* packages now sit in the correct
field and resolve cleanly under Bundler moduleResolution.

Refs investigations.md item 1 (post-#168 tsc hygiene).

Co-Authored-By: ruflo <ruv@ruv.net>
vi.fn(() => ...) inferred a 0-arg call signature, making .mock.calls[0]
an empty tuple []. Changed to vi.fn<typeof fetch>(() => ...) (vitest 4.x
single-type-param form) so MockParameters<typeof fetch> flows through
and [url, init] destructuring type-checks correctly. Applied to all
three fetchMock declarations in the file for consistency.

Refs investigations.md item 2 (post-#168 tsc hygiene).

Co-Authored-By: ruflo <ruv@ruv.net>
Add status, title, consecutiveOnTargetTicks, hasOverride, and
lastEvaluatedSnapshotId to all inline SustainmentRecord literals in
processHub.test.ts (3 sites), processState.test.ts (1 site), and the
recordFor() builder in sustainment.test.ts (1 site); semantically
meaningful defaults throughout — no as-casts or ts-ignore.

Refs investigations.md item 3 (post-#168 tsc hygiene).

Co-Authored-By: ruflo <ruv@ruv.net>
…ismatches

Add version, tributaries, createdAt, updatedAt to ProcessMap fixtures in
stampStepCapabilities.test.ts via a local makeMap builder; fix two ctqColumn
values from null to undefined (omitted) to match ProcessMapNode's string|undefined
type.

Refs investigations.md item 3 (post-#168 tsc hygiene).

Co-Authored-By: ruflo <ruv@ruv.net>
…PR A post-168)

T1 (e2c584ec) — d3 types placement fix; original hypothesis amended.
T2 (35c34d83) — vi.fn<typeof fetch>(...) tuple-mock typing.
T3 (7685734d) — SustainmentRecord fixture catch-up.
T4 (27027162) — ProcessMap fixture catch-up.

Item 4's vitest-timeout sub-item remains open for PR B.

Co-Authored-By: ruflo <ruv@ruv.net>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
mean-beoynd-lite-pwa Ready Ready Preview, Comment May 14, 2026 3:04pm
variscout_website Ready Ready Preview, Comment May 14, 2026 3:04pm

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