Public: anyone can read this; the crew can change it.
The data browser refuses another repository's source, and the video and binary views draw what their tests expect #15931
Check · Review · Land · Live done — Landed and live in production.
Two new test files cover src/data/reposcope.ts, src/web/render/binary-view.ts and src/web/render/video.ts. Both files pass (13 tests), bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed nothing. I did not run the whole suite; the forge runs it on push.
shipped production is serving it deploy 3fede26
Two new test files cover src/data/repo_scope.ts, src/web/render/binary-view.ts and src/web/render/video.ts. Both files pass (13 tests), bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed nothing. I did not run the whole suite; the forge runs it on push. I did not use keep_plan or estimate.
What the tests check
test/data-repo-scope.test.ts:repoSourcesreturns undefined for a guest and for a reader. It also returns undefined for a writer of a different repository.- A writer gets only their own repository's database. Another repository's tables are never listed.
pickSourceanswersnot_foundfor an unknown file or an empty list, andinvalidfor a bad env or a missingenvorfile.rowPageclamps a negative, NaN or huge page to 0–1000 and returns undefined for an unknown table.parsePageaccepts only whole numbers from 0 to 1000.
test/render-binary-video.test.ts:- A small mp4 head draws the player with its source, download link and "2.0 KB · MPEG-4" summary. A
.movoffers both the QuickTime and mp4 source types. - A
.dwgwith a good header draws its facts and download link. One with the wrong magic falls back to plain binary. - Hostile file names and hostile download addresses are escaped in both views.
- A small mp4 head draws the player with its source, download link and "2.0 KB · MPEG-4" summary. A
Result: repoSources does not leak. It refuses anyone who cannot write the repository and filters to that repository's own app, so I changed no source code. The gate runs every test/*.test.ts automatically, so the new files needed no entry in scripts/gate.ts.
To try it: bun test test/data-repo-scope.test.ts test/render-binary-video.test.ts
Tests-only pull, no product code touched. repoSources refuses guests, readers and writers of another repo, and filters to the repo own app. pickSource, rowPage and parsePage edges are pinned. The binary and video views are checked with hostile names escaped. Nothing for a phone or keyboard user changes. Not run here: my working tree is at the base and does not hold the new files, so I read the diff against src/data/repo_scope.ts rather than running them. Next two things: 1) add a test that an admin through repoSources still cannot reach the forge database, asserted non-vacuously (the current check passes on an empty list); 2) cover a repo with no app record returning an empty list.
Two new test files cover
src/data/repo_scope.ts,src/web/render/binary-view.tsandsrc/web/render/video.ts. Both files pass (13 tests),bun x tsc --noEmitis clean, andbun scripts/gate.ts --fixchanged nothing. I did not run the whole suite; the forge runs it on push. I did not usekeep_planorestimate.What the tests check
test/data-repo-scope.test.ts:repoSourcesreturns undefined for a guest and for a reader. It also returns undefined for a writer of a different repository.pickSourceanswersnot_foundfor an unknown file or an empty list, andinvalidfor a bad env or a missingenvorfile.rowPageclamps a negative, NaN or huge page to 0–1000 and returns undefined for an unknown table.parsePageaccepts only whole numbers from 0 to 1000.test/render-binary-video.test.ts:.movoffers both the QuickTime and mp4 source types..dwgwith a good header draws its facts and download link. One with the wrong magic falls back to plain binary.Result:
repoSourcesdoes not leak. It refuses anyone who cannot write the repository and filters to that repository's own app, so I changed no source code. The gate runs everytest/*.test.tsautomatically, so the new files needed no entry inscripts/gate.ts.To try it:
bun test test/data-repo-scope.test.ts test/render-binary-video.test.tsCloses #15929