Commit History
-
Compare reachability: one hop from where the question arises
TheYuchen* RunHistory: while exactly one compare checkbox is ticked, a status chip at the panel top says what completes the gesture ("1 of 2 picked — tick one more run, or A/B a card in Multiverse"); the first tick used to feed only a tab badge. * Fidelity card: with >=2 archived runs of the current configuration the across-runs strip grows a "compare vs previous run" link (marker compare-vs-previous) setting compareIds to the two latest run_ids via the new store action setCompareIds — the Evidence pane's existing length===2 auto-switch takes over.8311ef0 -
Remove the GMU-branded theme entirely
TheYuchenDouble-blind treatment is no longer needed (reviewers see the paper, not the site), and the branded palette was the last piece of identity chrome with real maintenance cost: theme.ts gated it behind ANON, vite.config.ts carried a CSS-stripping generateBundle hook, and every new visual had to be checked under a third palette. - theme.ts: ThemeKey is light|dark; gmu entry gone; stored "gmu" preference migrates to the light default (comment documents it). - index.css: [data-theme="gmu"] token block deleted. - vite.config.ts: %THEME_KEYS% is always ["dark"]; the anon CSS-stripping hook is retired (nothing left to strip). The rest of the VITE_ANON machinery (titles, manifest) is unchanged. - Stray "three themes" comments updated. Residue grep: only the migration comment mentions the old key.ceee520 -
Wave Q: paper figure pipeline (trace scrubbing, AI-grade SVG, 4x raster)
TheYuchenFilmstrips: Evidence Theater gains a batch-index trace scrubber (replayed/archived runs only; live path untouched) that renders the chart AS OF batch k — truncated intervals/envelope, "so far" readouts, stop annotation only once reached. Exports in a scrubbed state are bit-exact per (trace, k) and embed trace_position in the provenance; F0 filmstrip recipe (batch 2 / batch 4 / final) documented with live-verified widths (±3.06 / ±2.16 / ±1.93pp). Illustrator-grade true-SVG: new lib/svgPaper.ts holds the pure presentation-inlining logic (whitelisted attributes resolved via getComputedStyle to literals — zero var()/currentColor/class/<style>; concrete font stacks; px normalized; viewBox-derived pt sizing; standalone XML header) with a plain-node unit test (scripts/check_svg_paper.test.ts) and a per-export safety audit. Raster: hybrid PNG at explicit pixel dimensions (never devicePixelRatio); 2.5x default, 4x via alt-click/long-press on the camera. Files named <view>_<scenario|runid>[_b…9ee0efc -
Evidence Theater: steering becomes the visual protagonist (+F0 teaser)
TheYuchenThe system's most novel contribution -- anytime evidence steering (streaming CI narrowing + optional stopping, Wave I) -- was the smallest element on screen. New EvidenceTheater overlay (auto-opens on the first step_progress frame, dismissable, localStorage auto-open pref, toolbar + fidelity-card reopen affordances): one big SVG funnel per sampled node -- per-batch Wilson CIs on a linear shots axis with convergence envelope, first-interval-anchored auto-zoom, dashed target corridor + early-stop annotation with unspent-shots region, client- timed cost row (caveat commented) with server-total fallback, and a context strip (config hue chip, live root-seed via new runStream onMeta hook, pooled prior-evidence archive band). Store retains per- node stamped traces until the next run so the theater outlives the step; true-SVG figure export with embedded provenance. Scenario F0 (the teaser): bell_state on FakeFez, 4096 shots, sampled fidelity, target +/-2pp, pinned seed 2026 (probed live: all …f686793 -
Audit M1-M3 + minors: lineage, stopping disclosure, anon scrub
TheYuchenM1 scenarios.ts QUCAD_GRAPH is now a literal copy of bundled demo record 5c2a6a71a7a4's graph (ids n1..n5, sampled fidelity, same params/positions) instead of an s1..s5/statevector rebuild — F1/F5 runs now group with the demo cards (same config_hash) and pinned seed 336157917 replays the archived numbers bit-exactly. M2 Optional-stopping honesty in three places: limitation block at the stopping rule (qlib/qiskit_utils.py — width-based data-dependent stopping perturbs exact nominal coverage of the final fixed-n interval; confidence sequences are the rigorous alternative), one sentence in the Wave I doc section, and a clause in the precision-target tooltip. M3 Anon builds scrub the branded theme completely: generateBundle strips the [data-theme=gmu] CSS block, and theme.ts gates the stored-preference fallback behind !ANON so the key literal is dead-code-eliminated from VITE_ANON JS (runtime ?anon=1 behavior unchanged). Anon dist grep…e52951c -
Audit fixes: cache-hit node_id re-stamp, anon key, honest copy
TheYuchen* workflow_service: a step-cache hit now re-stamps the CURRENT node's id onto the served StepResult. The prefix hash ignores node ids, so a cached step written by a graph with different ids was served verbatim (live-reproduced: an s1..s5 scenario run poisoned a n1..n5 archive replay, which came back with node_ids s1..s3 the frontend cannot map). NOTE this fix only repairs the id, not the deeper pinned-cache identity hole — per-node seeds derive from node ids but the pinned cache key does not include them, so structurally-identical graphs with different ids can still serve each other's draws under the same root seed (see audit report). * FlowCanvas: ribbon-legend localStorage key renamed quaim-* -> quda.* ("quaim" matched the identifying Space slug and shipped in the VITE_ANON bundle, contradicting the doc's anon-audit claim). * scenarios/doc: F3's expected stop corrected to the value the live API actually produces (2,560 of 4096 shots; 512-shot batch granulari…18ca665 -
Wave J: uncertainty-in-provenance (evidence-mass lineage, pooled CIs)
TheYuchenProvenance views stop pretending states are deterministic — lineage nodes ARE distributions, so the timeline now shows how certainty accumulated over the session. Minimal honest version, one task per mark: * evidence mass (marker `evidence-mass`): lineage dot AREA propto sqrt(executed shots), radius 3-7px against a fixed 2048-shot reference; early-stopped runs are visibly lighter. Ring / slash / edges / hover target track the radius; tooltip gains "N shots of evidence". * replicate-band certainty funnel: pooled Wilson CI half-width at each row (counts summed oldest->newest; valid within a config group: same underlying p), mirrored polylines around the lane spine, narrowing upward ~1/sqrt(N) — Wave I's funnel motif, second context. Tooltip: "pooled +/-X.Xpp after n runs / N shots". * lib/stats.ts (new): wilson95 ported from app/services/stats.py::wilson_interval with unit-anchor comments; runEvidence / poolEvidence helpers. * Multiverse cards: "pooled mu x.x% +/-y.y…75184f5 -
Wave P: correct F3 expected stop point (verified against live API)
TheYuchen38c04fd -
Wave P: paper-first reorientation
TheYuchenDe-product: remove WelcomeTour(+slides), AuthButton/session UI, Support(NSF)/Papers/Developers popovers, Lab link, UploadPluginModal trigger; plugin protocol stays live via API. Neutral index.html title/meta + PWA manifest. Header = name/tagline/env chip/live toggle/theme. Anonymous mode (double-blind): lib/anon.ts. VITE_ANON=1 build folds identifying strings out of the bundle (EvidenceQ codename, no paper bibtex, no GMU theme, vite plugin rewrites index.html+manifest); ?anon=1 runtime fallback hides the same surfaces on normal builds. Audit: zero user-visible identifying strings in the anon dist. Figure export with embedded provenance: lib/figureExport.ts + camera buttons on canvas toolbar / Multiverse header / Evidence header. True-SVG for svg targets, foreignObject-SVG + 2.5x PNG for HTML composites; paper transform (white bg, fonts x1.25, chrome stripped); SVG <metadata> + .provenance.json carry app version, export time, run_ids/root_seeds/config_hashes of every visible run and t…79cd0aa
-
Wave I: anytime evidence steering (live CIs, optional stopping)
TheYuchenBackend: sampled fidelity always runs as B=min(8,max(2,shots//128)) batches; batch i seeded sha256(f"{node_seed}:batch:{i}") so replays are bit-exact regardless of any run's stopping point. Streaming SSE interleaves {"step_progress": {node_id, batch_i, n_batches, shots_done, successes, point, ci95}} frames (worker thread + queue in the executor; eager path unaffected). RunRequest.precision_target (CI half-width, (0,0.5]) = server-honoured optional stopping, min 2 batches; distribution records shots executed vs requested, stopped_early, and the full per-batch trace. qlib duplicates the Wilson fn (no app import from qlib); twins pinned equal by test. Frontend: toolbar precision-target select (off/±5/±2/±1pp); live narrowing CI band + shot counter on node faces from streamed frames; evidence-funnel in the fidelity card (one line per batch, opacity ramp, target ticks at point±target, early-stop annotation); RunRecord persists precision_target + stopped_early; restore/replay writes the tar…7fa375a -
Memoize fake-backend noise models; first-visit demo archive machinery
TheYuchenBackend: AerSimulator.from_backend / NoiseModel.from_backend rebuilt the full 100+ qubit device noise model on every sampled-fidelity and QuCAD step (~40-90 s of GIL-bound Python per fresh run — the dominant cost of every uncached run on the Space). Fake* snapshots are frozen, so the derived model is memoized by backend name (live IBM backends never cached). qlib/qiskit_utils.aer_simulator_for / noise_model_for. Frontend: plumbing for a bundled first-visit evidence archive — RunRecord.demo flag, lib/demoArchive.ts (ensureDemoArchive imports data/demoArchive.json via buildRunRecord on first visit only, decided flag quda-demo-decided, clearDemoRuns), DemoArchiveBanner on the Multiverse board + History tab, per-row demo chip, multiverse landing for first visits, welcome-slide tagline reframed to the evidence story. Archive JSON itself ships in the next commit (placeholder []).b84dc32 -
Seed coverage for QuBound/Qshot + cost estimates from run history
TheYuchenCloses the two remaining claim-integrity gaps for "every run is exactly replayable" over "stochastic, costly experiments": Seeds. QuBound trains its LSTM on BOTH ok paths (live IBM history and the cached 14-day pickle) — there is no precomputed-only branch in the handler — so both now seed the global RNGs (_seed_stochastic_libs: random + numpy + lazily-imported, try/except-guarded torch) and thread node_seed into qlib (Aer seed_simulator + Sabre seed_transpiler in get_labels_fromNoise); results carry nondeterministic=True + seed_used. Qshot's pilot seed was 99991 + hash(str(base)) — str hashes are PYTHONHASHSEED-salted, i.e. "fixed" only until the next server restart. pilot_seed is now threaded predict → recommend_shots → compute_pilot_pf, making the recommendation reproducible across processes given the seed. Executor cache logic untouched: fresh runs draw fresh node seeds (honest new draw, cache-bypassed), pinned runs re-derive the same seeds (cacheable in the seed-salted namespace)…91b2cd9 -
Multiverse board: configurations as small-multiple evidence
TheYuchenThe set of configurations the analyst has tried becomes a first-class workspace. A Compose|Multiverse segmented toggle in the canvas toolbar flips the center column to a MultiverseBoard: one card per config_hash group, each with a topological pipeline schematic (family-colored 8px squares, warn dots on stages whose params differ from the baseline), the outcome distribution on a shared 0-1 scale (group hue, mean tick, latest emphasized), Δmean vs the most-tried (baseline) configuration in pp with an "(n small)" honesty flag under 3 replicates, and Open/A-B actions wired into the existing restore + compare bridges. The board overlays the canvas instead of replacing it so React Flow graph state and the pendingRestore watcher survive mode flips. hashHue/hueCss move to lib/hues.ts, shared by RunHistory and the board so a configuration keeps one color everywhere. Tour welcome slide gains one sentence pointing at the mode.4bf1a9d -
Evidence pane: tabbed IA, shared-prefix folding, reproducible export
TheYuchenInformation architecture: the results pane is now the Evidence pane with three tabs — Current run (step cards + final metrics + hints), History (lineage view, always expanded, no own collapse toggle when embedded), Compare (instruction pointing at History's checkboxes until two runs are picked). Badges: History = archive size via a new countRuns() IndexedDB count (refreshed on historyVersion), Compare = selection count. Auto-switch: starting a run -> Current; ticking the 2nd compare checkbox -> Compare. flex-wrap tab bar so the pane still works inside the mobile drawer; collapsed strip + drawer title renamed to Evidence. Comparison: consecutive leading step rows that are identical on both sides (same node kind, no structural param diff for that kind, equal transformation-signature deltas) fold into one expandable "shared prefix - N steps" <details> row; the first divergent row carries an accent left border + "divergence point" label. Rationale in code: the analytical question is where…f25d955 -
Composition comparison: two archived runs side by side, CIs not scalars
TheYuchenPhase 3 (minimal viable) of the evidence-workbench rework. Pick any two runs in the history panel (checkboxes, keep-latest-two) and a comparison panel renders: * configuration diff — params matched structurally by (kind, occurrence) exactly like configHash, so node ids and layout don't matter; circuit swaps surface as a "circuit" row; * same-configuration detection — when the config hashes match the panel says so explicitly ("differences are noise"), because that changes how any metric gap must be read; * fidelity compared as intervals — both Wilson CIs on one 0-1 scale with the Δ in percentage points, and an explicit "intervals overlap: not evidence" callout when the difference is within run-to-run noise at these shot counts; * step-by-step alignment with each side's transformation signature.d105dc7 -
Transformation signatures: uniform circuit-delta vocabulary per step
TheYuchenPhase 2 (part 1) of the evidence-workbench rework. The executor now snapshots the circuit's structure (shape + gate counts by op) before and after every dispatched node and stamps a uniform transformation payload onto each successful StepResult: before/after snapshots, shape delta (qubits/depth/gates/params), per-op count delta, and a changed flag distinguishing pass-through steps from mutating ones. Captured centrally — handlers (and user plugins) never build this themselves, which is what keeps the vocabulary identical across QuCAD pruning, CompVQC folding, transpiles, and anything a plugin does. Kind-specific detail stays in each handler's summary. Frontend renders it at two densities: SignatureTile on canvas nodes (nonzero delta channels only, e.g. "D-4 G-12 P-12"; decrease=green since every optimizer in the catalog aims downward, increase=amber, qubit-width neutral) and SignatureCard in the results pane (before → after per channel + per-op chips). Pass-through steps say so expli…f956d64 -
Provenance timeline: run archive, restore/replay/fork, replicates
TheYuchenPhase 1 of the evidence-workbench rework. Every completed run is now archived client-side (IndexedDB — the server stays stateless by design) as an immutable RunRecord: the graph in share-link serialization, the full per-step response, and the seed envelope. Run history panel (results pane): newest-first timeline with a structural configuration hash chip — runs sharing a chip are replicates of the same experiment. Actions per entry: restore (canvas + circuit come back exactly), replay (restore + pin the recorded root seed, so Run reproduces the exact draw), delete. Restores thread forked_from lineage into subsequent records. Replicate execution: a ×1/×5/×10/×20 selector runs the same configuration N times with fresh seeds, sequentially, archiving each draw. The fidelity card now renders sampled results as what they are — a draw, not a number: Wilson 95% CI on a fixed 0-1 scale, the top-outcome histogram, the consumed seed, and an across-runs strip that accumulates one dot per archived…f2c03b7 -
Provenance core: run identity, replayable seeds, distribution payloads
TheYuchenPhase 0 of the evidence-workbench rework. Every run now gets a server-stamped provenance envelope (run_id, seed_mode, root_seed, app_version) in both the eager and SSE routes; the SSE stream opens with a run_meta event. Every run draws a root seed even when the caller doesn't pin one, so any historical run is replayable later by sending its recorded seed back. Per-node seeds derive from sha256(root_seed, node_id) — independent of execution order and of unrelated graph edits, keeping A/B comparisons honest. Sampled fidelity accepts the seed (seed_simulator) and reports a structured distribution payload: binomial successes/shots, Wilson 95% CI, top-16 outcome histogram. Cache semantics: seed-pinned runs live in a salted cache namespace and may cache stochastic steps (reproducible by construction); fresh runs keep today's namespace and the nondeterministic bypass. Precomputed disk-cache responses are never served for pinned runs. 19 new unit tests (seed derivation, Wilson edges, salted…2efd890
-
Polish pass: dedupe pipeline runners, shared chip component, emitter map
Yuchen YuanThree concrete refactors that reduce surface area for future bugs and make the codebase easier to maintain by hand or by LLM. 1. backend/app/services/workflow_service.py — run_pipeline and run_pipeline_stream used to be two 100+ line copies of the same dispatch loop. Extract a single _execute_pipeline generator and make both functions thin wrappers (one collects into a list, the other yields). Per-node dispatch (input / built-in / plugin / skipped) and the post-step circuit_shape stamping are factored into _dispatch_one_node. Plugin hydration becomes a named helper instead of an inline block duplicated on both paths. Also pulled out _clamp_shots and _set_backend_ctx so the two backend handlers share their shots-clamping and ctx-writing patterns; _cache_put's prefix_types argument becomes required (all call sites pass it; the dead 'None means skip sidecar' branch is gone); the run_cache.qpy_dump_bytes import moves to the top of the file with the …4ee621f -
Fix sampled fidelity being frozen by the per-node step cache
Yuchen YuanThe SSE run path caches each step's StepResult+ctx snapshot keyed on the pipeline prefix. For deterministic blocks (statevector fidelity, QuCAD output, etc.) that's a feature: re-runs reuse the trained model or computed metric. For sampled fidelity it was a silent scientific bug — the first shot draw got frozen and replayed forever. Reproduced live: 5 SSE runs of bell + FakeFez + fidelity(method=sampled) returned identical 0.5938 with from_step_cache=true after the first run. Fix: handlers can mark a StepResult as nondeterministic. The stream loop carries a sticky flag — once a nondeterministic step is emitted, both cache lookups AND cache puts are disabled for the rest of that run, including all downstream steps (their ctx depends on the fresh draw, so a lookup hit would restore a contradictory state). Frontend renders a 'live' chip on those steps so users know the cache is intentionally bypassed. Statevector fidelity is unchanged (still cacheable). QuBound / Qshot / QuCAD are als…b3ebd47 -
Fix exported script header URL: point to jqub21-quaim space
Yuchen YuanThe exportPython header was still referencing the qudastudio-app mirror. Since we now only maintain jqub21/quaim, point users at the canonical URL.50e62eb
-
Second-order checks: export gaps, pre-flight rule, backward compat
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Audit pass after Fidelity/QuBound/Backend changes to catch the downstream code that wasn't updated. exportPython.ts — 4 gaps fixed - fake_backend + ibm_backend export: now writes the user-set shots into the generated script. - qubound export: now writes the threshold + pass/fail check + margin printout so the exported script matches the canvas's behaviour. - fidelity export: the call signature changed (returns tuple, takes unbound_param_policy). Previously called the old signature, which would have crashed on every exported pipeline. Now branches on method: * statevector: calls simpleFidelityEstimator(qc, unbound_param_policy=...) * sampled: calls sampledFidelityEstimator(qc, backend, shots=shots, unbound_param_policy=...) Tuple unpacking captured both fidelity + meta. Print line identifies which method is in use. Pre-flight rule added Fidelity in `sampled` mode needs a backend upstream — that's where the noise model and shots come from. Without a backen…adb5d6a -
Fix Fidelity on parameterized circuits + QuBound threshold + Backend shots
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Three user-reported issues, all addressed with proper logging and actionable error surfaces. Issue 1 — Fidelity crashed on parameterized circuits simpleFidelityEstimator used Statevector.from_instruction(qc), which refuses circuits with unbound parameters. ry_chain_6q has 12 such parameters; Fidelity throw "TypeError: Parameter expression with unbound parameters … is not numeric" which surfaced as a generic "unexpected error" in the result card. The estimator now takes an `unbound_param_policy` argument: * "bind_zero" (default) — auto-binds free params to 0, matching the convention QuBound already uses internally, and reports `bound_unbound_to_zero: N` in the summary so the user sees what we did. * "error" — refuses and raises UnboundParametersError with the actionable message naming the offending param count and suggesting the upstream fix. _handle_fidelity catches UnboundParametersError specifically and maps it to a clean error step (the message is shown v…286193c
-
Canvas becomes data-aware: shapes, headline metrics, perf tint, pre-flight
Yuchen Yuan +1: Claude Opus 4.7 (1M context)After a Run, the canvas itself shows what's happening at every node and every edge — instead of just being a connection diagram with the real numbers banished to a sidebar. circuit_shape on every StepResult (backend) StepResult schema gains a CircuitShape sidecar field ({num_qubits, depth, size, num_parameters}). workflow_service snapshots ctx["circuit"] AFTER every successful handler and attaches it to the step. Built-in handlers and plugin steps both populate; ctx-less steps (source plugins with no upstream, errored steps) leave it as None. Edge data-flow labels (frontend) styledEdges memo in FlowCanvas reads the SOURCE node's circuit_shape and attaches a tiny monospace label to the React Flow edge: "5q · d8 · 17g". Falls back to no label when the source step doesn't have a shape (no run yet, or source errored). Drop-target highlight during drag-to-insert composes on top. Per-node headline metric + duration chip + tone (frontend) New lib/headlineMetric.ts table picks the most r…33e7bee -
Global code-quality polish: DRY + named constants + leak cleanup
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Targeted refactor pass based on a structured audit. Pure maintainability wins; no behaviour changes. Frontend: collapse 8 popovers into one hook 8 components (AuthButton, ThemeSwitcher, MoreMenu, PapersPopover, SupportPopover, DevelopersPopover, BlockPicker, PresetPicker) each carried an identical 16-line "close on mousedown + Escape" effect block. Extracted to lib/useDismissOn.ts; ~150 lines deleted, one hook to audit instead of eight. useDismissOn(open, rootRef, useCallback(() => setOpen(false), [])) Behaviour is intentionally identical to the inlined block so older git-blame on the call sites stays coherent. Backend: consolidate effective-user-id resolution routes/plugins.py and routes/workflow.py each carried a subtly different implementation of "session cookie wins over query_user_id, anon hf_ prefix is reserved". Pulled into auth_service.resolve_effective_user_id(request, query, *, required). - required=True path raises ValueError → routes/plugins maps to 400 - required=…57f0b3e -
Mobile + large-touchscreen UX overhaul
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Addresses a 15-finding audit covering viewport handling, safe areas, touch behavior, hit-target sizing, and iOS Safari quirks. Viewport + PWA chrome - viewport meta gains viewport-fit=cover + interactive-widget= resizes-content so safe-area-inset(*) applies and the iOS keyboard triggers layout reflow instead of just overlaying content. - theme-color set for light + dark via prefers-color-scheme media queries — browser chrome now blends with our surface instead of flashing white. apple-mobile-web-app-* meta + apple-touch-icon let the app feel native if added to home screen. - New /public/manifest.webmanifest registered, minimal but sufficient for installable-PWA detection. Dynamic viewport (100dvh) - App.tsx root: h-screen → 100dvh inline (with fallback). Was clipping ~80px under iOS Safari's collapsing address bar on first paint. - UploadPluginModal max-h moved from calc(100vh-2rem) to calc(100dvh-1rem) + safe-area-inset-bottom padding so the modal fits even whe…5c7eb51 -
Display fix + focus trap + mobile touch drag-to-edge-insert
Yuchen Yuan +1: Claude Opus 4.7 (1M context)DevelopersPopover layout fix When Yuchen Yuan's row gained a second link chip (LinkedIn), the single-row "icon + truncated name + chip + chip" layout squeezed the name down to its first letter ("Y") inside the 320px popover. Restructured to two rows per person: name on top (full width, no truncation), link chips below with flex-wrap. Single-link entries still look natural — the chip row simply contains one chip. Focus trap for modals + drawers New lib/focusTrap.ts useFocusTrap hook implements WAI-ARIA Authoring Practices for dialog focus management: - On open, focus moves into the container (prefers the container itself if tabIndex=-1, else first focusable child). - Tab from the last focusable wraps to first; Shift+Tab from first wraps to last. - Defensively re-routes focus into the container if something else steals it (e.g. async overlay). - Caller restores focus on close — we already do this for the upload modal and auth dropdown via their existing openerRef pattern. App…defa0ba -
Plugin output: typed figures (markdown / table / bar / svg / png)
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Plugins can now emit a list of typed visual outputs beyond the flat summary dict. Each figure is a small JSON object with a `type` field; the result card renders them inline below the summary table. Five types ship today - markdown — headings, lists, bold/italic/code, fenced code blocks. Raw HTML is rejected by the backend; the frontend renderer never reaches for dangerouslySetInnerHTML on this path. - table — headers (≤ 12 cols) + rows (≤ 100 rows), primitives only. - bar — inline SVG bar chart, up to 50 bars, zero JS deps. - svg — escape hatch with sanitisation: rejects <script>, javascript:, <foreignObject>, <iframe>, <object>, <embed>, and any on*= event-handler attribute. Up to 256 KB. - image_png_b64 — base64-encoded PNG, ≤ 1 MB decoded, must have the PNG magic bytes (JPEG/GIF/other formats rejected). Each figure also accepts an optional `title` (≤ 120 chars) rendered as the panel header. Total `figures` list capped at 10 entries. Backend - New plugin_run…725a720
-
Drag-to-insert + plugin lifecycle UX fixes
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Drag-to-insert (new feature) When the user drags a block from the palette and the cursor passes within ~60 flow-units of an existing edge, that edge lights up with an accent-coloured dashed animation. Dropping the block onto a lit edge splices it in: the old edge is removed and replaced by two new edges (upstream → new node, new node → downstream). Implementation: - New _findClosestEdge_ helper does line-segment-distance hit testing against every edge's source-right-center → target-left-center approximation. Threshold is in flow coordinates so it scales with zoom. Falls back to default 200x56 node footprint when React Flow hasn't measured yet. - _onDragOver_ checks for the palette's `application/reactflow` data type and computes the closest edge each frame, setting dropTargetEdgeId. - _onDragLeave_ clears the target so the dashed highlight doesn't linger if the user abandons the drag outside the canvas. - _onDrop_ captures dropTargetEdgeId, clears it, then either splices…dca3016 -
Multi-user: HF OAuth login + per-user plugin persistence
Yuchen Yuan +1: Claude Opus 4.7 (1M context)What this lets users do - Anyone can click "Sign in" in the top bar and authenticate with their Hugging Face account (OpenID Connect via the HF OAuth flow). No account creation, no password management on our side. - Each signed-in user gets their own private namespace for uploaded plugins. Other users (and other browsers from the same person) cannot see them. - Plugins uploaded while signed in are mirrored to a private HF Dataset repo (qudastudio/quda-user-data) so they survive container restarts and follow the user across devices. - Guest (anonymous) mode is fully preserved: visitors can still drop a .zip without signing in; those plugins continue to live in /tmp and are per-browser, exactly as before. Architecture Browser ──cookie──▶ FastAPI ──HfApi──▶ HF Dataset (private) │ └──▶ /tmp (volatile cache) Identity = session cookie's hf_<username> (when signed in) ∥ anon UUID query par…b6faf15 -
Polish pass on plugin Upload modal
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Detail review surfaced four small but meaningful items. Storage listener over-fires (App.tsx) - Was triggered by any quda.* key — included pane widths, theme, live-IBM toggle. Tightened to e.key === "quda.pluginsRev" so only actual plugin upload/delete events refetch. bumpPluginsRev() already writes that exact key. Duplicate-install regex collision (UploadPluginModal) - /already have a plugin/i matched both the per-kind duplicate AND the 5-plugin cap message, so a user at cap who clicked Install on a sample saw a green success banner. Tightened to /already have a plugin with kind=/i so only the idempotent case surfaces as a friendly hint; the cap is now an honest error. - Added a Content-Type guard after the example zip fetch so a captive portal serving an HTML 200 surfaces "got <type>, not a .zip" instead of the confusing manifest-parse error from the backend. Modal UX restructure - Examples-first ordering when installedPlugins.length === 0 — a first-time visito…4d0158a -
Bundled example plugins + UX polish from second audit pass
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Lets users try the plugin upload flow end-to-end without writing one from scratch: the Upload modal now shows a "Try with a sample" section that fetches /api/plugins/examples and offers per-example Install + .zip download buttons. Backend: - New read-only GET /api/plugins/examples returns minimal metadata parsed from each bundled zip's manifest.json (label, family, tagline, color, size). Catalog is empty if the examples dir is missing. - New read-only GET /api/plugins/examples/{name}.zip returns the raw zip bytes. Name is constrained to `^[a-z][a-z0-9_]{0,30}$`; resolved path must stay inside the examples dir (defence in depth against symlink shenanigans). 400 on bad name, 404 on missing or escaped path. - manifest.json read inside the zip capped at 64 KB so a malformed bundled example can't allocate unboundedly. - Defensive comment about route ordering vs the path-param DELETE. - Dockerfile COPYs example_plugins/ into the runtime image so the endpoints have content to s…ef8bb5f -
Plugin protocol Phase 4: full UI integration
Yuchen Yuan* lib/nodeCatalog.ts — `synthesizePluginSpec(manifest)` builds a NodeSpec on the fly from a backend-served PluginManifest. `resolveNodeSpec(kind, plugins)` is the new single source of truth for spec lookups: returns the built-in spec if available, otherwise the synthesized plugin spec, otherwise undefined. Adds PluginNodeSpec (NodeSpec + isPlugin/initials/pluginColor). * UploadPluginModal.tsx — drag-drop or click-to-pick .zip, posts to /api/plugins/upload with the browser's anonymous user_id, surfaces backend validation errors verbatim, refreshes the in- store plugin list on success. Inline docs spell out the manifest + handler.py contract. * NodePalette — new "Upload" button next to "Add blocks"; merges plugin specs with NODE_CATALOG before filtering by search / family chips. Plugin tiles render with the manifest's color + first-letter badge instead of a Lucide icon, and grow an X delete affordance on hover (with confirm dialog). * BlockPicker — same merge…74b7708 -
Plugin protocol Phase 3: frontend foundation
Yuchen Yuan* lib/userId.ts — anonymous browser ID stored in localStorage. Uses crypto.getRandomValues for a 16-byte hex string; falls back to Math.random if Web Crypto is unavailable. Matches the backend regex [a-zA-Z0-9_-]{8,64}. * lib/api.ts — three new endpoints (listPlugins / uploadPlugin / deletePlugin) and a PluginManifest type. RunRequest gains an optional user_id field so workflow runs can address the right user's plugins. * lib/store.ts — Zustand state for the current user's plugin list (refreshed on App boot, after upload, and after delete). * App.tsx — on boot, fetch this browser's plugin manifests in parallel with the health probe. Silent failure (just no plugins shown if /api/plugins is unreachable). * FlowCanvas.tsx — include getUserId() in the run-stream request payload so the backend can dispatch unknown node types to this user's plugins. No UI for upload yet — that's Phase 4. After this commit, refresh the live Space and a plugin uploaded directly via curl …10b580f -
Remove Parameter Sweep feature
Yuchen YuanReverts all 8 files involved in the sweep feature (per user request): - Delete SweepDialog.tsx - Remove Sweep button + state + dialog mount in FlowCanvas - Remove Sweep entry + props from MoreMenu (mobile) - Drop Sweep mention from TrySlide power-features strip - Drop Sweep mention from NextStepsHint in ResultsPane - Remove SweepConfig/SweepRequest/SweepRunResult types + sweepStream method from api.ts - Remove /api/workflow/sweep endpoint from backend routes - Remove SweepConfig/SweepRequest/SweepRunResult/SweepResponse from backend schemas The per-node intermediate cache stays — it was originally built as groundwork for sweep but is independently useful for re-running modified pipelines.44acddd -
Polish: unified value prop, error-message location hints, next-steps guidance
Yuchen YuanFour UX-audit follow-ups: 1. **Value-prop consistency**: WelcomeSlide's opening paragraph replaced. Was "A visual playground for research algorithms" — conflicted with README's "Interactive workflows for quantum system deployment" and TopBar's "Quantum Design Automation Studio" subtitle. Now leads with the QuDA acronym expansion + the canonical "interactive workflows" tagline, then explains the lab context underneath. All three surfaces (TopBar / WelcomeSlide / README) now agree. 2. **Error messages point at UI**: "Pick a circuit first" now also bumps a Zustand counter that App.tsx watches; the left CircuitPicker pane auto-expands (desktop) or its drawer slides open (mobile) so the user can SEE where to act. The message itself names the pane explicitly. "Canvas is empty" now mentions all three ways to add blocks (drag / Add blocks dropdown / preset). 3. **Cross-feature guidance**: After a successful run, ResultsPane shows a subtle "Where to …974ac89 -
Tour + mobile parity: address UX audit findings
Yuchen YuanUX audit found: 1. Tour didn't mention Export .py, Sweep, or BlockPicker (all shipped after the tour was last updated). 2. Sweep & Export were hidden on mobile (toolbar md+ only, not in MoreMenu). 3. TrySlide "What to try first" list was static text — users had to manually find samples + presets. Fixes: - MoreMenu: add Sweep entry alongside Auto-connect / Share / Export / Clear so mobile users can reach the parameter-sweep feature. - TrySlide: the 4 "What to try first" lines are now clickable buttons. Each loads its (preset, sample) combination via a new Zustand quickStart bridge and closes the tour. The bridge mirrors the existing pendingBlockKinds pattern. - TrySlide: new "Once you've got results" strip explicitly introduces Sweep and Export .py as the power-user features — these were completely undocumented before this commit. - TrySlide: "Build your own" now mentions Add blocks (multi-select dropdown) alongside drag interaction. - FlowCanvas.loadPreset: acce…82f6435 -
Feature: parameter sweep with comparison chart
Yuchen YuanBackend: - New POST /api/workflow/sweep SSE endpoint. Accepts a base pipeline + SweepConfig (target node_id, param_key, list of values up to 50). For each value, patches the target node's data and runs the full pipeline. Yields one SweepRunResult per value. - Schemas: SweepConfig, SweepRequest, SweepRunResult, SweepResponse. - Leverages the existing per-node intermediate cache: prefix steps upstream of the swept block are reused across all sweep iterations. An N-value sweep of the last block's parameter costs roughly N * (last-block runtime) instead of N * (full-pipeline runtime). Frontend: - New SweepDialog modal. UI flow: 1. Picks the target: auto-discovers all numeric NodeParamSpec entries on the canvas (QuCAD iters/lam/rho, Qshot alpha, etc.) 2. User sets start, end, steps (2-20) → preview of computed values 3. Click "Run sweep" → streams results from /workflow/sweep 4. Renders a line chart (param value on X, output metric on Y) plus a data table. Met…fead27e -
Fix 3 audit findings: export signatures, cache safety, accessibility
Yuchen Yuan1. CRITICAL — exportPython.ts CompressVQC template had 3 wrong function calls: - quadraticProgram_luttoqp(lut) → (qc, lut) - admmOptimizedCompVQC(qp, lut) → (qp) - resultsCompressVQC(qc, result, lut) → (result, qc) All verified against backend/qlib/compvqc.py actual signatures. Users who exported and ran pipeline.py would have hit TypeError. 2. MEDIUM — Step cache _cache_put now deep-copies QuantumCircuit objects via qc.copy() instead of storing references. Prevents a future handler that mutates circuit in-place from silently corrupting cached snapshots. Current handlers all reassign, so this is defensive, but the cost (one .copy() per step) is cheap. 3. MEDIUM — BlockPicker button now has aria-haspopup, aria-expanded, aria-label. Dropdown div has role="menu" and aria-label. Screen reader users can now navigate the block catalog.51365eb -
Feature: per-node intermediate result cache
Yuchen YuanBackend: - In-memory LRU cache (200 entries) keyed by pipeline-prefix hash. The prefix hash covers (circuit QPY + all node types & params up to the current step). If the user changes only the last block, all preceding steps return instantly from cache (~0ms) instead of re-running (saves minutes for QuBound LSTM / Qshot HDBSCAN). - After each step, a shallow copy of the ctx dict is cached alongside the StepResult. On cache hit, ctx is restored so subsequent steps can pick up where the cached prefix left off. - Cached steps are flagged with from_step_cache=True (new optional field on StepResult) so the frontend can distinguish them. - Cache is process-scoped and resets on container restart. LRU eviction at 200 entries prevents unbounded memory growth. Frontend: - StepResult type extended with optional from_step_cache. - Results pane shows a small "cached" chip on steps served from the intermediate cache, so users can see which steps were instant. Works with the SSE st…1e3019d -
Fix build: remove unused vars in exportPython; fix setRun functional updater
Yuchen Yuan22b441d -
Feature: SSE streaming for real-time pipeline progress
Yuchen YuanBackend: - Add run_pipeline_stream() generator in workflow_service.py that yields each StepResult as it completes instead of collecting all. - Add POST /api/workflow/run-stream SSE endpoint in workflow.py. Cache hits emit the full RunResponse as one event + [CACHED] sentinel. Cache misses stream individual step events + [DONE]. Frontend: - Add api.runStream() in api.ts: uses fetch + ReadableStream to parse SSE events incrementally. - FlowCanvas.runPipeline() now uses the streaming endpoint. Each step appears in the Results pane as soon as it finishes, so the user sees "Step 1: Input circuit... done" while Step 2 is still running, instead of staring at a blank spinner for 2+ minutes. - On cache hit, the full response arrives instantly (same UX as before). On stream error, falls back gracefully with an error toast. The old POST /api/workflow/run endpoint is unchanged for backwards compatibility and the precompute script.02d0eb5 -
Feature: Export pipeline as runnable Python script
Yuchen YuanNew "Export .py" button in the canvas toolbar (Code2 icon). Generates a flat, readable Python script that reproduces the current pipeline: - Topologically sorts the canvas nodes using the edge list - For each block, emits the corresponding Python code with the actual parameter values from the canvas (iterations, lambda, rho, noise_snapshot, alpha, backend_name, etc.) - Includes import statements, parameter binding for parameterized circuits, and print statements for each step's output - Downloads as pipeline.py with a browser file-save dialog Supports all 9 block types: input_circuit, fake_backend, ibm_backend, qucad, qubound, compvqc, qshot, fidelity, output. IBM live backend generates commented-out code with instructions + a fake backend fallback. Also added to the mobile MoreMenu so the feature works on phones.90bf6ec -
Polish pass: brand cleanup, popover consistency, mobile safety
Yuchen YuanAudit-driven fixes: 1. Branding: - Dockerfile comment: QuAIM → QuDA Studio - package.json name: jqub-quantum-flow-ui → quda-studio-ui - All localStorage keys: jqub.* → quda.* (theme, pane widths, collapsed state, IBM toggle, tour flag). Existing users will see fresh defaults on first visit (acceptable — the old Space URL is gone anyway so there's no continuity to preserve). 2. Popover consistency: - All 4 popovers (Papers, Developers, Support, BlockPicker) now share z-40 instead of a mix of z-30 and z-50. - BlockPicker gets the same mobile-safe positioning as the other three: fixed left-3 top-14 on narrow screens, absolute on ≥sm. - BlockPicker width clamped with min() so it can't overflow on narrow viewports. 3. Pre-hydration script in index.html updated to read quda.theme instead of jqub.theme.95967ab
-
NodePalette: checkbox multi-select + batch add to canvas
Yuchen YuanThree ways to add blocks now: 1. Drag a tile onto the canvas (unchanged). 2. Click the checkbox (top-left corner of tile) to select, then hit the "Add N to canvas" button that appears in the header. All checked blocks are created on the canvas in family order and auto-connected in one shot. 3. Hover a tile and click the + icon (top-right) to add just that one block instantly. Implementation: - NodePalette tracks a `checked: Set<NodeKind>` state. Checked tiles get an accent border + filled checkbox. - On "Add to canvas", NodePalette pushes the ordered list of kinds to `useApp.addBlocksToCanvas(kinds)` (new Zustand store field). - FlowCanvas watches `pendingBlockKinds` via useEffect: creates nodes positioned to the right of existing ones, merges them into the canvas, auto-connects the whole graph, shows a toast with any warnings, and fitViews to show all nodes. - Zustand bridge avoids restructuring the component tree (NodePalette and FlowCanvas are siblings, not …d9a330d
-
Neutralise dev-process metadata in code comments
Yuchen YuanEarlier audits caught keyword-level leaks (tokens, paths, emails). This pass goes one level up: comments throughout the codebase narrated the project's history — "Jovin's Streamlit prototype", "the handover snapshot", "Jovin's old prototype's flowChartProto", "Batch 2 circuits", etc. — which read like internal team notes rather than product code, and exposed the development trajectory (research handover → rewrite → packaging) to anyone reading the public repo. Replaced or trimmed the offending comments while keeping legitimate attribution (e.g., "author: Tong Li" in qshot/__init__.py docstring). No behavior change: docstrings + line comments only. Files touched: - qlib/qiskit_utils.py – module docstring rewritten - qlib/qucad.py – default-config attribution generalised - qlib/compvqc.py – "the original prototype did..." → factual - qlib/qshot/__init__.py – "handover snapshot" → "reference code" - app/services/workflow_service.py – Qshot docstring de-narrated - a…fa87757 -
Auto-connect: per-algorithm backend warnings; tour drift fixes
Yuchen YuanAuto-connect was using a single blanket "algorithms that need a noise model will error at run time" warning for any canvas missing a backend. That's only true for QuCAD; QuBound and CompressVQC silently fall back to FakeFez, and Qshot ignores ctx["backend"] entirely (uses its own bundled noise snapshots). Replace the blanket line with per-algorithm advisories driven by an ALGO_BACKEND_DEPENDENCY table: - qucad: "required" (hard error without backend) - qubound, compvqc: "optional" (soft fallback to FakeFez) - qshot: "ignored" (warns the OTHER way: backend wired in front of a qshot-only chain is dead weight) Also drop the misleading "noise profile" dashed-edge label on backend → qshot edges (the edge has no semantic meaning for qshot). Backend → qucad/qubound/compvqc still gets the dashed sidechain styling. Tour slides drifted relative to the current four-algorithm lineup: - WelcomeSlide named only QuCAD/QuBound/CompressVQC; add Qshot. - PipelineSlide split algorithms into "mutate c…2316315 -
Param hints: explain what each control does in plain language
Yuchen YuanEvery editable param now has a hint that tells the user (a) what the control actually means and (b) which way to push it for which effect. Previously fake_backend's dropdown showed 'FakeFez · 156q (Heron r2)' with zero context — a non-quantum reader had no idea Heron was a chip family or why three options exist; Qshot's snapshot dropdown was even worse, listing dates with no explanation of what a 'snapshot' is or why dates differ. New hints, all under one line: * fake_backend.backend_name → 'Each option is a simulated copy of a real IBM chip. The choice mainly affects which gate-error rates and qubit connectivity the noise model uses.' * qshot.noise_snapshot → 'A real IBM chip's calibration captured on a specific date — different days have different noise levels, so the recommended shot count shifts too.' * qshot.alpha (was 'fraction of converged fidelity to hit', a domain-of-art phrasing) → 'Fraction of the best-possible accuracy you want. 0.95 = aim for 95% — higher me…cadac03 -
Param editor collapses by default; misc review-driven cleanups
Yuchen YuanUser feedback: a tunable block shouldn't default to a fully expanded form on the canvas — that pushes the block visually big and clutters a multi-block pipeline. Default the param editor to a single-line disclosure with a chevron + a one-line summary of current values; the full editor only renders when the user clicks to expand. * QNode now owns local `paramsOpen` state (not in node-data — it's a pure UI affordance, shouldn't pollute share-links or auto-connect output). Header row shows `chev > params: <summary>`. Click toggles. * New `summariseParams()` helper builds the short summary from the schema: select values stay as their short keys (`pittsburgh_1`), numbers respect each param's `displayPrecision`. Kept under ~30 chars so it fits the block width. Three issues from an independent review of the recent Qshot work: * CRITICAL: workflow_service `_default_label()` was missing `"qshot"`, so step results in the right pane displayed lowercase "qshot" instead of "Qshot".…b89f3b2 -
Qshot preset: auto-load ry_chain_6q so default lands in 5-8q range
Yuchen Yuanbell_state (2q) is the global default circuit — perfect for QuCAD / QuBound demos but immediately trips Qshot's GNN-fallback path because it's outside the 5-8 qubit training distribution. New users picking the Qshot preset would see the warn-banner version of the result and think 'is this thing actually working?'. Add an optional `defaultCircuit` field on PipelinePreset that, when present, triggers a sample-load alongside the node/edge swap. Set it to `ry_chain_6q` for the Qshot preset only — every other preset keeps the user's current sample, since QuCAD / QuBound / CompressVQC are happy with whatever's loaded. Skip the round-trip when sampleKey is already on the target.088ad4b