Skip to content

Audit fixes: data correctness, security and cleanup (plan 01) - #57

Merged
woutervanwijk merged 22 commits into
mainfrom
claude/plan-01-audit-fixes
Nov 17, 2026
Merged

woutervanwijk merged 22 commits into
mainfrom
claude/plan-01-audit-fixes

Conversation

@woutervanwijk

Copy link
Copy Markdown
Owner

Implements docs/superpowers/plans/2026-11-15-01-audit-fixes.md (spec: docs/audits/2026-11-15-explorer-audit.md), 17 tasks plus a final-review fix round.

Data correctness

  • D1 Collector no longer crashes when resources are dropped from its buffer.
  • D4 HTML document weight comes from the browser's navigation entry; the app's own fetch is a fallback marked as an estimate.
  • D2 Size lookups never re-request known tracking pixels or third-party ping-like images.
  • D3 No cross-host / filename-only size matches; size-variant matches are shown as estimates. Matching moved out of HtmlService into derive/resource_matching.dart.
  • D5 Resource type comes from the browser's initiator type and extension (no URL substrings); fonts and video/audio get their own page-weight buckets.
  • D8 One "same site" definition from a pinned Public Suffix List (lib/utils/site.dart, generator in tool/), used by detection, sovereignty, estimates and cookies.
  • D9 Detection confidence is High/Medium/Low instead of a fake percentage; the longest cookie rule wins.
  • D10 Anycast CDN hosts no longer count as "located" in the residency check.
  • D7 source/diff.patch is a real unified diff (Myers), accepted by patch.

Security and privacy

  • D6 Collector runs in an isolated JS world on iOS/macOS (fetch/XHR patch dropped there); Android unchanged.
  • S2 iframes report resources via the native bridge (embedding page can no longer read them; forging is still possible, noted in the audit).
  • S3 Reader view page has a CSP forbidding scripts.
  • S1/S5 PRIVACY.md lists every third party the app contacts; sharing a package asks for confirmation first.
  • S6 debugPrint is silent in release builds; certificate dialog in English.
  • S7 RIPEstat requests carry sourceapp=viewsourcevibe.
  • Storage values never cross the JS bridge (sizes computed in the page).

Quality

  • Shared HTTP clients for RIPEstat and size lookups, draining/aborting on every path.
  • Dead code removed; filename generation moved to lib/utils/descriptive_filename.dart; one kAppVersion; avoid_print exemption limited to test/ and tool/. html_service.dart 5454 → 4743 lines.

Verification

  • flutter analyze clean; flutter test 1441 passed, 1 skipped.
  • validation/run.sh on all ten sites, branch vs main: identical totals (ok 415, wrong 14, volatile 9, gap 5). One per-site difference on kvk (survey widget hosts) did not reproduce in two re-runs.
  • Each task had a spec + quality review; a whole-branch review asked for five follow-ups, fixed in the last commit.

Known limits / follow-ups

  • About 190 file extensions have no syntax highlighting in the source viewer (pre-existing; the unused richer mapping was removed).
  • IDN multi-label public suffixes are stored in Unicode and miss punycode hosts (rare).
  • Anycast hosts still get a GeoLite region label in the region chart.
  • RIPEstat asks regular sourceapp users to email stat@ripe.net with the identifier.

🤖 Generated with Claude Code

woutervanwijk and others added 22 commits November 16, 2026 18:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l the section

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The vsvFrame handler is untested on a real browser here (validation gate
left to the controller); postMessage remains the fallback path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bucket

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d patterns

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…connections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Myers on lines with hunks and context, `\ No newline at end of file`
markers, and a manifest `diff` state (present / exceedsLimit /
notApplicable) instead of a line-N-vs-line-N comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a package

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at app name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onstant

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removed: lib/utils/page_weight.dart (resourcesBySize/ResourceSize had no
users in lib/ or integration_test/) with its test, HtmlService
loadServerSourceForDiff, cancelPendingHighlight (and its unused timer
field), getLanguageForExtension (tests now use
SourceViewerEditor.getLanguageForExtension, which the app uses).
generateDescriptiveFilename moved verbatim to lib/utils/descriptive_filename.dart.

Expectations changed in enhanced_language_support_test to what
SourceViewerEditor returns: tsx -> typescript, h -> c, and about 190
extensions (json5, vue, svelte, kt, scss, toml, ini, ...) -> plaintext.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted the 177-assertion all-plaintext test; plaintext expectations moved
out of the "should be supported" tests into one small fallback test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…frame bridge fallback, S2 comment, privacy wording)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@woutervanwijk
woutervanwijk merged commit a16af00 into main Nov 17, 2026
1 check passed
@woutervanwijk
woutervanwijk deleted the claude/plan-01-audit-fixes branch November 17, 2026 10:08
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