Commit Graph

32 Commits

Author SHA1 Message Date
gilesb
e4fd5eb010 Integrate artdag cache with deletion rules
- Add cache_manager.py with L1CacheManager wrapping artdag Cache
- Add L2SharedChecker for checking published status via L2 API
- Update server.py to use cache_manager for storage
- Update DELETE /cache/{content_hash} to enforce deletion rules
- Add DELETE /runs/{run_id} endpoint for discarding runs
- Record activities when runs complete for deletion tracking
- Add comprehensive tests for cache manager

Deletion rules enforced:
- Cannot delete items published to L2
- Cannot delete inputs/outputs of runs
- Can delete orphaned items
- Runs can only be discarded if no items are shared

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:51:18 +00:00
gilesb
9a399cfcee Add clean URLs with content negotiation and pagination for L1
- Add content negotiation (HTML for browsers, JSON for APIs)
- Clean URLs: /runs, /cache, /run/{id}, /cache/{hash}/detail
- Auth routes: /login, /logout, /register with clean URLs
- Add render_page() helper for consistent page layout
- Add infinite scroll pagination for HTML views
- Add API pagination with ?page=1&limit=20
- Redirect old /ui/* routes to clean URLs
- Update nav links to use clean URLs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 22:55:44 +00:00
gilesb
b2e4f81edf Add cache pinning and discard functionality
- Pin items when published (published, input_to_published)
- Discard endpoint (DELETE /cache/{hash}) refuses pinned items
- UI shows pin status and discard button on cache detail
- Run publish also pins output and all inputs for provenance

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 21:36:52 +00:00
gilesb
a3a37c568a Add metadata editing UI to cache detail page
- Added /ui/cache/{hash}/meta-form endpoint for HTMX form
- Origin selector (self vs external URL)
- Description and tags fields
- Publish to L2 with asset name
- Update on L2 for already-published items

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 21:22:48 +00:00
gilesb
5f58bf117e Increase L2 publish timeout to 30 seconds
L2 needs to call back to L1 to fetch run details, which can take
longer than 10 seconds especially with network latency.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 21:13:44 +00:00
gilesb
3436a22a94 Fix iOS video playback in list views
Use video_src_for_request() for iOS MP4 transcoding in:
- ui_runs partial
- ui_cache_list partial
- ui_run_partial (also added request parameter)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 20:58:40 +00:00
gilesb
1e95badddb Update UI to use Tailwind CSS with dark theme
- Replace custom CSS with Tailwind CSS via CDN
- Consistent dark theme across all pages
- Responsive layouts with mobile-friendly breakpoints
- Updated: home, login/register, runs list, cache list, run detail, cache detail
- Modern card-based UI with hover states and status badges

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 20:44:11 +00:00
gilesb
a5187c0f45 feat: iOS video support with on-the-fly MKV→MP4 transcoding
- Add /cache/{hash}/mp4 endpoint that transcodes MKV to MP4
- First request transcodes (using ffmpeg), result cached as {hash}.mp4
- Subsequent requests serve cached MP4 directly
- Detect iOS devices and use MP4 endpoint for video src
- Works with Cloudflare caching for efficiency

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 20:04:30 +00:00
gilesb
809d8e452b fix: add playsinline for iOS video support
iOS Safari requires playsinline attribute for inline video playback.

Note: MKV videos still won't play on iOS - only MP4/H.264 is supported.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 19:57:27 +00:00
gilesb
f9e22171de feat: add L1_PUBLIC_URL config for many-to-many L1/L2 support
- Add L1_PUBLIC_URL environment variable
- UI publish sends L1 URL to L2 so it knows where to fetch run data
- Update .env.example with new config

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 19:40:59 +00:00
gilesb
917146a7f3 feat: add publish to L2 button in run detail web UI
- Add POST /ui/publish-run/{run_id} endpoint for UI publishing
- Add publish form with HTMX to run detail page
- Shows publish button for completed runs with outputs
- Uses existing L2 /registry/record-run endpoint

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 19:12:46 +00:00
gilesb
85f349a7ab feat: add L1-L2 publish integration endpoints
- Add POST /cache/{hash}/publish to publish cache items to L2
- Add PATCH /cache/{hash}/republish to sync metadata updates
- Validates origin is set before publishing
- Tracks publish status in cache metadata (to_l2, asset_name, timestamps)
- Forwards auth token to L2 for authentication

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 19:08:03 +00:00
gilesb
bfa7568db4 feat: add cache metadata, folders, and collections API
- Update save_cache_meta() to support updates (not just create)
- Add GET/PATCH /cache/{hash}/meta endpoints for metadata management
- Add user data storage for folders/collections (per-user .json files)
- Add folder CRUD endpoints (/user/folders)
- Add collection CRUD endpoints (/user/collections)
- Add cache list filtering by folder, collection, and tags
- Support origin tracking (self vs external URL)
- Support tags, description, and organization metadata

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 18:57:38 +00:00
gilesb
0cbfd87711 feat: per-user cache visibility and login protection
- Run detail page requires login and ownership check
- Cache uploads require login and track uploader metadata
- Cache list filtered to show only user's own files (uploaded or from runs)
- Cache detail view requires login and ownership check
- Add helper functions for cache metadata and user hash lookup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 18:18:16 +00:00
gilesb
e01db2ed26 fix: require login to view runs and cache in UI
- Runs list now requires login, shows only user's own runs
- Cache list now requires login to view

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 18:02:34 +00:00
gilesb
fb354d8afe fix: match both username formats in runs filter
Filter now matches both plain username and ActivityPub format
(@user@domain) to support runs created before and after the
actor ID change.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 17:56:54 +00:00
gilesb
0b50f5ea95 feat: add cache browsing UI with tabs for runs and cache
- Add tabbed navigation between Runs and Cache views
- Add /ui/cache-list endpoint to list cached files with thumbnails
- Show media type, file size, and preview for each cached item
- Sort cache items by modification time (newest first)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 17:41:55 +00:00
gilesb
618e3b1e04 feat: enhance provenance with infrastructure, actor ID, and commit tracking
- Add infrastructure field to RunStatus model
- Store infrastructure (software/hardware) from task result
- Format username as ActivityPub actor ID (@user@domain)
- Display owner, effects commit, and infrastructure in UI provenance section
- Add artdag commit tracking for identity effect
- Include infrastructure in raw JSON provenance

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 17:26:07 +00:00
gilesb
c7ee59968a fix: identity effect links to GitHub, others to rose-ash
- Identity effect is part of artdag package on GitHub
- Other effects (dog) link to rose-ash effects repo with commit hash
- Added effect_url field to RunStatus for proper URL storage
- Extract repo_url from provenance instead of building it

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:55:59 +00:00
gilesb
631571ed88 feat: add authentication to L1 server
- Runs require auth token (verified with L2)
- Store username with each run
- UI login/register/logout via L2
- Filter runs by logged-in user
- Cookie-based auth for UI

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:43:56 +00:00
gilesb
0c7e43e069 feat: link effect to specific git commit for provenance
- Capture effects repo commit hash at render time
- Store effects_commit in run record
- Effect URLs now link to exact commit, not main branch
- Include commit in raw JSON provenance

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:29:40 +00:00
gilesb
5f7b6c3031 feat: show raw provenance JSON on detail page
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:24:29 +00:00
gilesb
62891f57fe feat: add cache view page with media display
- /ui/cache/{hash} shows image/video inline
- File details: hash, type, size
- Download button
- All cache links now go to view page

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:23:42 +00:00
gilesb
30050f7a65 style: left-justify layout, increase text sizes
- Runs/cards max-width 900px, left-aligned
- Media boxes left-justified, max 400px each
- Increased font sizes throughout

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:20:38 +00:00
gilesb
c03a26dbf2 feat: add detail page with provenance and linkable hashes
- Click run to see full detail page
- Effect name links to git.rose-ash.com source
- Input/output hashes link to cache downloads
- Full provenance: effect, inputs, output, timestamps

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:18:44 +00:00
gilesb
73908b318d feat: responsive side-by-side input/output layout
- Desktop: input left, output right
- Mobile (<600px): stacked vertically

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:15:32 +00:00
gilesb
dc9c13ffd9 feat: add HTML home page with nav to UI and docs
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:13:56 +00:00
gilesb
56d6f53695 feat: show input media in UI
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:12:40 +00:00
gilesb
5fbe9cbc45 feat: add HTMX web UI for viewing runs and results
- /ui endpoint shows runs list
- Auto-detects image vs video content
- HTMX polling for running jobs
- Dark theme

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:06:07 +00:00
gilesb
7adb63face feat: add file upload endpoint for remote cache 2026-01-07 12:57:09 +00:00
gilesb
8850ada3be feat: Docker support for L1 server
- Dockerfile for L1 server/worker
- docker-compose.yml with Redis
- Environment variables for Redis URL and cache dir

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 12:04:47 +00:00
gilesb
ba20c2dc63 feat: L1 server with persistent run storage
- FastAPI server on port 8100
- POST /runs to start rendering jobs
- GET /runs/{id} to check status
- Cache and run persistence in Redis
- Auto-generated API docs at /docs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 10:45:30 +00:00