Adding entries.chapters left stored items without theirs until their
feed next changed, so the episodes out now, the likeliest to be played,
had none. The migration now also forgets each feed's etag, Last-Modified
and body hash, as adding feeds.description did, so the next scan reads
every feed whole and changed_items fills the column. It runs after the
body_hash migration, which adds a column it clears.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVBuJRne2JAhFpaDV2U
Where they come from, in order: the chapters file an item names
(<podcast:chapters url>, the Podcasting 2.0 namespace's JSON), stored on
the item as entries.chapters and read when someone opens Now Playing; else
the downloaded file's own chapters (ID3 CHAP frames, MP4 chapters), which
ffprobe reads as it does for DeadAir. A chapter with toc false is only
there to change the artwork and is left out.
GET /api/enclosures/{id}/chapters answers for a file, since a file is what
plays. With ?deadair=true the starts are moved into DeadAir's shortened
clock with to_copy, as positions are, or a chapter would start late by
every silence cut before it. A chapters file that cannot be read is an
empty list: the player plays on without them, and the step's span says why.
Items already stored get their chapters address when a scan next finds
them told differently; feeds that answer 304 add it with their next items.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVBuJRne2JAhFpaDV2U
Db::counts counted enclosures WHERE state = 'pending' with no index to
use: a parallel sequential scan of all ~690,000 rows in production, 92 ms
and 32,397 buffers, every 30 s for /metrics and on each /api/status, to
find a handful. It was the slowest route at p95 and once 1.1 s. A partial
index on the pending rows makes it an index-only count of those few, as
enclosures_on_disk already does for the downloaded count beside it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVBuJRne2JAhFpaDV2U
Time For Chaos's Season 1 had all 20 files downloaded and since reaped.
Download Season 1 queued nothing and said all of it was on iPX, because
Db::undownloaded left out reaped files, as Download latest wants: there
they would only come back to be reaped again. A season asked for by name
is wanted whole, so its reaped files are queued; a fresh download is new
again to the quota and age sweeps, which order by when it was
downloaded. A file already downloading is no longer queued a second time,
for either.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
Asked for on the issue: lowest to highest, by season and then episode,
and a way to download every episode of a season.
sort=episode orders by season, episode, then date, with the episodes in
none last either way round; a podcast told in seasons opens in it until a
heading is clicked, and its seasons are offered lowest first.
download-latest takes a season and queues every file of it not on iPX,
first episode first, up to 300; the page asks first, since a season can
be gigabytes. The picked season scrolls into view in the picker, and the
count under the list is the season's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
GET /api/feeds/{id}/seasons counts a podcast's episodes and unread by
season, from the same FROM as its list, so a count is what picking it
shows; season= on its entries narrows the list to one, or to the
episodes naming none. The page puts the seasons under the tabs, as the
tabs' own track, when a podcast is told in them: two or more, holding
most of its episodes. That leaves out Ken and Robin, whose "seasons" are
years on a quarter of 767 episodes, and The Vintage RPG Podcast's 2 of
366. Listed all together by date, a heading marks where each season
starts.
A fixture podcast in seasons is in the browser suite, which now
configures six feeds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
The ways a feed leaves the catalogue now take its subscriptions with
it, but any path missed now or added later would leave the same
leftover: items in All Subscriptions with no feed to name them. Each
start now unsubscribes everyone from a feed the catalogue does not
have, after retire_stranded, unless the catalogue is empty, which is
likelier a fault than a server with no feeds.
The 41 already in production (all from the Hacker News top feeds OPML,
which drops feeds daily) were deleted by hand on 2026-11-19.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
Removing a feed from the catalogue left whoever subscribed to it
subscribed, the same leftover a list's dropped feed made: All
Subscriptions listed its items with no feed to name them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
On 2026-11-18 a scan's OPML sync dropped sciencedaily-latest-science-news.
drop_managed deleted the feed and its items but left its subscriptions,
and the scan, which had the feed in its list of feeds due, read it again
later in the same run and stored 60 items. The feed was then in no
catalogue but still subscribed to: All Subscriptions, which reads
subscriptions, listed its items, while the feed list, which reads the
catalogue, left it out, so the page had no name to put beside them and
sharing one answered 404.
drop_managed now deletes the feed's subscriptions too, and sync_group
returns the ids it dropped so the scan skips them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
rustc 1.100 knows serving a file cannot fail (the error is Infallible)
and called e.to_string() an unreachable call, which -D warnings made
the pre-commit hook refuse for every commit touching ipx's Rust.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
A playlist is the episodes of the podcasts chosen, those set to play first
ahead of the rest, newest or oldest first, unplayed only or all, kept up to
date by itself (table `playlists`, /api/playlists). It sits in a folder of its
own in the feed list, as Signals do. Played from one, an episode goes on to
the playlist's next once Up Next has nothing.
The priority ids are written into the ORDER BY, which the page query uses
twice, so they are quoted there rather than bound; they are also only ever
feed ids this person subscribes to.
The folder row first borrowed Signals' `sigs` class, which the tests use to
mean Signals' folder; four Signals tests failed until it had its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A place beside Up Next listing every feed with audio or video as a grid of
its artwork, with how many episodes are new, as Overcast's home screen
does. It is drawn from the feed list the page already holds; the feed list
gains `podcast`, an EXISTS per subscription over enclosures, which stops at
a podcast's first episode and is one index probe for a feed with no files.
Its cost on production's database is not measured: the EXPLAIN was not run.
The iOS app's generated messages (ios/Sources/Wire) are not regenerated:
there is no protoc here. Nothing in the app reads the new fields, and a
proto3 reader skips a field it does not know.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playing was one episode at a time: when one ended nothing followed. Up Next
is a per-account queue on the server (table `queue`, GET and PUT
/api/queue), so the phone and the browser share it. The page adds to it from
a row or the reader, reorders it by drag or arrow keys, and plays the next
when one ends; what is playing leaves it as it starts, as Overcast's does. An
episode 90% played leaves it on the server too, which covers the phone
playing on while the page is frozen.
The iOS app is told what follows (`{t:'next'}`, gated on the app saying it
can) and starts it at the end of an episode; the page takes it up through
nowPlaying as it does the car's pick. The Swift is not compiled here.
The page stub answered every unknown address with [], whose `.entries` is
Array.prototype.entries, so the queue read a function as its list; it now
answers /api/queue as an entry list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After #459 a common word still took about 2 s: "apple" matched 61,674
items across every feed on the server, Postgres re-read each to confirm
the trigram match, and only then joined to the 1,151 in the searcher's
own feeds (EXPLAIN on production, 2026-11-17). The subquery
`e.feed_id IN (SELECT ... FROM subscriptions ...)` hid the feed list
from the planner, so the trigram index was always its way in.
Given as `e.feed_id = ANY(ARRAY(SELECT ...))`, the planner sees the
feeds and chooses per search: for "apple" this person's 20,152 items by
entries_seen, count 1.5 s to 0.38 s and the page of 50 1.1 s to 0.52 s;
for "kubernetes" still the trigram index, 21 ms; "the" 141 ms. Only for
a search, so ordinary lists keep their plans, and only on Postgres:
SQLite has no arrays and keeps the IN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A search on All Subscriptions took 4.5-5 s: the page and its count each
matched lower(title) and lower(description) with LIKE '%q%' over every
entry, a parallel seq scan reading 554k buffers, about 4.3 GB, nearly all
of it descriptions' HTML in TOAST (EXPLAIN on production, 2026-11-14).
entries.search_text holds the title and the text with its markup taken
out (an image's alt and title kept, as Signals read them), lowercased
and cut at 4,000 characters; a pg_trgm GIN index on it keeps a part of a
word finding the word (#296's meaning). Chosen over a trigram index on
the HTML itself, several GB on the shared Postgres, and over full-text
search, which matches whole words only.
A new item gets its search text as it is stored. search.rs fills in the
rest behind the daemon, 500 at a time, and makes the index after,
CONCURRENTLY so scans go on, again if a build was cut off. A scan that
changes an item's title or text clears its search text for that pass to
make again; until then, and for every item stored before this, a search
matches it the old way, through a partial index on the ones without.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ammonia 4.2.5 (mutation XSS through SVG and MathML, RUSTSEC-2026-0533),
pulldown-cmark 0.13.6 (wikilinks, 0414 and 0433), tokio 1.54.1
(AsyncFd, 0386), and async-compression 0.4.52, which let zstd go to
0.14.4 (0391), with zstd-safe 8.3.0 and zstd-sys (0398, 0403, 0410).
libsqlite3-sys (0459) stays at 0.37: sqlx-sqlite 0.9.0, the latest,
pins it below 0.38, so it waits on sqlx. Production runs on Postgres;
SQLite is the sample compose file's, the tests' and the load tests'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ipx-wire converted every protobuf answer at run time through
prost-reflect and serde_json::Value, so protobuf cost more than the JSON
it replaced: decoding 1,488 feeds took 1.50 ms that way against 0.37 ms
for serde_json and 0.09 ms for prost's own structs, and GET /api/feeds as
protobuf answered about 4 ms after JSON.
build.rs now generates those structs (prost-build from protox's
descriptors, still no protoc). An answer's JSON goes straight into its
struct with serde and out with prost, byte for byte what the runtime
path wrote (a test says so); bodies holding a google.protobuf.Value keep
the runtime path, as they are only ever read. ipx's calls to the
directory and ipx-play build and read the structs directly, through
From conversions beside the directory's own types.
The page asks for protobuf too, to see what it does in practice. It
reads it with web/src/wire.ts, about seventy lines and no library:
protobufjs alone was larger gzipped than all protobuf saves the page.
build.mts reads the .proto files into a table for it, and the answer
names its message in its Content-Type, so the page keeps no table of
routes. An answer of null stays JSON, since the empty message would be a
feed row of defaults. The offline worker decodes a kept answer to mark
what was read offline, and hands the page JSON.
The decoder's test caught `pos += varint()[0]`, which adds the length
to pos as it was before the varint was read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A client sending Accept: application/x-protobuf gets protobuf, and one
sending Content-Type: application/x-protobuf may send its body so; JSON
stays the default, so the page, the TUI and older iOS builds see nothing
new. ipx's own calls to the directory and ipx-play now go in protobuf.
The handlers are untouched. A new crate, ipx-wire, holds the .proto
files (compiled by protox in build.rs, so no protoc anywhere) and one
layer, negotiate, that converts JSON at the edge through prost-reflect,
by a table of each route's messages. Writing prost structs beside every
serde one would have doubled each type and every handler.
Protobuf cannot tell absent from empty or from null, and the PATCH
bodies depend on that: an Option<Vec> left out leaves the list, an empty
one clears it, and null clears a folder. So a list in a body is a
one-field message (absent or present), and null-to-clear is a
google.protobuf.Value. Numbers in a Value come back whole, or 3.0 would
not read as a usize.
Debug builds convert every JSON answer strictly and answer 500 for a
field missing from the .proto or a route missing from a table; the cargo
tests and the browser suite (125 tests) ran clean that way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5d0ff1a put ipx-play's /metrics on 9189, but hnopml, in the same
compose project, has published 192.168.1.130:9189 since 2026-11-12 and
Prometheus scrapes it there as job="hnopml". Deployed as written,
ipx-play's port would have clashed with it. 9187 to 9190 are ipx, the
directory, hnopml and ipx-web; 9191 is free.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/api/art remembered a failed image for an hour, whatever the failure, so
an image that could never pass was fetched again on the next view after
that. In 2026-11-09..13, five images over the 20 MB limit were fetched
146 times, each read 20 MB chunk by chunk before being refused, about
3 GB for nothing; a 400 from b2c-contenthub.com was asked for 34 times.
Now a Content-Length over the limit is refused before the body is read,
and a failure that will still hold tomorrow is remembered for a day: a
4xx other than 408 and 429, or ipx's own refusal (too large, not an
image). Timeouts, 5xx and dropped connections still retry in an hour.
JPEG XL, which shkspr.mobi sends as application/octet-stream, was
refused as not an image; its two signatures are sniffed now, and Safari
shows it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dry run printed "deleted <path> (N MB)" for every file and "deleted N
old file(s)" at the end, word for word a real reap, of files it kept:
Reaped and ReapDone carried no flag to say otherwise. Both now carry
dry_run (serde default false, so an older message still reads), and the
words are "would delete".
Found writing the browser suite's first test of retention, which ran on
the daemon's own clock and nowhere in the suite: over a tiny quota, a dry
reap lists the downloads and leaves them, and a reap with no limits
deletes nothing and only tidies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ipx-play sent traces and logged JSON but served no /metrics, so nothing showed whether
shared links were opening or failing. It now serves them on metrics_bind (9189 in
production, off the tunnel's port), with the directory's histogram and /proc reading:
requests by method, route and status (by route, so each shared episode is not a row of its
own, and an unknown address is route=""), episodes shared, memory, open files, uptime and
version.
The iPX dashboard gets an ipx-play row, its warnings join the other containers' log panel,
and alerts.py fires when Prometheus cannot reach it. The prod-check skill and docs/play.md
name it, with the scrape job and the OTEL_RESOURCE_ATTRIBUTES tag the trace panels need.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Share handed over the raw file address or the item's link: no preview,
no time, nothing a person without iPX could do much with. Now, as
Overcast does, an episode shares as a short link to its own page,
play.ipxreader.app/e/<id>, which anyone can open: the show's art and
name, the episode's title, date, length and notes, a player on the
publisher's own file starting at ?t= if a time was shared, buttons to
subscribe in Apple Podcasts, Overcast, Pocket Casts or Castro, and Open
Graph tags for a preview where the link is pasted.
ipx-play is a service of its own (crates/play), built like the
directory: ipx sends it the episode with its token (POST /v1/shares)
and gets the link back. The id comes from the feed's address and the
guid, so the same episode is one link whoever shares it. Only episodes
of feeds the directory would be sent go there, by the directory's own
rule (snapshot_entries), so the two cannot disagree on what is private;
ipx-play also refuses an address that looks private. Anything else, and
any server without ipx-play set up, shares as before.
In the page, Share on an episode opens a menu once the link is back:
Share link, Share from 12:34 (the player's clock, or where you left
off), Copy link. A menu because the share sheet needs a press of its
own, and the request for the link used up the one that opened it.
The page runs no script: the start time is the media fragment #t=, and
its CSP loads nothing but its stylesheet, the art and the file.
Admin, Directory, Sharing episodes sets the address and token. The
browser suite starts its own ipx-play; it was not run here (no Caddy on
this Mac).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each against a local stand-in server: Apple's push service answering per token, a feed host
serving a login page and a torrent, a directory refresh of feeds that cannot be read. push.rs
takes the APNs address as a parameter so the test can point it at the stand-in. coverage.sh asks
for 8 GB free, not 9: its container is capped at 6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVARreS9wxzH5o2rF7N
p hands the item's downloaded file (/media/{id}) to mpv in its own window, with the token as a
header. Moving onto an item with j or k marks it read, as selecting one on the page does. The
feed list follows the page's order: pinned first, a subscribed OPML a folder that Space opens,
its unread the sum of its feeds', and P pins or unpins. scripts/build-tui.sh cross-builds the
binary for Linux and macOS under the same cap as the image builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVARreS9wxzH5o2rF7N
ipx-tui (crates/tui) is iPX's reader in ratatui: your feeds, a feed's
items, an item's text as plain text, read and flagged as on the page,
through the API with an API token. It installs as `ipx`, so the daemon's
binary is now `ipxd`: the Dockerfile, release script, tests and every
doc and message that names its commands follow.
Naming the binary ipxd alone renamed its crate, and with it every log
target (ipx::scan became ipxd::scan): the default filters are ipx=info,
so nearly every line would have been dropped and the dashboard's queries
on the targets gone blank. The daemon's code is now a library still
called ipx, under a five-line ipxd main.rs, and the targets are as they
were.
ratatui is taken without its default features: 32 new packages in place
of 78.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
Siri: App Intents with phrases that need no setup: Resume, Pause,
Skip forward, Skip back, Set a sleep timer, How many unread. The
playback ones are AudioPlaybackIntents, run in the app and allowed to
start audio from the background. Playback is now one shared instance
(Playback.shared) so Siri and the widget reach it with no page loaded.
It remembers the last episode and its place (LastPlayed), so Resume
works with the app closed; the page, opened afterwards, does not know
about an episode started that way.
Widget: small and medium on the home screen, circular and rectangular
on the lock screen. It shows the unread count and the last episode,
with a Resume or Pause button (PlayPauseIntent, shared with Siri). It
draws what the app writes to the App Group group.net.sdf1.ipx. The app
asks for a redraw on play, pause, a new episode or a new count, not on
every position, since iOS rations redraws. Shared/ builds into both
targets, with WIDGET set in the widget's, where the player does not
exist.
ipx's push now carries content-available, which wakes the closed app
for a moment to give the widget the count the icon just got (#433).
Tested: unit tests for the snapshot and the remembered place, 19 in
all; in the simulator, playing an episode wrote the snapshot to the
App Group. Not testable there: Siri, and the widget drawn.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Background refresh runs when iOS chooses, and for this app that has
been rarely, so the icon's unread count lagged until the app was
opened (#421). Now ipx sends the count:
- ipx: a push_devices table and POST/DELETE /api/push/devices. With
[push] set to an APNs key, a task compares each phone's All
Subscriptions unread count with the last sent, once a minute, and
sends a changed one to Apple as a badge-only push: no alert, no
sound. A token Apple says is gone is forgotten. The signing token is
ES256 over the team and time, made again every forty minutes, inside
Apple's limits.
- iOS: the aps-environment entitlement. The app registers for push
once badge permission is given, each launch, and hands its token to
the page.
- Page: registers the token with ipx as the person signed in, since
the player's address (ipxapi) lets through only the player's paths,
and removes it on signing out.
jsonwebtoken here is built without PEM support, so the .p8 key's
base64 is decoded in push.rs rather than turning on a feature and
changing Cargo.lock for one file.
cargo test -p ipx on macOS: 182 pass; the 3 that fail read /proc and
fail there without this change too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The judge woke for a scan's new items and for changes to Signals, and
otherwise every five minutes. A feed the server already had brings no new
items when someone subscribes, so its recent items waited for the next idle
pass before the new subscriber's Signals saw them. The browser test for a
Signal's new hits ran into this whenever an earlier test had subscribed to
the same fixture feed and left: it waited 20 s and failed in the full suite,
passing alone. scan_soon, which every subscribe from the API calls, wakes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
Offline mode (#389) kept lists, text and pictures, but the worker let
every /media/ request pass, so no episode played without a connection.
A downloaded episode's files pane has a keep button beside Play. It
fetches the copy that person plays, the file or, when DeadAir cuts
something for them, the version without its dead air (/media/{id}/deadair,
the save button's), whole into a cache of its own, ipx-episodes, and
asks once for persistent storage. A kept episode plays as
/media/...?offline, online or not, and the worker answers that from the
cache with the byte ranges an audio element asks for (206, 416, 200);
not kept there, it goes to the server as before. Pressing it again takes
it off; signing out clears it with everything else. Only someone's
choice is kept, so there is no budget: a full device is the quota's
refusal, said in words. The button is data-a="offline", not "keep",
which the Directory's show page already uses for subscribing.
Places saved from DeadAir's version were read in its clock only if ipx
had handed out that file's playlist since it started (state.playing). A
kept copy plays without one, so the player now names the file in the
position it saves (deadair: <enclosure>) whenever it plays DeadAir's
clock, and ipx loads that file's plan when it has none, for that item's
file only. Checked the beacon is queued by the worker offline: it is.
Tests: playing a kept episode offline, its place queued and sent once
back, and taking it off (the offline show plays quiet.mp3, the only real
MP3 among the fixtures); the worker's ranges; which copy is kept and
played, in page-unit; the server reading a flagged place in DeadAir's
clock without a playlist, and ignoring another item's file. The files
pane's one-row test counts five buttons and checks a phone's width too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
ba18b44 had the JSON layer find a line's span context through the
dispatch it was registered with, and production's logging wrapped that
layer in an Option, whose Layer impl does not pass on_register_dispatch
on: the layer never got its dispatch and every line went out without
trace_id and span_id. The log test built a subscriber of its own,
without the Option, and passed.
Both services now box their stderr layer instead of an Option of each
kind (a Box passes registration on), the formatter falls back to the
default dispatcher when it was never registered, which a global
subscriber's lines find, and the log test builds the subscriber with
the function init uses, writing to its buffer, so a wrapper like this
one is under test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
WithTrace found a line's span with Span::current(), which asks the
thread's default dispatcher; inside an event under a scoped subscriber
(with_default), tracing's re-entrancy guard answers with none, so every
line went out without trace_id and span_id. Production, on the global
dispatcher, was not affected, but the log test had to go global for it.
The JSON layer now carries a small layer of its own that keeps the
subscriber it is registered with (on_register_dispatch, a weak handle),
and the formatter takes the registry's current span from its own
context and asks tracing-opentelemetry for its context through that
handle (get_otel_context), with no dispatcher lookup. The log test runs
scoped again; with the old formatter it fails for want of the ids.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
POST /api/login answered every wrong password 401 for as long as someone
kept trying. Now ipx counts them by the client's address: the tenth in a
window holds that address off until the window, which starts at its first
wrong password, ends, answered 429 with how long is left. Counted by
address and not name, since by name anyone could lock anyone out; a right
password does not reset the count, or a guesser with an account of their
own could clear it between guesses.
Behind Caddy every peer is Caddy, so the address is the last one in
X-Forwarded-For, taken only from trusted_proxies. Caddy now sets that to
{client_ip}: Cf-Connecting-IP for the tunnel's requests, believed only
from TUNNEL_PEER (servers trusted_proxies), and the peer for everyone
else, replacing whatever the client sent. Checked with Caddy against an
echo upstream: a forged XFF and Cf-Connecting-IP from elsewhere reach ipx
as the peer, the tunnel's Cf-Connecting-IP as itself.
The sign-in load test sends each attempt from its own address, so it
still measures a flood from many, whose passwords are all checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
A failed assertion skipped the terminate at the end, and the two runs
that failed while the test was written left their daemons running for
an hour on their scratch sockets and ports. Each daemon the test starts
is now killed when it is dropped, however the test ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file download was never marked 'downloading', only torrents were, so
one under way when the daemon stopped stayed 'pending' and
requeue_interrupted had nothing to do. The first pass after a start
scans only the feeds that are due, and a pending file is fetched only
in a scan of its feed, so after a deploy a half-downloaded episode
waited for its feed's next check: an hour on the default schedule, a
day for a daily feed. Found by the daemon test of #400, where the
episode was not asked for again in a minute after a restart.
fetch_one now marks the file 'downloading' while it runs, as a
torrent's is; every way out of it already records 'done' or 'error',
and the scan's queue takes only 'pending', so a running download is
not queued twice. requeue_interrupted gives back the ids it put back,
and the daemon puts each on the worker's queue before it serves, where
download_one takes it whatever its feed's schedule says. The daemon
test now checks the restarted daemon asks for the episode again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The weekly Apple Podcasts sync runs unattended and ran in no test. Its
Apple address is now an argument (run passes Apple's), and its pause
between calls is none under test, so a test runs it against a stand-in
with one category: the top chart and the category's are taken each
show once in order, looked up, and filed as the apple-podcasts
snapshot with a feed that has a key in it refused as private; a feed an
admin blocked is left out of the next; and a sync whose lookup fails
is an error that leaves the last good snapshot as it was.
/metrics serves every directory_ metric the dashboard and alerts
query, read out of them. Dropping a server's snapshot through the API
is for admins only, and takes the feeds only it listed, keeping one
another server lists too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
follow_move, which rewrites a feed's address in the catalogue after a
permanent redirect, ran in no test; the fetch only said where a feed
went. It now: the feed keeps its id, so its subscribers and their read
state, takes the new address in memory and in the database, and is
left as it was when another feed already has that address, or when it
is an OPML's, whose list would only put the old one back.
WordPress.com's browser check is answered from its API's posts, and a
Patreon creator's shows are asked of Patreon by the campaign its feed
names, each show the creator feed with its own show and credentials;
an unknown one is an error. Both against a stand-in: the two APIs'
addresses go through api_base, which a test points at a server of its
own; production's are unchanged.
ipx add names a feed from its title, keeps its folder and keywords,
refuses it a second time, and asked again to list it or with a
category changes only those; ipx rm takes it out of the catalogue and
the database.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The daemon ran as a process in no test but the browser suite's, which
never stops it mid-job or starts a second. crates/ipx/tests/daemon.rs
runs the built binary on a scratch config and SQLite database, against
a feed served from the test whose episode takes minutes: ipx status
goes through the socket and with --local does the work itself; a first
start with no token writes one, keeps it out of the log, and it signs
in; a second daemon on the socket is refused and the first keeps
serving; SIGTERM mid-download stops it within 5 s, removes the socket,
and leaves the episode queued; it starts again cleanly; and with no
daemon, ipx status works on its own. A process of its own, since a
signal sent to the test binary would reach every test in it.
until_next_scan keeps its floor and ceiling: 10 minutes with nothing
to check, 30 s with a feed due now.
The abandoned download is taken again only at its feed's next check,
not at the next start: #410.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
torrent.rs's fetch, and scan.rs's spawn_torrent and torrent_one, ran in
no test. A test now makes a swarm on 127.0.0.1: a seeding librqbit
session and a web server that serves the .torrent and answers as its
tracker, naming the seed. A detached torrent then downloads through
ipx's own session into the enclosure's own folder, the row is recorded
done with that folder as its path, the file is byte for byte the seed's,
and the slot is free again. The .torrent is refused from an internal
address by the guarded client unless fetch_internal allows it. A scan
hands a .torrent enclosure to the torrent worker, counted as a torrent
and left 'downloading' while it waits for a slot, and skips it, still
counted, with torrents off.
A test's torrent session joins no public DHT and sends no LAN
multicast (cfg!(test) in Torrents::new); production's is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
signals.rs's pass, judge, pace, back_off, check_key and pick_icon ran
only against a live Jev. In cargo tests ask now goes to a stand-in for
it, served from a thread of its own so every test shares it, answering
by key as TypeSafe would: a pass judges each new item once, keeps its
verdicts and bills its owner's tokens on their own key; a refused key
stops its owner's judging, not anyone else's, and is not sent again; a
429 stops the pass and the next call to Jev waits out Retry-After; a
422 stops the pass rather than repeating on every item; a key check
costs tokens; an icon is one Jev was offered, on the server's key.
The API: a Signal made, its words trimmed and deduplicated, bad names,
words, icons and descriptions refused, renamed and re-worded, its icon
cleared, its picked items listed, deleted with its verdicts; someone
else's is 404 every way. In the browser, a Signal renamed and deleted
from its own page. The coverage run runs the browser Signals tests too
(IPX_SIGNALS_TESTS=1): Jev there is the fixture server's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Who gets in had no test above the token check: the router now runs in
tests with a peer address, as the listener gives it. A name in the
proxy's header signs in only from the trusted proxy (not from
cloudflared's gateway or anyone else) and makes the first account an
admin; with Access set, the name is the signed token's, and a token for
another application, an expired one, garbage, a header without a token
or a token without the header are refused, as is a good token not via
Caddy. Wrong passwords and unknown names are 401 and the right one
after them signs in with a session cookie; a forged one is refused.
PATCH /api/me refuses an over-long block list and a malformed TypeSafe
key before asking TypeSafe. The signing keys are read from a local
stand-in for the team's certs, and a 503 or 404 is an error.
ipx user add, list, passwd, rename and rm run against a scratch
database: user_cmd takes its stdin as an argument, so a password can be
given without a terminal, and access's fetch takes the certs address.
There is no 429 for a flood of wrong passwords to test: that is #409.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three tests for what the dashboard and the alert rules read and nothing
checked: every ipx_ metric named in grafana/dashboard.py and alerts.py
(read out of them at compile time) is served by render, with the ones
written only once known (counts, the last scan, a job under way) set
first; ipx's JSON log lines for a scan's events carry ev, feed, new,
bytes, msg and error.type, and inside a span trace_id and span_id; the
directory's snapshot line carries instance, accepted and the refused_
counts.
The JSON layer was built the same way in both services' setup; it is
otel::json_layer now, so the tests run the layer production does.
The log tests set the global subscriber, as production does: under a
scoped one WithTrace finds no current span (#408).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
retention::run's age and quota passes and remove ran in no test: only
the pure choosers did. Three tests now run them against a scratch
downloads folder and a database: an old file deleted, marked reaped,
its bytes counted and its entry pruned, a dry run deleting and pruning
nothing; over quota the oldest going first with the age pass's take
not counted again; a file already gone reaped without an error, and
one procfs will not unlink left claiming its file with nothing freed.
Held items, which have no path, are never candidates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page and the service worker were strict TypeScript; the tests, the
build, the home page's generator, the load tests, boot.js and the
directory's site.js were plain JavaScript that nothing checked. All of
it is TypeScript now, in five programs, each with its own globals, all
checked by npm run typecheck: the page (tsconfig.json, with boot.ts and
the directory's site.ts), the worker, Node's (tsconfig.tools.json: the
Node tests, the browser suite, the build, the site generator, the load
harness), and k6's (tsconfig.k6.json, with @types/k6).
Node 24 runs the .ts files by stripping their types, so they hold only
TypeScript that erases (erasableSyntaxOnly) and import each other by
.ts name; package.json says "type": "module" for it, and Dockerfile.web
moves to Node 24 to run build.mts. k6 2.3 strips its scripts' types
itself.
The browser suite's page.evaluate calls reach the page's globals; the
page's tsc run now also writes its declarations to target/page-types,
which the suite's program includes, so those calls are typed by the
page's own code rather than by hand-written copies.
boot.ts is compiled by build.mts with swc, as the worker is, and named
by the hash of what is served. The directory's build has no Node, so
site.js is compiled from site.ts and committed (node web/build.mts
--directory-script), and tests/directory-script.ts fails if they drift.
Checked: the site generator's 139 pages are byte for byte what the
JavaScript made; the page build's app.js is identical and only boot.js
(now minified) and its hash differ; contrast, page-smoke, page-unit,
native-bridge, the browser suite (96 passed, 2 skipped) and the
directory's and ipx's Rust tests pass; k6 parses each load script. The
load tests themselves did not run: they build a release binary outside
the capped builder. .agents/skills/security-audit is an installed
skill's, not ours, and is left as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no network the home-screen app showed nothing: no service worker,
and the lists the page had fetched, full text included, lived only in
its memory.
A service worker (web/sw/sw.ts, TypeScript checked against a worker's
globals by tsconfig.sw.json, built by swc to /sw.js) goes to the network
first for the page and every API read and keeps the answers, so online
nothing is an old copy and #388's version check works as before;
offline the kept copy answers. Scripts named by hash come from what is
kept. Reads, flags and places in an episode that cannot reach the
server wait in an outbox, sent in order when the connection is back
(and new ones queue behind them meanwhile, so none lands out of turn);
a kept list served offline shows the reads waiting there.
Pictures: a worker cannot keep another site's pictures sensibly, since
browsers count each opaque answer as megabytes. ipx now remembers the
picture addresses in item text it sends (bounded, in memory) and
/api/art fetches those as it does artwork, through the guarded client;
the worker keeps them, for unread items, under a 200 MB budget, and
serves them offline in place of the publisher's. Online, pictures still
come from their publisher.
Sign-out, or another account signing in on the device, clears what was
kept. The browser suite blocks the worker except in the offline tests,
since it answers before page.route can.
The fixture JPEGs are placeholders a browser cannot draw; the offline
test uses a real PNG.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A scan fetches six feeds ahead of its turn, so channels next to each
other alphabetically (android-authority-2, android-developers, apple,
architectural-digest-2) went to YouTube together and failed together,
while one asked alone a minute later read. feed::fetch now takes a turn
before each request for a YouTube feed: one at a time per process, two
seconds after the last, its wait a `youtube_turn` span. The retries
take their turn too, in place of their one-second sleep. The directory
builds the same fetch and paces its own checks the same way.
39 channels due together add up to 80 s to that scan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#382's retries run (each failing fetch takes the two seconds) and still
end 404: YouTube fails about 70% of feed reads from Tower, in streaks
longer than seconds, for ?user= and ?channel_id= addresses alike (142
and 68 failures in 7 days across 26 and 13 feeds). The 39 YouTube
channels are catalogue feeds nobody subscribes to, read once a day, so
each missed about 5 days in 7.
due_at now waits at most an hour for a YouTube feed in the first day of
a run of failures. A channel gone for good costs 24 requests, then backs
off as any feed does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A swipe that only bounces sends no request and throws nothing, so
#383's stop at the 50th item left nothing in the log or the traces, and
the reader that would not scroll in the same report was never found.
The page now reports each swipe in the reader (next, prev, list, end,
short; a tap is not one) with where the reader stood, under the tap's
trace, and scroll_stuck when a drag up or down with room to move the
reader left it where it was. That one is watched by where the finger
was, not by what it landed on, so a layer lying over the reader is
caught, and its state names what is under the finger, what is inert,
the dialog, the reader's transform, a #dpeek left behind, and how long
since the app came back. ipx logs swipe as info and scroll_stuck as a
warning, in a new free-text state field, and the dashboard counts both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YouTube answers some requests for a channel's feed with a 404 or 500
in tens of milliseconds, while the next request for the same feed, or
another channel's 200 ms later, reads. Checked once a day, the 39
YouTube channels in the catalogue missed most days: 178 failures in
the week to 2026-11-04, against 74 in the ten days before, and all 39
read from Tower when asked by hand.
feed::fetch now asks a youtube.com/feeds/videos.xml address again, up
to twice, a second apart, when it answers 404 or 5xx. Other hosts'
404s are real and are not retried. tokio moves from ipx-feed's dev
dependencies to its own, for the sleep; both services build it already.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>