Repository navigation
fix(runtime): gate dynamic execution in AOT hosts - #182346
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR rejects dynamic host execution and non-embedded plugin loading in AOT standalone builds with runtime-switch or rebuild guidance. Example: An AOT host attempts a Node Code Mode cell containing return 42 under strict string-codegen restrictions.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review The prior wrapper-inventory blocker is fixed, and no new actionable correctness or security defect was found; current main still lacks these AOT gates. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherStandalone bootstrap facts feed a shared runtime-profile owner, which Code Mode, plugin loaders, QA evaluation, and the Plugin SDK consult before dynamic host execution. flowchart TD
A[Standalone build facts] --> B[Runtime profile owner]
C[Compiler module inventory] --> B
B --> D[Code Mode executor]
B --> E[Plugin loading]
B --> F[QA evaluation and SDK]
D --> G[Execution or actionable error]
E --> G
F --> G
Technical reviewBest possible solution: Keep capability selection in the shared artifact-backed owner and reject unsupported AOT work at the existing execution boundaries. Do we have a high-confidence way to reproduce the issue? Current-main source reaches host evaluation and plugin loading without these gates, and the author records baseline failures and compiled AOT probes; this read-only review ran no target code. Is this the best way to solve the issue? The change uses one small profile owner and the existing compiler inventory, preserves executor choice, and avoids global evaluator patches or a parallel loading subsystem. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 42da9c996d84. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +72, Tests +227, Docs +130, Other +10. Total +439 across 20 files. Added test files: 4. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 24, 2026, 5:20 AM ET / 09:20 UTC (Revision 2). |
4fa3cb4 to
450ed39
Compare
Select execution capabilities from standalone build facts and reject unsupported host evaluation or non-embedded plugin modules with actionable guidance. Preserve dynamic Node/Bun hosts and expose the same policy through the plugin SDK.
450ed39 to
4f275a5
Compare
|
@clawsweeper re-review The runtime profile now consumes immutable build facts, and its module is included in the trusted wrapper inventory. Current profile/CLI tests and strict AOT probes pass. The separate cold-provisioning timeout reproduces on the PR base; evidence is in the PR body. |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* fix(runtime): gate dynamic execution in AOT hosts Select execution capabilities from standalone build facts and reject unsupported host evaluation or non-embedded plugin modules with actionable guidance. Preserve dynamic Node/Bun hosts and expose the same policy through the plugin SDK. * fix(runtime): use immutable standalone profile facts
What Problem This Solves
Fixes opaque VM and plugin-loading failures when an AOT standalone host is asked to execute JavaScript that was not compiled into its image.
User Impact
AOT standalone users get an actionable error directing them to a Node/Bun or JIT/bytecode host, or to rebuild the artifact with the required plugin. Normal Node/Bun and non-AOT standalone behavior stays available. The existing QuickJS executor is not silently substituted, and declarative QA actions and statically declared imports remain usable.
Why This Change Was Made
One runtime-profile owner derives a process-stable decision from the immutable standalone bootstrap facts, with the existing manifest fallback. It consumes the shared build-facts owner added in #182309. Code Mode, plugin loading, QA evaluation, and the SDK use that owner before attempting dynamic host execution. Plugin admission uses compiler-owned image membership rather than a filename, directory, or installation-success heuristic.
This is a compatibility contract, not a security sandbox. It adds no user configuration and does not globally patch evaluators or enable a strict string-codegen flag. Fixed-path validator/parser/codec compatibility and full-artifact qualification remain separate work. Guest/external runtimes retain their own qualification requirements.
Evidence
Owning tests used
pnpm test <file> --maxWorkers=1with Node; wall times include wrapper/startup overhead on a busy host. The table records the initial candidate, before the shared build-facts integration.The new regressions fail against the original owner implementations: retained Node execution completes when it should be unavailable; fetched CJS/TS execute when they should be rejected; QA expressions/lambdas evaluate and unknown imports lack profile guidance. Baseline runs took 55.28s, 46.39s, and 29.93s respectively. Exact candidate bytes were restored afterward.
Small probes compiled with experimental Bun exercise the actual profile owner. The ordinary string-codegen ban still lets a VM control return
42; strict mode instead produces a rawEvalError. The profile gate returns runtime-switch guidance before evaluation. A late plugin import changes fromERR_MODULE_NOT_FOUNDto rebuild/runtime guidance. The integrated owner probe compiled six modules in 0.94s under the strict flag; gated runs took 0.02–0.83s. It also proves that immutable AOT bootstrap facts win over a contradictory JIT disk manifest. Fresh Node processes select the expected AOT/JIT/bytecode profile and retain it after manifest edits. Ordinary Bun selectsdynamic-executionand returns42. No interpreter tripwire or whole-application compilation was used.The final main integration preserves the new source-loader capability declaration and WebAssembly documentation. The range comparison shows context-only changes; the reviewed runtime additions are unchanged. On that head, all four profile boundaries pass (16 tests, 30.74s combined), CLI and metadata pass (62 tests, 12.40s), and focused types, core lint, and formatting pass. Earlier cache-disabled attempts stalled without a verdict; the fresh isolated-cache runs close those local gaps.
Focused source and metadata types, the required tooling type leaf, core/script/metadata lint, formatting, docs links (15,889; zero broken), and glossary validation pass. Codex review is clean through P2.
The initial exact-head CI passed runtime, extension lint, and package-boundary checks. Its two failing tooling shards exposed a missing runtime-profile entry in the extracted PR wrapper inventory; this revision adds that required entry. Both inventory regression assertions now pass locally with an isolated cache (69.62s wall). The local QA package-boundary lint attempt had timed out during SDK declaration preparation, before lint, so the CI result supplies that broader proof. One existing QA test (
loads bundled QA runtime modules through qaImport) timed out at its unchanged 120s limit (507.72s wall), with 18 other cases passing. That exact test also times out with the original base implementations (1041.36s wall, including cold compilation and cache verification). It is retained as an investigated baseline failure, not counted as passing.The scoped tooling repair run passed both inventory assertions and the disabled-acceleration/count cold-provisioning cases. The parameters transport case exceeded its unchanged 120s test limit (475.00s whole invocation). The exact same 120s timeout reproduces on the clean PR base (210.77s wall), where the test and provisioning owner match this PR. It remains a recorded local baseline failure; no timeout or assertion was weakened.
Final exact-head CI run 40080809504, attempt 1, completed all 90 jobs. Runtime, tooling, types, lint, docs, and security checks passed. UI shards 2/9 and 4/9 failed, making the aggregate gate red. The failing cases are
active turn recovery > restores the active assistant and tool after navigation(the/usageroute does not settle) andoffers Undo when an individual archive completes after navigate on the Sessions page(Undo never appears). Both reproduce on a clean worktree at the exact tested main parentd95a32ccfcde1246d4175f6e22e442f4d8f53784: 2 failed / 15 skipped, 138.85s wall. The full UI tree and its package, lockfile, Vitest setup/config, and shared helper inputs are identical in the tested merge. These mocked Gateway browser flows do not execute the changed host-profile paths. The initial classifier marked them new because the scheduled main job passed without scope comparison; this direct baseline reproduction establishes the inherited failures. Landing uses the native pre-existing-failure exception and retains the red CI result; no CI rerun or UI assertion change was requested.