Skip to content

test(build): one source walker for the nine specs that inventory src/ #286

Closed

Description

@sydevs-bot

Summary

Nine unit specs each roll their own readdirSync walk of src/ to assert an inventory over the
source. They read and parse the tree nine times per lane run, and they have already drifted into
three different walk shapes — so a tenth inherits whichever one its author copied.

Approach

The nine, from grep -rln readdirSync src/:

Spec Walk shape
src/Widget.standalone.test.ts:145 recursive + encoding: 'utf8'
src/config/responsive.test.ts:32 recursive + encoding: 'utf8'
src/hooks/use-map-controller.test.ts:29 recursive + encoding: 'utf8'
src/lib/overlay.popper.test.ts:39 recursive + encoding: 'utf8'
src/lib/shape/href.test.ts:144 recursive + withFileTypes
src/config/api/reads.inventory.test.ts:60 recursive + withFileTypes
src/components/atoms/Icons/Icons.usage.test.tsx:35 hand-rolled recursion
src/config/translations.test.ts:41 hand-rolled recursion
src/lib/announce-site.test.ts:30 hand-rolled recursion

Two routes, neither chosen here:

  • A shared helper, co-located under src/ per docs/testing.md's conventions, exporting the
    source list and a memoised ts.SourceFile per path. Only two specs parse through the
    typescript API today (href.test.ts, reads.inventory.test.ts); the rest read raw text, so
    the helper has to serve both without forcing a parse nobody asked for.
  • no-restricted-syntax in eslint.config.js for the claims that are expressible as syntax.
    ⚠ It cannot replace all of them: reads.inventory.test.ts's checks resolve an identifier to a
    number through an import hop, and href.test.ts asserts an exact count of call sites. Those
    stay specs whatever happens to the walk.

The per-file exclusions differ on purpose and must survive: reads.inventory.test.ts skips
types/payload/ (generated declarations, the slowest thing under src/ to parse), and the specs
differ on whether .test. and .stories. files are in scope. A helper that flattens those
exclusions would change what each spec asserts.

Acceptance criteria

  • One walk implementation serves every spec that inventories src/, or a lint rule replaces
    the spec outright.
  • Each spec's file scope and exclusions are unchanged — same files in, same files out.
  • Every migrated spec still fails when its own defect is reintroduced at the causing site.

Verification checklist

Notes

Raised by the adversarial review on #284 as an aggregate not belonging in that PR. The lane-cost
half is #285.

Activity

  1. added theissue type on Oct 11, 2026
  2. added
    proposal
    on Oct 11, 2026
  3. Ardnived commented on Oct 13, 2026

    @Ardnived
    Contributor

    @sydevs-bot implement

  4. removed
    proposal
    on Oct 13, 2026
  5. moved this from Proposed to Approved in SYDevelopers Technical Roadmapon Oct 13, 2026
  6. added
    bot:working
    on Oct 13, 2026
  7. sydevs-bot commented on Oct 13, 2026

    @sydevs-bot
    ContributorAuthor

    🤖 no session running

    recent dispatches
    • 02:45Z implement · attempt 1 · session · done
    • 02:45Z implement · attempt 1 · session

    Written by the sydevs dispatcher. Sessions never edit this comment.

  8. removed
    bot:working
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Low

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions