Elffuss BraidHub

utopia-ia/elffuss-code public

Census: open the samples once the sandbox runs, and rerun it

The census opened its sample documents while the sandbox was still
starting, when Code showed extensions only the active tab, so extensions
that start on a document's language were counted as never starting.
Code now shows every open tab, and the census also waits for the sandbox
before opening its samples.

Rerun on the same 89 (top 500 with a browser entry, 2026-10-11): 50 start
(was 49), 34 register something (33), 14 register language features (12),
23 fail while starting (22), 7 never start (9), 8 too large, 1 refused,
0 beacon hits. CSS language features now start and register completion,
hover, definition, references, highlights, symbols, code actions, rename
and range formatting; TypeScript's language features register theirs;
configuration-editing starts and then fails on a proposed API.

README: the census table and what it means, and the panel, address,
byte, deploy and run-modes changes of the previous commits.

Changeset9a38018bfc749deedfcfed10b455557845cb7e4b8ad5790afa9cf975a8e41522
AuthorKikoCis <kikocisneros@gmail.com> · 2026-10-11 21:51 +02:00
CommitterKikoCis <kikocisneros@gmail.com> · 2026-10-12 09:38 +02:00
Parentsfc9a8dba96f6

Browse the files at this changeset

3 files changed

modified README.md +66 −38
@@ -80,13 +80,19 @@
8080 renders what extensions return as plain text or escaped markdown.
8181
8282 **In the Extensions panel**, before you install anything, each result says what will work:
83-the declarative parts, *"Runs in Code's sandbox"* (with its commands, keybindings and
84-settings), *"Needs Node: not available in the browser"*, the parts that *won't appear here*
85-(views, webviews, debugger…) and *"Tested in Code"* from the runtime census below. The
86-**Works in Code** chip hides what cannot work (it reads each result's manifest, which Open
87-VSX then sees; the panel says so). **Install and run its code…** first shows what the
88-extension will see, that it has no internet and cannot save, and the download sizes;
89-nothing is fetched until you accept. Installed extensions with code get: run or turn off
83+the declarative parts (counted the way they apply: a language Monaco already has does not
84+count), *"Runs in Code's sandbox"* (with its commands, keybindings and settings),
85+*"Needs Node: not available in the browser"*, the parts that *won't appear here* (views,
86+webviews, debugger…) and *"Tested in Code"* from the runtime census below. Where level 2
87+cannot run (code.elffuss.com today, Firefox, Safari, `?noext2`) the line says so with the
88+reason, the run button is inert, and the **Works in Code** chip keeps only what works
89+there. An extension that declares proposed VS Code APIs is marked: Code does not turn those
90+APIs on, so some of its parts may fail (the census shows many such extensions start). The
91+chip reads each result's manifest, which Open VSX then sees; the panel says so. **Install**
92+on a result that only brings code reads its manifest first (no download) and offers
93+**Install and run its code…**, which first shows what the extension will see, that it has no
94+internet and cannot save, the runtime's size and the extension's own (from a HEAD request to
95+Open VSX); nothing is downloaded until you accept. Installed extensions with code get: run or turn off
9096 their code (no reload), state, their commands with Run buttons (the way in on a phone),
9197 settings as JSON checked against what they declare, the formatter per language (theirs
9298 or the built-in one), keybindings that were not bound and why, a log, and the number of
@@ -112,9 +118,15 @@
112118 punctuation character is escaped: no remote image, link or HTML. Decoration styles go
113119 through a whitelist (no `url()`, no `fontFamily`); gutter icons are not shown.
114120 - **Every address asks first** and shows the full URL (control and bidi characters made
115- visible, the host in Unicode and punycode): `openExternal`, also when a completion or a
116- code action runs it, and Cmd+click in the editor while extensions run. Links inside what
117- extensions show are plain text. Clipboard writes need a recent click or key.
121+ visible, the host in Unicode and punycode, the site repeated next to the buttons, a long
122+ address scrolling in its own box): `openExternal`, also when a completion or a code
123+ action runs it, and Cmd+click in the editor while extensions run. A `vscode.Uri` opens
124+ the way VS Code opens it (`encodeURI(uri.toString(true))`, so `=`, `&` and `+` stay as
125+ written). *Block requests for this session* blocks extensions' requests only (your own
126+ Cmd+click still asks); each dropped request is reported in the status bar, and the panel
127+ shows the block with an *Unblock* button. Links inside what extensions show are plain
128+ text. Clipboard writes need a recent click or key. A notification that waits for an
129+ answer is reachable from the editor with F6 (F6 again goes back) or from Code's palette.
118130 - **Open documents only, no saving.** Extensions see the files you have open, as
119131 `file:///<project path>`; their edits go to the active document as one undo step and stay
120132 unsaved until you save with Cmd+S as always. An edit computed on text that changed in
@@ -138,12 +150,13 @@
138150
139151 - **Nothing of level 2 loads until you turn an extension's code on.** `tests/x2_bytes.mjs`
140152 compares Code with the level 1 tip request by request, uncompressed: with no extension
141- it asks for exactly the same files and 817 bytes more (two one-line hooks in `main.js`
142- and `ide.js`); with level 1 extensions only, the same files and 4.4 KB more (the hooks in
143- `js/ext/host.js` and `store.js` that decide when to load `js/ext2/host2.js`); with the
144- Extensions panel open and a search done, the same files and 18 KB more (what the panel
145- now tells everyone: what will work, the Works in Code filter, how extensions are
146- isolated). In none of these is anything fetched from `vendor/x2/`, `js/ext2/` or the
153+ it asks for exactly the same files and 881 bytes more (short hooks in `main.js` and
154+ `ide.js`: the palette list, the preview gate and the list of open tabs); with level 1
155+ extensions only, the same files and 4.4 KB more (the hooks in `js/ext/host.js` and
156+ `store.js` that decide when to load `js/ext2/host2.js`); with the Extensions panel open
157+ and a search done, the same files and 19.8 KB more (what the panel now tells everyone:
158+ what will work, the Works in Code filter, how extensions are isolated, the check before
159+ Install). In none of these is anything fetched from `vendor/x2/`, `js/ext2/` or the
147160 sandbox site. Once code is on, the runtime is 2.6 MB gzip (from the manifest), fetched
148161 once and then served from the HTTP cache. `?noext` pauses every extension, `?noext2` only
149162 their code, `"enabled": false` in the manifest is a global kill switch, and the panel can
@@ -157,35 +170,46 @@
157170 debugger, source control, status bar), the network or the whole project, extensions that
158171 replace typing (Vim, Emacs), `createQuickPick` and `createInputBox`, gutter icons, and
159172 Firefox and Safari in this version.
160-- **Not available on code.elffuss.com yet:** the sandbox needs its own domain first
161- (`sandbox/x2/nginx.conf.example`, then `deploy-sandbox.sh`, `deploy-vendor.sh` and
162- `deploy.sh`, in that order). Locally, open Code on `http://127.0.0.1:<port>` with
173+- **Not available on code.elffuss.com yet:** the sandbox needs its own registrable domain
174+ first: `web/js/ext2/config.js` refuses a sandbox on the same site as Code (a subdomain of
175+ elffuss.com would share cookies and a process), and `deploy-sandbox.sh` checks it before
176+ uploading. In order: merge this branch's `deploy.sh` filter for `vendor/x2/` into main
177+ (any deploy without it deletes the bundle; `deploy-vendor.sh` refuses until main has
178+ it), then `sandbox/x2/nginx.conf.example` (Code's vendor location sets Cache-Control
179+ without `always`, so a missing file is never cached as immutable), `deploy-sandbox.sh`,
180+ `deploy-vendor.sh` and `deploy.sh` (which refuses to ship a manifest whose build the
181+ server lacks). Locally, open Code on `http://127.0.0.1:<port>` with
163182 `tests/lib/x2-server.mjs`, which serves the sandbox on `localhost:<port>` (a different
164183 site).
165184
166185 **What actually runs (runtime census, 2026-10-11).** Of the 500 most downloaded extensions
167186 on Open VSX, 89 have a browser entry. `tests/x2_census.mjs` installed each one from its
168-verified package (the web build, when the publisher ships one) and started it alone in the
169-real sandbox with a beacon listening:
187+verified package (the web build, when the publisher ships one), started it alone in the
188+real sandbox with a beacon listening, and once the sandbox ran opened one sample document
189+per language it declares:
170190
171191 | Result | Extensions |
172192 |---|---|
173193 | Too large to install (over 32 MiB per file or 64 MiB per extension) | 8 |
174-| Start | 49 |
175-| …and register a command, a language feature or diagnostics | 33 |
176-| …and register language features (completion, hover, formatting…) | 12 |
177-| Fail while starting (Node modules or globals in their browser build, services Code doesn't have, blocked network requests) | 22 |
178-| Never start (nothing in Code triggers them: previews, custom editors, sign-in) | 9 |
194+| Start | 50 |
195+| …and register a command, a language feature or diagnostics | 34 |
196+| …and register language features (completion, hover, formatting…) | 14 |
197+| Fail while starting (Node modules or globals in their browser build, services or proposed APIs Code doesn't have, blocked network requests) | 23 |
198+| Never start (what starts them doesn't exist in Code: a workspace, the Markdown preview, custom editors, notebooks, sign-in; one starts and never finishes) | 7 |
179199 | Refused: Vim replaces typing | 1 |
180200 | Requests that reached the beacon | 0 |
181201
182-The census ran again with the finished sandbox (the RPC firewall on, and notifications,
183-dialogs and pickers answered the way a hurried user would: closed or cancelled) and gave
184-the same counts. 8 of the 89 asked the user something while starting (7 notifications and
185-1 picker); one that failed already, GitHub Pull Requests, now stops at the firewall's
186-refusal of sign-in. Some extensions that start still need things Code doesn't have
187-(webviews, the network, a workspace), so the census is an upper bound; per-extension
188-results are in `web/js/ext2/tested.json` and feed the panel's "Tested in Code" lines.
202+It ran with the finished sandbox (the RPC firewall on, and notifications, dialogs and
203+pickers answered the way a hurried user would: closed or cancelled). 9 of the 89 asked the
204+user something while starting (8 notifications and 1 picker); GitHub Pull Requests stops at
205+the firewall's refusal of sign-in. An earlier run opened the sample documents while the
206+sandbox was still starting, when Code showed extensions only the active tab: CSS and
207+configuration-editing were counted as never starting and TypeScript's language features
208+were missed. Code now shows extensions every open tab, also the ones opened before the
209+sandbox started (`tests/x2_ux.mjs`, X11), and the census opens its samples once the sandbox
210+runs. Some extensions that start still need things Code doesn't have (webviews, the
211+network, a workspace), so the census is an upper bound; per-extension results are in
212+`web/js/ext2/tested.json` and feed the panel's "Tested in Code" lines.
189213
190214 Across the whole catalog (19,335 extensions on 2026-10-11) only a static sample has been
191215 read: 2,000 manifests put the share with a browser entry at about 5%, roughly 470 to 1,430
@@ -200,23 +224,27 @@
200224 | Suite | What it proves |
201225 |---|---|
202226 | `x2_unit` | protocol validators, escaped markdown on a hostile corpus, conversions, keybindings and reserved chords, globs, headers, manifests, the RPC allowlist, the decoration whitelist, URL display, classification, texts, the package reader, the shipped census |
203-| `x2_headers` | the sandbox documents' exact headers, 404 for anything else, Code never serves `/x2/`, the vendor files' headers and SRI (also against a deployment) |
227+| `x2_headers` | the sandbox documents' exact headers, 404 for anything else, Code never serves `/x2/`, the vendor files' headers and SRI, a missing vendor file not cached (also against a deployment); the generated nginx snippets |
228+| `x2_deploy` | the deploy scripts against a folder that plays the server (fake `git`, `ssh` and `rsync`): only the manifest's files go up and nothing else may be there, a stray or corrupt file stops it, main must protect `vendor/x2/` first, the sandbox must be another site |
204229 | `x2_smoke` | synthetic extensions end to end: commands, formatting, hovers, symbols, diagnostics, decorations, dialogs, the gates, the firewall, tampering, `?noext`/`?noext2`/kill switch |
205230 | `x2_bytes` | the default path and the level 1 states against the level 1 tip (above) |
206231 | `x2_canary` | the canary and the drill (above), with positive controls |
207232 | `x2_manager` | sort-lines and Prettier installed, run, configured and uninstalled through the panel, Open VSX mocked from their pinned packages |
208233 | `x2_commands` | sort-lines in Code's palette, F1, F9 and the context menu; Cmd+S; reserved chords and conflicts; Code's own shortcuts unchanged; hostile titles stay text |
209234 | `x2_format` | Prettier: Format Document, Shift+Alt+F, undo, save, settings, the built-in formatter back, a race with an agent write |
210-| `x2_ux` | what the panel says before installing, the filter, sizes, a 390 px phone, dialog roles and keys, 25 of Code's elements styled identically with and without level 2 |
235+| `x2_ux` | what the panel says before installing (also where level 2 cannot run, and with the filter on first), Install on a code-only result, sizes, phones (390 and 360 px, a long address), keyboard access to notifications, pickers and dialogs, blocking and unblocking requests, tabs opened before the sandbox, Spanish texts, contrast, 25 of Code's elements styled identically with and without level 2 |
211236 | `x2_live`, `x2_lifecycle` | the real Open VSX: install, update, turn off and on, disable, reload and uninstall, with pinned versions and SHA-256 |
212237
213238 `tests/run-modes.sh` runs every Code suite in `tests/suites.txt` twice, as is and in
214239 **extension mode** (`tests/lib/x2-mode.mjs` installs two code extensions that run in the
215240 sandbox while the suite works, then checks the sandbox ran wherever the IDE opened, with
216241 no level 2 error and nothing but its two documents asked from the sandbox site), plus the
217-level 2 suites once. The suites that need a live model, a GPU, a local Bridge, the
218-internet or production are listed there with the reason. The runtime census is
219-`node tests/x2_census.mjs` (manual).
242+level 2 suites once. A suite that never opens the IDE cannot exercise extension mode: it
243+shows *PASS, no IDE* and is listed at the end, not counted as covered (`stop_ide` is the
244+IDE variant of `stop`). The suites that need a live model, a GPU, a local Bridge, the
245+internet or production are listed there with the reason; the Bridge ones need its fixed
246+ports (8765, and Code on 8799), so they have not run in extension mode. The runtime census
247+is `node tests/x2_census.mjs` (manual).
220248
221249 ## Run locally
222250
modified tests/x2_census.mjs +10 −5
@@ -10,9 +10,10 @@
1010 //
1111 // Por cada una: baja el .vsix y comprueba su SHA-256 (falla cerrado), lo
1212 // guarda como lo haría una instalación (con sus lenguajes, para que Code
13-// reconozca sus ficheros), abre un documento de muestra por lenguaje que
14-// aporte, lanza onStartupFinished, «*» y los onCommand de sus comandos (solo
15-// activa: no ejecuta ningún comando) y anota:
13+// reconozca sus ficheros), espera a que el recinto esté en marcha, abre
14+// entonces un documento de muestra por lenguaje que aporte, lanza
15+// onStartupFinished, «*» y los onCommand de sus comandos (solo activa: no
16+// ejecuta ningún comando) y anota:
1617 // · si arranca, o el error con el que no arranca;
1718 // · qué comandos y proveedores registra (por tipo), y los de fase 2;
1819 // · si pone diagnósticos;
@@ -162,7 +163,6 @@
162163 await seedReal(page, pkg, { languages: langs });
163164 await page.goto(srv.codeOrigin + '/?test-opfs', { waitUntil: 'domcontentloaded' });
164165 await page.waitForFunction(() => !!window.monaco?.editor?.getEditors?.().length, null, { timeout: 30000 });
165- for (const n of [...files.keys()].slice(0, 12)) await page.evaluate(async n => { await (await import('/js/ide.js')).openFile(n); }, n).catch(() => {});
166166 // (una que el recinto rechaza —sustituye el tecleo— se queda fuera y, si era
167167 // la única, el recinto se desmonta: eso es «no soportada», no un fallo)
168168 const st = await until(() => page.evaluate(async id => {
@@ -173,6 +173,11 @@
173173 const refusedNow = st?.extensions?.find(x => x.id === id && x.state === 'unsupported');
174174 if (refusedNow) { r.state = 'unsupported'; r.unsupported = 'replaces typing'; r.error = (refusedNow.text || '').slice(0, 300); r.contributedCommands = (e.manifest.contributes?.commands || []).length; continue; }
175175 if (st?.state !== 'running') { r.state = 'sandbox-error'; r.error = st?.error?.message || 'no start'; continue; }
176+ // Los documentos de muestra se abren con el recinto YA en marcha, uno a
177+ // uno, como los abriría alguien: cada uno llega a las extensiones y
178+ // dispara su onLanguage. (Que las pestañas abiertas ANTES de arrancar
179+ // también lleguen lo prueba tests/x2_ux.mjs, X11.)
180+ for (const n of [...files.keys()].slice(0, 12)) await page.evaluate(async n => { await (await import('/js/ide.js')).openFile(n); }, n).catch(() => {});
176181 // Lo que la extensión le pregunte al usuario (avisos, diálogos, selectores,
177182 // abrir direcciones) se contesta como lo haría alguien con prisa: cerrar o
178183 // cancelar. Una extensión que espera esa respuesta para terminar de
@@ -264,7 +269,7 @@
264269 };
265270 const out = {
266271 schema: 1, date: new Date().toISOString().slice(0, 10), vscode: vendor.vscode, library: vendor.library, buildId: vendor.buildId,
267- method: `Runtime census: the top ${TOP} Open VSX extensions by downloads (list of ${listDate}) that have a browser entry, each installed from its verified .vsix and started alone in the real sandbox; activation events fired: the open sample documents' languages, onStartupFinished, * and onCommand for each contributed command (no command was executed).`,
272+ method: `Runtime census: the top ${TOP} Open VSX extensions by downloads (list of ${listDate}) that have a browser entry, each installed from its verified .vsix and started alone in the real sandbox; once the sandbox ran, one sample document per language was opened; activation events fired: those documents' languages, onStartupFinished, * and onCommand for each contributed command (no command was executed).`,
268273 counts, ...(reruns ? { reruns } : {}), results: merged,
269274 };
270275 if (!ONLY || MERGE) fs.writeFileSync(OUT, JSON.stringify(out, null, 1) + '\n');
modified web/js/ext2/tested.json +55 −22
@@ -4,22 +4,22 @@
44 "vscode": "1.138.0",
55 "library": "@codingame/monaco-vscode-api@37.3.11",
66 "buildId": "ad4bdda82184c442",
7- "method": "Runtime census: the top 500 Open VSX extensions by downloads (list of 2026-10-11) that have a browser entry, each installed from its verified .vsix and started alone in the real sandbox; activation events fired: the open sample documents' languages, onStartupFinished, * and onCommand for each contributed command (no command was executed).",
7+ "method": "Runtime census: the top 500 Open VSX extensions by downloads (list of 2026-10-11) that have a browser entry, each installed from its verified .vsix and started alone in the real sandbox; once the sandbox ran, one sample document per language was opened; activation events fired: those documents' languages, onStartupFinished, * and onCommand for each contributed command (no command was executed).",
88 "counts": {
99 "topN": 500,
1010 "listDate": "2026-10-11",
1111 "browserEntry": 89,
1212 "installed": 81,
13- "active": 49,
14- "activeAndUseful": 33,
13+ "active": 50,
14+ "activeAndUseful": 34,
1515 "activeNothingRegistered": 16,
16- "error": 22,
17- "notActivated": 9,
16+ "error": 23,
17+ "notActivated": 7,
1818 "unsupported": 1,
1919 "installFailed": 8,
2020 "sandboxOrCensusError": 0,
2121 "withWorkbenchContributions": 52,
22- "withFormatter": 3,
22+ "withFormatter": 5,
2323 "beaconHits": 0
2424 },
2525 "results": {
@@ -439,12 +439,9 @@
439439 "workbench": [],
440440 "bytes": 4026898,
441441 "state": "unsupported",
442+ "unsupported": "replaces typing",
442443 "error": "replaces typing (the \"type\" command), which Elffuss Code does not support",
443- "commands": 69,
444- "contributedCommands": 3,
445- "providers": {},
446- "diagnostics": false,
447- "unsupported": "replaces typing"
444+ "contributedCommands": 3
448445 },
449446 "davidanson.vscode-markdownlint@0.62.1": {
450447 "rank": 85,
@@ -620,7 +617,10 @@
620617 "diagnostics": false,
621618 "unsupportedCalls": [
622619 "Wz.setKeysForSync"
623- ]
620+ ],
621+ "askedUser": {
622+ "toasts": 1
623+ }
624624 },
625625 "tamasfe.even-better-toml@0.21.2": {
626626 "rank": 146,
@@ -666,7 +666,7 @@
666666 "later": {
667667 "codeLensProvider": 1
668668 },
669- "diagnostics": false,
669+ "diagnostics": true,
670670 "sandboxErrors": 4,
671671 "askedUser": {
672672 "toasts": 1
@@ -957,8 +957,9 @@
957957 "workbench": [],
958958 "apiProposals": 1,
959959 "bytes": 737200,
960- "state": "installed",
961- "activation": "no activation event fired",
960+ "state": "error",
961+ "error": "Activating extension 'vscode.configuration-editing' failed: Extension 'vscode.configuration-editing' CANNOT use API proposal: profileContentHandlers.\nIts package.json#enabledApiProposals-property declares: [] but NOT profileContentHandlers.\n The missing proposal MUST be added and you must start in e",
962+ "activation": "failed",
962963 "commands": 0,
963964 "contributedCommands": 0,
964965 "providers": {},
@@ -994,11 +995,26 @@
994995 "apiProposals": 7,
995996 "bytes": 40083487,
996997 "state": "active",
997- "commands": 12,
998+ "commands": 24,
998999 "contributedCommands": 13,
999- "providers": {},
1000+ "providers": {
1001+ "completion": 6,
1002+ "definition": 2,
1003+ "highlights": 2,
1004+ "symbols": 2,
1005+ "formatOnType": 2,
1006+ "formatRange": 2,
1007+ "hover": 2,
1008+ "references": 2,
1009+ "signature": 2,
1010+ "typeDefinition": 2
1011+ },
10001012 "later": {
1001- "linkProvider": 2
1013+ "linkProvider": 2,
1014+ "multiDocumentHighlightProvider": 2,
1015+ "foldingRangeProvider": 2,
1016+ "linkedEditingRangeProvider": 2,
1017+ "selectionRangeProvider": 2
10021018 },
10031019 "diagnostics": false
10041020 },
@@ -1097,11 +1113,28 @@
10971113 "workbench": [],
10981114 "apiProposals": 1,
10991115 "bytes": 4713199,
1100- "state": "installed",
1101- "activation": "no activation event fired",
1102- "commands": 0,
1116+ "state": "active",
1117+ "commands": 1,
11031118 "contributedCommands": 0,
1104- "providers": {},
1119+ "providers": {
1120+ "completion": 2,
1121+ "hover": 1,
1122+ "definition": 1,
1123+ "references": 1,
1124+ "highlights": 1,
1125+ "symbols": 1,
1126+ "codeAction": 1,
1127+ "rename": 1,
1128+ "formatRange": 3
1129+ },
1130+ "later": {
1131+ "linkProvider": 1,
1132+ "colorProvider": 1,
1133+ "foldingRangeProvider": 1,
1134+ "selectionRangeProvider": 1,
1135+ "documentDropEditProvider": 1,
1136+ "documentPasteEditProvider": 1
1137+ },
11051138 "diagnostics": false
11061139 },
11071140 "vscode.emmet@1.95.3": {