]> zackmdavis.net Git - An_Algorithmic_Lucidity.git/commitdiff
CLAUDE.md design discussion of LessWrong cross-posting integration
authorZack M. Davis <code@zackmdavis.net>
Thu, 6 Aug 2026 00:22:21 +0000 (17:22 -0700)
committerZack M. Davis <code@zackmdavis.net>
Thu, 6 Aug 2026 00:22:39 +0000 (17:22 -0700)
CLAUDE.md

index 15e1fec97c43673f3f3f7b2a697a08106ef86772..75202c61a4d62bb779999569572059eb04d6e780 100644 (file)
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -66,3 +66,19 @@ The fix, when it's worth doing: build into a sibling directory and flip a symlin
 Note this means the heavy `.md` fetching visible in those digests is *not* evidence llms.txt works: the mirrors are reachable from the HTML anyway, via the `<link rel="alternate">` in `theme/templates/article.html` and the visible "Markdown source" link in `theme/templates/includes/post_card.html`.
 
 The fix is placement, not content — `_canonical_url` already builds absolute `https://zackmdavis.net/blog/...` links, so a copy served from the webroot works unmodified. It's the same problem `STATIC_PATHS` in `pelicanconf.py` already solves for `robots.txt` by deploying that standalone, but `llms.txt` is build-generated, so it needs copying out of `output/` after each build (`provisioning/pelican_scheduler.py`) rather than a one-time `scp`. While in there: there's no `sitemap.xml` at all and no `Sitemap:` line in `robots.txt`, which is the same missing-machine-discovery-surface problem — robots.txt *is* reliably fetched (ClaudeBot, Applebot, PerplexityBot, OAI-SearchBot all hit it), so it's the better hook of the two.
+
+## Less Wrong cross-posting (designed, not built — nothing decided)
+
+Two related wants, neither implemented: a "Discussion on Less Wrong" link on each post, and a script that rewrites internal blog links to their LW equivalents when preparing a linkpost. Findings below so this doesn't get re-derived.
+
+**Two directions, don't conflate them.** 46 posts carry `[(originally published at _Less Wrong_)](url)` as the first body line — that's the *old* relation, LW-canonical and mirrored here. New posts are the reverse: canonical here, linkposted to LW, so they want different wording ("Discussion on Less Wrong"). Backfilling the 46 into whatever mechanism gets chosen is mechanical but separate.
+
+**Where the LW URL should live — leaning sidecar, undecided.** The obvious answer is a `Lesswrong:` line in the post header; Pelican supports arbitrary metadata with no config change (`readers.py:320` lowercases the key, `:341` returns a single-line value as a string, `:117` passes unknown names through), exposing `article.lesswrong`. The problem is sequencing: the LW URL doesn't exist until *after* publishing, so post-header metadata forces a second commit per post that touches the post file. A sidecar `slug → LW URL` JSON keeps the publish commit clean and lets updates batch — which matters beyond tidiness, since every push triggers a full rebuild and the site-wide 404 window described above. Read it once in `pelicanconf.py` and attach `article.lesswrong` the way `_prepare_markdown_mirrors` attaches `article.markdown_url`; warn on a key matching no post, since the sidecar loses the typo-safety of co-located metadata. Slugs are verified unique corpus-wide, so slug is a safe key. Third option: linkpost *before* pushing (the blog URL is predictable from date and filename), publish once with the field already filled — costs a window where the LW post points at a 404.
+
+**Gotcha either way:** `_write_markdown_mirrors` restates a **hardcoded** field list (Author, date, Category, Tags, Canonical URL), so a new field silently vanishes from the `.md` mirrors — i.e. the artifact that exists for LLM legibility — unless added there too.
+
+**Link-rewriting script.** Key on slug, not whole-URL matching: of 323 internal links in the corpus, 284 are the legacy `http://zackmdavis.net/blog/YYYY/MM/slug/` form that only resolves via the 302 in `nginx_siteconf`, and only 9 are the current Pelican `/blog/YYYY/Mon/slug/` shape; there are also root-relative and `.md`-suffixed variants. Dispositions: mapped post → LW URL; unmapped post → absolutize (**mandatory** — root-relative links resolve against lesswrong.com once pasted); link with a `#fragment` → leave pointing home, since LW has no corresponding anchor and a wrong landing spot beats an off-site one; `/blog/` and `/blog/tag/...` → absolutize only; plus a self-link guard. Make it a standalone CLI with a `--check` mode that reports each link's disposition, *not* a build hook — no reason to grow the job that owns the 404 window.
+
+**Scope boundary.** Link rewriting is the easy half; your Markdown is not LW's Markdown (footnotes `[^name]`, `~~` via `pymdownx.tilde`, `$...$` MathJax, the `&#36;` entity workaround). "Swap the links" is bounded; "paste without touching" is open-ended. Build the first and let the footnotes say whether the second is needed.
+
+**Incidental:** `SOCIAL = ()` in `pelicanconf.py` is dead — the theme references `LINKS` (`theme/templates/base.html:94`) and never `SOCIAL`. It's `pelican-quickstart` scaffolding, and site-global anyway, so it's not a mechanism for per-post links.