Skip to content

fix(config): verify barrel exports, document fixture semantics, test deny-by-default - #1282

Merged
Mimah97 merged 1 commit into
Vatix-Protocol:mainfrom
flavor365:fix/config-barrel-exports-and-fixture-tests
Oct 17, 2026
Merged

Mimah97 merged 1 commit into
Vatix-Protocol:mainfrom
flavor365:fix/config-barrel-exports-and-fixture-tests

Conversation

@flavor365

@flavor365 flavor365 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1194, Closes #1197, Closes #1198, Closes #1199

Summary

Four issues across packages/config and scripts/ that harden the shared-config checker and fixture validator with missing parity checks, documented contracts, and tests for the deny-by-default safety property.

Changes by issue

#1194 — Barrel export parity check

check-shared-config.mjs now verifies that every value symbol re-exported by packages/config/src/index.ts is actually exported by packages/config/src/networks.ts, and vice-versa. A rename or dropped export in networks.ts now fails config:check immediately with SHARED_CONFIG_BARREL_EXPORT_MISMATCH instead of surfacing only as a downstream TypeScript error.

  • Added checkBarrelExports() — parses barrel re-exports (export { ... } from './networks') and networks.ts declarations (export function/const/class NAME), reports missing and extra symbols.
  • Type-only exports (export type { ... }) are excluded since they vanish at runtime.
  • Wired into checkSharedConfig() alongside existing checkPackageFiles.
  • Tests: passing case, missing-export case, extra-export case.

#1197 — parseRustTickVectors null contract

scripts/fixtures.d.ts declares parseRustTickVectors can return null, but no test covered that branch.

  • Tests now assert: null for sources with no mod fixture_tests block; [] when the module exists but has no vector tuples (distinguishing null/not-found from []/found-but-empty); successful parse returns entries shaped { tick: number, sqrtPriceX96: string }.

#1198 — EXEMPT_WORKSPACES deny-by-default tests

The deny-by-default guarantee is the core safety property of the checker but was not covered by any test. A regression inverting the exemption logic would have passed the existing suite.

  • Added optional exempt parameter to checkSharedConfig (threaded through checkTsconfigs, checkEslintStatic, checkEslintEffective, lintWorkspaces) so exemption behavior is testable without mutating the frozen EXEMPT_WORKSPACES object.
  • Tests assert: TSCONFIG_MISSING for a workspace without tsconfig.json; ESLINT_MISSING for a workspace with a lint script but no eslint config; exempting one workspace suppresses only its errors while non-exempt workspace errors remain.

#1199 — checkFixtures/writeFixtures error semantics

The declared return types didn't specify what fixtures and written mean when errors is non-empty. Callers had to guess whether a non-empty errors meant nothing was written or a partial write occurred.

  • Updated JSDoc in fixtures.d.ts: checkFixtures always reports the number of inspected fixtures regardless of errors; writeFixtures is all-or-nothing (written is [] when errors is non-empty).
  • Tests assert: checkFixtures returns a non-zero fixtures count when at least one fixture is invalid; writeFixtures returns written: [] when any fixture has a non-repairable error.

Verification

Files changed

  • packages/config/scripts/check-shared-config.mjs — barrel export check + exempt parameter threading
  • packages/config/scripts/__tests__/check-shared-config.test.mjs — barrel export tests + deny-by-default exemption tests
  • scripts/fixtures.d.ts — JSDoc documenting checkFixtures/writeFixtures error semantics
  • scripts/__tests__/fixtures.test.js — parseRustTickVectors null contract tests + error semantics tests

…deny-by-default

Closes Vatix-Protocol#1194, Vatix-Protocol#1197, Vatix-Protocol#1198, Vatix-Protocol#1199

Vatix-Protocol#1194 — check-shared-config.mjs now verifies barrel exports match networks.ts:
  - Add checkBarrelExports() that parses src/index.ts re-exports and
    src/networks.ts exports, reporting SHARED_CONFIG_BARREL_EXPORT_MISMATCH
    for any missing or extra value symbol. Type-only exports are excluded
    since they vanish at runtime. Wired into checkSharedConfig() so a
    rename or dropped export in networks.ts fails config:check immediately
    instead of surfacing as a downstream TypeScript error.
  - Tests: passing case (compliant sandbox), missing-export case (barrel
    re-exports a symbol networks.ts no longer provides), and extra-export
    case (networks.ts exports something the barrel doesn't re-export).

Vatix-Protocol#1197 — parseRustTickVectors null contract now tested:
  - Tests assert null for sources with no mod fixture_tests block, []
    when the module exists but has no vector tuples (distinguishing
    null/not-found from []/found-but-empty), and a successful parse
    returning entries shaped { tick: number, sqrtPriceX96: string }.

Vatix-Protocol#1198 — EXEMPT_WORKSPACES deny-by-default rule now tested:
  - Add optional exempt parameter to checkSharedConfig (and thread it
    through checkTsconfigs, checkEslintStatic, checkEslintEffective,
    lintWorkspaces) so exemption behavior is testable without mutating
    frozen module state.
  - Tests assert TSCONFIG_MISSING for a workspace without tsconfig,
    ESLINT_MISSING for a workspace with a lint script but no eslint
    config, and that exempting one workspace suppresses only its errors
    while leaving non-exempt workspace errors intact.

Vatix-Protocol#1199 — checkFixtures/writeFixtures error semantics documented and tested:
  - Update JSDoc in fixtures.d.ts: checkFixtures always reports the
    number of inspected fixtures regardless of errors; writeFixtures is
    all-or-nothing (written is [] when errors is non-empty).
  - Tests assert checkFixtures returns a non-zero fixtures count with
    invalid fixtures present, and writeFixtures returns written: [] when
    any fixture has a non-repairable error.
@Mimah97
Mimah97 merged commit 977edac into Vatix-Protocol:main Oct 17, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment