carlos / platform Public

static-markdown-twins

Written by claude agent, operated by paul@keymail.dev — this branch has no commits of its own to compare against, so how current this is cannot be said

Where it stands

MERGED to main as ffcf01b5 (squash, from tip 6acfc7c2, CI green on tip). Not released: ships with the next platform release. Task review R1 READY, whole-branch Opus review R1 READY, census approved on #280 (4 units + envelope), fix-wave re-review READY. Main CI red since df66050e (#511 F10, activator timing flakes), not caused by this branch; noted on #511.

Next

Paul: read the docs copy in discussion 545. Follow-ups (P3): empty Accept parameter handling, docs sentence on text/markdown params, 'served Markdown' wording, Vary merge if _headers ever allows Vary. Plan 4 consumer waits for a release.

Already decided

- no release and no edge verification step from T2 Step 5 — controller brief says "never cut a release" and overrides the plan — cost if wrong: consumers (plan 4) wait for the next ordinary release.
- docs prose goes through a Luna copy pass applied verbatim, then posted on the branch for Paul, instead of Paul's copy review before writing — brief's scope note says so explicitly — cost if wrong: Paul re-edits a docs paragraph after merge.
- locally run targeted tests only (niced, serial); CI on amadan is the full gate — brief item 5 overrides plan T2 Step 4's local full suite — cost if wrong: a cross-package break found in CI instead of locally (one more push).
- T1 gets its own Opus task review (cache/serving); T2 (tests+docs) is covered by the whole-branch Opus review — AGENTS.md stopping rule 3 — cost if wrong: a T2 test weakness found at the whole-branch review instead.
- Opus is the census cross-model reviewer (Codex authors) — brief item 3 — cost if wrong: none expected.
- apply Luna's rows verbatim except (a) row 429 keeps backticks on `Vary: Accept`, `Vary`, `Accept-Encoding` — the brief said header names stay exactly as written and Luna dropped the code formatting — and (b) row 434's first sentence keeps the draft "The existing slash redirects and `_redirects` rules apply before selecting a representation." because Luna's imperative "Apply existing..." tells the reader to do what the edge does (a fact change) — cost if wrong: Paul re-edits two sentences.
- claims file to move from testdata/ to docs/superpowers/notes/ only if the branch review asks — cost if wrong: a stray file at repo root testdata.
- P3-1 (empty Accept parameter `;;` drops the range, can flip the pick either way) goes on the follow-up list rather than riding this branch — fixing it changes static_markdown.go and would reopen the census check for a case no real client sends — cost if wrong: an odd Accept header gets the less-preferred representation of the tenant's own page until the follow-up lands.
- P3-5 (docs silent that text/markdown ranges with non-charset parameters, e.g. variant=GFM, get HTML) goes on the follow-up list; a new sentence would need another copy pass — cost if wrong: a reader sending variant=GFM is surprised by HTML.

Recently

Human

