8000 refactor(engine): move the engine's node-free half into engine-core by colinhacks · Pull Request #72 · colinhacks/reylo · GitHub
[go: up one dir, main page]

Skip to content

refactor(engine): move the engine's node-free half into engine-core - #72

Merged
colinhacks merged 2 commits into
mainfrom
engine-core
Oct 23, 2026
Merged

colinhacks merged 2 commits into
mainfrom
engine-core

Conversation

@colinhacks
Copy link
8000 Copy Markdown
Owner

The calls into the engine's WASI reactor, the lexer, the replay loop that hands each round's needs to an EngineIo, and the answer cache import nothing from Node. They move to src/engine-core.ts as EngineCore, with the request and answer types, so a browser can host the same engine.wasm with a WASI shim of its own. src/engine.ts re-exports them and keeps Engine.load, which loads the artifact with node:wasi; every caller is unchanged.

Verified: nub run typecheck, nub run test against throwaway Postgres 18 and MySQL 8.4 (223 pass, none skipped), and nub run build.

The calls into the reactor, the lexer and the replay loop import nothing from Node, so a browser can host the same engine.wasm with a WASI shim of its own; src/engine.ts keeps loading it with node:wasi.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 16:31
@vercel
vercel Bot commented Oct 23, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
reylo Ignored Ignored Preview Oct 23, 2026 4:39pm UTC

Request Review

Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues. One gap in the build guard is worth a look.

Reviewed changes

This review covers the one commit that splits the engine host into a Node-free core and the Node loader.

  • src/engine-core.ts: EngineCore (call, lex, the analyze replay loop), fulfil, AnswerCache and the request and answer types moved here unchanged. Its only imports are ./connection.ts and ./engine-type.ts (types only), and neither pulls in Node.
  • src/engine.ts: re-exports everything from the core. Engine now extends EngineCore and keeps only static load, which uses node:wasi. Every caller's import 8000 still resolves, and Engine.load still returns an Engine.
  • AGENTS.md: the file table now names src/engine-core.ts as the engine host's Node-free half.

ℹ️ The dist/reylo guard does not cover the new module

scripts/build.ts:63 fails the build when a run-time module pulls build-time code into dist/reylo. Today that check fires through src/engine.js. The analysis host now lives mostly in src/engine-core.js, and the regex does not list that file. If a run-time module imported ./engine-core.ts, the replay loop and AnswerCache would ship in reylo and the build would not complain. Nothing does that today, so this is about keeping the guard as strict as it was before the split.

Technical details
# Build guard misses `src/engine-core.js`

## Affected sites
- scripts/build.ts:63 — the regex `^src\/(tooling|analyze|engine|loader|commands|mapper-server)\.js$` does not match `src/engine-core.js`

## Required outcome
- A run-time import of `src/engine-core.ts` that drags it into `dist/reylo` fails `nub run build`, as an import of `src/engine.ts` does now. The other option is to decide that the core may ship in `reylo`, for example for a future browser entry, and say so in the comment above the guard.

## Open questions for the human
- Is the browser host meant to ship from `reylo` itself, or from an engine package or the docs site? That decides whether `engine-core` belongs in the guard.

Pullfrog  | Fix it ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

@colinhacks
Copy link
Copy Markdown
Owner Author

Pullfrog's build-guard note: fixed in 2534e67. The dist/reylo guard in scripts/build.ts now lists engine-core too, so it stays as strict as before the split; a later change that ships the core from reylo can relax it deliberately.

@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. The build guard gap from the last review is closed.

Reviewed changes

This review covers the one commit pushed since the last Pullfrog review.

  • scripts/build.ts: the dist/reylo guard regex now lists engine-core. A run-time module that imports ./engine-core.ts now fails nub run build, just as an import of ./engine.ts already did. Only src/engine.ts imports the core today, so the build still passes.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@colinhacks
colinhacks merged commit 45217d6 into main Oct 23, 2026
6 checks passed
@colinhacks
colinhacks deleted the engine-core branch October 23, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0