v20.0 Repo Audit Remediation
Summary
This archive records the completed maintenance batch that closed the repo-audit follow-through work while v22.0 remained the active strategic planning track.
This was not a new strategic version. It was bounded v20.0 maintenance work to reduce drift, harden privacy/tooling, and keep the repo stable while Gate 0 remains blocked on human-owned evidence.
Completed Outcomes
- Normalized repo contracts and tooling:
- added
generate-embeddings,db:types, andcheck:refs - standardized remaining workflows on Node 22
- replaced deprecated
next lintusage inlint-staged - fixed stale script/doc references
- Added local ephemeral Supabase type-generation workflow:
- reusable local Supabase bootstrap helper
npm run db:typesscript and supporting shell helpers- refreshed
types/supabase.tsstructure to match the local schema contract - Hardened privacy and analytics:
- removed raw query text from client analytics payloads
- enforced JSON validation plus
Cache-Control: no-store/X-Robots-Tag: noindexon search analytics - reused the shared Supabase client/env path for analytics
- cached Upstash rate-limiters instead of recreating them per request
- Consolidated feedback and dashboard mutations:
- shared server-side feedback handler for canonical and deprecated routes
- server actions for organization settings, notifications, and invitation writes
- Refactored dashboard member management:
- split the monolithic component into a data hook plus focused UI subcomponents
- moved invitation creation/cancellation to server actions
- Tightened service and search typing:
- typed
ServicePublic - added typed public-row and service-table mapping helpers
- removed nearly all
unsafeFrom()callsites from production code - Closed dependency and script hygiene gaps:
- exposed useful maintenance scripts in
package.json - added safe
--help/ dry-run behavior where needed - cleared
npm audit --omit=dev
Verification Snapshot
Validated on 2026-03-29:
npm run check:refsnpm run lintnpm run type-checknpm test -- --run->152files passed,1152tests passed,24skippednpm run buildnpm audit --omit=dev->0 vulnerabilities
Remaining Follow-Through
These items remain on the active roadmap because they were environment- or schema-dependent, not because the maintenance batch is still open:
- Run
npm run db:typeson a Docker-capable machine and commit the generatedtypes/supabase.tsoutput from the live local stack. - Replace the final intentional
unsafeFrom()usage fornotification_auditonce generated schema coverage or a typed contract exists for that table. - Publish a fresh coverage snapshot with
npm run test:coverage.