Repository navigation
fix(config): verify barrel exports, document fixture semantics, test deny-by-default - #1282
Merged
Mimah97 merged 1 commit intoOct 17, 2026
Conversation
…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.
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.
Closes #1194, Closes #1197, Closes #1198, Closes #1199
Summary
Four issues across
packages/configandscripts/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.mjsnow verifies that every value symbol re-exported bypackages/config/src/index.tsis actually exported bypackages/config/src/networks.ts, and vice-versa. A rename or dropped export innetworks.tsnow failsconfig:checkimmediately withSHARED_CONFIG_BARREL_EXPORT_MISMATCHinstead of surfacing only as a downstream TypeScript error.checkBarrelExports()— parses barrel re-exports (export { ... } from './networks') andnetworks.tsdeclarations (export function/const/class NAME), reports missing and extra symbols.export type { ... }) are excluded since they vanish at runtime.checkSharedConfig()alongside existingcheckPackageFiles.#1197 — parseRustTickVectors null contract
scripts/fixtures.d.tsdeclaresparseRustTickVectorscan returnnull, but no test covered that branch.nullfor sources with nomod fixture_testsblock;[]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.
exemptparameter tocheckSharedConfig(threaded throughcheckTsconfigs,checkEslintStatic,checkEslintEffective,lintWorkspaces) so exemption behavior is testable without mutating the frozenEXEMPT_WORKSPACESobject.TSCONFIG_MISSINGfor a workspace withouttsconfig.json;ESLINT_MISSINGfor 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
fixturesandwrittenmean whenerrorsis non-empty. Callers had to guess whether a non-emptyerrorsmeant nothing was written or a partial write occurred.fixtures.d.ts:checkFixturesalways reports the number of inspected fixtures regardless of errors;writeFixturesis all-or-nothing (writtenis[]whenerrorsis non-empty).checkFixturesreturns a non-zerofixturescount when at least one fixture is invalid;writeFixturesreturnswritten: []when any fixture has a non-repairable error.Verification
node --checkpasses on all modified.mjs/.jsfiles.checkBarrelExportsverified via inline tests: passes on the real tree, detects missing and extra exports.node --testfixtures tests for scripts/fixtures.d.ts declares parseRustTickVectors returning null but no test covers the unparseable-source branch #1197 and scripts/fixtures.d.ts and scripts/fixtures.js disagree on whether checkFixtures can report a non-zero fixture count on error #1199 pass (6/6).Files changed
packages/config/scripts/check-shared-config.mjs— barrel export check +exemptparameter threadingpackages/config/scripts/__tests__/check-shared-config.test.mjs— barrel export tests + deny-by-default exemption testsscripts/fixtures.d.ts— JSDoc documentingcheckFixtures/writeFixtureserror semanticsscripts/__tests__/fixtures.test.js—parseRustTickVectorsnull contract tests + error semantics tests