Skip to content

Repo hygiene: gate /mockups out of production, CI audit gate, untrack scratch, archive stale docs#328

Merged
BigSimmo merged 9 commits into
mainfrom
claude/repository-review-e09e6o
Jul 6, 2026
Merged

Repo hygiene: gate /mockups out of production, CI audit gate, untrack scratch, archive stale docs#328
BigSimmo merged 9 commits into
mainfrom
claude/repository-review-e09e6o

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Gate the 27-page /mockups/* design-exploration route tree out of production builds: src/app/mockups/layout.tsx now calls notFound() unless mockupsEnabled() (src/lib/env.ts) — always reachable in dev/test, production requires explicit NEXT_PUBLIC_MOCKUPS_ENABLED=true (previously these shipped in production hidden only by a robots.txt disallow). New tests/env-mockups-gate.test.ts guards the flag logic.
  • Add a dependency vulnerability gate to CI (npm audit --omit=dev --audit-level=high in the verify job) — the document parsers (pdf-parse, pdfjs-dist, mammoth, exceljs, jszip) process untrusted uploads, so high/critical advisories should block merges rather than wait for weekly Dependabot. Currently passes with 0 vulnerabilities.
  • Untrack 24 committed .tmp-visual/ visual-QA scratch files (capture scripts + PNGs) and add .tmp-visual/ to .gitignore.
  • Archive superseded/completed planning docs to docs/archive/: root COLOR_REDESIGN_PLAN.md (marked SUPERSEDED), TOOLS_CONTEXT_FOR_NEW_CHAT.md, design-qa.md, the completed search-rag-phase-0…5.5b series, and the completed clinical-chat-ui-* phase docs. No inbound references were broken (repo-wide grep); relative links inside moved files retargeted. Living docs (search-rag-master-plan/context, component map) stay.
  • Fix scripts/run-playwright.mjs port-finder for IPv6-less containers: EAFNOSUPPORT/EADDRNOTAVAIL on ::1/:: binds now counts as available instead of marking every port busy (previously verify:ui could not start in such environments).
  • Log all of the above in docs/process-hardening.md (dated 2026-07-06 entry).

Verification

  • npm run verify:cheap — pass (runtime, sitemap, lint, typecheck, 1,097 unit tests)
  • npm run verify:ui — 103/103 passed (includes the specs that exercise /mockups routes in dev, proving the gate leaves dev/test behavior unchanged)
  • npm run verify:release before release or handoff confidence claims
  • npm run format:check — pass
  • npm run eval:retrieval:quality — N/A: no retrieval, ranking, selection, chunking, or scoring behavior changed
  • npm run eval:rag / eval:quality — N/A: no answer-generation change
  • npm run check:production-readiness — not run here (no live keys in this environment); the change to production behavior is route-gating only, additionally verified end-to-end: production build serves HTTP 404 on /mockups/* and 200 on real routes
  • npm run check:deployment-readiness — N/A: no deployment startup/hosting change

Clinical Governance Preflight

Touches production env behavior (route gating) only; no ingestion/answer/search/source changes.

  • 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 — no clinical decision-support behavior changed

Notes

  • The /mockups gate is reversible per deploy via NEXT_PUBLIC_MOCKUPS_ENABLED=true (documented in .env.example).
  • docs/site-map.md intentionally unchanged: the route segments still exist; they 404 at request time in production.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XPVNBVo4cg9PEYtNhJZBQY


Generated by Claude Code

claude added 5 commits July 6, 2026 11:15
24 capture scripts and screenshots had been committed; .tmp-visual/ is
local investigation output (already Prettier-ignored) and now git-ignored.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPVNBVo4cg9PEYtNhJZBQY
Move to docs/archive/: root COLOR_REDESIGN_PLAN.md (marked superseded),
TOOLS_CONTEXT_FOR_NEW_CHAT.md and design-qa.md (chat handoffs referencing
machine-local paths), the completed search-rag phase 0-5.5b series, and the
completed clinical-chat-ui phase docs. Living docs (search-rag-master-plan,
search-rag-master-context, clinical-chat-ui-component-map) stay in docs/.
No inbound references existed; relative links inside moved files retargeted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPVNBVo4cg9PEYtNhJZBQY
The 27-page /mockups tree shipped in production builds, hidden only by a
robots.ts disallow. The mockups layout now returns 404 unless
mockupsEnabled(): always reachable in dev/test, production requires an
explicit NEXT_PUBLIC_MOCKUPS_ENABLED=true opt-in (mirrors the
isLocalNoAuthMode production guard). Verified against a production build:
mockup routes serve HTTP 404, real routes 200.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPVNBVo4cg9PEYtNhJZBQY
npm audit --omit=dev --audit-level=high now blocks merges on high/critical
advisories in the production tree. The document parsers (pdf-parse,
pdfjs-dist, mammoth, exceljs, jszip) process untrusted uploads, so
vulnerability response should not wait for the weekly Dependabot pass.
Verified passing locally (0 vulnerabilities).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPVNBVo4cg9PEYtNhJZBQY
…iene pass

canListenOnHost treated EAFNOSUPPORT/EADDRNOTAVAIL on ::1/:: binds as
'port busy', so verify:ui reported every port in the range taken and could
not start in containers without IPv6. An unsupported address family now
counts as available for that host. Also records the 2026-07-06 hygiene +
production-surface pass in docs/process-hardening.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPVNBVo4cg9PEYtNhJZBQY
@supabase

supabase Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

…iew-e09e6o

# Conflicts:
#	docs/process-hardening.md
#	scripts/run-playwright.mjs
@BigSimmo
BigSimmo marked this pull request as ready for review July 6, 2026 13:46
@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.

@BigSimmo

BigSimmo commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Conflicts resolved in 9eaad91. Two files had conflicts:

  • src/app/mockups/layout.tsx — kept both import type { Metadata } from "next" (added in main) and import { notFound } from "next/navigation" (added in this branch); the file uses both.
  • docs/process-hardening.md — kept both 2026-07-06 entries (the "Design convergence & type-scale ratchet" section from main and the "Repository hygiene + production surface pass" section from this branch).

The PR mergeable_state is now blocked on CI checks rather than dirty on conflicts.

@BigSimmo
BigSimmo enabled auto-merge July 6, 2026 14:12
@BigSimmo
BigSimmo merged commit 7d87326 into main Jul 6, 2026
5 checks passed
@BigSimmo
BigSimmo deleted the claude/repository-review-e09e6o branch July 8, 2026 16:21
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.

3 participants