fix(validate): the scan missed four kinds of file, and vouched for prose - #114
Merged
Conversation
Closes #110 items 2, 6 and 1. Stacked on #111. ITEM 2 — the walker saw two directories and one extension set. Added: dashboard/*.html (the served shell — a preconnect, font CDN or script src here is a browser request), .css (skipped by EXTENSION while the walker was already standing in that directory), i18n .json, dashboard/vite.config.js, and scripts/. Maintainer-run is a caveat for the purpose field, not a reason to be invisible. That surfaced eight things nothing had ever mentioned, each read in source before being classified: scripts/build-pricing-seed.cjs really fetches the LiteLLM list -> request_from seed-snapshot.json records that URL as a value -> data_from dashboard/vite.config.js proxies /proxy/ipcheck -> request_from dashboard/index.html footer links to the upstream repo -> link_from www.tokentracker.cc JSON-LD metadata, not fetched -> new entry www.npmjs.com same block -> new entry schema.org JSON-LD @context identifier -> ignored example.invalid reserved never-resolving TLD -> ignored ITEM 6 — the inventory's prose was unchecked. `user_data: true` with `readme: false` passed; so did a wrong `from` and purpose text describing something the code does not do. The fields a reader trusts most were the ones nothing verified. Types and required values are now checked, and `from` is checked against WHERE THE HOST IS ACTUALLY REACHED — a host only ever requested from src/ cannot honestly be `browser`. ITEM 1 — unresolvable authorities were dropped. The issue's three examples (bracketed IPv6, a Cyrillic lookalike, a single-label intranet host) all resolve now; they predate deferring to new URL(). What is left is interpolation that pins nothing, which is ordinary code — which is why the flag-flip version had to be reverted inside #109. So each is declared with a why, matched on file + authority text, and a new one fails. 15 declared across 8 files: the local bind and Host-header parsing, git remote normalisation into project_ref, the user's own HTTPS_PROXY, dev-server proxying, and this scanner's own probe strings. Also: checkOutbound and collectHosts were both over the 50-line rule; split into scanLine (39), checkUnresolved (30) and checkInventoryMetadata (29), leaving them at 46 and 21. File is 640 lines. 19 new tests. The metadata check was proved non-vacuous against five deliberately-wrong entries before being committed, with a valid control. ci:local exit 0: 903 root tests, 256 dashboard.
5 tasks
This was referenced Jul 25, 2026
Merged
pitimon
added a commit
that referenced
this pull request
Jul 26, 2026
15 commits since v0.39.43. Tracker: #125. User-facing: - The Projects panel honours the date range. It read no query parameter at all, so picking "24h" narrowed every other card while Projects kept showing all-time totals with nothing on screen saying so (#118). - Per-repo cost, with rows written before the change named as unpriced rather than shown as a confident $0 (#121). - Sources with no per-repo attribution are named, instead of their absence reading as "that tool cost nothing here" (#118). - A plan-value card answering what README:32 already promised, labelled as list-price-equivalent rather than a saving (#122). - The Codex quota chip no longer vanishes on a 401 (#119). - `sync --compact`, which reclaimed 34,924 lines to 5,636 on a real install (#117). Behind the scenes: outbound-privacy validator hardening (#111, #114), avatar proxy per-hop revalidation, port-aware allowlisting and a real download cap (#109, #112), a parser conformance ratchet (#116, #120), scripts/graph out of the product gate (#115), and a usage-limits fixture capture tool (#124). Version bumped in all four lockstep locations by the `version` hook: package.json, package-lock.json, both TokenTrackerBar targets, and the Windows csproj. validate:version-lockstep passes. WATCH AFTER SHIPPING: #121 migrates cursors.json on every user's first sync after upgrading, re-keying project buckets from project|source|hour to project|source|model|hour. Without that the old bucket strands and its usage is counted twice. Verified read-only against a real 2,015-bucket state — every key migrated, total_tokens preserved exactly at 6,281,653,062, and all 2,015 queuedKey markers survived, the loss of which would re-append every row. That is one machine; a differently-shaped state is the residual risk. ci:local exit 0: 972 root tests, 302 dashboard. Co-authored-by: itarun.p <itarun.p@somapait.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
Closes #110 items 2, 6 and 1. Rebased onto main after #111 merged (the original PR #113 was auto-closed when its base branch was deleted); same commit, same content.
Item 2 — the walker saw two directories and one extension set
Added
dashboard/*.html(the served shell — a<link rel=preconnect>, font CDN or<script src>here is a browser request),.css(skipped by extension while the walker was already standing in that directory), i18n.json,dashboard/vite.config.js, andscripts/.That surfaced eight things nothing had ever mentioned. Each was read in source before being classified — declaring without looking would just be a waiver nobody reviewed:
scripts/build-pricing-seed.cjs:10request_fromsrc/lib/pricing/seed-snapshot.json:1data_frompindashboard/vite.config.js:1188/proxy/ipcheckrequest_fromdashboard/index.html×5sameAsto the upstream repolink_frompinswww.tokentracker.ccurl/logo/breadcrumbs — search-engine metadata, not fetcheddata_fromwww.npmjs.comdownloadUrl. Distinct fromregistry.npmjs.org, which npx really contactsdata_fromschema.org@contextidentifier, same class as thewww.w3.orgnamespaceignored_hostsexample.invalidignored_hostsItem 6 — the inventory's prose was unchecked
user_data: truewithreadme: falsepassed. So did a wrongfrom, and purpose text describing something the code does not do. The fields a reader trusts most were the ones nothing verified.Types and required values are now checked, and
fromis checked against where the host is actually reached — a host only ever requested fromsrc/cannot honestly bebrowser.Proved non-vacuous against five deliberately-wrong entries before committing, with a valid control that stays clean.
Item 1 — unresolvable authorities were dropped
The issue's three examples — bracketed IPv6, a Cyrillic lookalike, a single-label intranet host — all resolve now. They predate deferring to
new URL(). What is left is interpolation that pins nothing, which is ordinary code, which is exactly why the flag-flip version had to be reverted inside #109.So each is declared with a
why, matched on file + authority text, and a new one fails. 15 declared across 8 files: the local bind and Host-header parsing, git-remote normalisation intoproject_ref, the user's ownHTTPS_PROXY, dev-server proxying, and this scanner's own probe strings. A declaration that no longer matches the code is reported as stale, so the list cannot outlive what it excuses.Test plan
ci:localexit 0 — 903 root tests (+12 over fix(validate): trailing comments read as requests; waivers covered whole files #111), 256 dashboardvalidate:outboundgreen: 26 declared hostsurl(),scripts/, the dev config; five metadata violations plus a valid control; a new unresolvable authority fails, a declared one passes, a stale declaration is reportedcheckOutbound(46) andcollectHosts(21) back under the 50-line rule viascanLine(39),checkUnresolved(30),checkInventoryMetadata(29). File 640 lines.Remaining in #110
Item 5 (URL composition — following expressions rather than scanning literals) and item 7 (avatar body cap, which is PR #112).