242 Commits

Author SHA1 Message Date
ec215ae426 Implement waitlist landing page FRE-656
- Add waitlist tRPC router with signup mutation and count query
- Add referral code generation and tracking
- Register waitlist router in app router
- Add useWaitlistSignup, useWaitlistCount, useReferralCount hooks
- Update landing page with email capture form, live waitlist counter, referral sharing
- Add waitlist and referral CSS styles

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-26 07:57:29 -04:00
11a188c68e FRE-623: Build KPI dashboard with Mixpanel, GA4, Stripe panels and unified report
- Created KPIDashboard component with tab navigation (product/acquisition/revenue/report)
- Created MixpanelPanel for product KPIs linking to Mixpanel
- Created GA4Panel for acquisition KPIs linking to GA4
- Created StripePanel for revenue KPIs linking to Stripe dashboard
- Created UnifiedReport with KPI thresholds table and reporting schedule
- Added KPI dashboard route (/app/kpi) and sidebar navigation link
- Added KPI dashboard CSS styles (metric cards, tabs, table, info cards)
- Fixed pre-existing parse errors in Faq.tsx (unescaped apostrophes)
- Fixed pre-existing CSS import paths in routes.tsx

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-26 07:56:17 -04:00
c9052a1fb0 FRE-651: Update daily memory with CEO actions taken 2026-04-26 07:43:03 -04:00
5f4eb60a98 FRE-651: CEO coordination notes for founder bio/headshot assets 2026-04-26 07:41:45 -04:00
3d5ff8650c Document FRE-645 waitlist schema completion
The waitlist/leads database schema was already implemented
and migrated in 0002_chemical_shocker.sql.

