Skip to content

fix: close P3 repository debt#924

Merged
BigSimmo merged 1 commit into
mainfrom
codex/p3-debt-fixes-20260719
Jul 19, 2026
Merged

fix: close P3 repository debt#924
BigSimmo merged 1 commit into
mainfrom
codex/p3-debt-fixes-20260719

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Repair Forms navigation so "View all forms" preserves the query and executes the full search, and make "Copy details" copy the visible form details.
  • Complete route/schema documentation, remove the Supabase-to-UI storage dependency inversion, remove the unused direct realtime dependency, and make Knip blocking output safe.
  • Widen coverage visibility, require the visual-artifact Playwright check, fix migration whitespace, and add no-growth budgets for the four existing maintenance hotspots.

Verification

  • npm run verify:cheap — passed before the final clean rebase (321 test files; 2,923 passed, 1 skipped).
  • npm run test:coverage — passed (321 test files; 2,917 passed, 1 skipped; 44.96% statements / 41.13% branches / 45.60% functions / 46.25% lines).
  • npm run verify:ui — passed production build and 240/240 Chromium tests.
  • npm run check:maintainability-budgets — passed on the current f8d3efac5 base.
  • npm run docs:check-index — passed; 38 routes/modules and all schema tables indexed.
  • git diff origin/main...HEAD --check — passed.

An exact-commit local verify:cheap rerun was attempted after rebasing onto PR #923, but the repository heavyweight-test lock was continuously held by other active worktrees. Required hosted checks on this exact head are the merge gate.

Risk and rollout

  • Risk: low; the changes are scoped to Forms UI behavior, repository documentation and verification configuration, dependency metadata, and library layering, with targeted regression coverage.
  • Rollback: revert the single squash commit produced by this pull request; no data migration or production-state rollback is required.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Residual risk

  • Knip's export/type findings remain advisory; this PR does not mass-delete them.
  • The large modules remain maintenance debt; this adds no-growth protection rather than a risky refactor.
  • No production data, provider APIs, clinical answer behavior, search ranking, or Supabase deployment was changed.
  • The PR rag: add deterministic and opt-in semantic reranking #901 malformed review replies were corrected through the GitHub API and are not repository changes in this commit.

Repair forms behavior, documentation coverage, dependency hygiene, coverage visibility, and library layering. Add no-growth hotspot and CI guards. Verified with npm run verify:cheap (321 files; 2,923 passed, 1 skipped).
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@supabase

supabase Bot commented Jul 19, 2026

Copy link
Copy Markdown

Updates to Preview Branch (codex/p3-debt-fixes-20260719) ↗︎

Deployments Status Updated
Database Sun, 19 Jul 2026 11:13:53 UTC
Services Sun, 19 Jul 2026 11:13:53 UTC
APIs Sun, 19 Jul 2026 11:13:53 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Sun, 19 Jul 2026 11:14:00 UTC
Migrations Sun, 19 Jul 2026 11:15:20 UTC
Seeding Sun, 19 Jul 2026 11:15:24 UTC
Edge Functions Sun, 19 Jul 2026 11:15:25 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds CI verification and maintainability checks, broadens documented and tested source coverage, relocates recent-query storage ownership to src/lib, improves form clipboard and search navigation behavior, and removes redundant UI exports.

Changes

Repository verification and maintainability controls

Layer / File(s) Summary
Verification and coverage controls
.github/workflows/ci.yml, package.json, knip.json, playwright.config.ts, vitest.config.mts, scripts/...
CI now runs documentation-index, KNIP, and maintainability-budget checks; KNIP and test coverage configurations are expanded, and production Playwright selection includes additional UI suites.
Repository documentation and validation
docs/codebase-index.md, docs/process-hardening.md, docs/testing.md, tests/test-runner-safety.test.ts, supabase/migrations/...
Repository indexes and testing guidance are updated, configuration assertions are added, and a migration line is whitespace-normalized.

Recent-query storage ownership

Layer / File(s) Summary
Library ownership and consumers
src/lib/recent-query-storage.ts, src/components/clinical-dashboard/..., src/lib/supabase/client.tsx
The storage key is defined in the library module, and dashboard and authentication consumers import storage helpers from that module.
Layering and import tests
tests/recent-query-storage.test.ts, tests/ui-smoke.spec.ts, tests/lib-layering.test.ts
Recent-query tests use the library path, and a new test prevents src/lib files from importing component modules.

Form details and search navigation

Layer / File(s) Summary
Structured clipboard details
src/components/forms/form-detail-page.tsx, tests/forms.test.ts
Desktop and mobile copy actions use structured form metadata, with coverage asserting multiple visible fields are included.
Query-preserving search links
src/components/forms/forms-search-results-page.tsx, tests/audit-content-services-regressions.test.ts
“View all forms” links preserve the search query and enable focused immediate execution, with source-level regression assertions.

UI icon and panel export cleanup

Layer / File(s) Summary
Icon and panel exports
src/components/therapy-compass/icons.tsx, src/components/therapy-compass/screens/detail-screen.tsx, src/components/ui-primitives.tsx
The redundant TargetIcon export is removed and replaced at its consumer with CompassIcon; panelSubtle becomes the direct base for sourceCard.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: claude, copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the PR's main theme of closing P3 repository debt.
Description check ✅ Passed The description includes the required Summary, Verification, Risk and rollout, and Clinical Governance sections with substantive details.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/p3-debt-fixes-20260719

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo merged commit 38beb57 into main Jul 19, 2026
17 of 19 checks passed
@BigSimmo
BigSimmo deleted the codex/p3-debt-fixes-20260719 branch July 19, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant