Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to formlit. Versions are `v*.*.*`; each release lists what it added, what it fixed and what is not verified yet.

## v0.54.0 · 2026-11-19

- Fixed: when formlit cannot start, it says why before it closes. The message gives the reason in a sentence (its engine program is missing, could not be started, stopped, or did not answer in time), the engine's last lines, and where the engine's log is. Before, a failed start showed one fixed sentence or closed with nothing at all.
- Fixed: quitting formlit on Windows ends its engine and everything the engine started, also when formlit is ended from Task Manager. On every system the engine now stops by itself within a few seconds once the app that started it is gone.
- Fixed: an engine left running without its app no longer blocks the next start. The new start ends it and takes over.
- Changed: a second formlit on the same data folder is refused with a sentence that names the folder and the running engine, instead of two engines writing to one catalog.
- Changed: opening the engine program by itself opens formlit instead of starting an engine nobody can see. If formlit is not beside it, it says so and stops.
- Added: the engine keeps a log, `Logs/formlit-engine.log` in the data folder (`~/Formlit` unless you chose another), with a second file for errors when it has no console to write them to.
- Changed: formlit waits up to two minutes for its engine to start, then says so. Before, it waited without end.
- Known: an engine left behind by 0.53.0 or older is not ended by the first start after the update, because older engines kept no record of themselves. It is gone after a restart of the computer, or when you end `formlit-engine` yourself.
- Known: a second start of formlit while it is open does not bring the open window forward yet. The second one closes with the sentence above.
- Checked here, on Linux only: the engine's start and stop with stand-in programs in place of the app, and the desktop app's start-up code as far as it can be checked without building the app. Nothing was run on Windows or macOS, and the desktop app itself was not built on the machine this was written on.

## v0.53.0 · 2026-11-19

- Added: Antigravity (Google's `agy` program) can run in a tab of the terminal panel beside Claude Code, Codex and Cursor, connected to formlit's tools the same way. The panel offers it when it is found on this computer; when it is not, its line in the panel's menu says where formlit looked and how to install it.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
<img alt="version 0.53.0" src="https://img.shields.io/badge/version-0.53.0-eef0f4?style=flat-square">
<img alt="version 0.54.0" src="https://img.shields.io/badge/version-0.54.0-eef0f4?style=flat-square">
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-7-3178c6?style=flat-square&logo=typescript&logoColor=white">
<img alt="Python" src="https://img.shields.io/badge/Python-3.12-3776ab?style=flat-square&logo=python&logoColor=white">
<img alt="macOS, Windows, Linux" src="https://img.shields.io/badge/macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-native-2f7bf5?style=flat-square">
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ check whether the problem is still there.

| Version | Supported |
| --- | --- |
| 0.53.x (latest release) | Yes |
| 0.54.x (latest release) | Yes |
| Anything older | No |

## Reporting a vulnerability
Expand Down
46 changes: 45 additions & 1 deletion backend/HASHOUT_LOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""formlit engine: the catalog, the develop pipeline's reference renderer, import, export and the agent surface."""

__version__ = "0.53.0"
__version__ = "0.54.0"
65 changes: 65 additions & 0 deletions backend/app/core/runtime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import json
import logging
import os
from logging.handlers import RotatingFileHandler
from pathlib import Path

from app.core import startup

LOG_NAME = "formlit-engine.log"
LOG_FOLDER = "Logs"
LOG_BYTES = 1_048_576
LOG_KEEP = 3
HANDLER = "formlit-file"
LOGGERS = ("formlit", "uvicorn", "uvicorn.error", "uvicorn.access")
FORMAT = "%(asctime)s %(levelname)s %(name)s %(message)s"

AlreadyRunning = startup.Busy


def start_logging(data: Path) -> Path:
folder = data / LOG_FOLDER
folder.mkdir(parents=True, exist_ok=True)
path = folder / LOG_NAME
for held in logging.getLogger("formlit").handlers:
if held.get_name() == HANDLER and getattr(held, "baseFilename", "") == os.path.abspath(path):
for name in LOGGERS:
if held not in logging.getLogger(name).handlers:
logging.getLogger(name).addHandler(held)
return path
stop_logging()
handler = RotatingFileHandler(path, maxBytes=LOG_BYTES, backupCount=LOG_KEEP, encoding="utf-8")
handler.setFormatter(logging.Formatter(FORMAT))
handler.set_name(HANDLER)
for name in LOGGERS:
logger = logging.getLogger(name)
logger.addHandler(handler)
if name == "formlit":
logger.setLevel(logging.INFO)
logging.getLogger("formlit").info("engine started, pid %s, data folder %s", os.getpid(), data)
return path


def stop_logging() -> None:
for name in LOGGERS:
logger = logging.getLogger(name)
for handler in list(logger.handlers):
if handler.get_name() == HANDLER:
logger.removeHandler(handler)
handler.close()


def claim(data: Path) -> Path:
lock, replaced = startup.claim(data, startup.shell_pid())
if replaced:
logging.getLogger("formlit").warning("an engine left running without its app was stopped (process %s)", replaced)
return lock


def release(data: Path) -> None:
path = data / startup.LOCK_NAME
try:
if int(json.loads(path.read_text(encoding="utf-8")).get("pid", 0)) == os.getpid():
path.unlink()
except (OSError, ValueError, AttributeError, TypeError):
pass
Loading
Loading