Repository navigation
Add Fingerprint page to investigate model substitution - #516
Conversation
|
Thanks for this. I reviewed it at e5b5825 and read all of What I checked:
Under the repo's contributor rules, two things need the maintainer before this can merge: the new network hosts, and the minified bundles. Here is what to change.
Two notes on the repo itself: under the same offline sandbox, the root |
|
Addressed the review in 531ca11:
Validation: typecheck, 30 tests / 197 assertions, production build, package check, no-install extracted-tarball smoke test, and Chromium QA in a sandboxed host frame (English fallback, Traditional Chinese, menus and narrow layout). Regression tests cover the download boundaries and concurrent salt creation. The existing unrelated root-suite failures are retained in the PR notes. The requested source/build changes are ready for another review. Approval of the new hosts and minified bundles remains with the maintainers. |
yetone
left a comment
There was a problem hiding this comment.
Re-reviewed at 531ca11. Thanks, every point from my review is addressed, and I checked each one against the code. The code side is ready. What's left is the maintainer's call on the two new hosts, as you said yourself, so I'm not merging yet.
The six points:
- No download when the page opens.
GET /api/bootstrapnow calls onlycatalog()(src/server.ts:471), and reportsbankStatusfrom a localaccess()check.- Downloads happen in two places only. One is
POST /api/bank/download, behind the new Download reference data button. The other is a validPOST /api/jobswhen nothing is cached. A malformed job is now rejected before any download (createJobmoved aboveensureDetector,:509). ttl: Infinityreally stops the SDK's background refresh:loadDatarefreshes only whenDate.now() - checkedAt >= ttl * 1000(vendor/lmfpd-sdk/index.js:1921).- Both hosts and the IP disclosure are named on the page (
web/main.tsx:675-682, always shown under the button, en/zh-Hans/zh-Hant), inregistry.json(en and zh) and in both READMEs andintegration.md.
- Pinning claim: removed from README, README.zh-CN and integration.md, which now say
@latest, that there is no locally pinned hash, andbuiltAtper job. - Lockfile:
bun.lockis committed, every resolved tarball is on registry.npmjs.org, and the direct devDependencies are exact. - Language: a non-Chinese host language falls back to English (
web/locale.ts) and zh-TW gets Traditional. The boot page starts in English and follows the host, and the manifest titles now cover zh-TW, ja and de. - Wording: "Evidence, not proof" sits on the collapsed result row, next to the prediction (
web/main.tsx:1179-1181). - Minor points:
- The four native
<select>s are gone; none is left inweb/. - The health digest is now an HMAC-SHA256 keyed with a random 32-byte salt per install. The salt is published with
link(), so it is written once and never replaced, and the file is 0600.
- The four native
What I ran (Mac mini, Bun 1.4.2, through mote-run):
- Dist:
bun run rebuildfrom yourbun.lock(frozen,--ignore-scripts, registry.npmjs.org). It ran typecheck, 30/30 tests and the build.diff -ragainst the committeddist/showed no differences in any of the six files, so the minified bundles are exactly what the source builds. - Repo suite, as CI runs it, on this head merged with main at 848497c (clean merge):
HOME=$(mktemp -d) bun test: 3838 pass, 0 fail (3846 tests, 312 files).bun scripts/check.mjs: exit 0.- CI hasn't run on this PR (no checks reported), so this run is the record.
- Offline run:
bun testin packages/fingerprint, with a preload that refuses every non-loopbackfetchand socket, passed 30 of 30. Nothing was refused. - Broken by hand in
tests/bank.test.ts, each going red:- Restoring
ensureDetector()in bootstrap made 3 of 3 fail. - Dropping
ttl: Infinityfailed "an old cached snapshot is reused without background network refresh". - Validating the job after the download failed "opening, refreshing and invalid jobs never download reference data".
- Restoring
- Hosts and telemetry: I grepped
src/,web/,page/,scripts/,dist/andvendor/for URLs. The only remote hosts in code are stilllm.ikale.ioandcdn.jsdmirror.com. The others are loopback, plus the w3.org and react.dev strings React carries. There is nothing new since e5b5825, and there is no beacon, WebSocket, eval ornew Function.vendor/is unchanged.
Left for the maintainer:
- the two third-party hosts, now opt-in and disclosed;
- the fallback, which is
@lateston a jsDelivr mirror with no pinned hash. The page uses the data only to rank candidates and sends it nowhere, but a bad snapshot would rank wrongly.
Also for when it's merged: @magpie-community/page-fingerprint isn't on npm (npm view → E404), so trusted publishing can't create it. magpie will install it from the dist branch until an owner publishes the first version.
|
Thanks for the thorough re-review and the independent rebuild, offline/mutation tests, and full repository checks. I updated the PR description with your validation results and their exact head/main revisions, replacing the older local timeout notes. The current head remains I also recorded the first-publication limitation: the package is not on npm yet, and Magpie can use the |
|
Merged as 00f4d84. My call on the two hosts: they're acceptable as they are now. They're contacted only on an explicit Download or a valid job, they're named on the page, in registry.json and the READMEs, and the data is used locally to rank candidates and sent nowhere. The @latest fallback without a pinned hash is a known limit, and the page states it.
|
API model labels alone do not help users investigate suspected model substitution. This adds Fingerprint, a page that samples models through Magpie’s existing providers and compares numeric response fingerprints with lm-detector’s reference bank. Users can compare channels with three shared challenges, inspect candidate rankings and actual routes, and retain raw evidence in local history or export it as JSON. Each result summary labels rankings Evidence, not proof.
@magpie-community/page-fingerprintunderpackages/fingerprint, with a provider-menu action and English/Chinese registry entry.magpie web; English is the fallback, Simplified/Traditional Chinese are distinct, and the boot page also supports Japanese/German.lmfpd-sdk@0.2.0runtime/declarations with provenance and third-party notices. Installed bundles and offline tests need no dependency installation. Exact development versions andbun.lockuseregistry.npmjs.org;bun run rebuildperforms a frozen install and checks in an isolated temporary copy.https://lm.ikale.io/data/and fallbackhttps://cdn.jsdmirror.com/npm/lmfpd-data@latest/, named in the UI, registry and READMEs. These requests reveal the client IP but carry no credentials, model ids, prompts or replies.Starting a run sends three sampling requests per selected model and uses provider quota. Remote reference data is not release-pinned or verified against a locally pinned hash; each job retains its loaded snapshot and records
builtAt. Rankings provide evidence for investigation, not proof of model identity. New network hosts and the minified bundles remain subject to maintainer review.Validation at
531ca11:bun scripts/check.mjs fingerprint;git diff --check.bun run rebuildruns with Bun 1.4.4 and the committed frozen lockfile produced byte-for-byte identicaldist/(six files).npm pack --ignore-scripts, then extracted-bundle demo startup withoutnode_modules: bootstrap, four demo models and both UI assets verified.Independent re-review at
531ca11(review) confirmed all six requested changes and byte-identical rebuilt assets. On this head merged with main at848497c, the reviewer reported 3,838 repository tests passed, 0 failed (3,846 tests across 312 files), andbun scripts/check.mjsexited 0. Their non-loopback-denying sandbox also passed all 30 Fingerprint tests, and deliberate regressions in bootstrap loading, cache TTL and job-validation order each made the relevant tests fail. These are reviewer-run results; GitHub Actions still requires approval. They supersede the earlier local full-suite timeout notes.Maintainer decisions remain: accepting the two disclosed, opt-in reference hosts and the unpinned
@latestfallback. The new package is not yet on npm; Magpie can install it from the repository’sdistbranch until its first npm publication, as the reviewer noted.Standalone project and release: https://github.com/KaranocaVe/magpie-fingerprint/releases/tag/v0.2.0
Demo screenshot: https://github.com/KaranocaVe/magpie-fingerprint/blob/main/docs/preview.png