Skip to content

Commit 2bc1db8

Browse files
committed
refactor: adopt native guidata browser APIs
Require guidata 3.15, retire the obsolete backend backport, and retain only the FloatArray schema hints still missing upstream. Distinguish inferred and live audits before removing future shims. Assisted-by: GPT-5.6 Sol
1 parent 6e48492 commit 2bc1db8

22 files changed

Lines changed: 296 additions & 1122 deletions

‎.github/copilot-instructions.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ you add or restructure a top-level subsystem.
3939
DataLab desktop's `register_1_to_1` / `register_n_to_1` / etc. machinery.
4040
- **`src/runtime/dlw_main.py`, `dlw_plugins.py`, `dlw_h5browser.py`,
4141
`dlw_interactive_fit.py`, `notebook_display.py`, `macro_proxy.py`,
42-
`_guidata_*_shim.py`** — focused Python modules pushed into Pyodide's FS
43-
alongside `bootstrap.py` (plugin host, HDF5 browser, interactive fit,
44-
notebook `display()`, macro/notebook proxy, guidata browser shims).
42+
`_guidata_jsonschema_shim.py`** — focused Python modules pushed into
43+
Pyodide's FS alongside `bootstrap.py` (plugin host, HDF5 browser,
44+
interactive fit, notebook `display()`, macro/notebook proxy, and the
45+
tracked guidata `FloatArrayItem` schema-hint backport).
4546
- **`src/runtime/runtime.ts`** is the only place that touches the Pyodide
4647
API. All Python calls go through `DataLabRuntime`; the rest of the UI
4748
consumes typed interfaces (`SignalMeta`, `SignalData`,
@@ -158,9 +159,12 @@ temporary shim**, not an ad-hoc patch:
158159
`run_with_env.py`) — those are permanent.
159160
- The network-free anti-drift test in `npm test`
160161
(`tests/ts/shims/shim-registry.test.ts`) **fails CI** if the registry,
161-
the sources and the markers drift. The version audit
162-
(`npm run audit:shims`, `*.spec.ts`) is **report-only** and runs only
163-
via `vitest.audit.config.ts`. Full workflow in
162+
the sources and the markers drift. `npm run audit:shims` is a fast,
163+
**report-only** pre-audit inferred from PyPI and `pyodide-lock.json`;
164+
`npm run audit:shims:runtime` is the authoritative live-Pyodide version
165+
check. Before removing a candidate, also run focused contract or E2E tests
166+
proving that the upstream implementation preserves the required behavior.
167+
Full workflow in
164168
[`doc/shim-registry.md`](../doc/shim-registry.md).
165169

166170
## Testing

‎.vscode/tasks.json‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
},
323323
{
324324
"label": "🔍 Audit shims (versions)",
325-
"detail": "Report which temporary backport shims are now removable by comparing each shim's removableFrom with the version resolved at runtime (PyPI / pyodide-lock). Report-only; needs network.",
325+
"detail": "Fast pre-audit: infer package versions from PyPI / pyodide-lock and report removable backports. Report-only; needs network.",
326326
"type": "shell",
327327
"command": "npm",
328328
"args": ["run", "audit:shims"],
@@ -331,6 +331,17 @@
331331
},
332332
"problemMatcher": []
333333
},
334+
{
335+
"label": "🔬 Audit shims (live Pyodide)",
336+
"detail": "Authoritative audit: boot the browser runtime and classify shims against the package versions actually installed in Pyodide.",
337+
"type": "shell",
338+
"command": "npm",
339+
"args": ["run", "audit:shims:runtime"],
340+
"options": {
341+
"cwd": "${workspaceFolder}"
342+
},
343+
"problemMatcher": []
344+
},
334345
{
335346
"label": "🟢 Vitest watch",
336347
"type": "shell",

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- **Guidata compatibility:** browser runtimes now require guidata 3.15 and use
12+
its native async DataSet backend and JSON Schema exporter. The former
13+
backend backport has been removed; a focused compatibility patch preserves
14+
the `FloatArrayItem` sizing hints required by the browser array editor.
15+
916
## [0.9.0] - 2026-08-11
1017

1118
### Added in 0.9.0

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ DataLab-Web is fully internationalised: English is the source language and Frenc
7979

8080
## Temporary shims
8181

82-
DataLab-Web sometimes backports a feature or patches a bug that is fixed upstream (`guidata`, `sigima`, …) but not yet in a released wheel. These **temporary shims** are tracked centrally so they can be audited and removed once upstream catches up. Every backport shim is declared once in [src/runtime/shims/registry.ts](src/runtime/shims/registry.ts), carries `# TEMPORARY SHIM` / `@shim-registry: <id>` markers in its source, and is kept in sync by a network-free anti-drift test that runs in `npm test`. Run `npm run audit:shims` (or the **🔍 Audit shims (versions)** task) to see which shims are now removable. Full workflow — adding, registering and removing a shim — is in [doc/shim-registry.md](doc/shim-registry.md).
82+
DataLab-Web sometimes backports a feature or patches a bug that is fixed upstream (`guidata`, `sigima`, …) but not yet in a released wheel. These **temporary shims** are tracked centrally so they can be audited and removed once upstream catches up. Every backport shim is declared once in [src/runtime/shims/registry.ts](src/runtime/shims/registry.ts), carries `# TEMPORARY SHIM` / `@shim-registry: <id>` markers in its source, and is kept in sync by a network-free anti-drift test that runs in `npm test`. Use `npm run audit:shims` for the fast PyPI/lockfile pre-audit and `npm run audit:shims:runtime` to verify the versions actually installed in Pyodide. A `ready-to-remove` version result is only a candidate: focused contract or E2E tests must also prove native behavioral parity before the shim is deleted. The full workflow is in [doc/shim-registry.md](doc/shim-registry.md).
8383

8484
## Branching model
8585

‎doc/architecture.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,13 @@ param.edit_async(...)` for parameter dialogs.
389389
user scripts (macros and notebook cells). Each method ultimately
390390
becomes a `bridge_call` to the main thread.
391391

392-
- **`_guidata_backends_shim.py`** / **`_guidata_jsonschema_shim.py`** —
393-
patch guidata so that DataSet parameter classes (a) do not require a
394-
Qt backend and (b) can be serialised as JSON schemas that
395-
`DataSetDialog.tsx` consumes. These are **temporary backport shims**:
396-
they are declared in `src/runtime/shims/registry.ts` and audited for
397-
removal once upstream ships the feature — see
398-
[`shim-registry.md`](shim-registry.md).
392+
- **guidata integration** — guidata 3.15 provides the native async backend
393+
registry and JSON Schema exporter. `bootstrap.py` registers the browser
394+
dialog bridge through that backend API. `_guidata_jsonschema_shim.py` is a
395+
small **temporary backport shim** that only adds the `FloatArrayItem`
396+
variable-size and min/max hints still missing upstream. It is declared in
397+
`src/runtime/shims/registry.ts`; see
398+
[`shim-registry.md`](shim-registry.md) for the audit and removal workflow.
399399

400400
### 3.5 SDK — `packages/sdk/`
401401

0 commit comments

Comments
 (0)