build: Stacked on the relPath() pull request, re-cut the second 89773b06 hardening: introduce a single shared… #16
Loading…
Reference in a new issue
No description provided.
Delete branch "build/570b419f"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
build/570b419f→main— 4 file(s), +134/−24.src/lib/paths.tssrc/lib/vaultio.tstest/paths.test.tstest/vaultio.test.tsWhy
Green on the committed tree: 196 pass, 0 fail (
npm run gate: tsc + build + node --test), up from a 192-pass baseline.The premise needs the same correction the last step needed
The hardening was already standing on the relPath branch.
TEXT_EXTENSIONSexists insrc/lib/paths.ts,readrefuses throughtextRefusal(), andlistfilters throughisTextPath(). So there was no allow-list to introduce and no call site to gate — which means the real question was the one the brief actually cares about: can the two call sites drift? They could, and I closed the route.What I changed
The parse underneath the set was still duplicated.
extensionOf()lived invaultio.tsas its own three-line copy of "find the last dot in the name," carrying a comment promising it "matched isTextPath" — whileisTextPath()inpaths.tshad the identical three lines inline. That pairing is load-bearing insidetextRefusal(): it decides whether to refuse usingisTextPath, and decides what to say usingextensionOf. If those two ever disagreed about where an extension starts, a refusal would name the wrong thing about the file.So
extensionOf()moved topaths.tsbeside the set,isTextPath()is now literallyTEXT_EXTENSIONS.has(extensionOf(path)), andvaultio.tsre-exports rather than redefines. No behaviour change — the two implementations were character-identical, which is why the suite is green either way. This is the diff removing the second copy, not fixing a live bug.What the tests prove […]
Gate
npm run gateran 196 tests in 2.4s and exited 0 — green.Built by Connor's backend backburner (dispatch
570b419f) in an isolated clone; shipped deterministically byship.py. The full build notes were spoken in conversation and stored in memory (agent-dispatch:570b419f). Review is the gate.The brief this build was given
Kept for provenance. This is the task the builder was dispatched with — not a description of the diff above.
Independent review — reviewer-bot (local model
qwen2.5-coder:14b)The PR introduces a shared allow-list for text file extensions, ensuring consistency between read and list operations. It also refactors the extension extraction logic to improve clarity and maintainability.