Skip to content

[codex] Tighten Fusion post validation and host coverage#3

Merged
540lyle merged 5 commits into
mainfrom
codex/validation-hooks
Apr 9, 2026
Merged

[codex] Tighten Fusion post validation and host coverage#3
540lyle merged 5 commits into
mainfrom
codex/validation-hooks

Conversation

@540lyle

@540lyle 540lyle commented Apr 9, 2026

Copy link
Copy Markdown
Owner

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.cps runtime 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 validate entrypoint, 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 for adapters/fusion/FluidNC.cps, 100% coverage unit tests, differential host comparisons, and the fixture capture validator.

@540lyle 540lyle changed the title codex/validation hooks [codex] Tighten Fusion post validation and host coverage Apr 9, 2026
@540lyle 540lyle marked this pull request as ready for review April 9, 2026 17:43
# 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

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.

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.

Comment thread tools/validate/run-differential-tests.mjs Outdated
Comment thread tools/validate/run-original-fixture-audit.mjs
Comment thread tests/support/fusion-host.mjs
Comment thread tests/support/fusion-adapter-api.mjs Outdated
@540lyle 540lyle merged commit abb6253 into main Apr 9, 2026
1 check passed
@540lyle 540lyle deleted the codex/validation-hooks branch April 12, 2026 20:53
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.

3 participants