Skip to content

test(suite): a real test suite, ./formext test and CI for it (0.11.0) - #14

Merged
nodemode-ai merged 15 commits into
mainfrom
test/suite-0.11.0
Nov 24, 2026
Merged

nodemode-ai merged 15 commits into
mainfrom
test/suite-0.11.0

Conversation

@nodemode-ai

Copy link
Copy Markdown
Contributor

test(suite): a real test suite, ./formext test and CI for it (0.11.0)

Summary

  • form.ext gets 821 new test cases: 265 for the interface (vitest with happy-dom, frontend/tests/unit) and 556 for the engine (pytest against the real FastAPI app, tests/). With the 41 cases that were already here, 862 pass.
  • ./formext test runs both layers, ./formext test unit or ./formext test engine runs one. CI runs them in one new job, test; no job ran tests before.
  • docs/TESTING.md holds the five rules a test must meet; CLAUDE.md and AGENTS.md now say tests are added when the owner asks and follow those rules.
  • No app code changed. One case stays as a strict expected failure whose reason starts with DEFECT:: the MCP move tool lists source as required but leaves it out of its properties while refusing additional properties.
  • The publish tests never reach GitHub: they point FORMEXT_GH_BIN at a stand-in and use local bare repositories, because the app finds a real gh even when PATH is replaced.
  • vitest 5.0.5 and happy-dom 21.0.4 are new development dependencies with a row in NOTICE.md; neither ships.

Commits

  • test(foundation): vitest and happy-dom for interface tests (0.11.0)
  • test(runner): ./formext test runs the interface and engine tests by layer (0.11.0)
  • ci(tests): one job, test, runs the interface and engine tests (0.11.0)
  • docs(testing): how the tests run and what a test must do (0.11.0)
  • test(foundation): the interface tests may read the contract and docs folders beside frontend (0.11.0)
  • test(cli): command line, mcp server over stdio and http, formpkg tool and engine selfcheck run as programs (0.11.0)
  • test(demoengine): in-browser demo engine routes for projects, files, validation, settings and refusals, plus its zip, hash and diff helpers (0.11.0)
  • test(panes): new and check panes mounted in a document, docs markdown, studio manifest and editor helpers, preview message text (0.11.0)
  • test(publish): prepare submission, registry submit, pull request refusals and prepared request, host sources (0.11.0)
  • test(security): window key refusal sweep over every write route, publisher keys kept private, settings seal tamper detection, local family and portal catalogue reads, ordered event bus and agent feed (0.11.0)
  • test(shell): extension host bridge, sdk round trips, simulated host apps and the shell with docs, home and library panes (0.11.0)
  • test(validate): manifest refusals, sandbox code rules, package zip read back, every shipped template scaffolds and validates (0.11.0)
  • test(workspace): projects, project files, path escapes, settings, preview serving and library refusals through the real app (0.11.0)
  • chore(release): v0.11.0

The short hashes are left out because signing changes them.

Version

v0.11.0 (the release commit is last). The version moves to 0.11.0 in backend/app/init.py, frontend/package.json, frontend/package-lock.json, frontend/src/shell/version.ts, the demo engine's health answer, src-tauri (Cargo.toml, Cargo.lock, tauri.conf.json) and the README badge, each by hand. CHANGELOG.md describes v0.11.0. Ran: ./formext test unit (265 passed) and ./formext test engine (597 passed, 1 expected failure). Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows.

Checks

Ran: ./formext test unit (265 passed) and ./formext test engine (597 passed, 1 expected failure).
From a clean clone of this branch: npm ci in frontend with the stock npm of Node 22, then npx vitest run: npm ci ok
Tests 265 passed (265).
Sampled expected values were flipped in every lane to see the tests fail, then restored.

Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows. The workflow itself has not run on GitHub; the .bat runner has not run on Windows.

Merging

Merge with a merge commit so each commit and its signature stays. Do not squash.

frontend/vitest.config.ts runs tests/unit/**/*.test.ts in happy-dom. vitest 5.0.5 and happy-dom 21.0.4 are development dependencies, the versions FormCAD uses; neither ships. Ran: one probe test under npx vitest run, passed.
…ayer (0.11.0)

