Skip to content

FormTxt 0.36.0: one engine per data folder, an engine log, and a clean stop (engine side only) - #13

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

nodemode-ai merged 3 commits into
mainfrom
feat/windows-start-0.36.0

Conversation

@nodemode-ai

Copy link
Copy Markdown
Collaborator

FormTxt 0.36.0: one engine per data folder, an engine log, and a clean stop (engine side only)

The start and stop pattern that FormTools 0.10.0 has, carried into FormTxt's engine. The shell side of the pattern is not in this release; see "Held".

What changes for people

  • Only one FormTxt engine uses a data folder at a time. A second copy of FormTxt started on the same folder is refused with one sentence ("formtxt 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 folder.
  • An engine of this version that is left running after its app is gone is stopped and replaced at the next start. An engine left behind by 0.35.0 or older holds no lock, so it is not found and not ended.
  • The engine keeps a log, Logs/formtxt-engine.log in the FormTxt folder (1 MB, three older files kept). When the engine has no standard error, its errors go to Logs/formtxt-engine-errors.log.
  • Opening the engine program by itself opens FormTxt and leaves no engine running; with no FormTxt 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.
  • The engine watches the app that started it with the family's check and leaves when it is gone. It still reads FORMTXT_PARENT_PID, which the shell of 0.35.0 sets, after the family's FORMTXT_SHELL_PID.
  • A stop by SIGTERM now removes the lock and ends with exit code 0, after the server has shut down.
  • Shell, three small changes: the engine also gets FORMTXT_SHELL_PID; when the engine cannot be started, the sentence is shown before the loading window closes (it was closed first); the sentence says a copy may already be open and where the log is.
  • Not touched: engines started without the entry (./formtxt, uvicorn app.main:app, the test fixtures) take no lock and write no log file.

Commits

  • feat(engine): one engine per data folder, a log file, and the engine leaves with its app
  • fix(shell): the start failure is said before the loading window closes, and the engine gets the shell's process id under the family's name
  • release: 0.36.0

How it was checked

All on Linux, Python 3.13 (the workflow pins 3.12), with stand-ins for the app (sleep) and for the agent programs.

Engines from source with stand-in shells, seen before any test was written: the entry with standard output closed, with output and error closed, and with all three closed answered its health route; a second engine was refused with the sentence while the first kept answering, and the refusal was in the log; the engine left about a second after its stand-in shell ended and the lock was gone (the same with only the older variable); a holder whose shell was gone was replaced, by SIGTERM when it was running and by SIGKILL after five seconds when it was stopped; locks holding text that is not JSON, a list, a wrong type and nothing were replaced; a lock naming an unrelated process was replaced and that process kept running; started alone, the stand-in app was opened in each of four install layouts with no lock and no port, and with no app near the exit code was 4 with the sentence.

Checks rehearsed, on a scratch copy of the engine commit (git archive), the workflow's jobs as written:

Job Command Result
backend python -m compileall -q app formtxt_engine.py exit 0
backend python formtxt_engine.py --selfcheck exit 0
backend python -m uvicorn app.main:app --host 127.0.0.1 --port 8210, then the health route answered, exit 0
test python -m pytest tests -q -p no:cacheprovider 222 passed (207 on 0.35.0, 15 new); agent program stand-ins started 0 times
frontend npm ci, npm run build exit 0
frontend npm run typecheck exit 0
frontend npm audit --audit-level=low 0 vulnerabilities
window python -m pytest frontend/tests/window -q -p no:cacheprovider, Playwright 1.63.0 2 passed
scripts bash -n on the launcher and setup scripts no error
scripts ./formtxt agents check, ./formtxt mcpb check clean; "a build stamps version 0.36.0" on the release tree
scripts python3 -B setup/icon_rules.py, the em dash and emoji check clean (run in the repository: both ask git for the file list)

The shell commit after it changes only src-tauri/src/main.rs and a log entry; no job of the workflow builds the shell. On the release tree the engine's suite was run again (222 passed, stand-ins started 0 times) and the script checks were repeated. The release commit's message says the suite was not run on that tree: the run was still waiting in the machine's queue when the message was written, and it finished, all passed, in the same minute.

Held

  • The shell side of the pattern: win_job.rs (on Windows, the job object that ends the engine and everything it started when the shell ends, however it ends), engine_start.rs (the failure text with the engine's last lines, its exit code and the log's path) and a limit on the wait for the engine's address, which has none today. FormTxt starts its engine through tauri-plugin-shell, which gives no process handle for the job object; the way to take is FormTools's, moving that one start to std::process::Command. The clock ran out before it could be proved with the scratch crate, and unproved Rust in the shell would cost a failed build. backend/HASHOUT_LOG.md lists what that work must mind.
  • Until then, on Windows: ending FormTxt from Task Manager leaves the engine to notice by itself within about two seconds, and what the engine started (a terminal tab's program) is not ended with it. A second copy of FormTxt reads the general sentence, not the engine's own line.
  • Packaging with no console window for the engine (off by default in the family) was not prepared.
  • A second start does not bring the first window forward: that needs the single-instance plugin, left out of this pass in every app.
  • An engine with no app that holds the lock (a development run through the entry) is never ended by another; an app started on the same folder is refused until that run is stopped.

Not run

  • Nothing ran on Windows or macOS. Every Windows line of backend/app/core/startup.py is unrun: asking whether a process is alive, reading when it was created, ending a process tree with taskkill, the wait on the shell's handle, and the detached start of the app.
  • The desktop shell was not compiled, on any system; the first compile of the three changed lines in src-tauri/src/main.rs is the release build.
  • No frozen engine was built: "frozen" was the entry run with sys.frozen set.
  • A real Claude Code, Codex, Cursor or Antigravity was never started.
  • Only a Windows machine can show: that the failure sentence is seen before the app goes; that an ordinary quit leaves no engine behind and that an engine left behind is replaced at the next start; that a double click on the engine opens FormTxt and leaves no engine; what a second start of FormTxt looks like; that no console window appears.

Merge

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

…leaves with its app

The family's start and stop pattern, as built in FormTools, on the engine side.

backend/app/core/startup.py is FormTools's file with the names at its top changed. backend/app/core/runtime.py is new: the log file Logs/formtxt-engine.log in the data folder, and the lock's taking and giving up. backend/formtxt_engine.py serves in this order: the data folder and the log (exit code 5 and one sentence when the folder cannot be made), an absent standard error kept in Logs/formtxt-engine-errors.log, a frozen engine started with no app opens the app beside it or says it serves nothing on its own (exit code 4), the lock engine.lock (a second engine is refused with one sentence and exit code 2 while the first one's app lives, and an engine whose app is gone is ended and replaced), the watch on the app, then the port, the window key line and the server as before. --selfcheck is decided first and is unchanged.

Kept: FORMTXT_PARENT_PID, which the shell of 0.35.0 sets, is read after FORMTXT_SHELL_PID for the lock, the watch and the started-alone question. Removed: the entry's own _alive and watch_parent; the family's take their place. A SIGTERM now gives the lock up and exits 0 after the server has shut down.

FormTxt had no lock before, so no older lock can be met. Engines started without the entry (./formtxt, uvicorn app.main:app, the test fixtures) take no lock.

Seen first on Linux, Python 3.13, engines from source with stand-in shells: the three closed-stream starts answered the health route; the second engine was refused and the first kept answering; the engine left about a second after its shell ended and the lock was gone; a holder whose shell was gone was replaced (SIGTERM, and SIGKILL after five seconds for one that was stopped); damaged locks and locks naming an unrelated process were replaced and that process kept running; started alone it opened the stand-in app in each of the four install layouts and took no lock, and with no app near it exited 4 with the sentence. Tests added after that: backend/tests/test_startup.py, 15 tests, FormTools's file with FormTxt's names; run with tests/test_f5_boot.py: 18 passed.
Not run: Windows, macOS, a frozen engine.
…s, and the engine gets the shell's process id under the family's name

src-tauri/src/main.rs, three small changes in the engine's start. The engine also gets FORMTXT_SHELL_PID beside FORMTXT_PARENT_PID. 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 says that a copy of FormTxt may already be open, since only one engine can use the data folder now, and where the engine's log is.

Not compiled: the desktop shell cannot be built here. One added .env line beside its twin, one string, and two statements in another order. Not run on any system.

Held: the rest of the family's shell side (the Windows job object, the failure text with the engine's last lines and exit code, a limit on the wait for the address). backend/HASHOUT_LOG.md says what it needs.
A minor release, engine side only: one engine per data folder with a lock, the engine's log file in the data folder, a frozen engine started alone opens the app, the engine leaves with its app by the family's watch, and in the shell the start failure is said before the loading window closes. The CHANGELOG entry lists them and says what is not in it: the Windows job object and the failure text with the engine's last lines, which wait for a session that can prove the shell's Rust.

Version sites, the same eleven files as 0.35.0: backend/app/__init__.py, frontend/src/version.ts, frontend/package.json, frontend/package-lock.json (the two fields of this project), src-tauri/Cargo.toml, src-tauri/Cargo.lock (package formtxt), src-tauri/tauri.conf.json, README.md (the badge and the version line), CHANGELOG.md (new entry), and the two header lines of backend/HASHOUT_LOG.md and frontend/HASHOUT_LOG.md. Left alone: setup/mcpb/manifest.json (0.0.0, stamped at build), the log entries headed "after v0.35.0", and the three browser demo pages.

Checked on a scratch copy of the engine commit, the workflow's jobs as written: compileall, --selfcheck, the boot probe, the engine's suite (222 passed), npm ci, npm run build, npm run typecheck, npm audit (0 vulnerabilities), the window check with Playwright 1.63.0 (2 passed), bash -n, agents check, mcpb check. On this tree: agents check, agents sync --check, mcpb check ("a build stamps version 0.36.0"), the icon rules and the em dash check, all clean.
Not run: the engine's suite on this exact tree (the machine's queue did not reach it before the clock; the tree differs from the checked commit by the version strings and three lines of the shell), a desktop build, Windows, macOS, a real agent program. The run was on Python 3.13; the workflow pins 3.12.
@nodemode-ai
nodemode-ai requested a review from gbarnai as a code owner November 20, 2026 04:37
@nodemode-ai
nodemode-ai merged commit cc8a9d4 into main Nov 20, 2026
5 checks passed
@nodemode-ai
nodemode-ai deleted the feat/windows-start-0.36.0 branch November 20, 2026 04:40
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