The README can carry the site link, and one region does it - #198
Merged
Conversation
Asked from the outside: why is there no link to the site on the README — missing annotation, the user's job, or something wired halfway? Third one, and the answer was on line 57 of this repository's own README: a hand-typed `dmarx.github.io/luria` sitting immediately below the closing marker of a region `luria index` rewrites on every run. DP-3, one line from its source, in the repo that ships the principle. `Site.base_url` derives from `issue_url` with no configuration and `luria site` builds against it, so the fact was always there — nothing wrote it where a reader of the front page would look. Adds a `<!-- luria:site -->` region rendered from `Site`, rewritten beside the badges and the citation block. Its own marker rather than the badges region, whose docstring is explicit that it holds two numbers about the record; a link is not a number, and separate markers let a project take one without the other. A link rather than a shields badge, because a base URL is a constant and an image would cost a reader a round-trip to display text this repository already knows. A region is opt-in and is never inserted — the position would have to be guessed, and the guess is wrong for a front page that opens with a logo block. So the disclosure opts in and the guard reporting its absence opts out: `unlinked-site` names a record that publishes a site its README never mentions. Satisfied by the URL appearing anywhere, prose link included — the finding is about the front page, not about the marker. Scoped by a new `[luria.site] publish`, defaulting true. Two predicates were tried and rejected first: `base_url` alone fires for every GitHub project deployed or not, and `"site" in raw` fails outright because DEFAULTS injects the key before the user's TOML is read — and would have contradicted that table's own "the conventional case needs no [luria.site]" besides. Unplanned, and the better half: the region machinery existed three times — badges, citation, and about to be a fourth — already drifted between `re.DOTALL` and `re.S`. It is now one implementation in `readme.py`, with both callers keeping their OPEN/CLOSE names. Fired before trusting: reports the anthology, which is the record that prompted the question, and is silent here now that the region writes what the deleted line used to say. `luria init` writes no root README, so there is nothing for it to scaffold markers into; the finding carries the whole load, which is what reaches the records that already exist. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YP4P3m8rzVFb8idnTE4FfT
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 #197. Split out of #195, which is now just the record-line bugfix.
Asked from the outside: why is there no link to the site on the README — a missing annotation, the user's job, or something wired halfway?
Third one. The answer was on line 57 of this repository's own README:
A hand-typed link on the line immediately after the closing marker of a region
luria indexrewrites on every run. DP-3, one line from its own source, in the repository that ships the principle.Site.base_urlderives fromissue_urlwith no configuration at all, andluria sitebuilds against it — the fact was always there. Nothing wrote it where a reader of the front page would look. Downstream is worse: the anthology has no badge region either (grep -c 'luria:badges' README.md→0), so it gets neither the counts nor a link, and nothing anywhere says it could. DP-15 exactly — the absence reads like a success.What this adds
A
<!-- luria:site -->region rendered fromSite, rewritten byluria indexbeside the badges and the citation block.Its own marker, not the badges region. That region's docstring is explicit that it holds "two numbers about the record", and a link is not a number. Separate markers also let a project take one without the other.
A link, not a shields badge. A badge carries a number that moves and the round-trip buys something; a base URL is a constant luria already knows, so an image would cost a reader a request to display text this repository could write itself — which is
badges.py's own argument for baking its counts in.The region holds only the derived fact. Prose about the site stays outside the markers where no rewrite touches it; this README keeps its sentence about backlinks and the graph, and only the link moved inside.
The disclosure opts in; the guard that reports its absence opts out
A region is opt-in and luria never inserts one — the position would have to be guessed, and the guess is wrong for a front page that opens with a logo block, a table or a quote. The badge region's own test already says why: "a tool that edits a README nobody asked it to edit is a tool people stop running."
So a scaffold alone would reach nobody, and
luria initwritesdocs/README.mdand no root README, so there is nothing to scaffold markers into anyway.unlinked-sitecarries it instead: a record that publishes a site its README never names. Satisfied by the URL appearing anywhere in the README, prose link included — the finding is "your front page does not point at the site you publish", never "you must use our marker". That's DP-10 applied twice to one feature.Scoped by a new
[luria.site] publish, defaulting true, and this is the part I'd most like pushed back on. Two predicates were tried first:base_urlalone — fires for every GitHub project whether or not one is deployed, so a record living only in its repository carries a warning it can never clear."site" in raw— written and tested, and it fails outright:DEFAULTSinjects"site"before_siteever sees the user's TOML. That was luck, because the idea was wrong regardless — the defaults' own comment says "the conventional case needs no[luria.site]table at all", so making the table the opt-in would have contradicted the design one function above.A key nobody sets is a key nobody reads. It earns its place only because the alternative is an unclearable warning. If you'd rather it just fire for every GitHub project, that's a smaller surface and I'll drop the key.
Unplanned, and the better half
Looking for where to put the region found the machinery already written three times —
badges.py,citation.py, and about to be a fourth here. Four lines each (OPEN,CLOSE, a compiled regex, asub), and they had already drifted in spelling:re.DOTALLin one,re.Sin the other; an f-string against concatenation.Now one implementation in
readme.py—markers,has,rewrite,path— with both callers keeping theirOPEN/CLOSEnames so nothing addressing them had to move. Splittingregion()into_inner()plus markers was the whole mechanical cost. Nobody extracts at two copies; reaching for a fourth is the signal.Fired before trusting
Reports the anthology, which is the record that prompted the question:
…and is silent here, now that the region writes what the deleted hand-typed line used to say. A test asserts this repository's own README names its site, so the real corpus is covered and not only the fixtures.
Checks
python -m pytest tests -q→ 919 passed on this branch alone.luria link --fix,luria index,luria lint→ clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01YP4P3m8rzVFb8idnTE4FfT
Generated by Claude Code