[PR #1600] [MERGED] build: resolve versioned Motion host modules from the correct dependency #1598

Closed
opened 2026-10-24 04:02:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1600
Author: @SpicyMarinara
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara

Base: staging ← Head: build/motion14-host-shims


📝 Commits (5)

  • e270390 chore: track versioned Motion host tooling
  • b323e75 build: keep Motion runtime exports and package types on their declared host slot
  • 93f8083 test: follow versioned host imports in package browser fixtures
  • 27c5a58 test: include host helper in isolated typecheck fixture
  • 356a7d5 fix: validate host mappings and resolve hoisted package types

📊 Changes

10 files changed (+393 additions, -25 deletions)

View changed files

📝 CONTRIBUTING.md (+8 -1)
📝 scripts/build-feature-packages.mjs (+14 -2)
📝 scripts/client-host-gates.mjs (+2 -0)
📝 scripts/esbuild-host-plugins.mjs (+84 -10)
📝 scripts/tests/client-host-gates.regression.mjs (+2 -0)
📝 scripts/tests/host-module-shims.regression.mjs (+243 -1)
📝 scripts/tests/typecheck-packages-missing-tsc.regression.mjs (+2 -1)
📝 scripts/typecheck-packages.mjs (+22 -5)
📝 tests/package-engine-boundary.regression.mjs (+8 -0)
📝 tests/package-host-fixture.ts (+8 -5)

📄 Description

Why this change

Engine Motion 14 coexistence retains the complete Motion 13 namespace at the existing API-1 host slot. Probing the Engine's primary framer-motion dependency would give a legacy package the wrong exports and types even though its runtime slot still uses 13.

What changed

  • Read MARINARA_HOST_MODULE_IMPORTS from the Engine contract for export inventories, with identity resolution for older contracts. Reject invalid dependency mappings.
  • Add the explicit motion/react host slot. Building an import requires a declared capability API 1.377 or newer; an older Engine or missing runtime slot fails clearly. The legacy slot keeps its 1.341 floor.
  • Use the strict lane's TypeScript resolver for Engine-backed mapped imports, including hoisted dependencies and package-export subpaths. Legacy framer-motion sees version-13 declarations; motion/react sees version 14. A declared mapping that cannot be parsed fails clearly; only a genuinely absent mapping uses legacy identity resolution.
  • Make shared package-browser fixtures read the actual Engine slots, mapped dependencies and supported capability API; this supports both older hosts and the new slots.
  • Keep no-bundled-host-library gates effective for aliases and the Motion wrapper. Pass each feature's declared capability API to its build plugin and document the version boundary.

Closes #1599. Coordinates Pasta-Devs/Marinara-Engine#8134 / #8078. No package payload, version, manifest, ZIP or catalog is rebuilt by this tooling-only change.

Package and security impact

  • Affected package IDs: build/typecheck tooling; no package payloads or catalogs change.
  • Engine compatibility: legacy host slots retain API 1.341; opt-in motion/react requires 1.377 and the companion Engine.
  • Permissions/entrypoints: no changes.
  • Restart, storage, update and uninstall: no changes.

Validation

  • npm run check passes on the final ten-file change, with existing warnings and zero errors.
  • test-catalog-lanes, validate-package-locales, validate-catalog and catalog-release-notes.regression pass.
  • Actual esbuild-shim regressions cover old-contract fallback, mapped legacy/modern inventories, runtime object identity, older declaration/API, missing slot, wrong-version exports and invalid mapping. Real Engine inventories retain legacy observeTimeline and modern useScopeMotion in their respective slots.
  • Real TypeScript declarations compile the correct-version imports and reject both crossed imports with TS2305. Existing Long-Term Memory strict checks pass for 97 server/shared and 45 client files.
  • The existing full Long-Term Memory browser test reaches its keyboard identity-select assertion (line 5055), then fails unchanged on this macOS host with both API 1.376 and 1.377 Engines; the new Engine replay reproduces the same result. An isolated native HTML select reproduces the same behavior in macOS Chromium 156 with hasTouch: true: the exact keys fire without input/change events. No assertions, skips or timeouts were changed. The repair head passes hosted catalog validation and the complete Linux Long-Term Memory workflow. Attempt 1 passed against Engine e63449e56470044b4a906b6d429a51b42f663167 (API 1.376). The unchanged attempt 2 passed after Engine merge against 1ffb916dfb32a3400fdca2fb65616d078fa6018e (API 1.377): full browser lifecycle, every LTM regression, and strict checks for the same 142 files. Both actual checkout SHAs are retained in the job logs.
  • Standalone fixture browser controls pass against actual API 1.376 and 1.377 Engines, preserving legacy-only exports and separate modern/legacy contexts.
  • The isolated missing-TypeScript regression retains its ENOENT assertion and includes the newly imported helper in its temporary checkout. The complete CI command suite passes locally: 57/57 commands.
  • Host-library gate regressions reject bundling either legacy alias or the Motion wrapper. git diff --check passes.
  • Fresh full-branch local CodeRabbit review completed on all 10 changed files against staging: 0 findings. Repair head: 356a7d55ed048966acc76167d156e14f2fa180bc.

Review follow-up

The first Dottore review reported three defects. Two were reproduced and repaired:

  • A wrapped/annotated mapping returned identity exports. Wrapped/annotated declarations now fail clearly, an empty map is validated, and a truly absent declaration retains legacy identity behavior. All mapping entrypoints have regression controls.
  • A root-hoisted dependency produced two TS2307 errors. The same compiler as the strict lane now resolves declarations from the Engine client root. Tests compile root-only packages and a virtual exported subpath, reject the package root's wrong export with TS2305, and reject a missing dependency.

The boundary-precedence finding was rejected after tracing the emitted manifest: it uses the same validated boundary API as the build gate. readPackageEngineBoundary requires exact API equality, and Hierarchical Maps also validates its fixed floor. A feature override cannot unlock a slot while the installed manifest still declares an older API. Added an explanatory comment and a mismatch-rejection regression; gate precedence is retained. The diagnostic wording note remains non-blocking: both compatibility failures name the unavailable slot and required API floor.

Fresh full Dottore review on 356a7d55ed048966acc76167d156e14f2fa180bc is Viable, With Notes: 0 defects, 1 nonblocking note. Both repairs are explicitly confirmed. The stale boundary thread was resolved with the source-linked disposition above, leaving zero open review threads. The new note suggests caching contract parsing; direct reads remain in this compatibility fix.

Documentation impact

Updated contributor guidance and the companion Engine's host-module reference. Engine translation work is tracked in Pasta-Devs/Marinara-Engine#8136.

Claim boundary and manual checks

This changes build/typecheck tooling, not installed package data or lifecycle. Existing API-1 package bundles continue to read the same Motion-13 namespace. Engine's companion browser proof uses synthetic old/new package roots in Chromium and WebKit; actual Noodle/Slurp user flows and physical hardware were not rerun.

  • Manually build a package declaring 1.377 and importing motion/react against the companion Engine.
  • Manually verify a legacy package still builds against an older compatible Engine.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1600 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `build/motion14-host-shims` --- ### 📝 Commits (5) - [`e270390`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e27039072d2782dde835ea0aee9919b3d6cc9e04) chore: track versioned Motion host tooling - [`b323e75`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b323e754b081499c15c4cf511784bc775977d0d9) build: keep Motion runtime exports and package types on their declared host slot - [`93f8083`](https://github.com/Pasta-Devs/Marinara-Agents/commit/93f8083141660491b52ff9c20a139a0e1a925643) test: follow versioned host imports in package browser fixtures - [`27c5a58`](https://github.com/Pasta-Devs/Marinara-Agents/commit/27c5a5813764f2317aea539422fb760ef63c401e) test: include host helper in isolated typecheck fixture - [`356a7d5`](https://github.com/Pasta-Devs/Marinara-Agents/commit/356a7d55ed048966acc76167d156e14f2fa180bc) fix: validate host mappings and resolve hoisted package types ### 📊 Changes **10 files changed** (+393 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTING.md` (+8 -1) 📝 `scripts/build-feature-packages.mjs` (+14 -2) 📝 `scripts/client-host-gates.mjs` (+2 -0) 📝 `scripts/esbuild-host-plugins.mjs` (+84 -10) 📝 `scripts/tests/client-host-gates.regression.mjs` (+2 -0) 📝 `scripts/tests/host-module-shims.regression.mjs` (+243 -1) 📝 `scripts/tests/typecheck-packages-missing-tsc.regression.mjs` (+2 -1) 📝 `scripts/typecheck-packages.mjs` (+22 -5) 📝 `tests/package-engine-boundary.regression.mjs` (+8 -0) 📝 `tests/package-host-fixture.ts` (+8 -5) </details> ### 📄 Description ## Why this change Engine Motion 14 coexistence retains the complete Motion 13 namespace at the existing API-1 host slot. Probing the Engine's primary `framer-motion` dependency would give a legacy package the wrong exports and types even though its runtime slot still uses 13. ## What changed - Read `MARINARA_HOST_MODULE_IMPORTS` from the Engine contract for export inventories, with identity resolution for older contracts. Reject invalid dependency mappings. - Add the explicit `motion/react` host slot. Building an import requires a declared capability API **1.377** or newer; an older Engine or missing runtime slot fails clearly. The legacy slot keeps its 1.341 floor. - Use the strict lane's TypeScript resolver for Engine-backed mapped imports, including hoisted dependencies and package-export subpaths. Legacy `framer-motion` sees version-13 declarations; `motion/react` sees version 14. A declared mapping that cannot be parsed fails clearly; only a genuinely absent mapping uses legacy identity resolution. - Make shared package-browser fixtures read the actual Engine slots, mapped dependencies and supported capability API; this supports both older hosts and the new slots. - Keep no-bundled-host-library gates effective for aliases and the Motion wrapper. Pass each feature's declared capability API to its build plugin and document the version boundary. Closes #1599. Coordinates Pasta-Devs/Marinara-Engine#8134 / #8078. No package payload, version, manifest, ZIP or catalog is rebuilt by this tooling-only change. ## Package and security impact - Affected package IDs: build/typecheck tooling; no package payloads or catalogs change. - Engine compatibility: legacy host slots retain API 1.341; opt-in `motion/react` requires 1.377 and the companion Engine. - Permissions/entrypoints: no changes. - Restart, storage, update and uninstall: no changes. ## Validation - `npm run check` passes on the final ten-file change, with existing warnings and zero errors. - `test-catalog-lanes`, `validate-package-locales`, `validate-catalog` and `catalog-release-notes.regression` pass. - Actual esbuild-shim regressions cover old-contract fallback, mapped legacy/modern inventories, runtime object identity, older declaration/API, missing slot, wrong-version exports and invalid mapping. Real Engine inventories retain legacy `observeTimeline` and modern `useScopeMotion` in their respective slots. - Real TypeScript declarations compile the correct-version imports and reject both crossed imports with TS2305. Existing Long-Term Memory strict checks pass for **97 server/shared** and **45 client** files. - The existing full Long-Term Memory browser test reaches its keyboard identity-select assertion (line 5055), then fails unchanged on this macOS host with both API 1.376 and 1.377 Engines; the new Engine replay reproduces the same result. An isolated native HTML select reproduces the same behavior in macOS Chromium 156 with `hasTouch: true`: the exact keys fire without input/change events. No assertions, skips or timeouts were changed. The repair head passes hosted catalog validation and the complete Linux [Long-Term Memory workflow](https://github.com/Pasta-Devs/Marinara-Agents/actions/runs/39887275277). Attempt 1 passed against Engine `e63449e56470044b4a906b6d429a51b42f663167` (API 1.376). The unchanged [attempt 2](https://github.com/Pasta-Devs/Marinara-Agents/actions/runs/39887275277/attempts/2) passed after Engine merge against `1ffb916dfb32a3400fdca2fb65616d078fa6018e` (API 1.377): full browser lifecycle, every LTM regression, and strict checks for the same 142 files. Both actual checkout SHAs are retained in the job logs. - Standalone fixture browser controls pass against actual API 1.376 and 1.377 Engines, preserving legacy-only exports and separate modern/legacy contexts. - The isolated missing-TypeScript regression retains its ENOENT assertion and includes the newly imported helper in its temporary checkout. The complete CI command suite passes locally: **57/57** commands. - Host-library gate regressions reject bundling either legacy alias or the Motion wrapper. `git diff --check` passes. - Fresh full-branch local CodeRabbit review completed on all **10 changed files** against staging: **0 findings**. Repair head: `356a7d55ed048966acc76167d156e14f2fa180bc`. ## Review follow-up The first Dottore review reported three defects. Two were reproduced and repaired: - A wrapped/annotated mapping returned identity exports. Wrapped/annotated declarations now fail clearly, an empty map is validated, and a truly absent declaration retains legacy identity behavior. All mapping entrypoints have regression controls. - A root-hoisted dependency produced two TS2307 errors. The same compiler as the strict lane now resolves declarations from the Engine client root. Tests compile root-only packages and a virtual exported subpath, reject the package root's wrong export with TS2305, and reject a missing dependency. The boundary-precedence finding was rejected after tracing the emitted manifest: it uses the same validated boundary API as the build gate. `readPackageEngineBoundary` requires exact API equality, and Hierarchical Maps also validates its fixed floor. A feature override cannot unlock a slot while the installed manifest still declares an older API. Added an explanatory comment and a mismatch-rejection regression; gate precedence is retained. The diagnostic wording note remains non-blocking: both compatibility failures name the unavailable slot and required API floor. Fresh **full** Dottore review on `356a7d55ed048966acc76167d156e14f2fa180bc` is **Viable, With Notes: 0 defects, 1 nonblocking note**. Both repairs are explicitly confirmed. The stale boundary thread was resolved with the source-linked disposition above, leaving zero open review threads. The new note suggests caching contract parsing; direct reads remain in this compatibility fix. ## Documentation impact Updated contributor guidance and the companion Engine's host-module reference. Engine translation work is tracked in Pasta-Devs/Marinara-Engine#8136. ## Claim boundary and manual checks This changes build/typecheck tooling, not installed package data or lifecycle. Existing API-1 package bundles continue to read the same Motion-13 namespace. Engine's companion browser proof uses synthetic old/new package roots in Chromium and WebKit; actual Noodle/Slurp user flows and physical hardware were not rerun. - [ ] Manually build a package declaring 1.377 and importing `motion/react` against the companion Engine. - [ ] Manually verify a legacy package still builds against an older compatible Engine. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:02:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1598
No description provided.