Files
ersatztv/web/src/vite-env.d.ts
T
timothy 8aeacd534a
Build ErsatzTV Image / CI toolchain image resolves (push) Successful in 9s
Build ErsatzTV Image / Delimiter ban (release path) (push) Successful in 21s
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 8m52s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (push) Successful in 6m23s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (push) Successful in 5m50s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (push) Skipped
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (push) Skipped
Build ErsatzTV Image / Build & push image (amd64) (push) Successful in 5m5s
fix(819): derive the SPA page-size guard population from the git index (#875)
The guard asserted EXACT completeness over a population enumerated by a directory
walk, so an untracked .ts/.tsx under web/src/ entered it and failed as unregistered
on that developer's checkout while CI — which only ever checks out tracked files —
stayed green.

The glob still supplies file CONTENT; the POPULATION is now the git index, read by
web/vite-plugins/trackedSourceFiles.ts in Vite's own Node context and handed to the
app project as a virtual module. That reaches the index without admitting
@types/node to tsconfig.app.json, the obstacle that deferred this in #818.

Three mechanisms carry the proof, each added because the previous was measured
insufficient: a closed-form restatement of the shared scope predicate (sharing no
helper at any depth with what it checks); a second independent `ls-files --others`
query cross-checking the population; and real-git tests that execute the derivation
against a temp repository.

Six residuals are stated with their MEASURED fail-directions, and
testing.guard-derives-population-from-source gains a bounded exception plus the
closed-form criterion.

fixes #819

Co-authored-by: Timothy <timothy@noreply.gitea.tblindustries.be>
2026-08-29 09:14:15 +00:00

25 lines
1.4 KiB
TypeScript

/// <reference types="vite/client" />
// ersatztv#819: the tracked-source-file population, supplied by `vite-plugins/trackedSourceFiles.ts`
// from `git ls-files`. Declared here rather than imported from the plugin so the app project never
// pulls in `@types/node` — see that plugin's doc comment for why that matters.
//
// Residual: this is a HAND-WRITTEN mirror of that plugin's `TrackedSources`, with no
// compile-time link to it, so a renamed or retyped field type-checks here and fails at
// runtime. Importing the real type would drag `@types/node` into the app project, which is
// the whole thing this arrangement exists to avoid. The runtime failure is loud and immediate
// for `tracked` (a rename yields `new Set(undefined)`, an empty population the anti-vacuity floor
// reddens on) and for `others` (a TypeError). It is NOT loud for `absentFromDisk`: renaming that
// one is silent, which is the same fail-noisy-only tolerance recorded for it in the guard.
declare module 'virtual:etv-tracked-source-files' {
const trackedSources: {
/** Paths relative to the Vite root (`web/`), e.g. `src/api/pageSizeScan.ts`. */
tracked: string[];
/** Tracked paths with no READABLE file: usually an unstaged deletion, also a broken symlink. */
absentFromDisk: string[];
/** Untracked paths under `src/` (ignored included), from a separate `ls-files --others` query. */
others: string[];
};
export default trackedSources;
}