Created plan document at plans/FRE-645-waitlist-schema.md
with schema documentation and usage examples.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-26 06:36:17 -04:00
a638b23c85 Add waitlist seed data to seed script (FRE-645) 2026-04-26 06:34:39 -04:00
67c3881dcf Add waitlist schema for marketing (FRE-635)
- Created waitlist_signups and waitlist_events tables
- Supports email, name, source tracking, and status management
- Enables VIP supporter list for Product Hunt launch
- Migration 0002_chemical_shocker.sql generated
- Fixed brand color in product-hunt-assets-brief.md (#518ac8)
2026-04-26 06:21:20 -04:00
ce1ba395c7 Update FRE-574: Foundation complete
- FRE-607, FRE-608, FRE-609 all done (Clerk, Turso, tRPC)
- FRE-587 unblocked and in_progress (real-time collaboration)
- MVP progress: 7/13 complete (54%)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 14:11:45 -04:00
1d39be2446 fix: resolve all collaboration layer test failures for FRE-605
- Fix snapshot restore to properly copy text and map content from Yjs docs
- Fix concurrent edit sync to use delta-based updates instead of full state
- Fix delete operation test with correct position offset
- Add selection and lastActive fields to CursorPosition interface
- Fix updateSelection to propagate selection to cursor object
- Fix idle detection test by manually setting lastActivityTime
- Fix batcher test expectations for auto-flush behavior
- Fix undo/redo test with correct captureTimeout setting

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 10:24:14 -04:00
Paperclip
14b78273f9 FRE-605: Fix Phase 4 tests and improve snapshot restore
- Fix validateMerge test: seed document with content before validation
- Fix IDB persistence test: remove browser-only code from Node.js test
- Improve restoreSnapshot: replace document state entirely instead of additive merge
2026-04-25 09:27:18 -04:00
4435a12dd7 feat: integrate tRPC client with Clerk authentication
- Update trpc-client.ts with auth token management
- Create comprehensive tRPC hooks for all project operations
- Store Clerk session token in localStorage for API auth
- Clear token on sign out
- Support integer IDs matching backend schema

Hooks created:
- Projects: useProjects, useProject, useCreateProject, useUpdateProject, useDeleteProject
- Characters: useCharacters, useCharacter, useCreateCharacter, useUpdateCharacter, useDeleteCharacter
- Relationships: useRelationships, useCharacterRelationships, useCreateRelationship, useUpdateRelationship, useDeleteRelationship
- Scenes: useScenes, useScene, useCreateScene, useUpdateScene, useDeleteScene
- Stats: useCharacterStats, useProjectCharacterStats

All 34 backend tests passing.
2026-04-25 08:31:05 -04:00
754fce269f fix: implement critical security remediation for authentication and authorization
- Add Clerk token verification to tRPC context (server/trpc/index.ts)
- Remove client-controlled authorId/reviewedById from revisions router
- Require JWT_SECRET environment variable, remove hardcoded fallback
- Add table name validation to prevent SQL injection in backup logic
- Fix TRPCContext type to use better-sqlite3 instead of LibSQL
- Update revisions router tests to use proper tRPC v11+ API
- Add resetInMemoryState function for test isolation

Security fixes address:
- Critical: Authentication bypass via missing token verification
- Critical: User impersonation via client-controlled IDs
- High: Insecure WebSocket defaults with hardcoded secrets
- High: SQL injection vulnerability in backup logic

All tests passing (24/24).
2026-04-25 08:24:45 -04:00
bbf6ee2c51 Document FRE-625 liveness incident follow-up FRE-625 2026-04-25 08:08:04 -04:00
936430fb40 FRE-587 Phase 5: Add integration tests - COMPLETE
Phase 5 Polish & Optimization - COMPLETE:

Integration Tests (collaboration.test.ts - 440 lines):
- Multi-user sync flow tests
- Change tracking integration tests
- Merge logic integration tests
- Presence integration tests
- Persistence integration tests
- Performance integration tests
- End-to-end collaboration scenario tests
- Edge case tests (rapid updates, large docs, disconnection, undo/redo)

Coverage:
- 15+ test suites
- 25+ individual tests
- Tests all collaboration layer components
- Browser and Node.js compatible

Phase 5 Summary:
 IndexedDB persistence
 Change highlighting UI
 Version history panel
 WebSocket message batching
 Performance benchmarking
 Conflict detection alerts
 Integration tests

Files Created:
- src/lib/collaboration/collaboration.test.ts (440 lines)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 02:32:50 -04:00
e47debc2d7 FRE-587 Phase 5: Add performance optimization + conflict alerts
Phase 5 Polish & Optimization - Part 2:

Performance Optimization:
- Create UpdateBatcher class for WebSocket message batching
  - Batches multiple Yjs updates into single messages
  - Configurable batch size (default: 10) and wait time (default: 50ms)
  - Reduces network overhead significantly
  - Tracks statistics (updates sent, batches sent, avg batch size)

Benchmarking:
- Create CollaborationBenchmark class
  - Measures sync latency with percentile stats (p50, p95, p99)
  - Tracks memory usage (heap used/total)
  - Operation timing utilities
  - JSON export for analysis

UI Components:
- ConflictDetectionAlerts component - toast notifications for conflicts
  - Real-time conflict notifications
  - Three resolution options (Keep Mine, Accept Theirs, Review)
  - Auto-dismiss after 10 seconds (configurable)
  - Expandable for multiple conflicts
  - Color-coded by conflict type

Files Created:
- src/lib/collaboration/update-batcher.ts (130 lines)
- src/lib/collaboration/benchmark.ts (200 lines)
- src/components/collaboration/conflict-alerts.tsx (280 lines)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 02:28:07 -04:00
8c64318b9a FRE-587 Phase 5: Add offline persistence + UI components
Phase 5 Polish & Optimization - Part 1:

Offline Persistence:
- Create IDBPersistence class for IndexedDB storage
- Auto-save with configurable intervals (default 5s)
- Offline mode with update queuing
- Automatic flush when back online

UI Components:
- ChangeHighlighting component - visual change indicators
  - Color-coded by user
  - Auto-fade after 30s
  - Toggle visibility
- VersionHistoryPanel component - snapshot management
  - Chronological snapshot list
  - Relative timestamps
  - One-click restore
  - Manual snapshot creation

Documentation:
- analysis/fre587_phase5_polish_implementation.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 02:24:22 -04:00
ee7fb7ed12 FRE-603: Fix code review blockers (memory leak + auth security)
Blocker 1 - Memory Leak in Event Handlers:
- Store event handlers as class properties (arrow functions)
- Ensure initialize() and shutdown() use same references
- Prevents handler accumulation on reconnect cycles

Blocker 2 - Auth Token Security:
- Remove token from URL query parameters
- Send auth token via Yjs awareness state after connection
- Token no longer exposed in server/proxy logs or browser history

Files Modified:
- src/lib/collaboration/presence-manager.ts
- src/lib/collaboration/websocket-connection.ts

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 02:20:06 -04:00
298b2f5151 FRE-603: Fix code review blockers (memory leak + auth security)
- Fixed memory leak in PresenceManager: event handlers now use bound methods
  so they can be properly removed in shutdown()
- Removed auth token from URL query parameters (security: prevents token leakage
  to server logs and browser history)
- Fixed TypeScript errors: corrected WebsocketProvider import, removed unsupported
  send() calls, fixed type mismatches in presence callbacks
- All collaboration module files now type-check successfully

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 02:19:33 -04:00
b89575fb6e FRE-605: Implement Phase 4 Change Tracking & Merge Logic
- Create ChangeTracker class with full version history support
  - Document change recording with metadata
  - Snapshot creation and restoration
  - Change acceptance/rejection workflow
  - Change diff generation between snapshots
  - Event-based change notifications

- Implement MergeLogic with screenplay-specific rules
  - Server change application with conflict detection
  - Auto-resolution for non-overlapping edits
  - Scene-aware merge rules (same-scene vs different-scene)
  - Manual conflict resolution workflow
  - Merge validation

- Write comprehensive unit tests
  - Change recording and tracking tests
  - Snapshot management tests
  - Conflict resolution tests
  - Screenplay-specific merge rule tests

- Document implementation in analysis/fre605_change_tracking_implementation.md

Architecture: ChangeTracker integrates with Yjs document updates.
MergeLogic applies screenplay-specific rules for concurrent edits.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 02:14:54 -04:00
7c684a42cc FRE-600: Fix code review blockers
- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-25 00:08:01 -04:00
65b552bb08 Complete FRE-574 technical specifications
- Marked FRE-574 as done
- Unblocked FRE-588 (Database schema)
- All 12 child issues assigned to Founding Engineer
- 6/13 MVP subtasks complete (46%)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 18:07:15 -04:00
da0b3a4997 FRE-606: Add icon generation and tests for Tauri desktop
- Add generate-icons.sh script for cross-platform icon generation
- Generate all required icon sizes (32x32, 128x128, 256x256, 512x512)
- Create Windows .ico and macOS .icns icons
- Add Rust unit tests for core functionality
- Add tauri:test and tauri:icons npm scripts

New files:
- src-tauri/generate-icons.sh
- src-tauri/icons/32x32.png
- src-tauri/icons/128x128.png
- src-tauri/icons/128x128@2x.png
- src-tauri/icons/512x512.png
- src-tauri/icons/icon.ico
- src-tauri/icons/icon.icns
- src-tauri/icons/src/app-icon.svg
- src-tauri/icons/tray-icon.png
- src-tauri/src/tests.rs

Modified:
- src-tauri/src/lib.rs (added tests module)
2026-04-24 16:08:07 -04:00
36f9b420f5 FRE-608: Add Turso database setup with Drizzle ORM
- Create schema for users, projects, scripts, characters, scenes, revisions
- Implement DatabaseManager with connection pooling
- Implement EdgeDatabaseManager for multi-region replicas
- Implement DatabaseBackupManager with automated scheduling
- Generate initial migration with 9 tables
- Add seed script and documentation
- Configure Drizzle Kit for migration management
- Add NPM scripts for database operations

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 15:41:03 -04:00
0ba20e5b31 FRE-592: Fix 4 code review blockers (security + correctness)
- Add project ownership verification to relationship mutations (createRelationship,
  updateRelationship, deleteRelationship, getRelationshipsForCharacter)
- Add project ownership verification to getCharacter and getScene
- Add ownership check to projectProcedure middleware (hasProjectAccess)
- Fix searchCharacters filter combination bug (accumulate conditions instead of
  overwriting)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 10:13:49 -04:00
79d153f75a FRE-592: Fix remaining code review blockers and add tests
- Replace in-memory Maps with Drizzle ORM queries for all CRUD operations
- Use integer IDs matching SQLite schema instead of UUIDs
- Fix scriptId to projectId inconsistency in characters and scenes
- Add project ownership verification on all mutation procedures
- Make getCharacter/getScene procedures protected (not public)
- Proper JWT-based userId validation via context
- Add cascade delete for characters/relationships/scenes on project deletion
- Add verifyProjectOwnership helper for authorization checks
- Rewrite tests with createCallerFactory pattern for tRPC v11
- Use better-sqlite3 for in-memory test database
- Split vitest config into separate file from vite config
2026-04-24 08:31:42 -04:00
4d9b4ecf2a FRE-592: Address code review feedback
Fixes from review:
- Add DB-level unique constraint on character relationships
- Fix character stats to use sceneCharacters join table instead of text matching
- Add loading/error states to CharacterList, CharacterSearch, CharacterStatsPanel
- Add delete confirmation dialogs to CharacterProfile and CharacterRelationships

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 07:23:50 -04:00
ccbf3039d9 FRE-594: Implement revision tracking and version history system
Add complete revision tracking system for scripts with:
- Database schema for revisions and revision_changes tables
- Diff engine with color-coded change types (addition/deletion/modification)
- tRPC router with 14 endpoints (create/list/compare/rollback/branch/merge)
- SolidJS components: RevisionTimeline, DiffViewer, RevisionReview
- Unit tests for diff engine and router

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 05:54:06 -04:00
FrenoCorp Agent
8dc4827597 FRE-592: Implement character database and relationship mapping
Add full character management system with enriched profiles (bio, traits,
arcs, motivation, conflict, secrets), relationship mapping between
characters with types and strength, character search/filter by role and
arc type, and character statistics (scene count, dialogue, screen time).

Includes database schema, tRPC router procedures, SolidJS components,
API hooks, and unit tests.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 02:24:31 -04:00
0fcd91cf87 FRE-606: Add Tauri desktop framework with cross-platform support
- Configure Tauri v2 for macOS, Windows, Linux
- Implement native menu bar (File, Edit, View, Window, Help)
- Add system tray with show/hide/quit functionality
- Create auto-updater framework with periodic checks
- Set up window state persistence
- Configure plugins (fs, http, dialog, shell, store)
- Add build scripts for all platforms
- Include comprehensive documentation

Files:
- src-tauri/Cargo.toml
- src-tauri/tauri.conf.json
- src-tauri/build.rs
- src-tauri/src/main.rs
- src-tauri/src/lib.rs
- src-tauri/src/menu.rs
- src-tauri/src/tray.rs
- src-tauri/src/updater.rs
- src-tauri/Cargo.lock
- src-tauri/icons/tray-icon.svg
- src-tauri/tauri.build.conf
- src-tauri/README.md
- .gitignore
- package.json (Tauri CLI scripts)
2026-04-23 22:29:22 -04:00
Senior Engineer
adf453e245 FRE-586: Add core screenplay editor with auto-formatting engine
- types.ts: Screenplay element types, template configs, and interfaces
- format.ts: Auto-formatting engine with Standard, Sitcom, Podcast templates
- detect.ts: Element detection (scene headings, transitions, characters, parentheticals)
- ScreenplayEditor.tsx: Editor component with keyboard shortcuts and live formatting
- PreviewPanel.tsx: Real-time formatting preview panel
- detect.test.ts: 19 tests for element detection
- format.test.ts: 15 tests for formatting engine and templates
- Fixed transition regex to handle periods and other terminators
- All 34 tests passing
2026-04-23 07:42:58 -04:00
1c74a082e5 FRE-603: Add Presence & Visibility Layer UI components
- CollaboratorList: Display connected users with presence state
- RemoteCursorOverlay: Render remote cursors in editor
- EditingIndicator: Show active editors and their context
- Component index for clean imports
- Tests for CollaboratorList

Architecture:
- Polling-based presence updates (100ms for cursors, 500ms for editors)
- Color-coded user indicators
- Line:column cursor positioning
- Selection highlighting with transparency

Files:
- src/components/collaboration/collaborator-list.tsx
- src/components/collaboration/remote-cursor-overlay.tsx
- src/components/collaboration/editing-indicator.tsx
- src/components/collaboration/index.ts
- src/components/collaboration/collaborator-list.test.tsx

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-23 06:37:21 -04:00
ef1b15c9ea FRE-600: Implement Phase 1 WebSocket + Yjs CRDT foundation
- Create TypeScript and Vite configuration for SolidJS
- Implement Yjs document structure for screenplay collaboration
- Build WebSocket connection manager with exponential backoff reconnection
- Create CRDT document manager with undo/redo support
- Set up WebSocket sync server with JWT authentication
- Add SolidJS reactive bindings for Yjs shared types
- Build collaborative editor component
- Write unit tests for CRDT operations
- Document implementation in analysis/fre600_websocket_foundation.md

Architecture: Yjs chosen over Automerge for better ecosystem and
Tauri compatibility. WebSocket for sync, WebRTC for video.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-22 23:08:27 -04:00
6cf6858b1c FRE-574: Complete technical evaluation for WriterDuet competitor
- Validated tech stack (Tauri + SolidJS + TypeScript, Clerk, Turso, tRPC)
- Created 8 child issues to break down MVP work (FRE-586 through FRE-596)
- Defined technical KPIs (startup <2s, sync <100ms, coverage >80%)
- Timeline assessment: 6-month MVP is tight but achievable

Next: Assign child issues to Founding Engineer for execution.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-22 22:13:19 -04:00
3a31689f49 FRE-573: WriterDuet competitor plan with feature matrix, pricing analysis, and technical/marketing expectations for CTO and CMO 2026-04-22 21:16:47 -04:00
ea574c8257 Auto-commit 2026-04-02 12:59 2026-04-02 12:59:03 -04:00
ca55a64366 april fools ya goof 2026-04-01 15:43:42 -04:00
62f6157f43 drop skills from here 2026-03-31 14:06:06 -04:00
a8e6328d36 some plans and such 2026-03-29 09:15:40 -04:00
f37c4c28e2 drop memory 2026-03-24 21:32:08 -04:00
863a3d3fd3 moving things to specific repos 2026-03-22 19:20:43 -04:00
53082e4afd Draft Terms of Service document for Lendair platform FRE-483
- 22 sections: user accounts, loans, fees, collections, arbitration
- Platform fee: 1% lender origination, 2% borrower transaction
- Late fee:  or 5% after 5-day grace; default at 90 days
- Delaware law, binding arbitration, class action waiver
- Full risk disclosures for peer-to-peer lending
2026-03-22 18:16:59 -04:00
d0c0f98acb Add AI features scoping plan for Lendair
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 12:58:16 -04:00
86d309b5cc Update daily notes: break down FRE-449 into 6 implementation subtasks
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 01:59:06 -04:00
f6adc09d88 note for status setting 2026-03-20 12:11:53 -04:00
0b43b7158b memory reset 2026-03-20 07:56:52 -04:00
46433ab505 remove nessa specifics 2026-03-20 07:56:09 -04:00
74772039d4 Auto-commit 2026-03-19 17:07 2026-03-19 17:07:57 -04:00
ce3c8e020a agents: add Nessa codebase workflow instructions to all engineer agents 2026-03-19 16:37:05 -04:00
4abc47cd00 bit more clarity 2026-03-19 09:50:28 -04:00
d27d2680ca additional note to help nudge 2026-03-19 09:13:59 -04:00