Draw what a shared map carries, and close two redaction gaps it found - #37
Merged
Conversation
The README says a map is private by default and then leaves a reader to take that on trust. This adds the drawing that says it instead: seven things git or the filesystem hands index, and what each one becomes in the written file. One row is marked, and it is the setting that puts real absolute paths in the map. Writing it meant reading sanitize_credentials closely, and two origins went through it untouched. A password in an ssh URL survived, because the userinfo rule was bound to http and https. A parameter named access_token survived, because a word boundary cannot match between an underscore and a letter, so a pattern anchored on one sees token and misses every prefixed spelling of it. Both sit under a module docstring that calls the redaction always-on. Drawing the gap would have advertised it, so the code is fixed and ten new cases hold it: three password-carrying schemes, ten parameter names bare and prefixed, one ssh username that stays because a username is not a secret, and six ordinary remotes that must come back byte for byte. Reverting the module turns six of them red. The value class after a credential name still runs to the end of the query. Stopping it at an ampersand would uncover the next parameter, which may be a secret whose name this pattern does not know, so the greedy read is the safe one and the reason is now in the code. The card gate measures every row against its column with the renderer's own width table, and it checks two failures rather than one. A note that loses its ending is the obvious case. A single token longer than the column is the quiet one: greedy wrapping leaves it alone on its line, the joined text still equals the source, and the drawing runs off the page with every check green. Both are proved failable by a control card. Measured against the real Hanken Grotesk face as well as the renderer's table: 37 text elements, widest right edge 905.8 real and 904.2 by table, against a rule at 916. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What this adds
A record card,
docs/art/what-leaves.svg, embedded in the README under the privacy bullet. Seven rows: what git or the filesystem hands index on the left, what the written map ends up carrying in the middle, why it lands that way on the right. One row wears the hot mark, and it isportableturned off, the single setting that puts real absolute paths in the file.The README already claimed a map is private by default. Nothing pictured it, and nothing let a reader see the shape of the claim without reading
gitmeta.pyandscan.pythemselves.Two redaction gaps, found by reading the code the card describes
Drawing a claim means checking it first. Two origins went through
sanitize_credentialsuntouched:ssh://user:pw@host:22/o/r.gitssh://<redacted>@host:22/o/r.githttps://h/r.git?access_token=v?access_token=<redacted>The first because the userinfo rule was bound to
https?://. The second because\bcannot match between_andt, so a pattern anchored on a word boundary seestokenand misses every prefixed spelling. Both sat under a module docstring calling the redaction always-on.Publishing a diagram that advertised the gap seemed worse than fixing it, so the code is fixed.
ssh://git@hoststill passes through whole: a username is not a secret, and blanking it costs a reader the half of the URL that says how the clone was set up.This is a scope extension. The task was artwork. This changes security-relevant source, so review it as such.
What holds it
Ten new cases in
tests/test_gitmeta.py: three password-carrying schemes, ten parameter names bare and prefixed, one ssh username that must stay, six ordinary remotes that must come back byte for byte. Revertinggitmeta.pyto the merged version turns six of them red, so they are bound to the module rather than to a fixture.The greedy value class after a credential name is kept on purpose. Stopping at
&would uncover the following parameter, which may be a secret whose name this pattern does not know. More redaction is the safe direction, and the reasoning is now a comment in the code.The card gate
tests/test_repo_art.pygains inline gates in this repository's plain-pytest shape, each with a docstring saying what it stops:<img>hides the description the SVG carries inside itThe width check tests two failures, not one. A note that loses its ending to the wrapper is the obvious case. The quiet one is a single token longer than the column: greedy wrapping leaves it alone on its line, the joined text still equals the source, and the drawing runs off the page with every check green. A 120-character token draws 690px into a 376px column that way.
Measurement
Measured twice, against the renderer's width table and against the real Hanken Grotesk face the site serves:
37 text elements, 19 of them grotesk. Nothing past the rule either way. The table is a class approximation (every lowercase letter one width), so the two numbers are expected to differ; a line full of wide letters is where it drifts.
Honest nulls
repo_art.py/repo_flow.py/repo_card.pyacross these repositories rather than a shared package. That is a real cost and it is not paid here.repo_card.pyhas no treatment for anunverifiableverdict. The published site separates that tone by border and ring rather than hue; the card has neither. This card sidesteps the gap by marking the one row where something does leave.NOTE_BUDGETequals the rule exactly, so the note column has zero designed margin. This card's widest note clears by 11.8 by table and 10.2 real, which is margin by wording rather than by geometry.ruff(40) andmypy(29) findings exist onmainand none of them touch the files changed here. CI runs pytest only.🤖 Generated with Claude Code