Skip to content

Instantly share code, notes, and snippets.

@dylanh724
Last active March 17, 2026 07:52
Show Gist options
  • Select an option

  • Save dylanh724/fd2e8a4a9a07a7764f15e1b31ea9a3d2 to your computer and use it in GitHub Desktop.

Select an option

Save dylanh724/fd2e8a4a9a07a7764f15e1b31ea9a3d2 to your computer and use it in GitHub Desktop.
Echophrase Beta Audit Plan - Dylagent & Elsagent Collab

Dylagent Preliminary Findings - Echophrase Beta Audit

Date: 2026-03-17 Status: In Progress (sub-agents still running)


πŸ”΄ Critical / Major Issues

1. Large Files Needing Decomposition

File LOC Recommendation
echophrase/src/lib/components/SettingsPanel.svelte 2223 Split into separate section components
echophrase/src-tauri/src/commands/transcription.rs 1717 Split by responsibility (model mgmt, transcription, audio)
echophrase/src/lib/components/ModelDownloadProgress.svelte 1360 Extract progress UI, status logic
echophrase/src/lib/components/settings/CudaSetupModal.svelte 1309 Extract platform detection, install steps
echophrase/src/lib/composables/useRecording.ts 1226 Extract VAD logic, state machine
echophrase/src-tauri/src/transcription/candle_whisper.rs 1220 Consider splitting tokenizer/decoder
echophrase/src-tauri/src/transcription/onnx_backend.rs 1087 Extract model loading, inference
echophrase-server/Program.cs 840 Well-structured but could use extension methods

2. Unsafe unwrap() Calls (Potential Panics)

File Line Code Risk
commands/transcription.rs 105, 142, 596 dirs::home_dir().unwrap() Panics if no HOME
commands/transcription.rs 737, 741 dirs::cache_dir().unwrap() Panics if no cache dir
vad.rs 140-146 Multiple .unwrap() on tensors Could panic on invalid data
transform/t5_grammar.rs 60 cache.as_mut().unwrap() Panics if not loaded

Recommendation: Replace with ok_or("message") or expect("reason") with context.

3. Unimplemented Webhook Handlers (25+ TODOs)

File: echophrase-server/src/Echophrase.Core/impl/Webhooks/DefaultWebhookHandler.cs

// TODO: Persist subscription to database (line 125)
// TODO: Update subscription record in DB (line 145)
// TODO: Update subscription status in DB (line 161)
// ... 20+ more TODOs

Impact: Subscription lifecycle events not fully handled. Recommendation: Implement or document as "out of scope for beta".


🟑 Minor Issues

4. Feature Gate Consistency

Client (Rust): 3 tiers - Anonymous, Free, Premium Server (.NET): 4 tiers - Anonymous, Free, ProMonthly, ProAnnual

βœ… OK: Client correctly normalizes ProMonthly/ProAnnual β†’ Premium via from_string()

Admin Dashboard: Uses boolean feature flags (model_medium, model_large) while Rust uses string arrays (available_models). This is a design difference but documented.

5. Entry Points Assessment

  • lib.rs (766 LOC): Well-structured, mostly plugin setup and commands registration
  • Program.cs (840 LOC): Clean but long - could extract service registration to extension methods

βœ… Good Practices Observed

  1. Feature gate changes are documented with sync instructions
  2. Tier normalization handles various formats (snake_case, PascalCase, kebab-case)
  3. Proper separation between auth storage and business logic
  4. Environment validation on startup (Rust)
  5. Comprehensive rate limiting configured (Server)

Next Steps

  1. Wait for sub-agent reports
  2. Deep dive on auth flow end-to-end
  3. Cross-reference with Elsagent's frontend findings
  4. Prioritize issues by beta-blocking vs nice-to-have

Echophrase Beta Audit Plan

Date: 2026-03-17
Objective: Comprehensive pre-launch audit for beta release
Participants: @Dylagent, @Elsagent
Status: 🟑 Planning Phase


Audit Scope

1. Feature Gates Consistency

  • Verify client-side gates match server-side gates
  • Verify admin dashboard gates editor syncs correctly
  • Test each tier boundary (anonymous β†’ free β†’ pro_monthly β†’ pro_annual)
  • Audit gate enforcement across all surfaces

2. Single Responsibility Principle (SRP)

  • Each function does exactly 1 thing
  • No monolithic "god" functions
  • Extract any overloaded functions

3. Code Quality

  • Comments are practical and non-redundant
  • No duplicate inline docs repeating what code already says
  • No scripts too large for 1 file (>500 LOC guideline)

4. Architecture & Entry Points

  • Entry points are high-level and human-readable
  • Main entry points should mostly call other functions
  • No business logic in entry-level functions

5. Security & Holes

  • No exposed secrets or hardcoded credentials
  • Auth flow has no bypass vulnerabilities
  • Webhook validation is robust
  • No race conditions in critical paths

6. UI/UX Flows

  • All flows are optimized and buttery smooth
  • No dead-end states or confusing navigation
  • Error states are handled gracefully
  • Loading states exist where needed

Proposed Work Split

Dylagent (Backend Lead)

Focus: Complex cross-module integration, Rust backend, server APIs

Area Priority Notes
client ↔ server auth flow P0 Deep link, token refresh, session management
client ↔ server feature gates P0 Ensure gates sync and enforce correctly
admin ↔ server sync P1 Feature gates editor, constants editor
Rust backend (src-tauri/) P0 Transcription, recording, auth modules
Server (.NET) P0 Auth endpoints, webhooks, entitlements
Cross-module data flow P1 How data travels between modules

Elsagent (Frontend Lead)

Focus: UI/UX, component architecture, frontend code quality

Area Priority Notes
Client Svelte components P0 SRP, composition, state management
Admin React components P0 Same principles
Marketing site (www) P1 Static site, SEO, pricing config
UI/UX flows audit P0 Recording β†’ transcription β†’ output flow
Error handling UI P1 Toast patterns, error boundaries
Component file sizes P1 Flag any >300 LOC components

Sub-Agent Strategy

Each of us spawns 2 sub-agents:

Dylagent's Sub-Agents

  1. haiku-backend-scanner - R&D pass: list all files, flag violations
  2. opus-backend-reviewer - Deep analysis of flagged issues

Elsagent's Sub-Agents

  1. haiku-frontend-scanner - R&D pass: component audit, flag violations
  2. opus-frontend-reviewer - Deep analysis of flagged issues

Deliverables

  1. Audit Report (per module)

    • Issues found with severity (critical/major/minor)
    • Line numbers and file paths
    • Recommended fixes
  2. PRs (if issues found)

    • Grouped by module
    • Follow existing PR workflow (ping Elsagent for review)
  3. Summary (posted to Discord)

    • High-level findings
    • Blockers for beta release
    • Confidence score for shipping

Timeline

  1. Planning (now) - Agree on split, finalize plan
  2. R&D Scan (~1-2 hours) - Sub-agents scan codebase
  3. Deep Review (~2-4 hours) - Analyze flagged issues
  4. PRs & Fixes (TBD) - Based on findings
  5. Final Report - Summary to Discord

Questions for Discussion

  1. Should we include docs/ and docs-internal/ in the audit?
  2. Any specific areas Dylan wants extra focus on?
  3. Timeline pressure - how thorough vs how fast?
  4. Should we run full test suites as part of audit?

Updated: 2026-03-17 07:50 UTC
Next: Await Elsagent feedback, then begin scans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment