Skip to content

feat(providers): read Lobste.rs stories and Lemmy posts as posts - #8

Merged
Yigtwxx merged 1 commit into
mainfrom
feat/lemmy-lobsters
Sep 18, 2026
Merged

Yigtwxx merged 1 commit into
mainfrom
feat/lemmy-lobsters

Conversation

@Yigtwxx

@Yigtwxx Yigtwxx commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Two more platforms a post can be read from without an account: Lobste.rs (host-bound, the .json twin of each story/comment page — the Hacker News pattern) and Lemmy (read from whichever instance hosts it — the Mastodon pattern — but recognised by host: the lemmy. prefix or lemm.ee, sh.itjust.works, beehaw.org, programming.dev, feddit.org; never by /post/<n> alone). polite.ProviderError gains code, the bare error token of a JSON error body (^[a-z][a-z0-9_]{1,63}$ only, nothing else from the body).

Why

The README's platform table was five rows. Lemmy answers a missing post and a private instance with the same 400, told apart only by the body's token (couldnt_find_post vs not_logged_in); without code the reader would file a private instance as "not found" — the absence-as-evidence product rule 2 forbids. Now not_logged_in → UNVERIFIED (blocked), couldnt_find_* → UNVERIFIED (unreachable), any other 400 → UNVERIFIED (unavailable). The host rule for Lemmy keeps /api/v3 requests off blogs whose articles happen to live at /post/<n>.

Read live before this PR: lemmy.world/post/1, lemmy.world/comment/100, lobste.rs/s/htziuj (1 claim supported), lobste.rs/c/fltdzp; lemmy.world/c/technology → "is a page, not a post"; lemmy.world/post/999999999 → not found (HTTP 400). Full code review + re-review; findings resolved or recorded in OPEN-ITEMS §18.

Checklist

  • ruff check and ruff format --check are clean
  • pytest passes
  • Type annotations on every new function signature
  • No network access in unit tests
  • If a new reported state was added, spec section 15 is updated too (no new state; §6.2 rows added)
  • This change does not make the tool sound more confident than its evidence

🤖 Generated with Claude Code

https://claude.ai/code/session_012cDuGjsQS1Ei8eoxDrak8Z

Two more platforms a post can be read from without an account. Lobste.rs
follows the Hacker News pattern (host-bound, the .json twin of each page);
Lemmy follows Mastodon's (read from whichever instance hosts it) but is
recognised by host — the lemmy. prefix or a short list — never by /post/<n>
alone, because that is any blog's address and a shape-only match would send
/api/v3 requests to sites that never invited them.

Lemmy answers a missing post and a private instance with the same 400, told
apart only by the body's token, so ProviderError now carries that one bare
identifier (`code`) and nothing else from the body: not_logged_in is BLOCKED,
couldnt_find_post is UNREACHABLE, anything else is UNAVAILABLE. Both platforms
were probed without auth and read live before this commit (spec §6.2).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012cDuGjsQS1Ei8eoxDrak8Z
@Yigtwxx
Yigtwxx merged commit d7b395f into main Sep 18, 2026
7 checks passed
@Yigtwxx
Yigtwxx deleted the feat/lemmy-lobsters branch September 18, 2026 13:22
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.

1 participant