mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 22:10:34 +00:00
datascript.query labels a datom's slots with the string names "e", "a", "v" and "tx", and reads one back with a bracket access on the datom object. Closure renames the field and leaves the string, so the read succeeds and returns whichever field inherited the old name. The index reads the same slots as real fields, so storage keeps answering correctly and the corruption stays silent. Datascript ships datascript/externs.js to pin those five names and declares it in its deps.cljs. shadow-cljs collects that declaration into a :deps-externs entry it never populates, and reads it only behind an unset :cljsjs-externs flag, so the declaration is inert and the :worker release names the file itself. It costs 170 B on the probe build's 436 197 B. bench.debug becomes the gate rather than a reproducer: six readings, one per datom slot plus a join and an index control, each paired with the answer it must give, exiting non-zero on a wrong one. The new ds-probe build compiles it with the worker's release options. Without the externs entry that build reads nil for every transaction, and a vanilla shadow project loses the value slot as well, which is why the gate binds each slot on its own. The ab-bench pin stays at :simple, and its comment now names the reason that still holds: one compiler configuration across both engines, matching the 2026-08-21 V8 table. Answers mirror:ds-advanced-corruption. AI-assisted-by: opus-5