A new script, setup/test, runs the tests one layer at a time: unit is vitest in frontend, engine is pytest on the tests folder from the repository root with the backend venv. No layer or all runs both, an unknown layer exits 2 with a sentence, and the rest of the line goes to the runner. It says what to install when the interface packages, the venv, pytest or httpx are missing. The launcher and formext.bat each gain the one test line; the usage text is not changed.

Run: ./formext test bogus exits 2; ./formext test engine passes 41 tests; ./formext test unit starts vitest, which finds no test files yet.
The workflow gains a job named test on Linux with Python 3.12 and Node 22. It makes backend/venv the way the launcher expects, installs backend/requirements.txt with pytest and httpx into it, runs npm ci in frontend, and then runs ./formext test unit and ./formext test engine one step each, so the step that fails names the layer. No existing job ran these tests, so nothing was removed.

Run: the workflow file was read back as YAML and lists the jobs frontend, engine and test. The job itself has not run on GitHub.
A new page, docs/TESTING.md, says how to run the tests, what the two layers are, where an area's tests live, what tests/stand_ins.py gives an engine test, the five rules and the list of what is not accepted, the DEFECT: rule for a test that shows the app is wrong, and what CI runs. The tests line in CLAUDE.md and AGENTS.md now says tests are added when the owner asks, a change in behaviour updates its tests in the same pull request, and every test follows the five rules. CONTRIBUTING.md points to the page, NOTICE.md lists vitest and happy-dom as test only and not shipped, and backend/HASHOUT_LOG.md records the runner.

Run: a search of the changed files for an em dash found none. No code changed in this commit.
…folders beside frontend (0.11.0)

frontend/vitest.config.ts allows the folders beside frontend, as vite.config.ts does, so the shell and the docs pane, which load raw files from ../contract and ../docs, import in a test as they do in the app. Ran: npx vitest run, 265 passed.
… and engine selfcheck run as programs (0.11.0)

Runs the formext command line, the MCP server (stdio and the engine's /mcp route), contract/tools/formpkg.py and formext_engine.py as programs against temp data folders and checks output, exit codes, files made and refusals; expected values come from the README and docs/MANUAL.md (commands, 33/19/14 tool counts, Ask/Allowed/Blocked), JSON-RPC 2.0 and MCP shapes, an independent zip and SHA-256 reader, round trips, and two routes that must agree. Ran: backend/venv/bin/python -m pytest tests/cli -q -p no:cacheprovider, 65 passed, 1 expected failures. The folder is a package (an empty __init__.py) and its helpers are imported relatively, so its conftest does not take the module name the other test folders import.
…validation, settings and refusals, plus its zip, hash and diff helpers (0.11.0)

Drives the demo engine through its exported dispatch router: projects made, listed, opened, linked, imported and removed, files written, read back, moved and deleted, validation answers, settings, and refusals for unknown routes and bad input. Expected values come from the manual (package/ layout, trash, folders opened in place), the real engine's stated messages and status codes in backend/app, round trips, and published vectors (CRC-32 check value, SHA-256 of abc, RFC 4648 base64, zip record layout read by an independent reader in the test). Ran: cd frontend && npx vitest run tests/unit/demoengine, 64 passed, 0 expected failures.
…, studio manifest and editor helpers, preview message text (0.11.0)

The New and Check panes are mounted into a happy-dom document with only the engine client stubbed, then checked for what a user sees and can do: lists filled from engine answers, refusals shown as sentences, no request for an empty name, the exact request a button sends, and the same nodes kept when data arrives again. Expected values come from the stubbed engine answers, the pane's own on-screen wording rules, Markdown rules, and round trips (manifest text parsed back by JSON.parse, an editor change applied by hand must give the new text). Ran: cd frontend && npx vitest run tests/unit/panes, 70 passed, 0 expected failures.
…sals and prepared request, host sources (0.11.0)

Drives the publish and sources routes on the real app in process: the submission folder and its index entry, the registry folder layout, the refusals before a pull request and the branch and request prepared against local bare repositories, and sources listed, pulled, read, searched, refused and removed. Expected values come from docs/MANUAL.md, contract/schema/extensions.schema.json, hashlib over the files on disk, git reading the pushed branch, and files the tests wrote themselves. Ran: backend/venv/bin/python -m pytest tests/publish -q -p no:cacheprovider, 65 passed, 0 expected failures. The folder is a package (an empty __init__.py) and its helpers are imported relatively, so its conftest does not take the module name the other test folders import.
…isher keys kept private, settings seal tamper detection, local family and portal catalogue reads, ordered event bus and agent feed (0.11.0)

Checks through the real app's HTTP routes, live and agent sockets and public service functions that every non-GET route answers 403 "Only the form.ext window can do this" without the key (the sweep walks the app's own route tree and is checked against its API schema, never calling the two forbidden publish routes), that private key halves stay on disk (0600) and out of every answer, that hand-edited or forged sealed settings are reported broken and dropped, that the family list and FormPortal catalogue come from local files, and that bus and agent-feed events arrive in order without argument values; expected values come from the stated refusal sentences, an independent Ed25519 and HMAC-SHA256 computation, the dev.json contract and files written by the tests. Ran: backend/venv/bin/python -m pytest tests/security -q -p no:cacheprovider, 170 passed, 0 expected failures.
…pps and the shell with docs, home and library panes (0.11.0)

