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

@@ -1,7 +1,9 @@
# ADR-005: IndieLogin Authentication Integration
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
> Admin login stopped using IndieLogin.com during v1.x (it discovered the authorization endpoint from `ADMIN_ME`) and has used OIDC since v2.0.0 (ADR-064). (status updated 2026-11-03)
## Context
The user has explicitly required external IndieLogin authentication via indielogin.com for V1. This is different from implementing a full IndieAuth server (which CLAUDE.MD mentions). The distinction is important:
@@ -1,7 +1,9 @@
# ADR-007: Slug Generation Algorithm
## Status
Accepted
Superseded by ADR-062 (was: Accepted)
> New notes get timestamp slugs by default since v1.5.0 (ADR-062). (status updated 2026-11-03)
## Context
@@ -466,7 +468,7 @@ def update_note_slug(note_id, new_slug):
- [IndieWeb Permalink Design](https://indieweb.org/permalink)
- [URL Slug Best Practices](https://moz.com/learn/seo/url)
- [Python secrets Module](https://docs.python.org/3/library/secrets.html)
- [ADR-004: File-Based Note Storage](/home/phil/Projects/starpunk/docs/decisions/ADR-004-file-based-note-storage.md)
- [ADR-004: File-Based Note Storage](ADR-004-file-based-note-storage.md)
## Acceptance Criteria
@@ -444,9 +444,9 @@ When ready to release:
### Internal Documentation
- [Versioning Strategy](/home/phil/Projects/starpunk/docs/standards/versioning-strategy.md) - Complete versioning specification
- [Architecture Overview](/home/phil/Projects/starpunk/docs/architecture/overview.md) - System architecture
- [Development Setup](/home/phil/Projects/starpunk/docs/standards/development-setup.md) - Development workflow
- [Versioning Strategy](../standards/versioning-strategy.md) - Complete versioning specification
- [Architecture Overview](../architecture/overview.md) - System architecture
- [Development Setup](../standards/development-setup.md) - Development workflow
---
@@ -470,10 +470,10 @@ Created comprehensive documentation:
### Internal Documentation
- [ADR-008: Versioning Strategy](/home/phil/Projects/starpunk/docs/decisions/ADR-008-versioning-strategy.md) - Semantic versioning decision
- [Versioning Strategy](/home/phil/Projects/starpunk/docs/standards/versioning-strategy.md) - Complete versioning spec
- [Git Branching Strategy](/home/phil/Projects/starpunk/docs/standards/git-branching-strategy.md) - Complete branching spec
- [Development Setup](/home/phil/Projects/starpunk/docs/standards/development-setup.md) - Development workflow
- [ADR-008: Versioning Strategy](ADR-008-versioning-strategy.md) - Semantic versioning decision
- [Versioning Strategy](../standards/versioning-strategy.md) - Complete versioning spec
- [Git Branching Strategy](../standards/git-branching-strategy.md) - Complete branching spec
- [Development Setup](../standards/development-setup.md) - Development workflow
---
@@ -3,6 +3,8 @@
## Status
Accepted
> Partly superseded by ADR-064: the IndieLogin login flow was replaced by OIDC. The single `starpunk/auth.py` module and the session design are still in use. (status updated 2026-11-03)
## Context
With the core utilities and notes management complete, StarPunk needs an authentication system for the admin interface. ADR-005 already decided on using IndieLogin.com as the authentication provider. This ADR defines the specific module architecture and implementation approach for the authentication system.
@@ -204,7 +206,7 @@ Balance between security and usability:
## References
- [ADR-005: IndieLogin Authentication](/home/phil/Projects/starpunk/docs/decisions/ADR-005-indielogin-authentication.md)
- [ADR-005: IndieLogin Authentication](ADR-005-indielogin-authentication.md)
- [IndieAuth Specification](https://www.w3.org/TR/indieauth/)
- [OWASP Session Management](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html)
- [Flask Security Best Practices](https://flask.palletsprojects.com/en/3.0.x/security/)
@@ -507,8 +507,8 @@ Dev auth implementation is successful if:
## References
- [ADR-005: IndieLogin Authentication](/home/phil/Projects/starpunk/docs/decisions/ADR-005-indielogin-authentication.md)
- [ADR-010: Authentication Module Design](/home/phil/Projects/starpunk/docs/decisions/ADR-010-authentication-module-design.md)
- [ADR-005: IndieLogin Authentication](ADR-005-indielogin-authentication.md)
- [ADR-010: Authentication Module Design](ADR-010-authentication-module-design.md)
- [OWASP Authentication Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)
- [The Twelve-Factor App - Dev/Prod Parity](https://12factor.net/dev-prod-parity)
+1 -1
View File
@@ -1,7 +1,7 @@
# ADR-012: Flaky Test Removal and Test Quality Standards
## Status
Proposed
Accepted (implemented in v1.5.0; was: Proposed)
## Context
@@ -4,6 +4,8 @@
Accepted
> Its deferral of WebSub is superseded by ADR-071 (v2.10.0), and "no feed caching" by the feed cache added in v1.1.2. RSS is now one of three feed formats (ADR-038) and is served at `/feed.rss` (`/feed.xml` still works). (status updated 2026-11-03)
## Context
Phase 5 requires implementing RSS feed generation for syndicating published notes. We need to decide on the implementation approach, feed format, caching strategy, and technical details for generating a standards-compliant RSS feed.
@@ -365,8 +367,8 @@ The decision will be validated by:
- [Feed Discovery](https://indieweb.org/feed_discovery)
### Internal Documentation
- [Architecture Overview](/home/phil/Projects/starpunk/docs/architecture/overview.md)
- [Phase 5 Design](/home/phil/Projects/starpunk/docs/designs/phase-5-rss-and-container.md)
- [Architecture Overview](../architecture/overview.md)
- [Phase 5 Design](../design/v1.0.0/phase-5-rss-and-container.md)
---
@@ -87,10 +87,10 @@ The developer should:
6. Tag release after merge: `git tag -a v0.6.0 -m "Release 0.6.0: RSS feed and production container"`
## References
- [Versioning Strategy](/home/phil/Projects/starpunk/docs/standards/versioning-strategy.md)
- [Git Branching Strategy](/home/phil/Projects/starpunk/docs/standards/git-branching-strategy.md)
- [Phase 5 Design](/home/phil/Projects/starpunk/docs/designs/phase-5-rss-and-container.md)
- [Phase 5 Quick Reference](/home/phil/Projects/starpunk/docs/designs/phase-5-quick-reference.md)
- [Versioning Strategy](../standards/versioning-strategy.md)
- [Git Branching Strategy](../standards/git-branching-strategy.md)
- [Phase 5 Design](../design/v1.0.0/phase-5-rss-and-container.md)
- [Phase 5 Quick Reference](../design/v1.0.0/phase-5-quick-reference.md)
---
@@ -4,6 +4,8 @@
**Superseded by ADR-019** - IndieLogin.com does not use h-app microformats for client discovery. PKCE implementation is the correct solution.
> ADR-019 was itself replaced by ADR-025, and the whole IndieLogin login flow by OIDC in ADR-064. (status updated 2026-11-03)
## Context
StarPunk uses IndieLogin.com as a delegated IndieAuth provider for admin authentication. During the first production deployment to https://starpunk.thesatelliteoflove.com, authentication failed with the error:
@@ -4,6 +4,8 @@
**Superseded by ADR-019** - IndieLogin.com does not require OAuth metadata endpoint. PKCE implementation is the correct solution.
> ADR-019 was itself replaced by ADR-025, and the whole IndieLogin login flow by OIDC in ADR-064. (status updated 2026-11-03)
## Context
StarPunk continues to experience "client_id is not registered" errors from IndieLogin.com despite implementing h-app microformats in ADR-016 and making them visible in ADR-006.
@@ -2,7 +2,9 @@
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
> The IndieAuth login flow whose HTTP traffic this logged was replaced by OIDC in v2.0.0. General logging is described in ADR-054. (status updated 2026-11-03)
## Context
@@ -2,7 +2,9 @@
## Status
Proposed
Superseded by ADR-025 (was: Proposed)
> ADR-025 is the accepted version of this decision; its login flow was in turn replaced by OIDC (ADR-064). (status updated 2026-11-03)
## Context
@@ -1,7 +1,7 @@
# ADR-021: IndieAuth Provider Strategy
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
## Context
@@ -525,8 +525,8 @@ If there is user demand for a more integrated solution, V2 could add:
- [IndieWeb Wiki: authorization-endpoint](https://indieweb.org/authorization-endpoint) - Endpoint details
### Related ADRs
- [ADR-005: IndieLogin Authentication](/home/phil/Projects/starpunk/docs/decisions/ADR-005-indielogin-authentication.md) - Original auth decision
- [ADR-010: Authentication Module Design](/home/phil/Projects/starpunk/docs/decisions/ADR-010-authentication-module-design.md) - Auth module structure
- [ADR-005: IndieLogin Authentication](ADR-005-indielogin-authentication.md) - Original auth decision
- [ADR-010: Authentication Module Design](ADR-010-authentication-module-design.md) - Auth module structure
### Community Examples
- [Aaron Parecki's IndieAuth Notes](https://aaronparecki.com/2025/10/08/4/cimd) - Client ID metadata adoption
@@ -1,7 +1,9 @@
# ADR-022: Fix IndieAuth Callback Route Mismatch
## Status
Proposed
Accepted (implemented in v0.9.2; was: Proposed)
> The `/auth` prefix remains; since v2.0.0 `/auth/callback` is the OIDC callback (ADR-064). (status updated 2026-11-03)
## Context
We have discovered a critical routing mismatch in our IndieAuth implementation that causes a 404 error when IndieAuth providers redirect back to our application.
@@ -1,7 +1,9 @@
# ADR-023: IndieAuth Client Identification Strategy
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
> StarPunk is now a registered OIDC client for login and publishes no h-app. (status updated 2026-11-03)
## Context
@@ -1,7 +1,9 @@
# ADR-024: Static HTML Identity Pages for IndieAuth
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
> The `ADMIN_ME` page must now advertise StarPunk's own IndieAuth endpoints, not indieauth.com's (ADR-064, decision 3). (status updated 2026-11-03)
## Context
@@ -2,7 +2,7 @@
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
## Context
@@ -1,7 +1,7 @@
# ADR-026: IndieAuth Token Exchange Compliance
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
## Context
StarPunk's IndieAuth implementation is failing to authenticate with certain providers (specifically gondulf.thesatelliteoflove.com) during the token exchange phase. The provider is rejecting our token exchange requests with a "missing grant_type" error.
@@ -1,7 +1,7 @@
# ADR-027: IndieAuth Authentication Endpoint Correction
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
## Context
@@ -178,7 +178,7 @@ Continue current implementation, document incompatibility.
- [IndieAuth Specification Section 5.4](https://www.w3.org/TR/indieauth/#authentication-response): Authorization Code Verification for authentication flows
- [IndieAuth Specification Section 6.3](https://www.w3.org/TR/indieauth/#token-response): Token Endpoint for authorization flows
- [IndieAuth Authentication vs Authorization](https://indieweb.org/IndieAuth#Authentication_vs_Authorization): Community documentation
- [ADR-021: IndieAuth Provider Strategy](/home/phil/Projects/starpunk/docs/decisions/ADR-021-indieauth-provider-strategy.md): Related architectural decision
- [ADR-021: IndieAuth Provider Strategy](ADR-021-indieauth-provider-strategy.md): Related architectural decision
---
@@ -2,7 +2,9 @@
## Status
Proposed
Accepted (implemented in v1.0.0-rc.1; was: Proposed)
> Its token endpoint was removed by ADR-050; tokens are now issued and verified by StarPunk's own IndieAuth server (ADR-064). Update and delete were added by ADR-067. (status updated 2026-11-03)
## Context
@@ -1,7 +1,9 @@
# ADR-029: Micropub IndieAuth Integration Strategy
## Status
Accepted
Superseded by ADR-050, then ADR-064 (was: Accepted)
> The token endpoint designed here was removed in v1.0.0-rc.4 (ADR-050). v2.0.0 added a new built-in IndieAuth server (ADR-064). (status updated 2026-11-03)
## Context
@@ -1,7 +1,7 @@
# ADR-030: External Token Verification Architecture
## Status
Accepted
Superseded by ADR-043, then ADR-064 (was: Accepted)
## Context
@@ -1,7 +1,7 @@
# ADR-031: Database Migration System Redesign
## Status
Proposed
Accepted (implemented through ADR-032 and ADR-033; was: Proposed)
## Context
@@ -1,7 +1,7 @@
# ADR-033: Database Migration System Redesign
## Status
Proposed
Accepted (implemented in v1.1.0; was: Proposed)
## Context
The current migration system has a critical flaw: duplicate schema definitions exist between SCHEMA_SQL (used for fresh installs) and individual migration files. This violates the DRY principle and creates maintenance burden. When schema changes are made, developers must remember to update both locations, leading to potential inconsistencies.
+1 -1
View File
@@ -1,7 +1,7 @@
# ADR-034: Full-Text Search with SQLite FTS5
## Status
Proposed
Accepted (implemented in v1.1.0; was: Proposed)
## Context
Users need the ability to search through their notes efficiently. Currently, finding specific content requires manually browsing through notes or using external tools. A built-in search capability is essential for any content management system, especially as the number of notes grows.
+3 -1
View File
@@ -1,7 +1,9 @@
# ADR-035: Custom Slugs in Micropub
## Status
Proposed
Accepted (implemented in v1.1.0; was: Proposed)
> Default slugs later became timestamps (ADR-062); `mp-slug` is still honoured. (status updated 2026-11-03)
## Context
Currently, StarPunk auto-generates slugs from note content (first 5 words). While this works well for most cases, users may want to specify custom slugs for:
@@ -1,7 +1,9 @@
# ADR-036: IndieAuth Token Verification Method Diagnosis
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
> Micropub tokens are verified locally since v2.0.0. (status updated 2026-11-03)
## Context
StarPunk is experiencing HTTP 405 Method Not Allowed errors when verifying tokens with the external IndieAuth provider (gondulf.thesatelliteoflove.com). The user questioned "why are we making GET requests to these endpoints?"
@@ -1,7 +1,7 @@
# ADR-022: Multiple Syndication Format Support
## Status
Proposed
Accepted (implemented in v1.1.2; was: Proposed)
## Context
StarPunk currently provides RSS 2.0 feed generation using the feedgen library. The IndieWeb community and modern feed readers increasingly support additional syndication formats:
@@ -1,7 +1,7 @@
# ADR-023: Strict Microformats2 Compliance
## Status
Proposed
Accepted (implemented in v1.3.0, reviewed in v2.8.0; was: Proposed)
## Context
StarPunk currently implements basic microformats2 markup:
@@ -158,7 +158,7 @@ The lesson learned: Release candidates are valuable for discovering not just bug
- [Semantic Versioning 2.0.0](https://semver.org/)
- [ADR-008: Versioning Strategy](../standards/versioning-strategy.md)
- [ADR-021: IndieAuth Provider Strategy](./ADR-021-indieauth-provider-strategy.md)
- [StarPunk Philosophy](../architecture/philosophy.md)
- StarPunk Philosophy (`philosophy.md`, not preserved)
---
@@ -1,7 +1,9 @@
# ADR-043-CORRECTED: IndieAuth Endpoint Discovery Architecture
## Status
Accepted (Replaces incorrect understanding in previous ADR-030)
Superseded by ADR-064 (was: Accepted; it replaced ADR-030)
> Admin login uses OIDC and Micropub tokens are verified locally since v2.0.0; no endpoints are discovered from `ADMIN_ME`. (status updated 2026-11-03)
## Context
@@ -1,7 +1,7 @@
# ADR-031: IndieAuth Endpoint Discovery Implementation Details
## Status
Accepted
Superseded by ADR-064 (was: Accepted)
## Context
@@ -1,7 +1,9 @@
# ADR-050: Remove Custom IndieAuth Server
## Status
Proposed
Superseded by ADR-064 (was: Proposed; implemented in v1.0.0-rc.4)
> v2.0.0 brought back a built-in IndieAuth server for Micropub clients (ADR-064). (status updated 2026-11-03)
## Context
@@ -363,7 +365,7 @@ TOKEN_ENDPOINT=https://tokens.indieauth.com/token
- [IndieAuth Spec](https://www.w3.org/TR/indieauth/)
- [tokens.indieauth.com](https://tokens.indieauth.com/)
- [ADR-021: IndieAuth Provider Strategy](/home/phil/Projects/starpunk/docs/decisions/ADR-021-indieauth-provider-strategy.md)
- [ADR-021: IndieAuth Provider Strategy](ADR-021-indieauth-provider-strategy.md)
- [Micropub Spec](https://www.w3.org/TR/micropub/)
---
@@ -1,7 +1,9 @@
# ADR-056: Use External IndieAuth Provider (Never Self-Host)
## Status
**ACCEPTED** - This is a permanent, non-negotiable decision.
Superseded by ADR-064 (was: Accepted, "permanent, non-negotiable")
> In v2.0.0 the operator moved login to OIDC and StarPunk became its own IndieAuth server for Micropub clients (ADR-064). (status updated 2026-11-03)
## Context
StarPunk is a minimal IndieWeb CMS focused on **content creation and syndication**, not identity infrastructure. The project philosophy demands that every line of code must justify its existence.
@@ -271,8 +271,8 @@ Make media support pluggable for advanced features.
- [Apple Podcast RSS Requirements](https://podcasters.apple.com/support/823-podcast-requirements)
- [Podcast Index Namespace](https://github.com/Podcastindex-org/podcast-namespace)
- [RSS 2.0 Enclosure Specification](https://www.rssboard.org/rss-specification#ltenclosuregtSubelementOfLtitemgt)
- [ADR-057: Media Attachment Model](/home/phil/Projects/starpunk/docs/decisions/ADR-057-media-attachment-model.md)
- [ADR-058: Image Optimization Strategy](/home/phil/Projects/starpunk/docs/decisions/ADR-058-image-optimization-strategy.md)
- [ADR-057: Media Attachment Model](ADR-057-media-attachment-model.md)
- [ADR-058: Image Optimization Strategy](ADR-058-image-optimization-strategy.md)
## Decision
This ADR documents the scope of Full Standardization (Option 3) for the project backlog. Implementation should be scheduled for v1.3.0 and v1.4.0 releases according to the phased approach outlined above.
@@ -0,0 +1,103 @@
# ADR-060: Route Adapter for the Metrics Dashboard
## Status
Accepted (v1.1.1-rc.2, 2025-11-25)
> Reconstructed on 2026-11-03 from code, changelog and related documents;
> the original was lost. The original
> (`ADR-060-production-hotfix-metrics-dashboard.md`) was deleted in the
> v1.1.1-rc.2 architectural review as "a bug fix, not an architectural
> decision", and its content was merged into
> `docs/design/v1.1.1/hotfix-v1.1.1-rc2-consolidated.md`. Code
> (`starpunk/routes/admin.py`) and CHANGELOG 1.1.1-rc.2 still cite it, so
> this record restores the number.
>
> Not to be confused with the "Option 2 (ADR-060)" for Media RSS mentioned
> in ADR-059: that ADR was planned but never written (see
> `docs/design/v1.2.0/2025-12-10-documentation-audit-v1.2.0.md`).
## Context
v1.1.1-rc.1 added a metrics dashboard. In production it returned 500:
```
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'database'
```
Two problems were found:
1. **Route conflict.** The notes dashboard (`/admin/`, endpoint
`admin.dashboard`) and the new metrics dashboard (`/admin/dashboard`)
were easily confused. This was fixed first by moving the metrics
dashboard to `/admin/metrics-dashboard` (the "ADR-022" route-naming fix
cited in the CHANGELOG; see Numbering below).
2. **Data contract mismatch** (the real cause). The template reads
`metrics.database.count` and `.avg/.min/.max`, but
`starpunk.monitoring.get_metrics_stats()` returns
`by_type.database.count` and `avg_duration_ms`, `min_duration_ms`,
`max_duration_ms`.
Either the monitoring module, the template (and its JavaScript), or the
route could change.
## Decision
Adapt the data **in the route handler** (presentation layer) and leave
both the monitoring module's API and the template unchanged.
- `transform_metrics_for_template()` in `starpunk/routes/admin.py`
flattens `by_type.<type>` to `<type>` for `database`, `http` and
`render`, renames `avg_duration_ms`/`min_duration_ms`/`max_duration_ms`
to `avg`/`min`/`max`, and keeps `total_count`, `max_size` and
`process_id`. Missing types get zero values.
- If collecting metrics fails, the route flashes a warning and renders
the same structure with zeros.
- The monitoring imports are defensive: if `starpunk.monitoring` or the
pool statistics are unavailable, stub functions return an error value
and the dashboard still renders.
- The metrics dashboard lives at `/admin/metrics-dashboard`
(`admin.metrics_dashboard`); `/admin/` (`admin.dashboard`) stays the
notes list, so existing `url_for("admin.dashboard")` redirects are
unaffected.
## Consequences
### Positive
- Minimal, low-risk hotfix: one route changed, no template or monitoring
changes.
- The monitoring module's output stays the same for the JSON endpoint
(`/admin/metrics`) and other consumers.
- The dashboard degrades instead of failing when metrics are missing.
### Negative
- Treats the symptom: the template and the monitoring module still
disagree about the data shape, and the adapter must be kept in step
with both (noted in `docs/design/v1.1.1/hotfix-v1.1.1-rc2-review.md`).
- Errors loading metrics are shown as zeros, which can hide a problem.
## Alternatives Considered
- **Change the monitoring module to return the template's shape**: breaks
its other consumers.
- **Change the template and its JavaScript**: larger change in a hotfix,
with more to test.
## Numbering
The CHANGELOG for 1.1.1-rc.2 says "See ADR-022 and ADR-060". The ADR-022
it meant was `ADR-022-admin-dashboard-route-conflict-hotfix.md`, deleted in
the same review; its number collided with the existing
[ADR-022](ADR-022-auth-route-prefix-fix.md) (IndieAuth callback route) and
it was not restored. Its decision (the route rename) is recorded above.
## References
- `starpunk/routes/admin.py`: `transform_metrics_for_template()`,
`metrics_dashboard()`
- `docs/design/v1.1.1/hotfix-v1.1.1-rc2-consolidated.md`
- `docs/design/v1.1.1/2025-11-25-hotfix-v1.1.1-rc.2-implementation.md`
- `docs/design/v1.1.1/hotfix-v1.1.1-rc2-review.md`
- ADR-053 (performance monitoring)
@@ -0,0 +1,293 @@
# ADR-063: Webmention Implementation
## Status
Accepted (v1.6.0; revised v2.6.8, v2.6.9, v2.7.0, v2.7.2, v2.8.0, v2.10.1)
> Reconstructed on 2026-11-03 from code, changelog and related documents;
> the original was lost. The v1.6.0 release was never committed: its code
> was recovered from the production image (`v1.6.0-rc.2`), but its tests,
> this ADR and the `docs/design/v1.6.0/` folder (`background-worker.md`,
> `api-contract.md`, `display-moderation.md`, `rate-limiting.md`) were not
> in the image. This document describes the design as it exists in
> v2.10.1. The numbering of the decisions below is new, except that
> Decision 9 (SSRF protection) keeps the number the code cites.
## Context
Webmention (W3C Recommendation, https://www.w3.org/TR/webmention/) is how
IndieWeb sites tell each other that one page links to another. It is what
makes replies, likes and reposts from other sites (and from Mastodon or
Bluesky via Bridgy) show up on a note, and what tells the sites a note
replies to or links to that it exists.
Both directions involve fetching URLs chosen by someone else, which is
slow, can fail, and can be abused:
- A receiver must fetch the source page to check that it really links to
the target. Doing that inside the request lets anyone make StarPunk
fetch arbitrary URLs synchronously, and ties up a server process.
- A sender must discover each target's endpoint and POST to it, with
retries when the other site is down.
- Any fetch can be pointed (directly, by redirect or by DNS) at private
addresses on the server's own network (SSRF).
- Content from other sites is shown on our pages (XSS).
StarPunk is a single-user site on SQLite, run under gunicorn with several
processes, with no job queue or message broker.
## Decision
### 1. Endpoint and discovery
- `POST /webmention` receives webmentions (form-encoded as the spec
requires; JSON is accepted as an extension);
`GET /webmention` returns a short description of the endpoint.
- HTML responses advertise it with a `Link: </webmention>; rel="webmention"`
header (added alongside other Link headers, not replacing them) and a
`<link rel="webmention">` in `base.html`.
- `WEBMENTION_ENABLED` (default true) turns the feature off.
### 2. Receiving is asynchronous
The endpoint does only cheap, local checks and then answers
**202 Accepted**; verification happens later in the background worker.
Synchronous checks, each answered with 400 on failure: `source` and
`target` are well-formed http(s) URLs of at most 2048 characters, they
differ, and the target is a **published note** on this site (host compared
case-insensitively and without default ports; `#fragment` dropped). Since
v2.7.0 mentions of the home page or other pages are refused instead of
being stored and never shown.
The mention is upserted into `webmentions` keyed by `(source_url,
target_url)` with `validation_status = 'pending'`, so a re-sent mention is
re-verified rather than duplicated.
### 3. Background worker
One daemon thread (`WebmentionWorker`) handles both incoming verification
and outgoing sending, using two SQLite tables as queues (`webmentions`,
`webmention_queue`). No external queue is introduced.
- Started by `create_app()` when `WEBMENTION_WORKER_ENABLED` is true (not
in tests). It polls every `WEBMENTION_POLL_INTERVAL` seconds (10),
handles up to `WEBMENTION_BATCH_SIZE` items (5) per pass, and backs off
`WEBMENTION_ERROR_BACKOFF` seconds (60) after an unexpected error.
- Each pass runs inside `app.app_context()` (v2.6.8: without it every
item failed with "Working outside of application context"). The thread
lives for the life of the process; it is not stopped on app-context
teardown (v2.6.8: that stopped it after the first request).
- **Only one process works the queues** (v2.6.9). Every gunicorn process
starts a worker, but a worker only processes after taking a
non-blocking `flock` on `<data>/webmention-worker.lock`. Others retry
each poll, so one takes over if the holder dies.
- On acquiring the lock it resets outgoing items stuck in `sending` for
more than 5 minutes (orphans from a crash).
- `/health?detailed=true` (authenticated) reports the worker's
statistics.
### 4. Verifying a received webmention
Per Recommendation 3.2.2 and 3.2.4:
- The source is fetched with an `Accept` header, following redirects
(Decision 9), and decoded in its declared character set.
- The source must link to the **exact** target URL, by media type: for
HTML any link attribute (resolved against the final URL after
redirects); for JSON any string value; for `text/*` a substring; other
types never match. Fragments are ignored (v2.7.0).
- The source is parsed with mf2py. The responding entry and its author are
found with the authorship algorithm (v2.8.0); the mention type is one of
`reply`, `like`, `repost`, `bookmark` or `mention`. The source's own
`u-url` and `dt-published` are stored (`source_post_url`,
`source_published`, migration 014) so the response links to and is
dated by the original post.
- If the source is gone (410, other 4xx) or no longer links, the mention
is removed from display. If it can't be reached right now (network
error, 5xx, temporary DNS failure), a previously valid mention stays up
(v2.7.0, v2.10.1).
- A webmention from one of the note's own crossposts (e.g. its GoToSocial
copy returned through Bridgy) is ignored (v2.8.0).
### 5. Moderation and display
- Valid mentions are approved automatically when `WEBMENTION_AUTO_APPROVE`
is true (the default), otherwise they wait in `pending`. The admin can
approve, hide or delete them at `/admin/webmentions` (single and bulk
actions).
- A re-sent mention keeps its moderation: hidden stays hidden, approved
stays approved (v2.7.0).
- Notes show only mentions that are both `valid` and `approved`, grouped
by type. Replies are marked up as `u-comment h-cite`; likes, reposts,
bookmarks and mentions as `u-like`, `u-repost`, `u-bookmark`,
`u-mention` h-cites, each with the author's h-card (v2.8.0).
### 6. Sending
- After a note is created, edited, deleted or restored, links are
extracted from its **rendered HTML**: `<a href>` only, excluding links
inside `<pre>` and `<code>`, the `in_reply_to` target first, then
document order, at most 10 current links per operation. Each target is
queued in `webmention_queue` (unique per source and target).
- On edit, every target sent to before is notified again, including links
the edit removed and an old reply target; on delete and undelete too
(Recommendation 3.1.4, 3.1.5; v2.7.0). Re-sends are not capped.
- When the responses a note displays change (a mention arrives, changes
or is removed, or the admin approves, hides or deletes one that was
shown), the note's previous webmentions are re-queued, as 3.1.4
recommends. An unchanged re-verification sends nothing, so two sites
that both do this don't ping-pong (v2.7.2).
- Endpoint discovery follows 3.1.2: the first `Link` header with a
`webmention` rel token (RFC 8288 parsing, several headers, any case),
otherwise the first `<link>` or `<a>` in document order; relative URLs
resolve against the final URL. The endpoint is discovered afresh every
time; there is no cache (v2.7.0).
- The webmention is a form-encoded POST. Any 2xx is success; redirects
are not followed (a redirected POST would become a GET). A target
without an endpoint is marked `no_endpoint`.
- Failures (network errors, 5xx, 429) are retried after 1 h, 6 h and
24 h; after the fourth failed attempt the item is `failed`.
- The User-Agent is `StarPunk/<version> Webmention (+site)`.
### 7. Deleted notes
A deleted note answers **410 Gone** with a "This post has been deleted"
page (soft-deleted notes, and hard-deleted notes that sent webmentions),
so receivers can remove the mention (3.1.5; v2.7.0).
### 8. Content safety (XSS)
- Snippets and reply content are sanitized with nh3, cut at 500
characters and sanitized again so no tag is left open (v2.7.0); the
admin "Mentions" list shows them with tags stripped.
- Author URLs and photos are kept only if they are absolute http(s) URLs;
otherwise the source URL is used as the author link and no photo is
shown (v2.6.9). mf2 values with `alt` are reduced to their URL.
### 9. SSRF protection
All outbound requests for webmentions (source fetches, endpoint discovery
and the POST) go through `starpunk/webmention_ssrf.py` (Recommendation
4.2, 4.3, 4.5):
- Only http(s). **Every** address a hostname resolves to (IPv4 and IPv6)
must be public: private, loopback, link-local, multicast, reserved,
unspecified, carrier-grade NAT (`100.64.0.0/10`), `0.0.0.0/8` and
IPv4-mapped forms are blocked.
- Redirects (at most 10) are followed by hand and **each hop** is checked
(v2.7.0).
- **DNS pinning** (v2.7.2): each request connects to the exact address
that passed the check, with the original host in the `Host` header and
as TLS SNI, so certificates are still verified against the hostname. A
rebinding DNS server can't answer differently the second time. IPv4 is
preferred when a host has both.
- Responses are limited to 1 MB, and each fetch has a total time limit of
10 s that a slow, byte-by-byte response can't extend (v2.10.1).
- `DEV_MODE` allows localhost for local testing.
The same guard is reused for IndieAuth client metadata fetches (ADR-064),
Micropub remote photos (v2.9.0) and WebSub callbacks and deliveries
(ADR-071).
### 10. Rate limiting
`POST /webmention` is rate-limited before any other work: by client IP
(`WEBMENTION_RATE_LIMIT_IP`, 60) and by source domain
(`WEBMENTION_RATE_LIMIT_DOMAIN`, 10) per `WEBMENTION_RATE_LIMIT_WINDOW`
(60 s), answering 429 with `Retry-After`. Counters are an in-memory
sliding-window log (`starpunk/rate_limiter.py`), so they are per server
process. Behind a reverse proxy, `TRUSTED_PROXY=true` makes the first
`X-Forwarded-For` address the client IP. `WEBMENTION_RATE_LIMIT_ENABLED`
turns it off.
`starpunk/rate_limiter.py` and `routes/webmention.py` cite this as
"ADR-064: Webmention Rate Limiting", a v1.6.0 ADR that was lost with this
one. The number ADR-064 was later reused for OIDC login
(ADR-064-oidc-admin-login-and-builtin-indieauth-server.md); the rate-limit
decision is recorded here instead.
### 11. Data (migrations 010 and 014)
- `notes.in_reply_to`
- `webmentions`: source, target, target note, type, author name/URL/photo,
snippet, `validation_status` (`pending`, `valid`, `invalid`, `error`),
`moderation_status` (`pending`, `approved`, `hidden`, `deleted`),
timestamps, and (migration 014) `source_post_url`, `source_published`
- `webmention_queue`: outgoing items with `status` (`pending`, `sending`,
`sent`, `failed`, `no_endpoint`), retry count and next retry time
- `reply_contexts`: cached title, snippet and author of pages notes reply
to
## Consequences
### Positive
- Receiving is cheap and can't be used to make StarPunk fetch URLs while
the sender waits.
- No new infrastructure: the queues are SQLite tables and the worker is a
thread, as for crossposting and WebSub.
- Outbound fetching is hardened once and reused by every other feature
that fetches user-supplied URLs.
- Follows every MUST and SHOULD of the Recommendation after v2.7.2.
### Negative
- Mentions appear only after the next worker pass (seconds), not
immediately.
- One worker per site: throughput is limited, which is fine for a
personal site.
- Rate limits are per process and reset on restart.
- `error` rows (unexpected failures) are not retried automatically.
- Endpoint discovery ignores HTTP cache headers (spec 5.3); targets are
only fetched when a note changes.
- The 410 page is a generic tombstone without microformats.
## Revisions
- **v2.6.8** — Worker runs inside an app context and is no longer stopped
on teardown; before this, no webmention was ever processed
(`docs/design/v2.6.8/2026-11-03-webmention-worker-app-context.md`).
- **v2.6.9** — Author photos with alt text; endpoint discovery crash
fixed and discovery errors retried; `flock` so only one process works
the queues; http(s)-only author links
(`docs/design/v2.6.9/2026-11-03-webmention-processing-fixes.md`).
- **v2.7.0** — Full review against the Recommendation: published notes
only, exact target match, RFC 8288 endpoint discovery, no discovery
cache, re-sends on edit/delete/undelete, 410 for deleted notes,
per-hop SSRF checks, size and time limits, moderation kept on re-send
(`docs/design/v2.7.0/2026-11-03-webmention-spec-compliance.md`).
- **v2.7.2** — DNS pinning; re-send when displayed responses change
(`docs/design/v2.7.2/2026-11-03-webmention-shoulds.md`).
- **v2.8.0** — Authorship algorithm, source URL and published time
(migration 014), response microformats, own crossposts ignored
(`docs/design/v2.8.0/2026-11-03-microformats2-review.md`).
- **v2.10.1** — Hard total time limit on fetches; temporary DNS failures
treated as transient.
## Alternatives Considered
- **Synchronous verification in the request**: simpler, but slow, ties
up a gunicorn process and turns the endpoint into a fetch-anything
proxy. The Recommendation allows 202 for exactly this.
- **External service (webmention.io)**: no code to run, but mentions
would live outside the site's database and moderation, against the
self-hosted approach.
- **A job queue (Celery/RQ with Redis)**: new infrastructure for a few
jobs a day.
- **Resolving and validating the host, then letting the HTTP client
connect normally**: open to DNS rebinding; replaced by pinning in
v2.7.2.
## References
- W3C Webmention: https://www.w3.org/TR/webmention/
- Code: `starpunk/routes/webmention.py`, `starpunk/webmention_worker.py`,
`starpunk/webmention_processor.py`, `starpunk/webmention_sender.py`,
`starpunk/webmention_ssrf.py`, `starpunk/webmention_queries.py`,
`starpunk/rate_limiter.py`, `migrations/010_add_webmentions.sql`,
`migrations/014_webmention_source_details.sql`
- Tests: `tests/test_webmention_spec.py`, `tests/test_webmention_worker.py`
- [IndieWeb protocols](../architecture/indieweb-protocols.md)
- ADR-064 (OIDC login; reuses the SSRF guard), ADR-071 (WebSub; same
guard and worker pattern)
@@ -4,6 +4,8 @@
Accepted (v2.5.0, 2026-11-01). Bookmarks were considered and declined.
> Bookmarks were later added in v2.9.0 (Micropub `bookmark-of`, migration 015) without a separate ADR. (status updated 2026-11-03)
## Decision
1. **Storage.** `notes.like_of` / `notes.repost_of` (migration 013). The note's
+163 -99
View File
@@ -1,139 +1,203 @@
# Architectural Decision Records (ADRs) Index
This directory contains all Architectural Decision Records for StarPunk CMS. ADRs document significant architectural decisions, their context, rationale, and consequences.
This directory holds StarPunk's Architectural Decision Records. Each ADR
records one decision: its context, what was decided, and the consequences.
Superseded ADRs are kept as history; their Status line names the ADR that
replaced them.
## ADR Format
**Total ADR files**: 67 (66 numbers: ADR-001 to ADR-044 and ADR-050 to
ADR-071, with two files numbered ADR-012). See [Numbering](#numbering).
Each ADR follows this structure:
- **Title**: ADR-NNN-brief-descriptive-title.md
- **Status**: Proposed, Accepted, Deprecated, Superseded
- **Context**: Why we're making this decision
- **Decision**: What we decided to do
- **Consequences**: Impact of this decision
Status values: **Accepted** (in force), **Superseded** (replaced by a later
ADR), **Deprecated** (withdrawn, nothing replaces it; none at present),
**Proposed** (not implemented). "Accepted*" means accepted, with later
changes noted in the ADR's Status section.
## All ADRs (Chronological)
## Current decisions by area
### Foundation & Technology Stack (ADR-001 to ADR-009)
- **[ADR-001](ADR-001-python-web-framework.md)** - Python Web Framework Selection
- **[ADR-002](ADR-002-flask-extensions.md)** - Flask Extensions Strategy
- **[ADR-003](ADR-003-frontend-technology.md)** - Frontend Technology Stack
- **[ADR-004](ADR-004-file-based-note-storage.md)** - File-Based Note Storage
- **[ADR-005](ADR-005-indielogin-authentication.md)** - IndieLogin Authentication
- **[ADR-006](ADR-006-python-virtual-environment-uv.md)** - Python Virtual Environment with uv
- **[ADR-007](ADR-007-slug-generation-algorithm.md)** - Slug Generation Algorithm
- **[ADR-008](ADR-008-versioning-strategy.md)** - Versioning Strategy
- **[ADR-009](ADR-009-git-branching-strategy.md)** - Git Branching Strategy
### Foundation and process
### Authentication & Authorization (ADR-010 to ADR-027)
- **[ADR-010](ADR-010-authentication-module-design.md)** - Authentication Module Design
- **[ADR-011](ADR-011-development-authentication-mechanism.md)** - Development Authentication Mechanism
- **[ADR-016](ADR-016-indieauth-client-discovery.md)** - IndieAuth Client Discovery
- **[ADR-017](ADR-017-oauth-client-metadata-document.md)** - OAuth Client Metadata Document
- **[ADR-018](ADR-018-indieauth-detailed-logging.md)** - IndieAuth Detailed Logging
- **[ADR-019](ADR-019-indieauth-correct-implementation.md)** - IndieAuth Correct Implementation
- **[ADR-021](ADR-021-indieauth-provider-strategy.md)** - IndieAuth Provider Strategy
- **[ADR-022](ADR-022-auth-route-prefix-fix.md)** - Auth Route Prefix Fix
- **[ADR-023](ADR-023-indieauth-client-identification.md)** - IndieAuth Client Identification
- **[ADR-024](ADR-024-static-identity-page.md)** - Static Identity Page
- **[ADR-025](ADR-025-indieauth-pkce-authentication.md)** - IndieAuth PKCE Authentication
- **[ADR-026](ADR-026-indieauth-token-exchange-compliance.md)** - IndieAuth Token Exchange Compliance
- **[ADR-027](ADR-027-indieauth-authentication-endpoint-correction.md)** - IndieAuth Authentication Endpoint Correction
| ADR | Title | Status | Summary |
|---|---|---|---|
| [001](ADR-001-python-web-framework.md) | Python Web Framework Selection | Accepted | Flask as the web framework. |
| [002](ADR-002-flask-extensions.md) | Flask Extensions and Dependencies | Accepted | A minimal dependency set; avoid Flask extensions where the standard library will do. |
| [003](ADR-003-frontend-technology.md) | Front-end Technology Stack | Accepted | Server-rendered Jinja2 templates with minimal client-side code. |
| [006](ADR-006-python-virtual-environment-uv.md) | Python Virtual Environment Management with uv | Accepted | uv manages the virtual environment and dependencies. |
| [008](ADR-008-versioning-strategy.md) | Versioning Strategy | Accepted | Semantic Versioning, PEP 440 compatible. |
| [009](ADR-009-git-branching-strategy.md) | Git Branching Strategy | Accepted | Simplified trunk-based development with feature branches and release tags. |
| [012](ADR-012-flaky-test-removal.md) | Flaky Test Removal and Test Quality Standards | Accepted | Remove the multiprocessing migration tests and fix brittle assertions (done in v1.5.0). |
| [015](ADR-015-phase-5-implementation-approach.md) | Phase 5 Implementation Approach | Accepted | Version jump 0.5.1 → 0.6.0 for Phase 5 (historical). |
| [051](ADR-051-phase1-test-strategy.md) | Phase 1 Test Strategy and Implementation Review | Accepted | Review of the v1.1.1 Phase 1 test approach (historical). |
### Error Handling & Core Features (ADR-012 to ADR-015)
- **[ADR-012](ADR-012-http-error-handling-policy.md)** - HTTP Error Handling Policy
- **[ADR-013](ADR-013-expose-deleted-at-in-note-model.md)** - Expose Deleted-At in Note Model
- **[ADR-014](ADR-014-rss-feed-implementation.md)** - RSS Feed Implementation
- **[ADR-015](ADR-015-phase-5-implementation-approach.md)** - Phase 5 Implementation Approach
### Storage and database
### Micropub & API (ADR-028 to ADR-029)
- **[ADR-028](ADR-028-micropub-implementation.md)** - Micropub Implementation
- **[ADR-029](ADR-029-micropub-indieauth-integration.md)** - Micropub IndieAuth Integration
| ADR | Title | Status | Summary |
|---|---|---|---|
| [004](ADR-004-file-based-note-storage.md) | File-Based Note Storage Architecture | Accepted | Note content in Markdown files under `data/notes/YYYY/MM/`, metadata in SQLite. |
| [013](ADR-013-expose-deleted-at-in-note-model.md) | Expose deleted_at Field in Note Model | Accepted | `deleted_at` on the Note dataclass for soft deletes. |
| [020](ADR-020-automatic-database-migrations.md) | Automatic Database Migration System | Accepted | Numbered SQL migrations applied at startup and tracked in a table. |
| [031](ADR-031-database-migration-system-redesign.md) | Database Migration System Redesign | Accepted | Baseline schema first, then migrations, so existing databases upgrade (implemented via ADR-032/033). |
| [032](ADR-032-initial-schema-sql-implementation.md) | Initial Schema SQL Implementation for Migration System | Accepted | `INITIAL_SCHEMA_SQL` holds the baseline schema. |
| [033](ADR-033-database-migration-redesign.md) | Database Migration System Redesign | Accepted | Frozen baseline schema; every later change only in migration files (v1.1.0). |
| [037](ADR-037-migration-race-condition-fix.md) | Database Migration Race Condition Resolution | Accepted | SQLite `BEGIN IMMEDIATE` lock with retries so several gunicorn workers don't migrate at once. |
| [041](ADR-041-database-migration-conflict-resolution.md) | Database Migration Conflict Resolution | Accepted | Handling a production database that fell into a migration edge case. |
### Database & Migrations (ADR-020, ADR-031 to ADR-037)
- **[ADR-020](ADR-020-automatic-database-migrations.md)** - Automatic Database Migrations
- **[ADR-031](ADR-031-database-migration-system-redesign.md)** - Database Migration System Redesign
- **[ADR-032](ADR-032-initial-schema-sql-implementation.md)** - Initial Schema SQL Implementation
- **[ADR-033](ADR-033-database-migration-redesign.md)** - Database Migration Redesign
- **[ADR-037](ADR-037-migration-race-condition-fix.md)** - Migration Race Condition Fix
- **[ADR-041](ADR-041-database-migration-conflict-resolution.md)** - Database Migration Conflict Resolution
See also [database architecture](../architecture/database.md).
### Search & Advanced Features (ADR-034 to ADR-036, ADR-038 to ADR-040)
- **[ADR-034](ADR-034-full-text-search.md)** - Full-Text Search
- **[ADR-035](ADR-035-custom-slugs.md)** - Custom Slugs
- **[ADR-036](ADR-036-indieauth-token-verification-method.md)** - IndieAuth Token Verification Method
- **[ADR-038](ADR-038-syndication-formats.md)** - Syndication Formats (ATOM, JSON Feed)
- **[ADR-039](ADR-039-micropub-url-construction-fix.md)** - Micropub URL Construction Fix
- **[ADR-040](ADR-040-microformats2-compliance.md)** - Microformats2 Compliance
### Notes, slugs, media and search
### Architecture Refinements (ADR-042 to ADR-044)
- **[ADR-042](ADR-042-versioning-strategy-for-authorization-removal.md)** - Versioning Strategy for Authorization Removal
- **[ADR-043](ADR-043-CORRECTED-indieauth-endpoint-discovery.md)** - CORRECTED IndieAuth Endpoint Discovery
- **[ADR-044](ADR-044-endpoint-discovery-implementation.md)** - Endpoint Discovery Implementation Details
| ADR | Title | Status | Summary |
|---|---|---|---|
| [062](ADR-062-timestamp-based-slug-format.md) | Timestamp-Based Slug Format | Accepted | Default slugs are `YYYYMMDDHHMMSS` timestamps (v1.5.0); replaces ADR-007. |
| [035](ADR-035-custom-slugs.md) | Custom Slugs in Micropub | Accepted* | Honour `mp-slug`, sanitized, with reserved names protected (v1.1.0). |
| [034](ADR-034-full-text-search.md) | Full-Text Search with SQLite FTS5 | Accepted | FTS5 search over note content (v1.1.0). |
| [057](ADR-057-media-attachment-model.md) | Media Attachment Model | Accepted | Social-media-style image attachments: up to 4 per note, ordered, with captions. |
| [058](ADR-058-image-optimization-strategy.md) | Image Optimization Strategy | Accepted | Upload limits, automatic resizing and size variants. |
### Major Architectural Changes (ADR-050 to ADR-051)
- **[ADR-050](ADR-050-remove-custom-indieauth-server.md)** - Remove Custom IndieAuth Server
- **[ADR-051](ADR-051-phase1-test-strategy.md)** - Phase 1 Test Strategy
### Feeds
### v1.1.1 Quality & Production Readiness (ADR-052 to ADR-055)
- **[ADR-052](ADR-052-configuration-system-architecture.md)** - Configuration System Architecture
- **[ADR-053](ADR-053-performance-monitoring-strategy.md)** - Performance Monitoring Strategy
- **[ADR-054](ADR-054-structured-logging-architecture.md)** - Structured Logging Architecture
- **[ADR-055](ADR-055-error-handling-philosophy.md)** - Error Handling Philosophy
| ADR | Title | Status | Summary |
|---|---|---|---|
| [014](ADR-014-rss-feed-implementation.md) | RSS Feed Implementation Strategy | Accepted* | RSS 2.0 feed; its WebSub deferral is superseded by ADR-071. |
| [038](ADR-038-syndication-formats.md) | Multiple Syndication Format Support | Accepted | RSS, Atom and JSON Feed side by side (v1.1.2). |
| [071](ADR-071-websub.md) | WebSub publishing with a built-in hub | Accepted | Built-in WebSub hub at `/websub` for StarPunk's own feeds (v2.10.0, amended v2.10.1). |
| [059](ADR-059-full-feed-media-standardization.md) | Full Feed Media Standardization (Option 3) | Proposed | Full Media RSS, podcasts, video and thumbnails in feeds; not scheduled. |
## ADRs by Topic
### IndieWeb: microformats, Webmention, Micropub
### Authentication & IndieAuth
ADR-005, ADR-010, ADR-011, ADR-016, ADR-017, ADR-018, ADR-019, ADR-021, ADR-022, ADR-023, ADR-024, ADR-025, ADR-026, ADR-027, ADR-036, ADR-043, ADR-044, ADR-050
| ADR | Title | Status | Summary |
|---|---|---|---|
| [040](ADR-040-microformats2-compliance.md) | Strict Microformats2 Compliance | Accepted | Full h-entry, h-card and h-feed markup (v1.3.0, reviewed v2.8.0). |
| [061](ADR-061-author-discovery.md) | Author Profile Discovery from IndieAuth | Accepted | The author h-card is read from `ADMIN_ME` and cached. |
| [063](ADR-063-webmention-implementation.md) | Webmention Implementation | Accepted | Async receiving (202) and sending via a background worker, SSRF guard, rate limits, moderation (v1.6.0, revised up to v2.10.1). *Reconstructed.* |
| [028](ADR-028-micropub-implementation.md) | Micropub Implementation Strategy | Accepted* | `/micropub` endpoint for creating posts (v1.0.0-rc.1); tokens now per ADR-064. |
| [039](ADR-039-micropub-url-construction-fix.md) | Micropub URL Construction Fix | Accepted | Fix the double slash in returned post URLs. |
| [067](ADR-067-micropub-update-delete.md) | Micropub update, delete, drafts and replies | Accepted | Micropub update, delete, drafts and replies (v2.4.0). |
| [068](ADR-068-likes-and-reposts.md) | Likes and reposts | Accepted* | `like-of` and `repost-of` posts (v2.5.0); bookmarks were added later in v2.9.0. |
### Database & Migrations
ADR-004, ADR-020, ADR-031, ADR-032, ADR-033, ADR-037, ADR-041
See also [IndieWeb protocols](../architecture/indieweb-protocols.md).
### API & Micropub
ADR-028, ADR-029, ADR-039
### Crossposting (POSSE)
### Content & Features
ADR-007, ADR-013, ADR-014, ADR-034, ADR-035, ADR-038, ADR-040
| ADR | Title | Status | Summary |
|---|---|---|---|
| [065](ADR-065-direct-syndication-posse.md) | Direct Syndication (POSSE) to GoToSocial | Accepted | Crosspost to GoToSocial/Mastodon-API servers from a background worker (v2.1.0). |
| [066](ADR-066-bluesky-syndication.md) | Crossposting to Bluesky | Accepted | Bluesky as a second crosspost target (v2.2.0). |
| [069](ADR-069-threads-syndication.md) | Crossposting to Threads | Accepted | Threads as a third target, with automatic token refresh (v2.6.0). |
| [070](ADR-070-crosspost-links-and-cards.md) | Links and link cards in crossposts | Accepted | Keep note links in crossposts and build link cards for the linked page (v2.6.3). |
### Development & Operations
ADR-001, ADR-002, ADR-003, ADR-006, ADR-008, ADR-009, ADR-012, ADR-015, ADR-042, ADR-051, ADR-052, ADR-053, ADR-054, ADR-055
### Authentication (current)
## Superseded ADRs
| ADR | Title | Status | Summary |
|---|---|---|---|
| [064](ADR-064-oidc-admin-login-and-builtin-indieauth-server.md) | OIDC Admin Login and Built-in IndieAuth Server | Accepted | Admin login via OIDC; StarPunk issues and verifies Micropub tokens itself (v2.0.0). |
| [010](ADR-010-authentication-module-design.md) | Authentication Module Design | Accepted* | Single `auth.py` module and server-side sessions; the login flow is now ADR-064. |
| [011](ADR-011-development-authentication-mechanism.md) | Development Authentication Mechanism | Accepted | `DEV_MODE` login bypass for local development only. |
| [022](ADR-022-auth-route-prefix-fix.md) | Fix IndieAuth Callback Route Mismatch | Accepted | Auth routes live under `/auth` (v0.9.2). |
These ADRs have been superseded by later decisions:
- **ADR-030** (old) - Superseded by ADR-043 (CORRECTED IndieAuth Endpoint Discovery)
### Operations, errors and monitoring
## How to Create a New ADR
| ADR | Title | Status | Summary |
|---|---|---|---|
| [012](ADR-012-http-error-handling-policy.md) | HTTP Error Handling Policy | Accepted | Correct HTTP status codes (e.g. 404 for missing notes) across routes. |
| [052](ADR-052-configuration-system-architecture.md) | Configuration System Architecture | Accepted | Environment variables with defaults, loaded in one module. |
| [053](ADR-053-performance-monitoring-strategy.md) | Performance Monitoring Strategy | Accepted | Built-in, standard-library performance metrics (v1.1.1). |
| [054](ADR-054-structured-logging-architecture.md) | Structured Logging Architecture | Accepted | Rotating log files with correlation IDs (v1.1.1). |
| [055](ADR-055-error-handling-philosophy.md) | Error Handling Philosophy | Accepted | Layered handling: graceful degradation, clear user messages, detailed logs. |
| [060](ADR-060-production-hotfix-metrics-dashboard.md) | Route Adapter for the Metrics Dashboard | Accepted | Adapt monitoring data to the dashboard template in the route (v1.1.1-rc.2). *Reconstructed.* |
See also [deployment](../architecture/deployment.md).
## Superseded decisions
Kept for history. Most concern the IndieLogin.com and external-IndieAuth
designs of v0.x–v1.6.0, all replaced by ADR-064 in v2.0.0.
| ADR | Title | Status | Summary |
|---|---|---|---|
| [005](ADR-005-indielogin-authentication.md) | IndieLogin Authentication Integration | Superseded by 064 | Admin login through indielogin.com. |
| [007](ADR-007-slug-generation-algorithm.md) | Slug Generation Algorithm | Superseded by 062 | Slugs from the first words of the note. |
| [016](ADR-016-indieauth-client-discovery.md) | IndieAuth Client Discovery Mechanism | Superseded by 019 | h-app markup for client discovery. |
| [017](ADR-017-oauth-client-metadata-document.md) | OAuth Client ID Metadata Document Implementation | Superseded by 019 | OAuth client metadata endpoint. |
| [018](ADR-018-indieauth-detailed-logging.md) | IndieAuth Detailed Logging Strategy | Superseded by 064 | Redacted HTTP logging of the IndieAuth login flow. |
| [019](ADR-019-indieauth-correct-implementation.md) | IndieAuth Correct Implementation Based on IndieLogin.com API | Superseded by 025 | Draft of the IndieLogin.com PKCE flow. |
| [021](ADR-021-indieauth-provider-strategy.md) | IndieAuth Provider Strategy | Superseded by 064 | Keep IndieLogin.com for admin login. |
| [023](ADR-023-indieauth-client-identification.md) | IndieAuth Client Identification Strategy | Superseded by 064 | Visible h-app in the footer. |
| [024](ADR-024-static-identity-page.md) | Static HTML Identity Pages for IndieAuth | Superseded by 064 | Standalone identity page pointing at indieauth.com. |
| [025](ADR-025-indieauth-pkce-authentication.md) | IndieAuth Correct Implementation Based on IndieLogin.com API | Superseded by 064 | IndieLogin.com authentication with PKCE. |
| [026](ADR-026-indieauth-token-exchange-compliance.md) | IndieAuth Token Exchange Compliance | Superseded by 064 | Token exchange parameters for the IndieAuth login. |
| [027](ADR-027-indieauth-authentication-endpoint-correction.md) | IndieAuth Authentication Endpoint Correction | Superseded by 064 | Use the authentication (not token) endpoint for login. |
| [029](ADR-029-micropub-indieauth-integration.md) | Micropub IndieAuth Integration Strategy | Superseded by 050, 064 | Built-in token endpoint for Micropub (v1.0.0-rc.1). |
| [030](ADR-030-external-token-verification-architecture.md) | External Token Verification Architecture | Superseded by 043, 064 | Verify Micropub tokens at a configured external endpoint. |
| [036](ADR-036-indieauth-token-verification-method.md) | IndieAuth Token Verification Method Diagnosis | Superseded by 064 | How to call the external token endpoint. |
| [042](ADR-042-versioning-strategy-for-authorization-removal.md) | Versioning Strategy for Authorization Server Removal | Accepted (historical) | Remove the authorization server in 1.0.0-rc.4 rather than in a later release. |
| [043](ADR-043-CORRECTED-indieauth-endpoint-discovery.md) | IndieAuth Endpoint Discovery Architecture | Superseded by 064 | Discover the token endpoint from `ADMIN_ME` to verify tokens. |
| [044](ADR-044-endpoint-discovery-implementation.md) | IndieAuth Endpoint Discovery Implementation Details | Superseded by 064 | Implementation details of ADR-043. |
| [050](ADR-050-remove-custom-indieauth-server.md) | Remove Custom IndieAuth Server | Superseded by 064 | Remove the built-in authorization and token server (done in v1.0.0-rc.4). |
| [056](ADR-056-no-selfhosted-indieauth.md) | Use External IndieAuth Provider (Never Self-Host) | Superseded by 064 | Never run an IndieAuth server in StarPunk. |
ADR-042 is listed here because it only matters together with ADR-050; it
was carried out and is not itself superseded.
## Numbering
- **Gap ADR-045 to ADR-049**: never used; no document or code refers to
them.
- **Two ADR-012 files**: `ADR-012-http-error-handling-policy.md` and
`ADR-012-flaky-test-removal.md` (added 2025-12-16). Both are cited as
plain "ADR-012": `starpunk/routes/admin.py` and early CHANGELOG entries
mean the error policy, `tests/test_migration_race_condition.py` means
the flaky-test one. Not renumbered, since other documents link to them.
- **Old numbers in headings**: several files were renumbered without
updating their first heading: ADR-037 and ADR-038 say "ADR-022",
ADR-040 says "ADR-023", ADR-042 says "ADR-027", ADR-044 says "ADR-031".
Older CHANGELOG entries use those old numbers ("ADR-022: Migration Race
Condition Fix" is ADR-037; "ADR-031: IndieAuth Endpoint Discovery" is
ADR-044). The file name is authoritative.
- **ADR-060** was deleted in the v1.1.1-rc.2 review and reconstructed on
2026-11-03 because code still cites it. ADR-059 also mentions a planned
"Option 2 (ADR-060)" for Media RSS that was never written.
- **ADR-063** was lost with the uncommitted v1.6.0 docs and reconstructed
on 2026-11-03.
- **ADR-064 used twice**: v1.6.0 code (`starpunk/rate_limiter.py`,
`starpunk/routes/webmention.py`) cites a lost "ADR-064: Webmention Rate
Limiting"; the number was reused in v2.0.0 for OIDC login. The rate-limit
decision is recorded in ADR-063, Decision 10.
## How to create a new ADR
1. Use the next number after the highest existing one (currently ADR-072).
2. Name it `ADR-NNN-brief-descriptive-title.md`.
3. Follow the format of recent ADRs (e.g. ADR-070, ADR-071):
1. **Find the next sequential number**: Check the highest existing ADR number
2. **Use the naming format**: `ADR-NNN-brief-descriptive-title.md`
3. **Follow the template**:
```markdown
# ADR-NNN: Title
## Status
Proposed | Accepted | Deprecated | Superseded
Accepted (vX.Y.Z, YYYY-MM-DD)
## Context
Why are we making this decision?
## Decision
What have we decided to do?
## Consequences
What are the positive and negative consequences?
## Alternatives Considered
What other options did we evaluate?
## Alternatives considered
```
4. **Update this index** with the new ADR
## Related Documentation
- **[../architecture/](../architecture/)** - Architectural overviews and system design
- **[../design/](../design/)** - Detailed design documents
- **[../standards/](../standards/)** - Coding standards and conventions
4. When a decision replaces an earlier one, change the earlier ADR's Status
to "Superseded by ADR-NNN" with a one-line note; don't rewrite its body.
5. Add the ADR to this index.
## Related documentation
- [../architecture/](../architecture/) — current system design
- [../design/](../design/) — per-version implementation designs
- [../standards/](../standards/) — coding and documentation standards
- [../../CHANGELOG.md](../../CHANGELOG.md) — what changed in each release
---
**Last Updated**: 2025-11-25
**Maintained By**: Documentation Manager Agent
**Total ADRs**: 55
**Last Updated**: 2026-11-03
**Total ADR files**: 67