feat(frontend): seal and upload steward datasets in the browser (P40) #280
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #280"
general
weight: 0.35
abendrothj
What and why
Plan item P40 (
docs/V1_PLAN.md). Part of #221: the browser half of the steward upload (ADR 0012). The issue stays open for sign-in (P32), as the maintainer's note on #221 says, and for the hybrid suite (#186) and #175's enrollment check.GET /api/v1/datasets(id, object count, ciphertext size, suite, write time), on every load. The publish form picks from them instead of taking a free-text slug.lib/datasets/footer.worker.tsreads only the file's tail (Blob.slice: the trailer, then a footer of at most 16 MiB), decodes it with hyparquet's Thrift decoder, and declares each column's name and type family by the rules of the enclave's Parquet reader, the embedded Arrow schema included (parquet-rsapply_hint). Column statistics are never decoded. It refuses a file the enclave could not read or declare; the form also refuses a schema unlike the dataset's recorded one and a file whose sealed object would exceed the limit, all before anything is sealed. The form says in one line that column names and types are stored in plaintext.uploadDatasetoperation uses the device's existing key and never creates one, refuses unless the tenant's enrolled key is that key, binds the session'stid, draws the object id and the version, seals the object and the manifest (HPK1until #186), zeroes its copy of the plaintext and sends the body. A 401 or 403 is shown clearly.GET /api/v1/datasetsnow gives each upload's declaredrow_capandschemafrom its record (null for a connector's dataset or an unreadable record), anddataset_max_bytes. Both were already visible to the operator (ADR 0012); #246 left the schema out to follow its issue's field list and noted that #221 would need it.snapshot::recorded_suiteis nowread_record.docs/BENCHMARKS.mdrecords the upload timed at the 64 MiB limit in a real browser: about 0.6 s of browser work on an Apple M4 once the wasm module is loaded, about 90 % of it the seal, so the 64 MiB default stands. It is a recorded manual run because the upload needs a running API, which the browser job does not start; the seal joins the regression run through #255. @AxolDad, the proposed target is there (footer read within 100 ms, upload within 3 s once the module is loaded, network excluded); please confirm or adjust it.scripts/check.shkept only data files whose path contains/fixtures/, so it refused the Parquet vectors in the repository's top-levelfixtures/(CI's first run on this PR). It now accepts afixtures/directory at any depth, checked against the tracked vectors and look-alike paths such asnotfixtures/andfixtures-old/, which it still refuses.scripts/is code-owned.How it was tested
fixtures/parquet/, 28 synthetic files):quackxide-engine/tests/parquet_schema_vectors.rswrites them and runs the enclave's ownregister_parquet_declaredon every file the browser declares;footer.test.tschecks the browser against the sameschema-vectors.json. They cover every type family, legacy converted types andINT96, the embedded Arrow schema's refinements (Date64andTimestamp(Second)stored asINT64, a binary named a string, the last entry winning), nested, repeated, binary,Float16, time, duration, interval, null, UUID andENUMcolumns, malformed, renamed and extra-field embedded schemas, duplicate, long and control-character names, 513 columns, and no rows.fixtures/envelope/hpk1-browser-upload.jsonis a body sealed by the browser's own upload code;a_browser_sealed_upload_opens_in_the_enclave(dataset_upload_api.rs) stores it through the route and queries it, so both envelopes open with the backend's open path and the declaration matches in the enclave.footer.test.ts,arrowSchema.test.ts): not Parquet, encrypted, a footer longer than the file or than the 16 MiB cap, truncated and non-Thrift footers, 22 footers parquet-rs would not read, row counts, name limits, tail-only reads, and property tests on arbitrary bytes.datasetUpload.test.ts,worker.test.ts,protocol.test.ts): the body round-trips through the real wasm seal, the version andinfobindings, the plaintext copy is zeroed, each refusal comes before sealing (no session, a non-canonicaltid, no key, no enrolled key, another enrolled key, a rejected session on the key check, a file over the limit), the API's 401, 403, 404, 409, 413, 422 and 503 are shown clearly, and no key is ever created.DatasetUploadForm.test.tsx,PublishForm.test.tsx,ResearchPortal.test.tsx): the real footer reader under jsdom for the malformed cases, labels androle="alert", the schema mismatch, the upload through the crypto worker under the portal's token and the reload after it, and a failed listing.dataset_upload_api.rs,snapshot.rs): the declared row cap and schema for uploads, null for connectors and unreadable records, and the configureddataset_max_bytes.footer.browser.test.tsruns the footer worker in real browsers. It did not run locally (no Playwright browsers here); CI's browser job runs it.Checklist
scripts/check.shpasses locallySECURITY_AUDIT_EVENTcovered byaudit_coverage.rs(n/a: the new refusals are in the browser; the routes' events are unchanged)docs/DATA_POLICY.md)CHANGELOG.mdupdated for user-visible changesdocs/adr/if one was made (ADR 0014)