docs: Bring all documentation up to date for v2.10.1

- architecture/: overview, technology stack, auth (OIDC + built-in
  IndieAuth), syndication (POSSE) rewritten; new database.md,
  deployment.md and indieweb-protocols.md; legacy stack marked historical
- decisions/: reconstructed ADR-060 and ADR-063; 31 status corrections
  (superseded auth ADRs, proposed -> accepted); INDEX rebuilt
- design/: reconstructed the v1.6.0 documents the webmention code cites;
  reports for 18 v2 releases without a design folder; INDEX rebuilt
- projectplan/: BACKLOG rewritten (shipped items removed, open issues from
  the reviews added); RELEASE.md for v2.0.0-v2.10.1; INDEX
- standards/: development setup (uv, tests, DEV_MODE), testing (CI test
  stage), git and release flow, versioning, coding standards, cookies
- README, CLAUDE.md, .env.example (every setting the code reads, with
  defaults) brought up to date
- 137 broken links repaired (old absolute paths, moved files); stale ADR
  references in code comments corrected (comments only)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-03 12:40:19 -07:00
1 parent fa551de197
commit 0716984958
143 files changed
+6222 -8660

No files matched your search

+178 -147
View File
@@ -1,43 +1,17 @@
# StarPunk Backlog
**Last Updated**: 2025-12-17
**Last Updated**: 2026-11-03 (current release: v2.10.1)
## Recently Completed
### v1.5.0 - Quality of Life Improvements (Complete)
- Timestamp-based default slug generation (ADR-062)
- Debug file management with automatic cleanup
- Filename sanitization in debug paths
- N+1 query fix for feed generation (batch media loading)
- Atomic variant generation (temp file pattern)
- MPO format test coverage
- Test suite cleanup (removed 5 broken tests, fixed brittle assertions)
### v1.4.2 - HEIC/MPO Support and Dimension Limit Increase (Complete)
- HEIC/HEIF format detection and conversion to JPEG
- MPO (Multi-Picture Object) format support for iPhone depth photos
- MAX_DIMENSION increased from 4096 to 12000 pixels
- Enhanced debug logging for failed uploads
### v1.4.0/v1.4.1 - Media Variants (Complete)
- Image variant generation (thumb, small, medium, large)
- Micropub media endpoint
- Enhanced feed media support with Media RSS
### v1.3.0 - Microformats2 Compliance and Tags (Complete)
- Tag/Category system with database schema
- p-category microformats2 markup
- h-feed required properties (name, author, url)
- Author h-card with photo and bio
- u-photo placement outside e-content
- mf2py validation test suite
These are the open features and bugs, sorted by priority. Each item was checked against the code
at v2.10.1. Work that has shipped is listed per release in `vX.Y.Z/RELEASE.md` and in
`CHANGELOG.md`.
## Priority Levels
- **Critical** - Items that break existing functionality
- **High** - Important features or fixes
- **Medium** - Planned features
- **Low** - Nice-to-have, deferred indefinitely
- **High** - Security, data-integrity or correctness bugs; important features
- **Medium** - Planned features and spec gaps with visible effect
- **Low** - Nice-to-have, minor spec deviations, deferred ideas
---
@@ -49,144 +23,201 @@
## High
### POSSE
- Native syndication to social networks
- Supported networks:
- First iteration:
- Mastodon (and compatible services)
- Bluesky
- Second iteration
- TBD
- Solution should include a configuration UI for setup
### SQLite foreign keys are not enforced (ON DELETE CASCADE is inert)
- **Description**: No connection runs `PRAGMA foreign_keys = ON`, so the `ON DELETE CASCADE` clauses in the schema do nothing. When a note is deleted from the admin (a hard delete), its `note_tags`, `note_media`, `syndications` and webmention rows stay behind. `delete_media()` relies on the cascade to remove `media_variants` and `note_media` rows, so those are left orphaned too. Before turning the pragma on, check for existing orphan rows and add a migration that cleans them up. Each cascade also needs tests.
- **Where**: `starpunk/database/` (connection setup/pool), `starpunk/notes.py` (`delete_note`, hard delete), `starpunk/media.py` (`delete_media`), `migrations/007`–`010`, `016`
- **Source**: v2.10.x review; confirmed in code (there is no `foreign_keys` pragma anywhere in `starpunk/`)
### No CSRF tokens on admin and consent forms
- **Description**: Admin forms (create/edit/delete notes, webmention moderation, token revocation) and the IndieAuth consent form rely only on the `SameSite=Lax` session cookie. Lax blocks cross-site POSTs in current browsers, but a per-session CSRF token is the standard defence and covers older clients and same-site subdomains.
- **Where**: `starpunk/routes/admin.py`, `starpunk/routes/indieauth.py`, `templates/admin/*`
- **Source**: Documentation refresh 2026-11-03 (architecture review)
### Two outbound fetches don't use the hardened fetcher
- **Description**: IndieAuth client-metadata discovery (`indieauth.fetch_client_redirect_uris`) checks only the first URL, then uses `httpx.get(follow_redirects=True)`: redirect hops aren't checked and DNS isn't pinned. Crosspost link cards and Threads image fetches (`syndication._fetch_public`) check each hop but don't pin DNS, and their 10 s timeout is per read. Move both to `webmention_ssrf.safe_get`, as Webmention, WebSub and Micropub photo downloads already do.
- **Where**: `starpunk/indieauth.py`, `starpunk/syndication.py`
- **Source**: Documentation refresh 2026-11-03
### `FLASK_DEBUG` defaults to on
- **Description**: `config.py` reads `FLASK_DEBUG` with default `"1"` (and `FLASK_ENV` defaults to development); the runtime image sets neither. Production is safe only because the deployment sets `FLASK_DEBUG=0`. Default to off, or set it in the `Containerfile` runtime stage.
- **Where**: `starpunk/config.py`, `Containerfile`
- **Source**: Documentation refresh 2026-11-03 (production verified: DEBUG is False there)
### Rate limiters are per process
- **Description**: `RateLimiter` keeps its counters in memory, and gunicorn runs 4 workers. The WebSub hub limit of 30/min is therefore really 4×30/min, and the webmention endpoint limit is multiplied the same way. Consider a counter stored in SQLite that all workers share.
- **Where**: `starpunk/rate_limiter.py`, `starpunk/routes/websub.py`, `starpunk/routes/webmention.py`, `Containerfile` (`--workers 4`)
- **Source**: ADR-071 (Consequences: rate limiting bounds subscriber-chosen requests); v2.10.1 review
---
## Medium
### PKCE Support for IndieAuth
- **Description**: Implement PKCE (Proof Key for Code Exchange) per RFC 7636 for IndieAuth authentication. Some IndieAuth providers (like indielogin.com) require PKCE. While not required by the W3C IndieAuth spec, it's a security best practice.
- **Source**: Hotfix 2025-12-17 scoping decision
- **Approach**:
- Add `code_verifier` column to `auth_state` table
- Add PKCE helper functions (`_generate_pkce_verifier()`, `_generate_pkce_challenge()`)
- Include `code_challenge` and `code_challenge_method=S256` in authorization request
- Include `code_verifier` in token exchange request
- **Reference**: Commit `5e50330` had working PKCE implementation that was removed in `a3bac86`
- **Priority**: Medium (adds security, enables compatibility with providers that require PKCE)
### Admin editor cannot clear all tags
- **Description**: When a note is saved with an empty tag field, the route passes `tags=None`. `update_note` treats that as "unchanged", so the last tags can't be removed from the editor.
- **Where**: `starpunk/routes/admin.py` (edit POST: `tags=tags if tags else None`), `starpunk/notes.py` (`update_note`)
- **Source**: Old backlog (v1.3.0 follow-up); still present
### N+1 Query Patterns - Deferred Locations
- **Description**: N+1 query patterns exist in multiple locations beyond `_get_cached_notes()`. These are lower priority due to lower traffic or single-note contexts.
- **Deferred Locations**:
1. **Admin Edit Page** (`starpunk/routes/admin.py` line 186): Single note context, low impact
2. **Tag Archive Pages** (`starpunk/routes/public.py` lines 243-248, 332): Lower traffic than main feed
3. **Individual Note View** (`starpunk/routes/public.py` lines 282-289): Single note, negligible
4. **Note Model Property** (`starpunk/models.py` lines 380-381): On-demand loading, acceptable
5. **Tag Module** (`starpunk/tags.py` line 197): Internal helper, low volume
- **Source**: Architect Review, v1.5.0 scoping decision
- **Approach**: Future optimization if performance issues arise. Consider batch loading patterns established in v1.5.0.
- **Priority**: Deferred to post-v1.5.0
### Media captions not escaped in RSS HTML
- **Description**: The RSS description embeds `<img alt="{caption}">` without escaping the caption. A caption containing `"` or `<` breaks the item's HTML.
- **Where**: `starpunk/feeds/rss.py` (two places, ~lines 136 and 277)
- **Source**: Old backlog (Architect Review 2.2.10); still present
### Rate Limiting on Upload Endpoints
- **Description**: No rate limiting exists on media upload endpoints, making them vulnerable to abuse.
- **Location**: `/admin/new` (admin.py), `/media` (micropub.py)
- **Source**: Architect Review (Security Assessment)
- **Approach**: Implement Flask-Limiter or similar rate limiting middleware for upload routes.
### No rate limiting on upload endpoints
- **Description**: Media uploads (`/admin/new` and the Micropub media endpoint) have no rate limit. Both require authentication, so the risk comes from a leaked token or session.
- **Where**: `starpunk/routes/admin.py`, `starpunk/routes/micropub.py`
- **Source**: Old backlog (Architect Review security assessment); still present
### Tag Enhancements (v1.3.0 Follow-up)
- Tag pagination on archive pages (when note count exceeds threshold)
- Tag autocomplete in admin interface
- Tag-filtered feeds (e.g., `/feed.rss?tag=python`, `/tags/python/feed.rss`)
- Fix: Empty tag field in admin should remove all tags (currently may leave unchanged)
### Micropub: more updatable properties
- **Description**: `add` works only for `category` and `photo`. `published`, `syndication` and `location` can't be updated.
- **Where**: `starpunk/micropub.py`
- **Source**: `docs/design/v2.9.0/2026-11-03-micropub-review.md` (Kept as is)
### Tag-Filtered Feeds
- Filter feeds by tag (e.g., `/feed.rss?tag=python`)
- Dedicated tag feed URLs (e.g., `/tags/python/feed.rss`)
- Support all three formats (RSS, Atom, JSON Feed)
- Cache management for filtered feeds
### Micropub: `insufficient_scope` returns 403
- **Description**: StarPunk follows RFC 6750 and returns 403, but the Micropub spec's error table says 401. Choose one: keep 403 and document why, or switch to 401.
- **Where**: `starpunk/micropub.py`, `starpunk/routes/micropub.py`
- **Source**: `docs/design/v2.9.0/2026-11-03-micropub-review.md` (Kept as is)
### Webmentions
- Receive endpoint
- Send on publish
- Display received mentions
- Moderation interface
### Webmentions with status `error` are never retried
- **Description**: When a received webmention fails unexpectedly or temporarily, it is stored as `error`. It is never processed again unless the sender sends it again. Add a limited number of retries with backoff.
- **Where**: `starpunk/webmention_worker.py`
- **Source**: `docs/design/v2.7.0/2026-11-03-webmention-spec-compliance.md` (Known limits)
### Reply Contexts
- In-reply-to support
- Like/repost posts
- Bookmark posts
### IndieAuth scope handling
- **Description**: The metadata's `scopes_supported` omits `draft`, though Micropub honours it and the consent screen grants it. Requested scopes aren't filtered, so unknown scopes are granted (and have no effect).
- **Where**: `starpunk/indieauth.py`, `starpunk/routes/indieauth.py`
- **Source**: Documentation refresh 2026-11-03
### Media Uploads Enhancements
- File management interface
- Thumbnail generation
- CDN integration (optional)
### Webmention source DNS failures are permanent
- **Description**: A DNS failure while fetching a webmention source becomes `ValueError` and marks the mention invalid/error without retry; the WebSub worker now retries `ResolutionError`. Treat it as transient here too.
- **Where**: `starpunk/webmention_processor.py`, `starpunk/webmention_worker.py`
- **Source**: v1.6.0 design reconstruction (docs/design/v1.6.0/background-worker.md)
### Photo Posts
- Instagram-like photo notes
- Gallery views
- EXIF data preservation
### Webmention rate limiter never cleaned up
- **Description**: `cleanup_rate_limiters()` is never called, so per-IP and per-domain keys accumulate for the life of each process.
- **Where**: `starpunk/rate_limiter.py`, `starpunk/routes/webmention.py`
- **Source**: v1.6.0 design reconstruction
### Audio/Podcast Support
- Podcast RSS with iTunes namespace
- Audio duration extraction
- Episode metadata support
- Apple/Google podcast compatibility
- See: ADR-059
### Atom and JSON Feed not linked from pages
- **Description**: `base.html` advertises only `/feed` (as RSS) and OPML with `rel=alternate`; add `<link rel="alternate">` for `/feed.atom` and `/feed.json` so readers can pick a format.
- **Where**: `templates/base.html`
- **Source**: Documentation refresh 2026-11-03
### Video Support
- Video upload handling
- Poster image generation
- Video in Media RSS feeds
- HTML5 video embedding
### Housekeeping in the repository
- **Description**: `compose.yaml` is stale (`image: starpunk:0.6.0`, `VERSION=0.6.0` would override the real version, unused `ENVIRONMENT`); the root `dev_auth.py` duplicates `starpunk/dev_auth.py` and is unused; `LICENSE` says "Copyright (c) 2024 [Your Name]"; `test.ini` contains a private host name; `lxml` and `python-dateutil` are used directly but only installed as dependencies of other packages, while `pytest` is pinned in the production `requirements.txt`.
- **Where**: `compose.yaml`, `dev_auth.py`, `LICENSE`, `test.ini`, `requirements*.txt`
- **Source**: Documentation refresh 2026-11-03
### Backfeed responses to crossposts
- **Description**: Idea: bring likes, boosts and replies to StarPunk's own crossposts back to the note as responses. Two options: poll GoToSocial (the token would need a `read` scope), or rely on Bridgy, which sends webmentions. Since v2.8.0, StarPunk ignores webmentions *from* a note's own crossposts, so that rule would need to change to work with Bridgy.
- **Where**: `starpunk/syndication.py`, `starpunk/webmention_worker.py`
- **Source**: v2.8.0 microformats2 review discussion
### Tag-filtered feeds
- **Description**: Tag pages are h-feeds and WebSub topics, but there are no RSS, Atom or JSON feeds per tag (for example `/tag/python/feed.atom`). Tag pages also have no pagination, and the editor has no tag autocomplete.
- **Where**: `starpunk/routes/public.py`, `starpunk/feeds/`, `templates/admin/`
- **Source**: Old backlog (Tag enhancements)
---
## Low
### HEIC/MPO Conversion Quality Not Configurable
- **Description**: HEIC and MPO to JPEG conversion uses hardcoded `quality=95`. Users with different quality/size tradeoff preferences cannot adjust this.
- **Location**: `starpunk/media.py` line 157
- **Source**: Developer Review (M3)
- **Approach**: Add `HEIC_CONVERSION_QUALITY` config variable with 95 as default.
### Micropub: `location` / `checkin` ignored
- **Description**: These properties are accepted but dropped, which spec 3.3.5 allows.
- **Where**: `starpunk/micropub.py`
- **Source**: `docs/design/v2.9.0/2026-11-03-micropub-review.md`
### MAX_DIMENSION Not Configurable
- **Description**: `MAX_DIMENSION = 12000` is a hardcoded constant. Cannot adjust limit without code change.
- **Location**: `starpunk/media.py` line 41
- **Source**: Developer Review (M4)
- **Approach**: Make configurable via config variable, keeping 12000 as default.
### Micropub: video and audio unsupported
- **Description**: `video` and `audio` are refused with 400 (`UNSUPPORTED_MEDIA`). Supporting them would need upload handling, HTML5 embedding, Media RSS and possibly podcast feeds (see ADR-059).
- **Where**: `starpunk/micropub.py`, `starpunk/media.py`
- **Source**: `docs/design/v2.9.0/2026-11-03-micropub-review.md`; old backlog (Audio/Podcast, Video)
### Animated WebP Not Detected
- **Description**: Animated GIF detection exists but animated WebP is not handled, potentially bypassing animated image size checks.
- **Location**: `starpunk/media.py` (validate_image function)
- **Source**: Architect Review (Issue 2.2.2)
- **Approach**: Add animated WebP detection similar to existing GIF handling.
### Micropub: GET `access_token` query parameter accepted
- **Description**: Tokens sent in the URL end up in logs and proxies. Consider refusing them.
- **Where**: `starpunk/micropub.py` (`extract_bearer_token`)
- **Source**: `docs/design/v2.9.0/2026-11-03-micropub-review.md`
### Caption Not Escaped in RSS HTML
- **Description**: In RSS generation, caption is used directly in alt attribute without HTML escaping. Could break markup if caption contains `"` or other special characters.
- **Location**: `starpunk/feeds/rss.py` line 136
- **Source**: Architect Review (Issue 2.2.10)
- **Approach**: Use `html.escape()` for caption when generating HTML content.
### Person tags (`p-category h-card`) unsupported
- **Description**: h-card objects in `category` are silently ignored.
- **Where**: `starpunk/micropub.py`, templates
- **Source**: `docs/design/v2.8.0/2026-11-03-microformats2-review.md` (Not done)
### Incomplete MPO Documentation
- **Description**: Code comment says "extract primary image" but doesn't explain the multi-frame nature of MPO files (contain multiple images for 3D or depth maps).
- **Location**: `starpunk/media.py` lines 163-165
- **Source**: Developer Review (M5)
- **Approach**: Enhance inline comment to document that MPO files contain multiple frames and only the primary frame is extracted.
### Reply-context h-cite lacks author h-card, name and published
- **Description**: The `u-in-reply-to h-cite` shows the cached author name as plain text. It has no `p-author h-card`, `p-name` or `dt-published`.
- **Where**: `templates/note.html`, `starpunk/reply_context.py`
- **Source**: `docs/design/v2.8.0/2026-11-03-microformats2-review.md` (Not done)
### Module Docstring Stale
- **Description**: Module docstring still states "4096x4096 max dimensions" but MAX_DIMENSION was updated to 12000 in v1.4.2.
- **Location**: `starpunk/media.py` lines 1-12
- **Source**: Architect Review (Issue 1.2.1)
- **Approach**: Update docstring to reflect current 12000px limit.
### Photo alt falls back to "Image"
- **Description**: A photo-only post with no caption still gets `alt="Image"`.
- **Where**: `templates/partials/media.html`
- **Source**: `docs/design/v2.8.0/2026-11-03-microformats2-review.md` (Not done)
### Flaky Migration Race Condition Tests
- Improve `test_migration_race_condition.py::TestGraduatedLogging::test_debug_level_for_early_retries`
- Test expects DEBUG retry messages but passes when migration succeeds without retries
- May need to mock or force retry conditions for reliable testing
### Old webmentions lack source details
- **Description**: Webmentions received before migration 014 keep NULL source details (the original post's URL and published time) until they are re-validated. A one-off re-validation would fill them in.
- **Where**: `starpunk/webmention_worker.py`, migration 014
- **Source**: `docs/design/v2.8.0/2026-11-03-microformats2-review.md` (Not done)
### Deferred Indefinitely
- Static Site Generation - Conflicts with dynamic Micropub
- Multi-language UI - Low priority for single-user system
- Advanced Analytics - Privacy concerns, use external tools
- Comments System - Use Webmentions instead
- WYSIWYG Editor - Markdown is sufficient
- Mobile App - Web interface is mobile-friendly
### Homepage webmentions refused
- **Description**: Mentions of the home page are refused with 400. They are not stored or shown anywhere.
- **Where**: `starpunk/routes/webmention.py`
- **Source**: `docs/design/v2.7.0/2026-11-03-webmention-spec-compliance.md` (Known limits)
### Webmention discovery ignores HTTP cache headers
- **Description**: Endpoint discovery doesn't apply HTTP caching (spec 5.3). Targets are only fetched when a note is created, edited or deleted, so the extra cost is small.
- **Where**: `starpunk/webmention_sender.py`
- **Source**: `docs/design/v2.7.0/2026-11-03-webmention-spec-compliance.md` (Known limits)
### 410 tombstone page has no microformats
- **Description**: The "This post has been deleted" page is a generic error page. It could include an `h-entry` with the post's URL and deletion state.
- **Where**: `templates/410.html`
- **Source**: `docs/design/v2.7.0/2026-11-03-webmention-spec-compliance.md` (Known limits)
### Slow and previously flaky tests
- **Description**: `tests/test_migration_race_condition.py` takes about 5 minutes. 8 tests were flaky or failing until v2.7.1. Speed them up (mock the waits) or mark them slow so the default test run stays fast.
- **Where**: `tests/test_migration_race_condition.py`
- **Source**: v2.7.1 release; ADR-012
### Animated WebP not detected
- **Description**: Animated GIFs are detected and handled; animated WebP is not.
- **Where**: `starpunk/media.py`
- **Source**: Old backlog (Architect Review 2.2.2); still present
### MAX_DIMENSION not configurable
- **Description**: `MAX_DIMENSION = 12000` is a constant.
- **Where**: `starpunk/media.py`
- **Source**: Old backlog (Developer Review M4)
### N+1 queries on secondary pages
- **Description**: Tag pages and a few single-note views load media one note at a time. Load it in batches if this becomes a problem.
- **Where**: `starpunk/routes/public.py` (tag page), `starpunk/routes/admin.py`, `starpunk/models.py`, `starpunk/tags.py`
- **Source**: Old backlog (v1.5.0 scoping)
### Unused settings and legacy tables
- **Description**: `NOTES_PATH` is read and its folder created, but notes are always written under `DATA_PATH/notes`. `SITE_AUTHOR` is required but shown nowhere. `INITIAL_SCHEMA_SQL` recreates the unused `tokens` and `authorization_codes` tables (dropped by migration 004) on every start, and `auth_state` is unused. Version fallbacks are stale (`author_discovery.py` "1.2.0", `base.html` "0.5.0").
- **Where**: `starpunk/config.py`, `starpunk/utils.py`, `starpunk/database/schema.py`, `starpunk/author_discovery.py`, `templates/base.html`
- **Source**: Documentation refresh 2026-11-03 (docs/architecture/database.md, deployment.md)
### Media library and crosspost settings UI
- **Description**: There is no admin page to browse or delete media, and crosspost targets can only be configured through environment variables.
- **Where**: `starpunk/routes/admin.py`
- **Source**: Old backlog (Media enhancements, POSSE configuration UI)
### Deferred indefinitely
- Static site generation (conflicts with Micropub)
- Multi-language UI, advanced analytics, WYSIWYG editor, mobile app
- Comments system (webmentions cover it)
- CDN integration, gallery views
---
## Done since the last update (2025-12-17)
These items were removed from the backlog because they have shipped:
- POSSE: GoToSocial (v2.1.0), Bluesky (v2.2.0), Threads (v2.6.0)
- Webmentions: receive, send, display and moderation (v1.6.0); fixed and made spec-compliant in v2.6.8–v2.7.2
- Reply contexts, replies, likes, reposts and bookmarks (v2.4.0, v2.5.0, v2.9.0)
- Photo posts without text (v2.6.5); thumbnails and image variants (v1.4.0)
- PKCE for IndieAuth login: replaced by OIDC admin login with PKCE (v2.0.0, ADR-064)
- HEIC conversion quality: no longer hardcoded; HEIC images now go through the normal optimisation tiers
- `media.py` module docstring now says 12000px
- Fresh feeds and push updates: WebSub (v2.10.0, v2.10.1)