feat(capture): learn editable motion, sandbox source canvas code, and promote after live verification - #485
Merged
Merged
Conversation
… clock candidates
… it after live verification
…erify it against the source
chubes4
marked this pull request as ready for review
September 30, 2026 15:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #425. Companion: Automattic/blocks-engine#2360.
Why
#458 reached LIQUID BONSAI parity only with a hand-authored site recipe. This PR makes plain URL capture learn that behavior from the source itself.
What it does
screenshot/behavior-capture.ts): two source runs under controlled dates and timezones. Instrumentation installed before source scripts records timestamped text (leaf and mixed content), visibility together with its mechanism, click/pointer listeners, and canvas drawing calls. Sampling is incremental so it does not slow the page it measures. Startup ends when text goes quiet (bounded), and each click probe starts from a settled page.learned-motion.ts): infers values in the Blocks Engine marker vocabulary:Anything else goes to
unsupported; nothing is substituted. Editorial copy is never embedded.learned-motion-promotion.ts): a staged copy with the markers and a portable interpreter (motion-runtime.ts) must match the live source at 390/768/1440 on a contract derived from the evidence. Only then is it written towebsite/, with aportable-motion.jsonreceipt (origin: learned, residuals listed). Plaincomparere-verifies the receipt and fails visibly per residual.canvas-sandbox.ts): canvas algorithms are not re-derived. The page's own captured, hash-verified scripts that draw on a canvas run behind a DOM membrane: canvas, drawing contexts and listeners are live, reads return real values, and every write to non-canvas content is discarded, so the source cannot overwrite editable text. The sandboxed copy must reproduce the source pointer response, or promotion falls back to learned motion with canvas as a residual.pointer-events:nonewhile busy).data-blocks-engine-marker-runtime, so Blocks Engine uses its lowered blocks view scripts in WordPress instead.Supersedes the earlier candidate compilers (
text-behavior-runtime.ts, the clock compile step).LIQUID BONSAI, plain URL, no recipe
Synchronizingpending dots, label and status-dot reveals, 4 click triggers, and the 12h clock with its frames and typed date. The source'sscript.jsruns sandboxed for the canvas.status: translated, no residuals. Plaincomparepasses at 390/768/1440 plus layout widths.preserved_runtime_island.compare --candidatepasses against the live source at 390/768/1440 including the canvas pointer probe. Gutenberg audit: all blocks valid, edited text saves, and the front end replays the edited value.Tests
npm run build,npm run test:package, fullnpm test: 125 files / 1,444 tests pass.dist/unchanged.Remaining
Source canvas code that depends on content it would have created itself cannot run behind the membrane. It stays an explicit residual rather than being approximated.
AI disclosure: GPT-6.1 Sol via OpenCode designed and implemented the observation, learning, canvas sandbox and promotion pipeline and the neutral fixtures, and ran the live LIQUID BONSAI portable and WordPress proofs directly (Chris authorized direct implementation after the Homeboy Cook stalled). Chris Huber directs the goal.