Project Prism — Remaining Work
Last updated: April 2, 2026 (frontend tests complete, documentation cleanup done)
All features are implemented end-to-end. What remains is hardening: tests, performance, documentation accuracy, security posture, and observability.
1. Backend Tests
| Priority | Item | Notes |
|---|---|---|
contact_handler_test.go | ||
contact_service_test.go | ||
contact_activity_service_test.go | ||
map_view_service_test.go | ||
vacancy_rollup_service_test.go | ||
Repo integration test coverage (completed April 2, 2026)
New test infrastructure:
testcontainer_test.go— shared PostGIS container (testcontainers-go v0.41.0), applies schema + all migrations, dual-pool pattern (prism_app w/ RLS for repo calls, superuser for seed/cleanup)newClaimsPool()setsrequest.jwt.claimsvia pgxpoolPrepareConnhook, matching production behaviorbootstrapTestRoles()stubsauth.jwt(), createsauthenticated+prism_approlesseedTestData()inserts 2 orgs, user memberships, submarket lookup
25 new integration test files:
owner_repo,tenant_repo,brokerage_firm_repo,organization_repo,contact_repobuilding_distance_repo,building_drive_catchment_repo,building_metrics_repo,building_park_repo,building_score_repotim_building_interest_repo,tim_comment_repo,tim_comp_lease_repo,tim_target_submarket_repo,broker_assignment_repolookup_repo,map_view_repo,key_point_repo,labor_block_group_repo,vacancy_rollup_repooperations_repo,report_repo,contact_activity_repo,geography_repo,rail_line_building_repo
10 existing test files updated to use shared container, admin pool for cleanup, consistent test constants.
2. Frontend Tests
Current coverage: ~37% (36 test files / 135 source files). Up from ~16% (22 files).
| Priority | Module | Files | Notes |
|---|---|---|---|
All 118 tests passing (36 test files). Previous assertion failures fixed: added explicit
cleanup()in test setup (RTL auto-cleanup needs it withoutglobals: true), switched duplicate-text assertions togetAllByText().lengthchecks, and fixed async timing for data-dependent assertions.
3. Backend Performance
From docs/backend-performance-audit-2026-03-31.md:
| ID | Priority | Issue | Fix |
|---|---|---|---|
ListByBuildingID / ListByTenantID unbounded | |||
| F-03 | High | BulkCalculate scorecard fully sequential | Deferred — needs pool saturation data |
| F-04 | High | Import does 4 DB calls per row | Deferred — needs import speed measurement |
10 of 15 performance findings already resolved (see
docs/backend-performance-audit-2026-03-31.md§4). F-03, F-04, F-08, F-09, F-12 deferred pending production metrics.
4. Documentation Cleanup
4a. Stale / inaccurate content
| File | Issue |
|---|---|
docs/backend/go-backend-api-migration.md | |
docs/frontend/implementation-checklist.md | |
docs/frontend/api-integration.md | |
docs/frontend/maps-architecture.md | tim-building-interest-workflow.md. Updated component list to reflect actual implementation. Updated date. |
docs/backend/database-reference.md | |
docs/backend/security-audit-2026-02-07.md | docs/security/security-audit-2026-04-01.md. |
4b. Planned/TBD items needing closure
| File | Item |
|---|---|
docs/security/secrets-management.md | preview and dev environments changed from "Planned" to "Deferred" with clear rationale. Ops secrets folder note updated to "deferred — migrate when monitoring stack is productionised". |
docs/security/vulnerability-management.md |
4c. Overlapping docs to consolidate
| Overlap | Recommendation |
|---|---|
docs/frontend-pages.md vs docs/frontend/menu-tree-page-map.md vs docs/frontend/navigation-ia.md | menu-tree-page-map.md and navigation-ia.md marked as historical context. frontend-pages.md confirmed canonical. Frontend README updated. |
docs/frontend/page-backend-wiring-checklist.md vs docs/frontend/backend-api-work-items.md | backend-api-work-items.md updated with companion note pointing to wiring checklist for current integration status. |
docs/frontend/rebuild-plan.md vs docs/frontend/implementation-checklist.md | rebuild-plan.md marked as historical. Frontend README updated. |
docs/backend/go-backend.md vs docs/backend/README.md | README.md now labels go-backend.md as the canonical entry point. |
4d. Formatting inconsistencies
| Issue | Where |
|---|---|
YYYY-MM-DD normalized to "Month DD, YYYY" convention (security/*, audit/*, ops/production-runbook). | |
docs/README.md timestamp mismatch |
5. Security & Compliance
| Priority | Item | Source |
|---|---|---|
| Medium | Migrate remaining ops secrets to Infisical | docs/security/secrets-management.md |
| Medium | Schedule external pen test | docs/security/vulnerability-management.md |
| Low | SOC 2 Type I blockers: backup/DR testing, access review process, evidence collection | docs/audit/soc2-readiness-assessment-2026-03-26.md |
CRIT-2 fix: prism_app RLS enforcement (April 2, 2026)
Problem: Production connects as postgres superuser, bypassing all 72 RLS policies. The prism_app role existed but had no grants and no authenticated role membership — RLS was effectively decoration.
What was done:
- Migration
000020_grant_prism_app_role.up.sql— grantsauthenticatedtoprism_app(idempotent). Down migration revokes the grant. cmd/api/main.go— PrepareConn / AfterRelease hooks — every DB connection now hasrequest.jwt.claimsset from the request'sAuthContext(populated by auth middleware). This makesauth.jwt()→can_org_read()/can_org_write()work at the Postgres level, enforcing RLS as defense-in-depth alongside Go-layerorganization_idfiltering.- Test infrastructure validates RLS end-to-end: repo tests run as
prism_appwith claims set, while seed/cleanup uses a superuser pool.
Production deployment (completed April 2, 2026):
- Run on prod Supabase:
GRANT authenticated TO prism_app; - Deploy Go backend with PrepareConn hooks
- Update Render
DATABASE_URLto connect asprism_appinstead ofpostgres - Verify RLS enforcement in prod —
pg_stat_activityconfirms all app connections areprism_appvia Supavisor, zeropostgresconnections from the app
6. Infrastructure & Observability
| Priority | Item | Notes |
|---|---|---|
/metrics, remote-writes to Grafana Cloud Prometheus. Existing prism-api-overview dashboard imported. | ||
| Low | Infisical preview environment | Planned but not set up — needed for QA branch builds |
Quick Reference: What's Done
For context on what does NOT need work:
- All 28 frontend routes — fully implemented, no stubs
- All 28 backend handlers — wired, tested, documented in Swagger
- Auth (Clerk JWT + API keys), CORS, rate limiting, RLS (72 policies)
- Field-level validation errors (backend
FieldErrors+ frontendApiRequestError) request_idon all error responses- Pagination normalization across all list endpoints
- CI/CD (GitHub Actions for both frontend and backend)
- Marketing site (complete, deployed to Cloudflare Pages)
- Database schema (66+ tables, 20 migrations, PostGIS)
- Swagger docs (auto-generated, drift-checked in CI)
- Repo integration tests — all 35 postgres repos covered (testcontainers-go, dual-pool, RLS-enforced)
- Frontend tests — 118 tests across 36 files, all passing (analytics, dashboard, data mgmt, admin, lookups, schemas, shared utils)
- RLS defense-in-depth — Go backend sets JWT claims via pgxpool PrepareConn hooks;
prism_approle grantedauthenticated - Production monitoring — Grafana Cloud (Alloy → Prometheus remote write), 10 alert rules, Slack notifications
- Documentation cleanup — all stale frontend/backend docs updated, overlapping docs consolidated with historical markers, dates refreshed
7. Developer Documentation Site
| Priority | Item | Notes |
|---|---|---|
| Low | Scaffold docs site | Fumadocs, Nextra, or Starlight (Astro) — renders existing docs/ markdown with zero rewriting |
| Low | Embed Swagger UI | API reference from existing swagger.json |
| Low | Add changelog page | Pull from git tags or a CHANGELOG.md |
| Low | Deploy to Cloudflare Pages | Alongside marketing site — infra already exists |
| Low | Add decision log / ADR section | Capture architectural decisions that aren't obvious from code |