Security and correctness audit fixes
The audit covered backend authorization, scheduling, recurrence, client state, mobile startup, dependency advisories, and build checks. Existing work was checkpointed inee47e5c; fixes are on fix/security-correctness-audit. No Fable agents were used.
Independent review also identified Customer tracking writes that lacked ownership checks, recurrence mutation authorization and conflict-policy gaps, retained exceptions outside a changed recurrence pattern, and a three-day calendar range that could repeatedly render. These are covered by the same fixes and additional regressions. The web typecheck command now follows its referenced projects; this exposed and corrected fragment-link types, an obsolete client type reference, and an incomplete booking-result type.
The TOML upgrade addresses uncontrolled recursion and prototype pollution. The dependency gate retains the repository’s existing documented advisory exclusions.
Validation on the integrated changes:
pnpm test:once: 122 files, 1,629 tests passed.pnpm test:ops: 2 tests passed.pnpm check-types: all 5 workspace tasks passed.pnpm lint: passed with 48 existing warnings and no errors.SENTRY_AUTH_TOKEN='' pnpm exec turbo run build --force: all 3 production build tasks passed; CDN deployment was a dry run.EXPO_NO_TELEMETRY=1 pnpm exec expo export --platform ios: local iOS bundle export passed.bash scripts/osv-audit.sh: passed under the repository’s advisory policy.- Convex code generation and typecheck passed. The final schema and functions compiled on an isolated anonymous backend; a real mutation seeded 2,001 historical appointments and verified that the overlap reader returned the one current appointment.
git diff --check: passed. The commit hook scans staged changes for secrets.
organizationSettings.test.ts. Fake timers now keep those jobs pending while the tests inspect their registration; the full rerun passed without unhandled errors. Independent technical review prompted additional fixes to recurrence counting and navigation history before completion. Implementation and review after the checkpoint took about 35 minutes. The final focused reviews reported no remaining blockers. Reviewer checks used real Convex handlers and installed navigation routers; native-device behavior remains unverified.
The calendar lookup rejects more than 2,000 matching appointments or an incomplete scan after 10,000 reads. Convex may reject earlier on its byte limit. This prevents partial calendars and false availability; it is not a replacement for a paginated calendar API at larger scale. The new end-time index needs to finish building when deployed. The optional recurrence reservedDates field records slots already counted during regeneration, preserving correct counts across deletion or detachment before generation resumes.
Employee and Customer bulk recurrence operations require access to the current and proposed template and every materialized occurrence. Series with 200 or more rows require an organization administrator. Smaller authorized operations delete within the requesting transaction, preventing an authorization change from racing a later destructive job. Single-occurrence operations retain their row-level checks.
The changes do not rewrite previously generated appointments or repair production data. Existing affected recurrence series need explicit review and regeneration if their materialized dates are already wrong. Local backend validation uses an isolated database and a dummy auth issuer. Native-device navigation, actual push/email delivery and production data migration remain outside the verification performed here.