Format worker/main.ts and remove its prettier carve-out - #195
Merged
Conversation
#180 excluded worker/main.ts from prettier because tests/worker-visual-capture.test.ts asserts on its exact source text, and prettier line-wrapping broke one assertion. Instead of a permanent carve-out, format the file and make that one assertion formatting-agnostic (match two stable substrings), so worker/main.ts is covered by the format gate like every other source file. Only 3 lines reformat (prettier is deterministic, whitespace only); only the structuredProfile source-guard assertion needed loosening. The file's other source guards are unaffected. Full worker-visual-capture suite passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #180. That PR fixed the chronic
format:checkdrift and added the required format gate, but it excludedworker/main.tsfrom prettier (.prettierignore) as a workaround:tests/worker-visual-capture.test.tsasserts on the file's exact source text, and prettier's line-wrapping broke one of those assertions.This removes that permanent carve-out so
worker/main.tsis covered by the format gate like every other source file:worker/main.tsfrom.prettierignoreand format it. Prettier is deterministic; only 3 lines actually reformat (two long calls wrap; one property access re-wraps) — behavior is unchanged.structuredProfileguard matched the whole wrapped line; it now matches two stable substrings (const structuredProfile = normalizeStructuredVisualProfile(andredactCaptionMetadataValue(metadata.structured_visual_profile)), which preserves the caption-redaction guarantee the test exists to protect while tolerating prettier's wrapping.Only that one assertion needed loosening — the file's other ~25 source guards are on lines prettier doesn't touch, so they're unchanged.
Trade-off (reviewer's call)
This reverses #180's deliberate
prettier-ignoreonworker/main.ts. Upside: the file is now auto-formatted and gated. Residual:worker-visual-capture.test.tsstill asserts exact source text elsewhere, so a future edit that grows an asserted line past 120 chars would trip the gate until that assertion is likewise loosened. If you'd rather keep #180's whole-file pin, that's a legitimate choice and this PR can simply be closed.Verification
npm run format:check— green (worker/main.tsnow conforms)npm run typecheck— passestests/worker-visual-capture.test.ts— all 9 cases pass (including the previously-broken guard)Clinical Governance Preflight
N/A — no behavior change.
worker/main.tschanges are whitespace-only (prettier). The test edit keeps the same caption-redaction guard (normalizeStructuredVisualProfilewrappingredactCaptionMetadataValue(metadata.structured_visual_profile)), just formatting-tolerant. No ingestion, privacy, source-governance, or Supabase-target behavior changes.🤖 Generated with Claude Code