Repository navigation
feat(mask): a CSV masking page for handoff to AI tools (#10) - #12
Merged
Merged
Conversation
Closes #10. The compare tool answers "what is missing from my .env". This answers the neighbouring question: how do I let a model read the shape of a configuration without reading the secrets in it? Same promise, second surface — /mask is a real page load like /privacy, sharing the header, the tokens and the guard. The pipeline is three pure modules: - src/core/csv reads RFC 4180 plus the lenient parts everyone relies on — BOM, CRLF, quoted commas and newlines, "" escapes — and reports what it cannot parse (ragged rows, an unterminated quote) instead of dropping it. The writer keeps the source's delimiter, line ending and quoting rules. - src/core/mask applies per-column and per-key modes: hide completely, mask the start, the middle or the end. Same input, same output, so duplicate secrets still line up after masking. - src/state/maskReducer holds the originals; the export is always derived, so nothing is destructive and reloading loses the file, as advertised. Five decisions: - Formatting, not encryption, and the page says so. A mask that claims more is a lie someone may rely on. - hide also hides the length; the other modes keep a prefix or suffix and are labelled by what stays visible. - A value too short to keep anything is hidden whole, rather than "masked" by revealing all of it. - Duplicates are reported in the preview, not encoded into the mask: a hash suffix would let anyone who can guess a secret confirm the guess. - The preview is the export — one maskCsv -> maskedText path, with the exact output text available before copying. Defaults follow the product's asymmetry: detection may only add masking. The key column is detected by header name, value columns by header name, value shape, or the rightmost column of a key,value file, and arrive masked. Warnings cover an open column that looks like credentials and a key column that has itself been masked. PRD §4.3 gained a paragraph stating /mask is not an exception to any non-goal, and §8.6 gained US-24 with the acceptance criteria as testable statements. Tests: 455 (25 files), up from 402. 15 CSV, 25 masking, 13 component tests walking the acceptance criteria, plus e2e/mask.spec.ts asserting that masking and copying make no request and write nothing to storage.
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 #10.
The compare tool answers "what is missing from my .env". This answers the neighbouring question: how do I let a model read the shape of a configuration without reading the secrets in it? Same promise, second surface —
/maskis a real page load like/privacy, sharing the header, the tokens and the privacy guard.The pipeline
Three pure modules, no new runtime dependencies:
src/core/csvreads RFC 4180 plus the lenient parts everyone relies on — BOM, CRLF, quoted commas and newlines,""escapes — and reports what it cannot parse (ragged rows, an unterminated quote) rather than dropping it. The writer keeps the source's delimiter, line ending and quoting rules, so the file can go back into the tool it came from.src/core/maskapplies per-column and per-key modes: hide completely, mask the start, the middle, the end. Same input masks to the same output, so duplicate secrets still line up after masking.src/state/maskReducerholds the originals; the export is always derived. Nothing is destructive, and a reload loses the file — as advertised.Decisions
hidealso hides the length; the other modes keep a prefix or suffix and are labelled by what stays visible.maskCsv→maskedTextpath, and Show the exact output prints the literal text the copy button writes.Defaults follow the product's usual asymmetry — detection may only ever add masking. The key column is found by header name; value columns from header names, then value shapes, then the rightmost column of a
key,valuefile, and they arrive masked. Two warnings run against that: an open column whose values look like credentials (or whose name does), and a key column that has itself been masked.Scope
This was the one place the issue could have diluted the product, so it was held to the constitution rather than bent around it: PRD §4.3 gained a paragraph stating
/maskis not an exception to any non-goal, and §8.6 gained US-24 with the acceptance criteria as testable statements.Verification
npm run check— 455 tests / 25 files, tsc clean, build ✓, privacy guard ✓e2e/mask.spec.tsasserts what unit tests cannot: filling, masking and copying makes no request and writes nothing to storage