Skip to content

Cover feed-discovery surfaces: api-catalog parity + autodiscovery tests #142

Description

@schmug

Task

Close the test-coverage and api-catalog parity gaps left after the feed-discovery work (per-section RSS autodiscovery, OPML subscription list, and sub-feed catalog entries). After this is done: the agent-discovery catalog lists every machine-readable surface the site exposes (including api/mythos.json), and automated tests guard both the catalog contents and the per-section feed autodiscovery <link> tags so they can't silently regress.

Context

A recent change made the RSS "feed of feeds" coherent: /podcast and /mythos now advertise their own feeds via <link rel="alternate"> (so a podcast client autodiscovers the iTunes feed instead of the enclosure-less firehose), and a new /feeds.opml + /feeds page lets readers subscribe to everything at once. Those new surfaces were verified manually (built-HTML grep + browser render) but not covered by automated tests, and one pre-existing inconsistency was found while in there. The api-catalog was introduced in #30.

Motivation

As a maintainer, I want the feed/catalog discovery surfaces under test so that a future refactor (or a dropped feedUrl prop) fails CI instead of shipping a broken-discovery regression — and I want the catalog to actually list every endpoint, so agents and readers can find them.

Three concrete gaps:

  1. api-catalog test gap — the agent-ready e2e asserts only blog.json, projects.json, and rss.xml; it does not cover the newly added mythos/rss.xml, podcast/rss.xml, or feeds.opml anchors.
  2. api/mythos.json catalog gap — the api/mythos.json endpoint exists but is absent from the api-catalog, even though its siblings api/blog.json and api/projects.json are listed.
  3. Autodiscovery link test — nothing asserts that /podcast and /mythos render their section <link rel="alternate"> tag (plus the global /rss.xml).

Pointers

  • e2e/agent-ready.spec.ts:34 — the linkset anchors assertions to extend (currently lines 35-37).
  • public/.well-known/api-catalog — add an api/mythos.json entry. Mirror the api/blog.json block (describedby → the text/html page).
  • src/pages/api/mythos.json.ts — the endpoint being registered; its page is /mythos.
  • src/pages/api/blog.json.ts, src/pages/api/projects.json.ts — the catalog-entry pattern to follow (blog→/blog, projects→/projects).
  • src/layouts/Base.astro — the feedUrl/feedTitle props and the rendered <link rel="alternate"> (section feed first, then global /rss.xml).
  • src/pages/podcast/index.astro, src/pages/mythos/index.astro — the pages that pass feedUrl.
  • e2e/smoke.spec.ts — example of asserting against rendered pages under astro dev; the autodiscovery test fits best here (the <head> <link> tags are server-rendered HTML, so a Playwright page.locator('link[rel=alternate]') check on /podcast and /mythos is the natural home — a unit test can't render the .astro page).
  • src/pages/_rss.xml.test.ts — pattern for the feed unit tests (for reference; autodiscovery is HTML, not feed XML).

Constraints

  • No new dependencies; use the existing Playwright + Vitest setup.
  • Keep api-catalog valid RFC 9727 (the existing e2e parses data.linkset).
  • Don't change feed contents, formats, or the feedUrl ordering (section feed must stay first, global second) — this is test/catalog work only.

Acceptance criteria

  • public/.well-known/api-catalog includes an api/mythos.json entry with a describedby link to /mythos.
  • The agent-ready e2e (e2e/agent-ready.spec.ts) asserts the catalog contains the mythos/rss.xml, podcast/rss.xml, feeds.opml, and api/mythos.json anchors.
  • A test asserts /podcast advertises /podcast/rss.xml and /mythos advertises /mythos/rss.xml via <link rel="alternate">, alongside the global /rss.xml.
  • npm test and npm run test:e2e are green locally.

Out of scope

  • The podcast cover art (handled separately).
  • Merging mythos into the /rss.xml firehose (deliberately kept a separate spoke).
  • Any change to feed XML structure or the OPML format.

Reasoning guidance

Prioritize responding quickly rather than thinking deeply — this is mechanical test/config work with clear patterns to mirror. When in doubt, follow the existing api/blog.json catalog block and the existing e2e assertion style.

Cross-references

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions