[PR #224] [MERGED] feat(application): define library storage contracts #222

Closed
opened 2026-10-13 19:49:03 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/224
Author: @Glitchy-Sheep
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @Glitchy-Sheep

Base: main ← Head: feat/define-library-storage-contracts


📝 Commits (2)

  • e219389 feat(application): define post store and library reader contracts
  • 042cfde test(application): verify post store contract with memory adapter

📊 Changes

6 files changed (+647 additions, -4 deletions)

View changed files

📝 boosty_downloader/application/ports.py (+103 -3)
➕ boosty_downloader/domain/library.py (+74 -0)
➕ boosty_downloader/domain/library_marks.py (+27 -0)
📝 pyrightconfig.json (+3 -1)
➕ test/support/memory_post_store.py (+73 -0)
➕ test/unit/library/memory_post_store_test.py (+367 -0)

📄 Description

📝 Summary

The stored-post pipeline needs a common way to load and save records before JSON and SQLite storage can be connected. This PR defines the downloader and viewer contracts and adds an in-memory post store for tests; current CLI behavior stays unchanged.

🔧 What changes

  • PostStore defines post lookup, stable folder ownership, record saves, author details, and separate observations of lost access.
  • LibraryReader defines author and post queries plus viewing marks; shared domain types describe its inputs and results.
  • MemoryPostStore owns independent copies of records and rejects folder conflicts before changing stored data.
  • CI type-checks the fake against PostStore, and 19 tests cover its observable contract.

🧪 Tests

  • task ci: 871 unit/e2e tests passed, along with Ruff, formatting, Pyright, import boundaries, and wheel/sdist builds.
  • New tests cover nested snapshot ownership, updates, full post identity, folder conflicts, missing records, and saved content after access loss.
  • Independent review found no material correctness or layer-boundary issues.
  • Authenticated API tests were skipped because the worktree has no .env; contracts and test support need no live download.

⏭️ Next

  • Implement versioned post.json reads and atomic writes, followed by folder lookup and author records.
  • Connect the new storage to downloads and implement viewer queries in their planned follow-up tasks.

✅ Checklist

  • Tested live on a real blog (feature or fix) - not applicable: contracts and test support only.
  • Updated CLI --help and README if needed - not needed: no CLI changes.
  • Updated docs/ if the download flow or dev process changed - not needed: contracts are documented beside their types and methods.
  • Added a line to ## Unreleased in CHANGELOG.md (or the ci/skip-changelog label if not user-facing) - ci/skip-changelog.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Glitchy-Sheep/boosty-downloader/pull/224 **Author:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Base:** `main` ← **Head:** `feat/define-library-storage-contracts` --- ### 📝 Commits (2) - [`e219389`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/e2193898df8e498faadc2a259b5346301f998305) feat(application): define post store and library reader contracts - [`042cfde`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/042cfdeda9b6ba5c239c00655a083d901ea4e69d) test(application): verify post store contract with memory adapter ### 📊 Changes **6 files changed** (+647 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `boosty_downloader/application/ports.py` (+103 -3) ➕ `boosty_downloader/domain/library.py` (+74 -0) ➕ `boosty_downloader/domain/library_marks.py` (+27 -0) 📝 `pyrightconfig.json` (+3 -1) ➕ `test/support/memory_post_store.py` (+73 -0) ➕ `test/unit/library/memory_post_store_test.py` (+367 -0) </details> ### 📄 Description ## 📝 Summary The stored-post pipeline needs a common way to load and save records before JSON and SQLite storage can be connected. This PR defines the downloader and viewer contracts and adds an in-memory post store for tests; current CLI behavior stays unchanged. ## 🔧 What changes - `PostStore` defines post lookup, stable folder ownership, record saves, author details, and separate observations of lost access. - `LibraryReader` defines author and post queries plus viewing marks; shared domain types describe its inputs and results. - `MemoryPostStore` owns independent copies of records and rejects folder conflicts before changing stored data. - CI type-checks the fake against `PostStore`, and 19 tests cover its observable contract. ## 🧪 Tests - `task ci`: 871 unit/e2e tests passed, along with Ruff, formatting, Pyright, import boundaries, and wheel/sdist builds. - New tests cover nested snapshot ownership, updates, full post identity, folder conflicts, missing records, and saved content after access loss. - Independent review found no material correctness or layer-boundary issues. - Authenticated API tests were skipped because the worktree has no `.env`; contracts and test support need no live download. ## ⏭️ Next - Implement versioned `post.json` reads and atomic writes, followed by folder lookup and author records. - Connect the new storage to downloads and implement viewer queries in their planned follow-up tasks. ## ✅ Checklist - [x] Tested live on a real blog (feature or fix) - not applicable: contracts and test support only. - [x] Updated CLI `--help` and README if needed - not needed: no CLI changes. - [x] Updated `docs/` if the download flow or dev process changed - not needed: contracts are documented beside their types and methods. - [x] Added a line to `## Unreleased` in CHANGELOG.md (or the `ci/skip-changelog` label if not user-facing) - `ci/skip-changelog`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 19:49:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Glitchy-Sheep/boosty-downloader#222
No description provided.