[codex] Tighten Fusion post validation and host coverage#3
Merged
Conversation
# Conflicts: # .gitignore # README.md # docs/install-fusion.md # docs/testing.md # fixtures/expected/fusion/README.md # llm/testing.md # package-lock.json # package.json # tools/validate/README.md
There was a problem hiding this comment.
Pull request overview
This PR strengthens the repo-owned validation surface for the Fusion adapter by adding a VM-backed mocked Fusion host, enforcing 100% unit-test coverage for the adapter, and introducing optional local-only differential/original-fixture auditing when a locally installed “original” post is available.
Changes:
- Added a mocked Fusion host runner plus a coverage-gated unit harness (100% statements/branches/functions/lines).
- Added optional local-only harnesses for original-vs-rewrite differentials and original-vs-fixture audits (skips when the original post is not present).
- Updated npm scripts, docs, and fixture review guidance to standardize local + CI validation (
npm run validate).
Reviewed changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/validate/run-unit-tests.mjs | New coverage-gated unit harness for mocked Fusion runtime execution. |
| tools/validate/run-differential-tests.mjs | New differential harness comparing original vs repo rewrite (when original post exists). |
| tools/validate/run-original-fixture-audit.mjs | New local audit comparing original post output to checked-in fixtures to gauge host fidelity. |
| tools/validate/README.md | Documents the new validation entry points and CI boundary. |
| tests/support/fusion-host.mjs | Adds VM-backed mocked Fusion host and post loader used by unit/differential harnesses. |
| tests/support/fusion-adapter-api.mjs | Adds adapter API picker helper (currently unused). |
| tests/adapters/fusion-scenarios.mjs | Adds/updates mocked-host unit scenarios covering adapter behavior and branches. |
| tests/adapters/fusion-post.test.mjs | Node test runner wrapper for unitScenarios. |
| tests/adapters/fusion-differential-scenarios.mjs | Differential scenarios for original vs rewrite comparisons and fixture prefix checks. |
| package.json | Adds test:unit*, fixture audit, and wires unit tests into validate:adapter. |
| package-lock.json | Locks new Istanbul dependencies for coverage instrumentation. |
| README.md | Clarifies repo-owned rewrite posture vs upstream helper surface and points to upstream baseline notes. |
| docs/testing.md | Documents new mocked-host test layer, CI boundary, and audit tooling. |
| docs/install-fusion.md | Expands linked-folder setup and local install guidance with concrete steps and examples. |
| adapters/fusion/README.md | Updates adapter status/priorities to match repo-owned rewrite + test harness posture. |
| adapters/fusion/upstream/baseline.md | Updates provenance notes and clarifies no upstream .cps working copy is tracked. |
| llm/testing.md | Updates testing guidance to include npm run test:unit and validation posture. |
| llm/fusion-adapter.md | Updates adapter guidance around repo-owned helper structure and mock-testability. |
| fixtures/expected/fusion/README.md | Adds guidance on agent-assisted diffs and recording accepted metadata-only diffs. |
| fixtures/expected/fusion/multi-tool/manual-toolchange-no-optional-stop.review.md | Records an accepted metadata-only diff to avoid re-triage. |
| .gitignore | Ignores coverage and tmp directories produced by validation tooling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Issue
The repository had started adding validation automation, but contributors could still change the Fusion adapter and its mocked host surface without a single repo-owned gate that combined syntax, lint, full-coverage unit tests, differential checks, and fixture validation. That left a real risk that Fusion-specific runtime drift or compatibility regressions would only show up late, after posting or manual inspection.
Root Cause
The rewritten
FluidNC.cpsruntime and the mocked Fusion host had coverage gaps around compatibility behavior and removed helper contracts. Validation was also spread across ad hoc commands, with no consistent hooks or PR workflow enforcing the same checks before review.Fix
This branch tightens the adapter and validation surface in two directions. On the process side, it adds repo-owned git hooks, a PR validation workflow, a single
npm run validateentrypoint, and updated contributor/testing documentation so the same checks run locally and in review. On the adapter side, it expands the mocked Fusion host, adds broader scenario and differential coverage against the local original post, hardens compatibility expectations inside the post runtime, and documents the updated upstream/testing posture.Effect On Users
Fusion users should see a more stable post because regressions in inch handling, split output, restart safety, tool boundaries, and compatibility behavior are caught earlier. Contributors now get faster feedback when a change breaks the repo-owned adapter contract or diverges from expected output.
Validation
I validated this branch with
npm run validate, which ran syntax and lint checks foradapters/fusion/FluidNC.cps, 100% coverage unit tests, differential host comparisons, and the fixture capture validator.