<task-notification> <task-id>a47802f9cc613c3be</task-id> <tool-use-id>toolu_0151T8SP9sSK8nMHmftojXhN</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/fadfb62a-03f5-4192-bd2b-e123c5e6663f/tasks/a47802f9cc613c3be.output</output-file> <status>completed</status> <summary>Agent "Scoped re-review of fix wave" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>1. **Docs section: ADDRESSED.** The new section in `docs/site/cli.md` (lines 407-436) matches `final-docs-section.md` byte for byte, and the "(draft)" marker and DRAFT comment are gone. Every fact in branch-review-r1.md §3 survives the rewording. It is still clear that the platform applies the slash redirects and `_redirects` rules before choosing a representation, and that your own rules can override the `/shop` redirect. The Markdown renders correctly: the `sh` fence is closed, the backticks pair up, and there is exactly one blank line before "#### Redirects for a static site". 2. **CLAIMS move: ADDRESSED.** It is a pure rename (similarity 100%) to `docs/superpowers/notes/census-static-markdown-twins-claims.tsv`, and nothing is left under `testdata/`. The only reference to the old path is in `docs/superpowers/reviews/OPUS-REVIEW-BRIEF-static-markdown-twins.md:21`. That is the restored round-1 brief, so it is intended history. No Makefile or script hard-codes the path, since CLAIMS is passed in as a variable. 3. **Brief restore:** it has no net diff against 31eac72b, so the brief now reads as it did for round 1. No other file content changed. No new P1 or P2 in the fix diff. One optional P3 at `docs/site/cli.md:427`: "The served Markdown" is a little broader than the old "Negotiated Markdown". It could be read as also covering a direct `/page.md` request, and I did not check that request's content type. **Verdict: READY**</result> <usage><subagent_tokens>40462</subagent_tokens><tool_uses>3</tool_uses><duration_ms>26530</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>a46d4063b7141e079</task-id> <tool-use-id>toolu_01J3YMrkoQ8Ym98z3vCSwZmc</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/fadfb62a-03f5-4192-bd2b-e123c5e6663f/tasks/a46d4063b7141e079.output</output-file> <status>completed</status> <summary>Agent "Whole-branch + census review" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**READY**: no P1 and no P2. **P1 / P2:** none. I ran the focused tests and they pass: the five `TestStaticMarkdown*` tests, the existing static-header, proxied-static and tag-cache tests, and `TestPlan14RootReadCensus`. **Census verdicts (tip 70cab1d6):** - `staticSite.serveFile` (body): **approve.** It does the same Open and open-file Stat as before. The only new input is a content type chosen in memory. No new read and no root decision. - `staticSite.serveTree` (body): **approve.** It picks the Markdown file only after all the existing lookups, redirects and guard checks. It adds a hard-tier check on the file actually sent, which is stricter, and a `Vary` header. The existing Stat sites are unchanged. - New `selectStaticRepresentation` (+file:Lstat, legacy accepted-legacy): **approve.** It does one Lstat of the `.md` file beside an HTML file already found inside the tree, and refuses links and anything that is not a regular file. The edge could already serve that same file to anyone who asks for `/x.md`. - Envelope `internal/edge`: **approve.** The changed tag-cache functions still read only the file that is already open, and the Accept parsing is pure. Nothing new is read, run, queried or followed. **Deferred Task 1 P3s: none must be fixed before merge.** One correction to the ledger: the empty-parameter note is wrong to say it "can only cost Markdown a win". It can also give Markdown a win. With `text/markdown;q=0.5, text/html;;q=0.9`, the HTML range is dropped and Markdown is served against the client's stated preference. RFC 9110 allows empty parameters, so the range is valid. No real client sends `;;`, so it stays P3. The fix is two lines plus two test rows, and can ride the branch if it is touched anyway. The other two deferred P3s are fine as they are: the hard-tier re-check changes no behaviour, and swapping the global tag cache in a test is not a race. **New P3s (follow-up only):** - `_headers` would erase `Vary: Accept` if `Vary` were ever allowed there. It is refused today. - The docs don't say that a Markdown range with other parameters (for example `variant=GFM`) is ignored, so such a request gets HTML. Every other fact in the docs section matches the code. - The CLAIMS file in repo-root `testdata/` makes no functional difference, but it breaks the `docs/superpowers/notes/` convention. Moving it is optional. The full review is in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/static-markdown-twins/.superpowers/sdd/2026-11-04-static-markdown-twins/branch-review-r1.md`. Tracked files are unchanged.</result> <usage><subagent_tokens>135859</subagent_tokens><tool_uses>34</tool_uses><duration_ms>394179</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>b7wsp11zv</task-id> <tool-use-id>toolu_014H357PzxNwFcRDyPpb2c9M</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/fadfb62a-03f5-4192-bd2b-e123c5e6663f/tasks/b7wsp11zv.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 2 Codex run" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a7b17df8915eca50c</task-id> <tool-use-id>toolu_01MSB1wvkEdvoz3GXUNok4XM</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/fadfb62a-03f5-4192-bd2b-e123c5e6663f/tasks/a7b17df8915eca50c.output</output-file> <status>completed</status> <summary>Agent "Review Task 1 (spec + quality)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>READY. No P1 or P2 findings. The review found three P3 follow-ups. None of them blocks the merge: - **Extra guard check:** the new hard-tier check runs on every static file served, not just the selected Markdown twin. No current hard-tier rule can tell `page.html` from `page.md`, so it changes no outcome. Removing it would not fail any test, because the existing rewrite check already refuses `/blocked`. - **Empty Accept parameters:** a range like `text/html;;q=0.1` is valid in RFC 9110, but the parser drops it as malformed. That can only cost Markdown a win, never serve it wrongly. - **Test swaps a global:** the tag-budget test replaces the package-wide tag cache. It is restored afterwards, but it is the only test that does this. I ran `go vet ./internal/edge` (clean) and `go test ./internal/edge -run '^TestStaticMarkdown' -count=1` (passed). I did not run the broader regression set or the cross-compile build. The full review is in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/static-markdown-twins/.superpowers/sdd/2026-11-04-static-markdown-twins/task-1-review.md`.</result> <usage><subagent_tokens>97669</subagent_tokens><tool_uses>14</tool_uses><duration_ms>230108</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bhb8j5ntd</task-id> <tool-use-id>toolu_015J4qB63EvVDwrFpMbLnPXh</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/fadfb62a-03f5-4192-bd2b-e123c5e6663f/tasks/bhb8j5ntd.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 1 Codex run to finish" completed (exit code 0)</summary> </task-notification>