Validation Interview Tracking System - Gap Analysis
Date: 2026-02-19
Project: C-of-C-CANADA (ChamberConnect AI)
System: submodules/gtm/coditect-gtm-strategy/09-validation-tracking/
Task: N.5.1.4
1. System Overview
| Metric | Value |
|---|---|
| Total source files | 61 |
| Total lines of code | 14,392 |
| Database tables | 18 |
| API route handlers | 42+ |
| Frontend routes | 15 (+ catch-all) |
| UI pages | 15 |
| UI components | 17 |
| Service modules | 12 |
| Test files | 0 |
Tech stack: React 18 + Vite 6 + TypeScript 5.7+ (strict) + Tailwind 3.4 + Zustand + Drizzle ORM + SQLite (WAL) + raw node:http server (port 3101)
Build status: TypeScript compiles clean (npx tsc --noEmit = 0 errors)
2. Feature Completeness Audit
2.1 Fully Implemented (Phase 1 Complete)
| Feature | Backend | Frontend | Database | Notes |
|---|---|---|---|---|
| Project management | 2 routes | Dashboard | projects | Multi-project switcher in sidebar |
| Contact management | 5 routes | ContactsPage | contacts | CRUD + CSV import + soft delete |
| Interview management | 5 routes | InterviewsPage | interviews | CRUD + conduct flow + soft delete |
| Interview conduct | 3 routes | InterviewConductPage | responses, dimension_scores | Section-based scoring, real-time save |
| Interviewer management | 4 routes | InterviewersPage | interviewers | CRUD + scheduling capacity |
| Hypothesis management | 4 routes | HypothesesPage | hypotheses, hypothesis_validations | CRUD + validation evidence |
| Outreach management | 4 routes | OutreachPage | outreach | Multi-channel tracking |
| Follow-up pipeline | 3 routes | FollowUpPage | actions | Action items with status tracking |
| Transcript import | 3 routes | TranscriptImportPage | transcripts | Paste, parse, segment |
| Analytics dashboard | 3 routes | AnalyticsPage | (computed) | Funnel, hypothesis results, dimensions |
| Interview templates | 3 routes | AdminPage | interview_templates | Sectioned question templates |
| Export (CSV/PDF) | (client) | Multiple pages | - | CSV export on contacts, interviews |
| Documentation pages | - | 5 doc pages | - | Guide, training, framework, rubric, sheet |
2.2 Backend-Only (No Frontend UI)
These features have complete backend implementations but zero frontend consumption:
| Feature | Backend Routes | Service File | DB Tables | Frontend Status |
|---|---|---|---|---|
| Google OAuth | 4 routes | google-oauth.ts (299 lines) | oauth_credentials | No /settings page, no useApi hooks |
| Google Calendar | 5 routes | google-calendar.ts (315 lines) | calendar_events | No calendar UI, no event display |
| Gmail send | 3 routes | google-gmail.ts (299 lines) | email_logs, email_opt_outs | No email compose UI |
| Email templates | 5 routes | email-templates.ts (273 lines) | email_templates | No template editor page |
| Email campaigns | 3 routes | email-queue.ts | email_campaigns | No campaign management page |
| Opt-out handling | 1 route | (in gmail service) | email_opt_outs | No opt-out management page |
Total backend-only: 21 route handlers (~950 lines of service code) with 6 database tables — all unreachable from the UI.
2.3 Critical Frontend Gap: OAuth Callback Broken
api.ts:485-486 redirects the OAuth callback to:
http://localhost:5173/settings?oauth=success
http://localhost:5173/settings?oauth=error
But App.tsx has no /settings route — the catch-all <Route path="*"> sends the user to / (Dashboard), silently discarding the OAuth result. The user would complete Google authorization but see the dashboard with no confirmation.
2.4 Missing useApi Hooks
useApi.ts (684 lines) contains hooks for all Phase 1 features but zero hooks for:
- Google OAuth (connect, disconnect, status check)
- Google Calendar (create event, check availability)
- Gmail (send email, check rate limit)
- Email Templates (CRUD, seed, render)
- Email Campaigns (create, send, queue status)
Result: Even if pages were created, they cannot call the backend without these hooks.
2.5 Missing Sidebar Navigation
Sidebar.tsx NAV_ITEMS has 10 entries. None reference email, calendar, settings, or campaigns. Users have no navigation path to any Google integration feature.
3. Usability Review
3.1 Strengths
- Consistent design system: All UI follows WPP-derived pattern with emerald accent, dark mode support, CoditectModal wrapper
- Project switcher: Multi-project support with sidebar selector
- Responsive sidebar: Flyout pattern works on mobile viewports
- Structured interview flow: Section-based conduct page with dimension scoring
- CSV import: Bulk contact import with column mapping
- Documentation built-in: 5 reference docs accessible from sidebar
3.2 Weaknesses
| Issue | Severity | Location | Description |
|---|---|---|---|
| No loading states | Medium | Multiple pages | API calls don't show spinners/skeletons |
| No optimistic updates | Low | All CRUD forms | Forms wait for server response before updating UI |
| No pagination | Medium | Contacts, Interviews | All records loaded at once — will degrade with scale |
| No search/filter on lists | Medium | ContactsPage, InterviewsPage | Must scroll through all records |
| No keyboard shortcuts | Low | Global | No Cmd+K, no table navigation |
| No undo/redo | Low | Forms | No undo for accidental changes |
| No confirmation on delete | Medium | Hypotheses, Templates | Some delete handlers are hard-delete (not soft) |
| Dashboard is read-only | Low | DashboardPage | No drill-down into analytics data points |
3.3 Accessibility
- No ARIA labels audited
- No keyboard navigation tested
- Color contrast likely acceptable (dark/light mode with high-contrast emerald accent)
- No skip navigation links
- No screen reader testing
4. Scalability Assessment
4.1 Database
| Concern | Severity | Detail |
|---|---|---|
| SQLite single-writer | High | WAL mode helps reads, but only one write at a time. Fine for single-user pilot, blocks multi-user. |
| No indexes beyond PKs | Medium | Only calendar_events.google_event_id and email_opt_outs.email have explicit indexes. Contact/interview queries will slow with volume. |
| JSON-in-text columns | Medium | metadata, parsed_segments, variables, attendee_emails stored as JSON text. No queryable structure. |
| No connection pooling | Low | Single connection via getDb(). Fine for pilot. |
| No migrations runner | Medium | Drizzle kit generates SQL but no automated migration tool in the server startup. |
Recommended indexes for pilot scale (100+ contacts, 50+ interviews):
CREATE INDEX idx_contacts_project ON contacts(project_id);
CREATE INDEX idx_contacts_status ON contacts(status);
CREATE INDEX idx_interviews_contact ON interviews(contact_id);
CREATE INDEX idx_interviews_status ON interviews(status);
CREATE INDEX idx_outreach_contact ON outreach(contact_id);
CREATE INDEX idx_email_logs_contact ON email_logs(contact_id);
CREATE INDEX idx_email_logs_campaign ON email_logs(campaign_id);
CREATE INDEX idx_hypothesis_validations_interview ON hypothesis_validations(interview_id);
CREATE INDEX idx_responses_interview ON responses(interview_id);
CREATE INDEX idx_dimension_scores_interview ON dimension_scores(interview_id);
4.2 API Server
| Concern | Severity | Detail |
|---|---|---|
| Raw node:http | Medium | No middleware framework, no request parsing library. Each route manually parses JSON body. Works but brittle. |
| No request validation | High | No input validation on any endpoint. Malformed JSON or missing fields cause runtime errors. |
| No authentication | High | All endpoints are unauthenticated. Anyone on the network can CRUD all data. |
| No rate limiting (API) | Medium | Gmail rate limiting exists but no API-level rate limiting. |
| CORS wildcard | Medium | Access-Control-Allow-Origin: * — acceptable for localhost dev, not production. |
| No request logging | Low | No access log, no request timing. |
| Synchronous DB in async handlers | Low | Drizzle with better-sqlite3 is synchronous. Not a problem at pilot scale but blocks the event loop under load. |
4.3 Frontend
| Concern | Severity | Detail |
|---|---|---|
| No code splitting | Low | All pages bundled together. Fine at 14K LOC. |
| Zustand store is flat | Low | Single store with all state. Works for current feature set. |
| No error boundaries | Medium | Component errors crash the whole app. |
| No offline support | Low | No service worker, no local cache. Expected for internal tool. |
5. Integration Opportunities
5.1 CODITECT Platform Integration (Phase 2)
| Integration | Benefit | Effort | Priority |
|---|---|---|---|
| CODITECT SSO | Single sign-on, user identity | Medium | High |
| Multi-tenant RLS | Per-venture data isolation | High | High |
| Cloud PostgreSQL | Concurrent users, proper indexing | Medium | High |
| Context Graph | Link interviews to org.db decisions | Low | Medium |
| MoE Agent Enhancement | Auto-classify interview transcripts | Medium | Medium |
| Semantic Search | Search across interview responses | Low | Medium |
| Session Logging | Track interviewer sessions | Low | Low |
5.2 MoE Agent ADR Enhancement Opportunities
| Agent Type | Use Case | ADR Opportunity |
|---|---|---|
| transcript-normalization-agent | Auto-normalize pasted transcripts | Extend with validation-specific speaker detection |
| sentiment-tracking | Analyze interview sentiment scores | Feed into hypothesis confidence calculations |
| meeting-notes-action-items | Extract action items from transcript | Auto-populate follow-up actions table |
| interview-feedback-summarizer | Summarize interview themes | Generate hypothesis validation evidence |
| data-quality-specialist | Validate contact data completeness | Flag incomplete records before outreach |
| email-marketing | Optimize email campaign timing | Integrate with email queue rate limiter |
| customer-segmentation | Segment contacts by engagement | Prioritize interview scheduling |
5.3 External Integration Opportunities
| Integration | Status | Gap |
|---|---|---|
| Google Calendar | Backend complete | Frontend UI needed |
| Gmail | Backend complete | Frontend UI needed |
| Not started | Contact enrichment from LinkedIn profiles | |
| Calendly | Not started | Alternative to custom calendar integration |
| Zoom/Google Meet | Partial (Meet via Calendar) | Recording import, auto-transcription |
| Notion | Not started | Export interview insights to team wiki |
| Slack | Not started | Notifications for scheduled interviews, completed validations |
6. Priority Recommendations
6.1 Critical (Before Pilot Use)
| # | Item | Rationale | Effort |
|---|---|---|---|
| 1 | Settings page with OAuth connection UI | Google integration is complete backend-side but unusable without UI. OAuth callback redirects to nonexistent page. | ~200 LOC |
| 2 | useApi hooks for Google integration | Required for any frontend to call the 21 Google endpoints | ~150 LOC |
| 3 | Sidebar navigation for Settings/Email | Users need to discover and navigate to integration features | ~20 LOC |
| 4 | Basic input validation on API | Prevent runtime crashes from malformed requests | ~100 LOC |
6.2 High (Before Broader Rollout)
| # | Item | Rationale | Effort |
|---|---|---|---|
| 5 | Email compose/campaign management page | Unlock the email send + campaign features | ~400 LOC |
| 6 | Calendar event display on interview records | Show scheduled events, Meet links | ~100 LOC |
| 7 | Database indexes | Performance at 100+ contacts/interviews | ~20 LOC SQL |
| 8 | Pagination on list pages | Contacts and interviews will grow | ~100 LOC per page |
| 9 | Error boundaries | Prevent full-app crashes from component errors | ~50 LOC |
6.3 Medium (Phase 2)
| # | Item | Rationale | Effort |
|---|---|---|---|
| 10 | Authentication/authorization | Required for multi-user deployment | High |
| 11 | PostgreSQL migration | Multi-user concurrency, proper indexes | Medium |
| 12 | Multi-tenant RLS | Per-venture data isolation | High |
| 13 | Test suite | Zero tests currently — need at least service layer tests | Medium |
| 14 | SDD update | Document is stale (missing 6 tables, 21 routes, 5 services) | Low |
| 15 | Request logging and monitoring | Operational visibility | Low |
7. Source File Inventory
7.1 Services (Backend)
| File | Lines | Purpose |
|---|---|---|
services/analytics.ts | 191 | Dashboard metrics, funnel, hypothesis results |
services/contacts.ts | ~200 | Contact CRUD, CSV import, soft delete |
services/email-queue.ts | ~250 | In-memory queue, SQLite persistence, retry |
services/email-templates.ts | 273 | Template CRUD, rendering, seed system templates |
services/google-calendar.ts | 315 | Calendar CRUD, availability, Meet links |
services/google-gmail.ts | 299 | Gmail send, threading, opt-out, rate limit |
services/google-oauth.ts | ~300 | OAuth 2.0 PKCE, token refresh, encrypt/decrypt |
services/hypotheses.ts | ~150 | Hypothesis CRUD, validation tracking |
services/interviewers.ts | ~150 | Interviewer CRUD, capacity management |
services/interviews.ts | ~200 | Interview CRUD, response management |
services/outreach.ts | ~150 | Outreach CRUD, channel tracking |
services/projects.ts | ~100 | Project CRUD |
7.2 Largest UI Files
| File | Lines | Purpose |
|---|---|---|
ui/pages/InterviewConductPage.tsx | 964 | Section-based interview conduct flow |
ui/pages/TranscriptImportPage.tsx | 626 | Paste, parse, map transcript segments |
ui/pages/FollowUpPage.tsx | 505 | Follow-up pipeline with action management |
ui/pages/OutreachPage.tsx | ~400 | Multi-channel outreach tracking |
ui/pages/ContactsPage.tsx | ~350 | Contact list with CSV import |
ui/hooks/useApi.ts | 684 | All API hooks (missing Google integration) |
db/seed.ts | 964 | Sample data seeding |
7.3 Database Tables (18 total)
Original (12): projects, contacts, interviews, responses, dimension_scores, hypotheses, hypothesis_validations, interview_templates, interviewers, outreach, transcripts, actions
Added in Iteration 5 (6): oauth_credentials, calendar_events, email_logs, email_opt_outs, email_templates, email_campaigns
8. Conclusion
The Validation Interview Tracking System is a substantial 14,392-line application with comprehensive backend coverage across 18 database tables and 42+ API routes. The core validation workflow (contacts -> outreach -> interviews -> scoring -> hypothesis validation -> analytics) is fully functional end-to-end.
The most significant gap is the frontend-backend disconnect for Google integration — 21 API endpoints and ~950 lines of service code are fully implemented but entirely unreachable from the UI. The OAuth callback actively breaks by redirecting to a nonexistent /settings page.
For pilot readiness, the critical path is:
- Settings page + OAuth hooks + sidebar navigation (~370 LOC)
- Email compose page (~400 LOC)
- Basic input validation (~100 LOC)
- Database indexes (~20 LOC SQL)
Total effort to close critical gaps: ~890 lines of code.
Analysis by: Claude (Opus 4.6)
Ralph Loop: 76d6b413 | Iteration 6 of 8
Task: N.5.1.4