Skip to content

fix(publish): judge a feed by the version it declares - #111

Merged
hhkaos merged 1 commit into
mainfrom
fix/69-publish-validate-document
Nov 4, 2026
Merged

hhkaos merged 1 commit into
mainfrom
fix/69-publish-validate-document

Conversation

@hhkaos

@hhkaos hhkaos commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Closes #69. Last call site in the repo still on validateFeed.

Broadcast reads a feed somebody else published, so it has to be judged against the version it declares. validateFeed is latest-only by design — right for documents this kit writes, wrong here. A valid 0.4 feed came back invalid over its specVersion alone, and because an invalid feed stops everything before any destination, Broadcast refused to publish a healthy feed outright.

Now on validateDocument. Being behind inside the support window is a notice, never a defect: the notices render above #main rather than in place of it, with their links as links, and the feed still broadcasts.

Two things that differed from the plan on #101

runCli did not need to become async. That note was written for the three exporters in 555ba2a; boot() here was already async, so the change is the call plus the notice rendering.

The bundle went 464 KB → 1.3 MB, which was not predicted. validateDocument can reach any published version's compiled validators, and apps/publish bundled to a single outfile, so esbuild inlined all of them. They sit behind a dynamic import() precisely so a bundler can split them — apps/validator already relies on this. The same splitting/outdir config takes main.js to 122 KB, smaller than before this change, since the latest version's validators are now a chunk too. deploy-tools.yml copies dist/. recursively, so the chunks ship; publish has no CSP meta, so nothing to widen.

Spec version

No spec-version change. The repo stays on OTE Spec 0.6.0.

Testing

pnpm lint, build, typecheck and test green across the workspace (71 publish tests).

src/main.ts is boot wiring with no unit coverage — per CONTRIBUTING.md the UI is checked by hand — so this was driven in a browser against a served build:

  • a valid 0.4 feed broadcasts, with the notice panel above the app and the changelog link rendered as a link;
  • an invalid feed still shows its errors and no console;
  • no console errors beyond a missing favicon.ico from the throwaway static server.

apps/publish/CLAUDE.md named validateFeed directly and now describes the validateDocument rule, so the doc does not lie about the one thing it is there to protect.

🤖 Generated with Claude Code

Closes #69. Broadcast was the last call site left on `validateFeed` —
latest-only by design, the right API for documents this kit writes and the
wrong one for a feed somebody else published and this tool merely reads.

A valid 0.4 feed came back invalid over its `specVersion` alone, and because
an invalid feed stops everything before any destination, Broadcast refused to
publish a healthy feed outright. Being behind inside the support window is a
notice, never a defect.

`validateDocument` now picks the version. The notices it returns render above
`#main` instead of in place of it, with their links as links rather than a
bare URL mid-sentence — the feed still broadcasts, which is the entire point.

The tracker predicted `runCli` would have to become async here as it did in
the three exporters; it did not. `boot()` was already async, so the change is
the call and the notice rendering.

One consequence that was not predicted: `validateDocument` can reach any
published version's validators, and `apps/publish` bundled to a single
`outfile`, so esbuild inlined all of them and `main.js` went 464 KB → 1.3 MB.
They sit behind a dynamic import precisely so a bundler can split them, which
`apps/validator` already relies on. Same `splitting`/`outdir` config here
takes `main.js` to 122 KB — smaller than before this change, since the latest
version's validators are now a chunk too.

Checked by hand, per CONTRIBUTING.md: a 0.4 feed broadcasts with the notice
shown, and an invalid feed still shows its errors and no console.

Co-Authored-By: Claude Opus 5 <[email protected]>
@hhkaos
hhkaos merged commit c798439 into main Nov 4, 2026
1 check passed
@hhkaos
hhkaos deleted the fix/69-publish-validate-document branch November 4, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The exporters and build-feed still judge every feed against the latest spec version

1 participant