iter-139: perf honesty II — unmeasurable vitals, byte attribution, page identity - #178
Merged
Conversation
Firefox structurally cannot measure layout-shift/longtask; perf vitals/audit fabricated "good" 0.0 for CLS/TBT anyway. Adds apply_unavailable_metric_fields (mirroring the iter-125 LCP guard) driven by PerformanceObserver.supportedEntryTypes, applied to perf vitals, perf audit, and perf compare. resource_by_type/resource_by_domain/third_party_summary previously excluded the top-level navigation document (a `navigation` entry, never a `resource` entry), making resource_by_type.document contradict navigation.transfer_size and reading third_party_summary as ~100% on pages with no other same-hostname subresources. Folds the navigation entry in as a first-party synthetic resource and adds per-type/per-domain opaque markers. perf vitals/audit also gain page_url + measured_at_ms; perf summary/audit text renderers now middle_ellipsis the slowest-resource URLs. Verified live against real headless Firefox (bbc.com/news, wikipedia.org) before and after the fix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…er-139 reuse pattern iter-137 (daemon-mode-parity) merged before iter-138/iter-139 both landed on top of it using the default daemon path, so Theme D's frame-scanning dependency is no longer a blocker. Also note iter-139's shared-helper / shared-spec pattern (middle_ellipsis, UnavailableMetricSpec) as the model to follow if Theme D/A/B end up needing the same field-shape logic in more than one place. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
perf vitals/perf audit/perf comparereported a fabricated "good"0.0for CLS/TBT — Firefox'sPerformanceObserver.supportedEntryTypeshas neitherlayout-shiftnorlongtask, structurally, so these can never be measured. Addsapply_unavailable_metric_fields(mirroring the iter-125 LCP guard, driven by the browser's ownsupportedEntryTypeslist) so both now reportnull/"unavailable"plus a note naming the missing entry type. Verified live on bbc.com/news and en.wikipedia.org, before and after the fix.resource_by_type/resource_by_domain/third_party_summarypreviously excluded the top-level navigation document (anavigationentry, never aresourceentry per the Resource Timing spec), soresource_by_type.document(a few hundred bytes, populated only by incidental ad iframes) contradictednavigation.transfer_size(tens of KB), and pages with no other same-hostname subresources read as ~100% third-party. Folds the navigation entry in as a first-party synthetic resource for these breakdowns, and adds per-type/per-domaintransfer_size_opaquemarkers (previously only flagged at the top-level summary).perf vitals/perf auditgainpage_url+measured_at_ms, so stale (pre-navigation) numbers are detectable instead of silently looking current.perf summary/perf audit --format text"slowest resources" tables now apply iter-128'smiddle_ellipsisto URLs — ad-tracker query strings previously produced single lines of 6000+ chars.Test plan
cargo fmt,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace -qall greencargo run -p xtask -- check-iteration-ready --plan kb/iterations/iteration-139-perf-honesty-2.md --base origin/main— 10/10 PASStests/live/live_139_perf_honesty_2.rs, all run and passed against real headless Firefox over the default daemon path (no--no-daemon):live_139_cls_unavailable,live_139_tbt_unavailable,live_139_audit_document_bytes_agree,live_139_audit_opaque_flagged_per_type,live_139_third_party_excludes_first_party,live_139_vitals_page_identity,live_139_perf_summary_text_boundedentry_type_supported, and text-truncation🤖 Generated with Claude Code## Claims vs code
<generated 2026-08-10T14:23:34Z by ralph-loop>
apply_unavailable_metric_fields→ ✅ matched in diff