feat: v1.2.0-rc.1 - IndieWeb Features Release Candidate

Complete implementation of v1.2.0 "IndieWeb Features" release.

## Phase 1: Custom Slugs
- Optional custom slug field in note creation form
- Auto-sanitization (lowercase, hyphens only)
- Uniqueness validation with auto-numbering
- Read-only after creation to preserve permalinks
- Matches Micropub mp-slug behavior

## Phase 2: Author Discovery + Microformats2
- Automatic h-card discovery from IndieAuth identity URL
- 24-hour caching with graceful fallback
- Never blocks login (per ADR-061)
- Complete h-entry, h-card, h-feed markup
- All required Microformats2 properties
- rel-me links for identity verification
- Passes IndieWeb validation

## Phase 3: Media Upload
- Upload up to 4 images per note (JPEG, PNG, GIF, WebP)
- Automatic optimization with Pillow
  - Auto-resize to 2048px
  - EXIF orientation correction
  - 95% quality compression
- Social media-style layout (media top, text below)
- Optional captions for accessibility
- Integration with all feed formats (RSS, ATOM, JSON Feed)
- Date-organized storage with UUID filenames
- Immutable caching (1 year)

## Database Changes
- migrations/006_add_author_profile.sql - Author discovery cache
- migrations/007_add_media_support.sql - Media storage

## New Modules
- starpunk/author_discovery.py - h-card discovery and caching
- starpunk/media.py - Image upload, validation, optimization

## Documentation
- 4 new ADRs (056, 057, 058, 061)
- Complete design specifications
- Developer Q&A with 40+ questions answered
- 3 implementation reports
- 3 architect reviews (all approved)

## Testing
- 56 new tests for v1.2.0 features
- 842 total tests in suite
- All v1.2.0 feature tests passing

## Dependencies
- Added: mf2py (Microformats2 parser)
- Added: Pillow (image processing)

Version: 1.2.0-rc.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-28 15:02:20 -07:00
parent 83739ec2c6
commit dd822a35b5
40 changed files with 6929 additions and 15 deletions

View File

@@ -0,0 +1,27 @@
-- Migration 006: Add author profile discovery table
--
-- Per ADR-061 and v1.2.0 Phase 2:
-- Stores author information discovered from IndieAuth profile URLs
-- Enables automatic h-card population for Microformats2 compliance
--
-- Features:
-- - Caches author h-card data from IndieAuth 'me' URL
-- - 24-hour TTL for cache freshness (per developer Q&A Q14)
-- - Graceful fallback when discovery fails
-- - Supports rel-me links for identity verification
-- Create author profile table
CREATE TABLE IF NOT EXISTS author_profile (
me TEXT PRIMARY KEY, -- IndieAuth 'me' URL (user identity)
name TEXT, -- h-card p-name
photo TEXT, -- h-card u-photo URL
url TEXT, -- h-card u-url (canonical)
note TEXT, -- h-card p-note (bio)
rel_me_links TEXT, -- JSON array of rel-me URLs
discovered_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
cached_until DATETIME NOT NULL -- 24-hour cache per Q&A Q14
);
-- Index for cache expiry checks
CREATE INDEX IF NOT EXISTS idx_author_profile_cache
ON author_profile(cached_until);

View File

@@ -0,0 +1,37 @@
-- Migration 007: Add media upload support
-- Per ADR-057: Social media attachment model
-- Per ADR-058: Image optimization strategy
-- Version: 1.2.0 Phase 3
-- Media storage table
-- Stores metadata for uploaded media files
CREATE TABLE IF NOT EXISTS media (
id INTEGER PRIMARY KEY AUTOINCREMENT,
filename TEXT NOT NULL, -- Original filename from upload
stored_filename TEXT NOT NULL, -- UUID-based filename on disk
path TEXT NOT NULL UNIQUE, -- Full path: media/YYYY/MM/uuid.ext
mime_type TEXT NOT NULL, -- image/jpeg, image/png, etc.
size INTEGER NOT NULL, -- File size in bytes
width INTEGER, -- Image width (pixels)
height INTEGER, -- Image height (pixels)
uploaded_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- Note-media junction table
-- Per Q4: Upload after note creation, associate via note_id
-- Per Q7: Caption support for accessibility
CREATE TABLE IF NOT EXISTS note_media (
id INTEGER PRIMARY KEY AUTOINCREMENT,
note_id INTEGER NOT NULL,
media_id INTEGER NOT NULL,
display_order INTEGER NOT NULL DEFAULT 0, -- Order for display (0-3)
caption TEXT, -- Alt text / accessibility
FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE,
FOREIGN KEY (media_id) REFERENCES media(id) ON DELETE CASCADE,
UNIQUE(note_id, media_id)
);
-- Indexes for performance
CREATE INDEX IF NOT EXISTS idx_media_uploaded ON media(uploaded_at);
CREATE INDEX IF NOT EXISTS idx_note_media_note ON note_media(note_id);
CREATE INDEX IF NOT EXISTS idx_note_media_order ON note_media(note_id, display_order);