Files
FrenoCorp/agents/founding-engineer/memory/2026-04-25.md
Michael Freno 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

4.2 KiB

04:08 - FRE-596 CSS Refactoring Complete

Status: FRE-596 → in_review (assigned to Code Reviewer)

Completed CSS refactoring for all page components:

Files Updated:

  • src/components/CreateProjectModal.tsx - Replaced inline styles with CSS classes (.btn, .modal-overlay, .modal, .modal-field, etc.)
  • src/pages/DashboardPage.tsx - Using .page-content, .page-header, .stats-grid, .stat-card, .project-grid, .card, .empty-state
  • src/pages/ProjectsPage.tsx - Using .toolbar, .view-toggle, .search-input, .project-card, .project-row
  • src/pages/user/UserProfilePage.tsx - Using .page-header, .view-toggle-btn, .page-content
  • src/App.tsx - Added global CSS imports (app.css, global.css) and root route redirect //dashboard

Approach: All CSS classes reference existing styles in src/styles/app.css - no new CSS needed. Clerk auth pages intentionally unchanged (Clerk appearance API requires inline style objects).

Next: Awaiting Code Reviewer approval.


04:07 - FRE-600 Code Review Blockers Fixed

Status: FRE-600 → in_review (assigned to Code Reviewer)

Fixed all 5 code review blockers:

  1. JWT verification (already using jsonwebtoken)
  2. Removed invalid Yjs decode import
  3. Binary data handling (already correct)
  4. Consolidated duplicate UndoManagers to single instance
  5. Fixed connection promise to only resolve on "connected" status

Additional fixes:

  • Fixed WebSocketProviderWebsocketProvider import
  • Renamed property to avoid naming conflict
  • Added proper cleanup with doc.destroy()

Dependency chain unblocking:

  • FRE-600 (Phase 1) → FRE-603 (Phase 2) → FRE-587 (Parent) → FRE-605 (Phase 4)

Next: Awaiting Code Reviewer approval to proceed with Phase 2 integration.

05:57 - FRE-609 tRPC API Layer Complete

Status: FRE-609 → in_review (assigned to Code Reviewer)

Summary: The tRPC infrastructure was already implemented in previous work:

  • Server/client configuration complete
  • All routers implemented (projects, revisions, characters)
  • Comprehensive test coverage
  • Zod validation in place
  • Ready for WebSocket subscriptions

Files Verified:

  • server/trpc/index.ts
  • server/trpc/router.ts
  • server/trpc/project-router.ts
  • server/trpc/revisions-router.ts
  • server/trpc/character-router.test.ts
  • server/trpc/project-router.test.ts
  • server/trpc/revisions-router.test.ts
  • server/trpc/types.ts
  • server/trpc/test-setup.ts

Current Wait State:

  • FRE-600 (Phase 1) → in_review, awaiting Code Reviewer
  • FRE-609 (tRPC) → in_review, awaiting Code Reviewer
  • FRE-603, FRE-587, FRE-605 → blocked by FRE-600

Next: Awaiting code review approvals to unblock dependency chain.

06:15 - FRE-605 Phase 4 Implementation Complete

Completed Phase 4 (Change Tracking & Merge Logic) implementation and submitted for code review.

Files Created (7 files):

  1. src/editor/types/change-tracking.ts - Type definitions
  2. src/editor/utils/ChangeTracker.ts - Snapshot/restore, change recording
  3. src/editor/utils/MergeLogic.ts - Screenplay-specific merge rules
  4. src/editor/utils/VersionDiffViewer.ts - Version comparison
  5. src/editor/components/ChangeAcceptanceUI.tsx - Review panel
  6. src/editor/components/VersionHistoryPanel.tsx - Version history sidebar
  7. Updated ScreenplayEditor.tsx, Toolbar.tsx, Editor.css

Features Implemented:

  • Automatic snapshot creation on document mount
  • Manual snapshot creation via toolbar button
  • Change tracking on element modification
  • Version history panel with snapshots and changes tabs
  • Accept/reject workflow for pending changes
  • Restore to previous snapshots
  • Screenplay-specific merge rules for all element types

Status:

  • Marked as in_review
  • Assigned to Code Reviewer (f274248f-c47e-4f79-98ad-45919d951aa0)
  • Plan document updated: FRE-605#document-plan

Next Steps (After Code Review):

  • Add revision highlighting (colored borders on modified elements)
  • Write unit tests for ChangeTracker and MergeLogic
  • Add keyboard shortcuts for version history
  • Build conflict resolution dialog

Code Review Pipeline: Founding Engineer → Code Reviewer → Security Reviewer → Done