Live canary: the lnw comment-thread marker still holds #88
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#80 (spec) — implements part of #77.
What to build
The Poll's lightnovelworld scan now depends on one marker string surviving in the Site's markup. When that marker vanishes the Series are skipped and logged — correct, but silent until a Reader notices their Latest Chapter has stopped moving. Give a maintainer a way to check on demand, without waiting for that report.
An env-gated live test that fetches a real Series page and asserts the marker still occurs exactly once and still follows the last chapter anchor. It skips when its environment variable is unset, so it never runs as part of the ordinary suite — same convention as the existing live browser smoke tests, which skip on an unset variable at the top of the function before touching the network.
Remember the page size when writing the fetch: a truncated read reports the marker as absent when it is present.
Acceptance criteria
cd backend && go test ./...is unaffectedBlocked by
Landed on main (merge of ticket/88-lnw-marker-canary; commits
78ce251,3396c50).backend/internal/latest/smoke_lnw_test.go adds TestSmokeLnwCommentBoundary, gated on SMOKE_LNW_SERIES_URL — the URL of the live Series page to check, read as the first statement of the function, t.Skip when empty. It asserts against the production symbols themselves, lnwCommentMarker and lnwChapterRe, not copies: a canary carrying its own copy of what it guards can pass while the scan is broken. The fetch goes through the package's own TLSFetcher, so it exercises the same path the Poll does (and never needs the browser sidecar), with fetchableSeriesURL gating the supplied URL and a 60s timeout.
Three assertions: the marker occurs exactly once, the last chapter anchor precedes it, and anchors exist before it at all — a marker at byte 200 with nothing before it satisfies the first two and is still catastrophic. Failures carry the observed offsets and body length; that is the whole value of the test.
A challenge, a non-200 or a short body is reported as 'not a marker failure' rather than as a missing marker. Page size is handled explicitly: a 100 KB floor rejects a truncated or challenged read before any marker judgement, since the marker sits at ~94% of these documents.
Verified both ways on the merged base:
Process note: the spec-axis reviewer hung with no activity and was cancelled rather than re-dispatched; I ran the spec review myself against git diff 71a2c8e...HEAD and found it clean — all three acceptance criteria met, no scope creep. The one judgement call is that the default Series URL lives in the doc comment rather than in code, because a code default would make the test run unattended and break the first acceptance criterion.