Fix repo-wide prettier format:check drift on main - #177
Conversation
|
@copilot resolve the merge conflicts in this pull request |
Head branch was pushed to by a user without write access
Done. Merged |
`.impeccable/` is a tooling hook cache (session ids, timestamps, local absolute paths) that was committed by mistake and fails `prettier --check`. Add it to .prettierignore and .gitignore, and untrack the committed file. (`database.types.ts` is already covered by .prettierignore on main.) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical `prettier --write .` of the tracked files that were not prettier-clean on current main. Formatting only, no logic changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
39612bc to
8822c20
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8822c2033e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| expect(workerSource).toContain("caption: classification.caption"); | ||
| expect(workerSource).toContain( | ||
| 'const structuredProfile = normalizeStructuredVisualProfile(redactCaptionMetadataValue(metadata.structured_visual_profile), {', | ||
| "const structuredProfile = normalizeStructuredVisualProfile(redactCaptionMetadataValue(metadata.structured_visual_profile), {", |
There was a problem hiding this comment.
Update source-string assertion after formatting
When the test suite is run with dependencies installed, this assertion now searches for a one-line normalizeStructuredVisualProfile(redactCaptionMetadataValue(...), { call, but the same commit reformatted worker/main.ts so that call starts with normalizeStructuredVisualProfile( and puts redactCaptionMetadataValue(...) on the next line. The old substring is no longer present, so tests/worker-visual-capture.test.ts fails even though the intended behavior remains unchanged; update the assertion to match the multiline format or check for smaller stable substrings.
Useful? React with 👍 / 👎.
…test) tests/worker-visual-capture.test.ts asserts on the exact source text of worker/main.ts (line-level guards on redaction/normalization order). Prettier wraps a long line there, which broke the test's .toContain and failed the new format gate's own verify run. Prettier-ignore the file and restore it to main's layout so both the test and format:check pass. This is the same wall the standalone cleanup in #177 hits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ci: enforce prettier format:check + stop tracking hook cache Root-cause fixes for chronic format drift on main: - Add a "Format check" step to the CI verify job (a required status check), so unformatted code can no longer merge. Previously verify ran lint/typecheck/test/build but not format:check, letting drift accumulate every merge. - Reformat the 17 files that had already drifted, so the new gate passes on a clean tree (whitespace only; prettier is deterministic so this is conflict-safe with the standalone cleanup in #177). - Stop tracking .impeccable/hook.cache.json (a machine-local hook cache): gitignore the dir, add it to .prettierignore, and git rm --cached the file so it stops churning diffs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: exclude worker/main.ts from prettier (pinned by source-assertion test) tests/worker-visual-capture.test.ts asserts on the exact source text of worker/main.ts (line-level guards on redaction/normalization order). Prettier wraps a long line there, which broke the test's .toContain and failed the new format gate's own verify run. Prettier-ignore the file and restore it to main's layout so both the test and format:check pass. This is the same wall the standalone cleanup in #177 hits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
Superseded by #180 (merged). #180 does the same repo-wide prettier cleanup and adds the durable fix this PR was missing: a |
Pull request was closed
`prettier --write` wraps the long normalizeStructuredVisualProfile(...) call in worker/main.ts across multiple lines, which broke the exact single-line `toContain` assertion in worker-visual-capture.test.ts. Match two stable substrings instead so the caption-redaction guard survives prettier formatting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Superseded by #180 (already merged to This standalone cleanup is now redundant and conflicts with |
…#180) and serve aliases by rewrite (#177) (#1886) * fix(therapies): stop the catalogue generator consuming its own output build-therapies-index.mjs read public/therapy-compass-data/therapies.json as its source and also wrote that same path as legacyFullTarget. Source and target were one file, so every run consumed its own output. That was not merely untidy. curatedFull nulls every tag-echo modality (curatedModality), so the first run overwrote the author's raw modality values with the scrubbed ones, and every later run re-read the scrubbed copy. It survived only because the scrub happens to be idempotent — the raw input was still destroyed, recoverable from git history alone. Move the hand-edited catalogue to src/data/therapies-source.json, outside the directory this generator writes, and read only from there. The file in public/therapy-compass-data/ is now output, never input. Also add the new path to .prettierignore. At its old path it was covered by the public/therapy-compass-data/ entry; without an entry Prettier pretty-prints the compact single-line catalogue into ~17k lines, which is the churn #179 fixed on the generated side. Verified: regenerated output is byte-identical to the previous alias (hashed filenames unchanged), the source stays byte-identical to its original across two further re-runs, check:therapy-data-index passes, and the 28 therapy contract tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti * perf(therapies): serve catalogue aliases by rewrite instead of duplicating bytes public/therapy-compass-data/ shipped each catalogue twice: therapies.json, therapies-index.json and therapies-home.json were written byte-identical to their content-addressed twin. Git stores one blob per identical pair, so history was unaffected, but the working tree and every Docker image carried both — 2.81 MB, and 5.34 MB while the one-deploy grace generation is retained. The alias URLs themselves are load-bearing: useTherapyData falls back to them when a bundle older than the grace generation names a hashed file that no longer exists, so they cannot simply be dropped. Serve them from next.config.ts rewrites onto the current hashed filename instead, and stop writing the files. afterFiles rather than beforeFiles: no file exists at the alias paths now, so the rewrite is reached once the static handler finds nothing, and nothing legitimate is shadowed. build-therapies-index.mjs --check now fails if an alias file reappears, since a real file would win over an afterFiles rewrite and then go stale at the next regeneration. The generator writes content-addressed assets directly from the generated bytes rather than copying a just-written alias, so projectionBytes/fullCatalogueBytes are now the single definition of each payload's exact bytes. Verified against a running server: all three alias URLs return 200 with content byte-identical to their hashed asset; aliases keep Cache-Control max-age=0, must-revalidate while the hashed asset keeps max-age=31536000, immutable, so the alias does not inherit the destination's immutable policy; the retained grace generation still returns 200. Hashed filenames are unchanged by this refactor, proving the direct-write path is byte-identical. public/therapy-compass-data/ drops from 8.0M to 5.3M. npm run build succeeds and the stray-alias guard fires. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti * docs(issues): close #180 and #177, and correct the paths they moved Both rows are resolved by the two preceding commits. Also corrects three rows that cited the catalogue paths this work moved — docs:check-links caught them. #175 mattered most: it instructed a future reader to curate modality values in public/therapy-compass-data/therapies.json, which no longer exists. It now names src/data/therapies-source.json, the only hand-edited catalogue file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti * docs(ledger): record the review for this branch Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti * fix: ship generated therapy assets with app runner * test: cover every next config runner import * fix(docs): update therapy catalogue references * fix(ci): reconcile therapy docs with ledger inbox --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
npm run format:check(prettier --check .) was failing repo-wide onmain, so the PR-templateformat:checkbox failed for every PR regardless of that PR's own diff. This restores a green check.The failing set is churn from recent merges landing code that was not prettier-clean. Rebased onto current
mainand split into two commits:chore(format)— untrack + ignore.impeccable/, a machine-local tooling hook cache (session ids, timestamps, local absolute paths) that was git-tracked by mistake and failsprettier --check. Added to.prettierignoreand.gitignore. (database.types.tsis already handled by.prettierignoreonmain, so it needs no change here.)style— mechanicalprettier --write .of the 17 tracked files that were not prettier-clean on currentmain. Formatting only, no logic changes.Verification
npm run format:check— green (All matched files use Prettier code style!)npm run typecheck— passesnpm run verify:ui/verify:release/check:production-readiness/check:deployment-readiness— N/A (no UI, runtime, env, or deploy behavior changed)Clinical Governance Preflight
N/A — formatting-only change. Some reformatted files live under ingestion / privacy / auth / worker paths (
src/lib/privacy.ts,src/lib/supabase/auth.ts,worker/main.ts,src/app/api/**), but only whitespace / line-wrapping / clarifying-parens changed — no logic, control flow, source-verification, privacy, Supabase target, service-role access, or SaMD-classification behavior was modified.Notes
.impeccable/hook.cache.jsoncontained machine-local absolute paths and session ids; untracking + gitignoring it removes per-machine churn from the repo.main(151e4e3f2); force-pushed with--force-with-lease.🤖 Generated with Claude Code