build: Close the whole vault-safety cluster on current main — working-list items 57, 58 and 59, in one coherent change with tes #9
Loading…
Reference in a new issue
No description provided.
Delete branch "build/28048962"
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?
Close the whole vault-safety cluster on current main — working-list items 57, 58 and 59, in one coherent change with tests.
(57) Re-cut the two 89773b06 hardenings against today's main: relPath() must reject any path segment beginning with '.' (no dotfile or dot-dir traversal into .obsidian, .git, .trash), and read/list must be gated on a text-extension allowlist.
(58) read_meta (src/main.ts around line 866) still returns a non-text file's raw bytes — gate it on the same isTextPath set. Where a file is not text, return the metadata you legitimately have (path, size, mtime, extension) plus explicit keys
text: falseandcontent_withheld: truerather than the bytes, so callers can say "that is a PDF, not a note".(59) The write lane has no gate at all: mcpWrite/planWrite (and any read_meta-composite that writes back) will prepend markdown frontmatter to a .pdf/.png and replace the binary with text. Gate write/modify on the same isTextPath set and refuse with a clear reason.
One shared isTextPath helper, used by read, list, read_meta and write — do not let four copies drift. Tests against real vault fixtures: a dotfile path rejected, a binary read refused, read_meta on a PDF returning content_withheld, a write aimed at a .png refused and the file left byte-identical, and normal .md/.canvas/.base paths still working end to end. Run the repo's own gate before finishing, and say plainly in your report which of 57/58/59 each test covers and whether anything in the cluster is left undone.
Built by Connor's session (dispatch
28048962) in an isolated clone; shipped deterministically byship.py. The full build notes were spoken in conversation and stored in memory (agent-dispatch:28048962). Review is the gate. Gate:npm run gate.