Checks the host bridge sandbox, handshake, permission refusals, consent memory, storage cap and timeouts, the SDK and the host wired to each other through postMessage, every simulated host app plus form.md apply, undo and reads, the sample wav and pdf through independent header and xref readers, and the real shell booted on index.html with docs, home and library mounted; expected values come from contract/CONTRACT.md (error codes, permission words, 30 s and 300 s timeouts, 256 KB storage, sandbox attributes), the docs markdown files, RIFF and PDF rules, and undo and round-trip invariants. Ran: cd frontend && npx vitest run tests/unit/shell, 131 passed, 0 expected failures.
…ad back, every shipped template scaffolds and validates (0.11.0)

Checks what makes an extension manifest valid or refused and with which message, which code the sandbox blocks and at which line, that a package built over HTTP reads back with Python's zipfile exactly as the contract states (sorted names, 1980 dates, mode 0644, deflate, no path escapes, manifest inside, SHA-256 and size), and that all 36 shipped templates scaffold a project that validates; expected values come from contract/CONTRACT.md, contract/schema/package.schema.json, the files on disk and an independent zip and sha256 reader. Ran: backend/venv/bin/python -m pytest tests/validate -q -p no:cacheprovider, 160 passed, 0 expected failures.
…view serving and library refusals through the real app (0.11.0)

Projects are created, listed, opened, renamed, imported, linked and deleted over HTTP and read back from disk; files are written, read, moved and deleted with climbing, absolute and symlinked paths refused; settings are saved and read back; the preview route is checked for bytes and content type per file kind. Expected values come from round trips (write then read, route against disk), the standard media types of the file formats, the README rule that only the window can change anything, and the invariant that nothing lands outside the project. Ran: backend/venv/bin/python -m pytest tests/workspace -q -p no:cacheprovider, 96 passed, 0 expected failures.
The version moves to 0.11.0 in backend/app/__init__.py, frontend/package.json, frontend/package-lock.json, frontend/src/shell/version.ts, the demo engine's health answer, src-tauri (Cargo.toml, Cargo.lock, tauri.conf.json) and the README badge, each by hand. CHANGELOG.md describes v0.11.0. Ran: ./formext test unit (265 passed) and ./formext test engine (597 passed, 1 expected failure). Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows.
@nodemode-ai
nodemode-ai requested a review from gbarnai as a code owner November 24, 2026 21:59
…m path (0.11.0)

The test removed FORMEXT_GH_BIN and emptied the fixed system folders, but the app also looks for gh on PATH, and the CI runner has one in /usr/bin, so readiness answered that gh is there. For the request the test now points PATH at a folder that holds only git. Ran: ./formext test engine with a gh program in /usr/bin and without one, 597 passed and 1 expected failure both times.
@nodemode-ai

Copy link
Copy Markdown
Contributor Author

test(suite): a real test suite, ./formext test and CI for it (0.11.0)

Summary

  • form.ext gets 821 new test cases: 265 for the interface (vitest with happy-dom, frontend/tests/unit) and 556 for the engine (pytest against the real FastAPI app, tests/). With the 41 cases that were already here, 862 pass.
  • ./formext test runs both layers, ./formext test unit or ./formext test engine runs one. CI runs them in one new job, test; no job ran tests before.
  • docs/TESTING.md holds the five rules a test must meet; CLAUDE.md and AGENTS.md now say tests are added when the owner asks and follow those rules.
  • No app code changed. One case stays as a strict expected failure whose reason starts with DEFECT:: the MCP move tool lists source as required but leaves it out of its properties while refusing additional properties.
  • The publish tests never reach GitHub: they point FORMEXT_GH_BIN at a stand-in and use local bare repositories, because the app finds a real gh even when PATH is replaced.
  • vitest 5.0.5 and happy-dom 21.0.4 are new development dependencies with a row in NOTICE.md; neither ships.

Commits

  • test(foundation): vitest and happy-dom for interface tests (0.11.0)
  • test(runner): ./formext test runs the interface and engine tests by layer (0.11.0)
  • ci(tests): one job, test, runs the interface and engine tests (0.11.0)
  • docs(testing): how the tests run and what a test must do (0.11.0)
  • test(foundation): the interface tests may read the contract and docs folders beside frontend (0.11.0)
  • test(cli): command line, mcp server over stdio and http, formpkg tool and engine selfcheck run as programs (0.11.0)
  • test(demoengine): in-browser demo engine routes for projects, files, validation, settings and refusals, plus its zip, hash and diff helpers (0.11.0)
  • test(panes): new and check panes mounted in a document, docs markdown, studio manifest and editor helpers, preview message text (0.11.0)
  • test(publish): prepare submission, registry submit, pull request refusals and prepared request, host sources (0.11.0)
  • test(security): window key refusal sweep over every write route, publisher keys kept private, settings seal tamper detection, local family and portal catalogue reads, ordered event bus and agent feed (0.11.0)
  • test(shell): extension host bridge, sdk round trips, simulated host apps and the shell with docs, home and library panes (0.11.0)
  • test(validate): manifest refusals, sandbox code rules, package zip read back, every shipped template scaffolds and validates (0.11.0)
  • test(workspace): projects, project files, path escapes, settings, preview serving and library refusals through the real app (0.11.0)
  • chore(release): v0.11.0
  • fix(tests): the gh-not-installed test hides a gh that is on the system path (0.11.0)

The short hashes are left out because signing changes them. The fix(tests) commit sits after the release commit because the branch was already pushed. It changes one test file and no version site.

Version

v0.11.0 (the release commit is last). The version moves to 0.11.0 in backend/app/init.py, frontend/package.json, frontend/package-lock.json, frontend/src/shell/version.ts, the demo engine's health answer, src-tauri (Cargo.toml, Cargo.lock, tauri.conf.json) and the README badge, each by hand. CHANGELOG.md describes v0.11.0. Ran: ./formext test unit (265 passed) and ./formext test engine (597 passed, 1 expected failure). Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows.

Checks

Ran: ./formext test unit (265 passed) and ./formext test engine (597 passed, 1 expected failure).
From a clean clone of this branch: npm ci in frontend with the stock npm of Node 22, then npx vitest run: npm ci ok
Tests 265 passed (265).
Sampled expected values were flipped in every lane to see the tests fail, then restored.

Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows. The workflow itself has not run on GitHub; the .bat runner has not run on Windows.

After the first push the test job failed in ./formext test engine on test_readiness_asks_for_gh_when_it_is_not_installed. The cause was in the test: the app also looks for gh on PATH, and the runner has one in /usr/bin. For the request the test now points PATH at a folder that holds only git. Reproduced here with a gh program in /usr/bin (1 failed, 596 passed before the fix), then ran ./formext test engine with the fix under that condition and without it: 597 passed and 1 expected failure both times.

Merging

Merge with a merge commit so each commit and its signature stays. Do not squash.

@nodemode-ai
nodemode-ai merged commit 209cdef into main Nov 24, 2026
3 checks passed
@nodemode-ai
nodemode-ai deleted the test/suite-0.11.0 branch November 24, 2026 22:37
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.

1 participant