Lab 9

At https://github.com/hcheval/rssmds there is a small implementation of an RSS feed reader that runs in the terminal, stores entries in SQLite, and includes a web interface (about 1300 lines of Python across 8 modules).

Clone the repository, set up the environment, and make sure both the tests and the type checker pass before moving on. Then try the app out:

python -m rssmds add "https://hnrss.org/newest?count=5"
python -m rssmds add "https://blog.rust-lang.org/feed.xml"
python -m rssmds fetch
python -m rssmds list
python -m rssmds read 1
python -m rssmds stats
python -m rssmds serve   # open http://127.0.0.1:8080

The point of the lab is to navigate and modify the codebase at first encounter using a coding agent. You can use opencode for this as in previous labs, or whatever tool you prefer.

Exercise 1

Answer the following by reading the source code.

  1. What happens when rssmds add is called with a URL that already exists in the database? Trace the path from the CLI entry point through to the database layer.

  2. The fetcher avoids re-downloading feeds that haven’t changed since the last fetch. What HTTP mechanism does it use, and which function implements it?

  3. The discover command tries several strategies to find feeds on a webpage. List them in the order they are attempted and explain when each one kicks in.

  4. Use the coding agent to generate a Mermaid sequence diagram for the rssmds fetch flow. It should start from the CLI dispatch and end with entries stored in the database, covering both the case where the feed has new content and the case where the server returns a 304. Read the generated diagram against the code and fix anything that might be mismatched. To render and edit the diagram, Mermaid Live Editor works in the browser with no setup.

Exercise 2

Pick one of the features below, or propose one of your own as long as it touches at least two modules. Write a short specification (a paragraph is enough) and then use the coding agent to implement it. Once the agent produces code:

Possible features: