Skip to content

FormEncoder 0.11.0: one engine of the app per data folder, an engine log, and a clean stop (engine side only) - #15

Merged
nodemode-ai merged 4 commits into
mainfrom
feat/windows-start-0.11.0
Nov 20, 2026
Merged

nodemode-ai merged 4 commits into
mainfrom
feat/windows-start-0.11.0

Conversation

@nodemode-ai

Copy link
Copy Markdown
Collaborator

FormEncoder 0.11.0: one engine of the app per data folder, an engine log, and a clean stop (engine side only)

This branch sits on top of feat/family-update-0.9.0 (version 0.10.0, pushed and not yet merged). It adds 4 commits: the engine side of the start and stop pattern that FormTools 0.10.0 has, one small change in the desktop shell, a fix in the terminal's reader, and the release commit. The shell side of the pattern is not in this release; see "Held".

What changes for people

  • One engine of the app serves a data folder. A second copy of FormEncoder on the same folder is refused with one sentence ("formencoder is already running on [folder] (engine process N).", exit code 2) and the first copy carries on. Before, two copies ran two engines on the same queue and settings.
  • An engine of this version that is left running after its app has gone is ended and replaced at the next start of the app. An engine whose app is still there is never ended. An engine of 0.10.0 or older holds no lock, so it is not found and not ended; it already leaves by itself within a second when its app is gone.
  • The engine leaves within about two seconds when the app that started it is gone, however the app ended, and takes its lock and its address record with it. It reads the app's process id from FORMENCODER_PARENT_PID, which the released shell already sets, so the shell needed no new variable.
  • The engine keeps a log, logs/formencoder-engine.log in the data folder (1 MB, three older files kept). A refused start and an error that stops the engine are written there. An engine with no error stream keeps its errors in logs/formencoder-engine-errors.log.
  • Opening the engine program by itself opens FormEncoder and leaves no engine running; with no FormEncoder near it, it says it serves nothing on its own (exit code 4). A data folder that cannot be made is one sentence and exit code 5.
  • formencoder-engine --headless, the engine a command line or an agent's bridge starts on purpose with no app, serves as before: it takes no lock and can run beside the app's engine, as it could.
  • When the app cannot start its engine, the sentence is shown before the loading window closes; the window used to close first. The sentence says that a copy of FormEncoder may already be open and where the engine's log is.
  • Changed: an engine that is stopped with a terminate signal gives up its lock and its address record and leaves with exit code 0.
  • A terminal's reader no longer writes an error line when the engine is already on its way out.

How it was checked

Everything below ran on Linux, from source, with stand-ins for the app (sleep) and for the agent programs.

  • The engine's start and stop, seen before any test was written: a second engine with a live stand-in app on the same folder left with 2 and the sentence while the first kept answering, and the log held the refusal; an engine whose stand-in app ended left with 0 in 1.3 seconds, and its lock and address record were gone; a holder that could not leave by itself (stopped with SIGSTOP) and whose app was gone was ended and replaced, with the line in the log; lock files holding not json at all, [1, 2], {"pid": "x"} and nothing were replaced; a lock naming an unrelated process was replaced and that process kept running; an engine marked as packaged started a stand-in app in each of four install layouts and left with 0, no lock and no address record, and with no app near it left with 4 and the sentence; a headless engine served beside a held lock and left the lock as it was; with its output, its output and error, and all three streams closed the engine answered its health route.
  • backend/tests/test_startup.py, written after that: 15 passed.

Checks rehearsed (the jobs of .github/workflows/ci.yml), in a clone:

Job Command Result here
test venv/bin/python -m pytest tests -q -p no:cacheprovider 279 passed (264 before this branch, 15 new), on the tree of the release commit. Stand-in agent programs started 0 times.
scripts the shell syntax loop, python3 setup/lint_text.py ., python3 -m py_compile setup/*.py All three exit 0; the text lint has 0 findings on the release commit.
engine python -m compileall -q app formencoder_engine.py, python formencoder_engine.py --selfcheck, ./formencoder agents sync --check Exit 0, "ok": true, in step. The step that boots an engine and encodes over MCP was not rehearsed.
interface npm ci, npm audit --audit-level=low, npm run build Built; 0 vulnerabilities.
window python -m pytest frontend/tests/window -q -p no:cacheprovider (Playwright 1.63.0) 2 passed.
engine-hosts cargo check --workspace --locked with -D warnings in native, on Ubuntu, macOS and Windows Not run. No Rust file under native changed; only its version fields.
desktop-shell cargo check --locked in src-tauri Cannot run here (no WebKit libraries).

On the release commit itself, in a clone: the version, boot and start test files, 21 passed; agents sync --check in step; the window check again, 2 passed; npm audit, 0 vulnerabilities; cargo metadata --locked --offline in native exit 0, so its lock file agrees with the new version. The same command in src-tauri could not answer without the network, so that lock's one hand-edited version field is checked only by reading it against the 0.10.0 release commit.

Not run

  • Nothing was run on Windows or macOS. Every Windows-only line of the engine's start code has never run: asking whether a process is alive and when it was created, ending a left-over engine and what it started, waiting on the app's process, and starting the app from the engine.
  • The desktop shell was not compiled on the build machine; the first compile is the release build. This branch changes src-tauri/src/main.rs in one place (one string, and two statements in another order) and the version fields. The native engine was not rebuilt.
  • No packaged engine was built: "packaged" above is the source entry marked as packaged.
  • The real Claude Code, Codex, Cursor and Antigravity were not run; stand-ins only.
  • The CI step that boots an engine and encodes over MCP, and cargo check of the native engine on the three hosts.
  • Only a Windows machine can show: that the failure sentence is seen before the app goes; that ending the app in Task Manager ends the engine, and that an ordinary quit leaves nothing behind; that an engine left by this version is ended and replaced at the next start; that a double click on the engine opens the app and leaves no engine; that no console window appears.

Held

  • The rest of the shell side: the Windows job object that ends the engine with the app however the app ends (FormEncoder starts its engine through tauri-plugin-shell, so this needs that one start moved or the engine's process opened by its id), the failure text with the engine's last lines, its exit code and the log's full path, a limit on the wait for the engine's address, and a sentence when the main window fails to build. Until then the engine's own two-second watch is what ends it.
  • A second start of the app does not bring the first window forward; it shows the sentence. Bringing the window forward needs the single-instance plugin, a new crate.
  • Each Antigravity tab in a folder of its own: not started. Two Antigravity tabs still share one entry in the agent workspace, and closing the second removes the first one's entry.
  • A headless engine and the app's engine write the one log file. On Windows the log's rotation at 1 MB would fail for as long as both run.
  • The windowed packaging switch for Windows (no console for the engine) was not prepared.

Merge

Merge with a merge commit. Do not squash and do not rebase-merge.

…the engine leaves with its app

The family's Windows start and stop pattern, engine side, as in FormTools 0.10.0. backend/app/core/startup.py is FormTools's file with the names at its top changed; the shell's process id is read from FORMENCODER_PARENT_PID, which the released shell already sets. backend/app/core/runtime.py holds the log file (logs/formencoder-engine.log), the claim and the release.

The entry now makes the data folder and starts the log first, keeps standard error in a file when there was none, opens the app and stops when a frozen engine was started alone, takes engine.lock or refuses with one sentence and exit code 2, and watches its shell. A headless engine takes no lock and is never treated as started alone: it is started on purpose with no app. SIGTERM gives up the lock and withdraws engine.json.

Seen on Linux with stand-in shells and a stand-in app; tests/test_startup.py: 15 passed. Nothing ran on Windows or macOS, and no frozen engine was built. backend/HASHOUT_LOG.md has the decisions and what is held.
src-tauri/src/main.rs, the arm that runs when the engine gives no address and key: the sentence is shown first and the loading window is closed only after it returns; it was closed first. The sentence now says that a copy of FormEncoder may already be open, since only one copy can use its data folder, and where the engine's log is. The engine's process id variable is unchanged: the shell already sets FORMENCODER_PARENT_PID, which the engine's lock and watch read.

Not compiled: the desktop shell cannot be built here. One string and two statements in another order. Not run on any system.

Held: the job object, the failure text with the engine's last lines and exit code, a limit on the wait for the address, and a sentence for a window that fails to build. backend/HASHOUT_LOG.md says what each needs.
…t is already closed

backend/app/routers/terminal.py, pump: handing output to the event loop ends the read loop when the loop is closed, and handing over the end notice ignores the same error. The wait for the child stays, so it is still reaped. This was a RuntimeError line in the test job's log, not a failure.

Seen: the whole backend suite with this change, 279 passed, no such line in its output.
Sets 0.11.0 at the version sites of the 0.10.0 release (README, backend, frontend package and lock, version.ts, the native and desktop Cargo files and their lock entries, pyproject, tauri.conf.json, the three demo bundles), adds the CHANGELOG entry for the engine side of the Windows start and stop work, the start failure sentence and the terminal reader fix, and lets the function manifest's own generator rewrite form-functions.json. Run on this tree before the commit: the whole backend suite, 279 passed, with stand-in agent programs started 0 times; the function manifest check in step; the text lint with 0 findings. Run on the commits before the bump, in a clone: the shell syntax loop, the setup scripts' Python syntax, compileall and the engine's self-check, agents sync --check in step, the window check (2 passed) and npm audit (0 vulnerabilities). Not run: Windows, macOS, the desktop shell (not compiled here; the native engine was not rebuilt), a packaged engine, any real agent program.
@nodemode-ai
nodemode-ai requested a review from gbarnai as a code owner November 20, 2026 06:14
@nodemode-ai
nodemode-ai merged commit 37e496f into main Nov 20, 2026
9 checks passed
@nodemode-ai
nodemode-ai deleted the feat/windows-start-0.11.0 branch November 20, 2026 22:14
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