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
2 changes: 1 addition & 1 deletion .agents/skills/formpdf-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Does PDF work with formpdf through its MCP server. Use whenever th
license: Apache-2.0
metadata:
author: formpdf
version: "0.63.0"
version: "0.64.0"
---

# formpdf harness
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/formpdf-skillset/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Guides development of the formpdf codebase: its FastAPI engine, va
license: Apache-2.0
metadata:
author: formpdf
version: "0.63.0"
version: "0.64.0"
---

# formpdf skillset
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formpdf-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Does PDF work with formpdf through its MCP server. Use whenever th
license: Apache-2.0
metadata:
author: formpdf
version: "0.63.0"
version: "0.64.0"
---

# formpdf harness
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formpdf-skillset/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Guides development of the formpdf codebase: its FastAPI engine, va
license: Apache-2.0
metadata:
author: formpdf
version: "0.63.0"
version: "0.64.0"
---

# formpdf skillset
Expand Down
3 changes: 2 additions & 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.63.0" src="https://img.shields.io/badge/version-0.63.0-eef0f4?style=flat-square">
<img alt="version 0.64.0" src="https://img.shields.io/badge/version-0.64.0-eef0f4?style=flat-square">
<img alt="Python" src="https://img.shields.io/badge/python-3.12%2B-3776ab?style=flat-square&logo=python&logoColor=white">
<img alt="TypeScript" src="https://img.shields.io/badge/typescript-vite-3178c6?style=flat-square">
<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 Expand Up @@ -146,6 +146,7 @@ cd formpdf
|---|---|
| `FORMPDF_DATA_DIR` | Where working copies, exports and settings live (default `~/Formpdf`) |
| `FORMPDF_NO_OCR` | Set to `1` before `./formpdf install` to leave out OCR (about 150 MB) |
| `FORMPDF_ENGINE_WINDOWED` | On Windows the engine is frozen with no console window; set to `0` before `setup/freeze_backend` to keep the console |

> [!IMPORTANT]
> **Status:** pre-release. Gaps include hosted sharing, form JavaScript beyond the standard AcroForm functions and print production (CMYK, flattening). See [`docs/PARITY.md`](docs/PARITY.md).
Expand Down
20 changes: 20 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -871,3 +871,23 @@ New for formpdf, because it had neither: a lock and a log file. Before this, two
Kept from before: nothing watched a parent in formpdf, so an engine with no `FORMPDF_SHELL_PID` watches nothing. Not done: when the engine leaves because its shell is gone it does not close its terminal tabs one by one (their programs end with the engine's terminals), so an Antigravity tab's folder from entry 130 stays. A released engine (0.62.0 and older) wrote no lock, so one left running is not seen and not ended by this engine; it does not hold the folder either, and the new engine starts beside it on its own port.

Run on Linux with stand-ins (`sleep` as the shell, a shell script as the app): the three closed-stream starts served, with descriptors 0, 1 and 2 on the null device and the errors file present when standard error was absent; a second engine with another live shell exited 2 with the sentence while the first kept serving, and so did an engine with no shell; the engine exited 0 within one second of its shell's end and the lock and `engine.json` were gone; a stopped holder whose shell had ended was replaced after the five seconds (its exit 137); locks holding `not json at all`, `[1, 2]`, `{"pid": "x"}`, nothing, and an unrelated live process were replaced and that process still ran; an unusable data folder gave the sentence and 5; started alone as "frozen" (`sys.frozen` set) it opened the stand-in app in the Windows, macOS, Linux package and resource-folder layouts with no lock and no port, and with no app near it said the sentence and returned 4. Then `tests/test_startup.py`, FormTools's file with formpdf's names plus three tests for what formpdf's entry adds (the refusal as a whole command, the folder sentence, one log line per event). Not run: Windows, macOS, a really frozen engine. Every Windows branch of `startup.py` has never run anywhere.

## 132. An engine that has ended but was not yet collected counts as gone where there is no /proc · _v0.64.0, logged 2026-11-20 (core/startup.py finished, gone_by; tests/test_startup.py)

kind: fix · logged: v0.64.0 · 2026-11-20

FormCut's macOS check found it in the same start-up file (FormCut commit c2c2e221): ending a leftover engine waits until it is gone, `_alive_posix` asks `kill(pid, 0)`, and a process that has ended and that its parent has not collected still answers that. Only `/proc` told such a process apart, and macOS has none, so the wait ran out and the start was refused with "could not stop an engine that was left running". In the app it happens when the leftover engine's own parent is alive and slow to collect it.

`finished(pid)` asks `ps -o stat= -p <pid>` where there is no `/proc` (never on Windows, never on Linux) and answers true for a state that starts with `Z`. `gone_by` stops waiting when the process is not alive or is finished. `alive` is unchanged, so the two second watch on the shell starts no program.

Seen on Linux with `PROC` pointed at a folder that does not exist: without `finished` the claim is refused with the macOS job's own sentence (a scratch run with `finished` answering false), with it the leftover is replaced. The new test does the same through `claim`. `tests/test_startup.py`: 16 passed (one of them needed a second run alone, the machine was loaded). Not run on macOS.

## 133. The Windows engine is frozen with no console window · _v0.64.0, logged 2026-11-20 (setup/freeze_backend; setup/freeze_backend.bat; README.md variables)

kind: change · logged: v0.64.0 · 2026-11-20

The owner's decision for the family: a Windows engine is packaged with no console window, as FormWeb's is. Without it a black console window opens beside FormPDF while its engine runs. Both freeze scripts now give PyInstaller `--noconsole` on Windows unless `FORMPDF_ENGINE_WINDOWED=0`, which keeps the console for someone who wants to watch the engine. The shell reads the engine's address and key from its pipes, which a windowed program still has.

With no console a Windows program can start with no standard streams; `formpdf_engine.py` puts the null device in place of a missing `sys.stdout` or `sys.stderr` (entry 131's wave), so `--selfcheck` still runs. Seen here: `formpdf_engine.py --selfcheck` with standard output and error closed exits 0. In `freeze_backend.bat` the self-check after the build counts by its exit code; its printed line may not show there with no console.

Checked: `bash -n setup/freeze_backend`; the `.bat` by reading (`if not "%FORMPDF_ENGINE_WINDOWED%"=="0"` is true when the variable is unset). No Windows build has shown it.
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.63.0"
__version__ = "0.64.0"
19 changes: 18 additions & 1 deletion backend/app/core/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,26 @@ def same(pid: int, born: float) -> bool:
return alive(pid) and (not born or (seen > 0 and abs(seen - born) <= SLACK))


def finished(pid: int) -> bool:
if WINDOWS or os.path.isdir(PROC):
return False
try:
told = subprocess.run(
["ps", "-o", "stat=", "-p", str(pid)],
stdin=subprocess.DEVNULL,
capture_output=True,
text=True,
timeout=END_WAIT,
check=False,
)
except (OSError, subprocess.SubprocessError):
return False
return told.stdout.strip().startswith("Z")


def gone_by(pid: int, seconds: float) -> bool:
until = time.monotonic() + seconds
while alive(pid):
while alive(pid) and not finished(pid):
if time.monotonic() >= until:
return False
time.sleep(STEP)
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_agent_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_the_shared_dock_folder_is_what_its_manifest_says():
sync = sync_module()
assert sync.dock_drift() == []
assert sync.dock_strangers() == []
assert json.loads((sync.DOCK_DIR / "MANIFEST.json").read_text(encoding="utf-8"))["version"] == "2.2.0"
assert json.loads((sync.DOCK_DIR / "MANIFEST.json").read_text(encoding="utf-8"))["version"] == "2.2.1"


def test_an_edited_added_or_app_importing_dock_file_is_named(tmp_path, monkeypatch, capsys):
Expand Down
17 changes: 17 additions & 0 deletions backend/tests/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ def test_a_holder_whose_shell_is_gone_is_ended_and_replaced(tmp_path):
stop(engine, shell, mine)


def test_a_holder_that_has_ended_but_was_not_collected_counts_as_gone_where_there_is_no_proc(tmp_path, monkeypatch):
from app.core import startup

monkeypatch.setattr(startup, "PROC", "/nonexistent")
engine, shell, mine = stand_in(), stand_in(), stand_in()
try:
assert not startup.finished(engine.pid)
(tmp_path / startup.LOCK_NAME).write_text(json.dumps(record(startup, engine, shell)))
stop(shell)
path, replaced = startup.claim(tmp_path, mine.pid)
assert replaced == engine.pid
assert startup.finished(engine.pid)
assert json.loads(path.read_text())["pid"] == os.getpid()
finally:
stop(engine, shell, mine)


def test_a_holder_from_an_engine_that_recorded_no_shell_is_replaced_only_by_an_engine_with_a_shell(tmp_path):
from app.core import startup

Expand Down
2 changes: 1 addition & 1 deletion demo/assets/demo.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "formpdf-demo",
"private": true,
"version": "0.63.0",
"version": "0.64.0",
"description": "formpdf offline browser demo",
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion demos/protect/assets/protect.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -911,3 +911,26 @@ The sentence is new too. Since entry 131 of the backend log only one engine can
Still held from entry 130: the job object, the engine's last lines and exit code in the message, and a limit on the wait for the address.

Not compiled: the desktop shell cannot be built on the machine this was written on. One string, and one existing statement (`close_splash(&handle);`) moved below the `blocking_show()` call it stood above; no name or type is new. Not run on any system.

## 132. The engine ends with the app on Windows, a failed start says why, and the wait for the address has a limit · _v0.64.0, logged 2026-11-20 (src-tauri/src/win_job.rs; src-tauri/src/engine_start.rs; src-tauri/src/main.rs kill_backend, start_limit, engine_failed, setup; Cargo.toml, Cargo.lock)

kind: fix · logged: v0.64.0 · 2026-11-20

The rest of the shell side held in entries 130 and 131, after FormVis, whose shell also starts its engine through tauri-plugin-shell; the start stays there.

- `win_job.rs` (Windows only): one job object with "kill on job close". The engine is put in it by its process id right after the start (`hold_pid(child.pid())`), so when the app ends in any way, a crash or Task Manager included, Windows ends the engine. `kill_backend` ends the job first and then the child.
- `engine_start.rs`: the sentence for each way a start can fail (the engine program missing, not started, stopped with exit code 2 because another engine holds the data folder, 5 because the data folder cannot be used, any other code, no code, a wait that ran out, the window that could not open), then the engine's last 12 lines (each cut at 300 characters, never the window key line), then the log's full path. The path follows `backend/app/core/config.py`: `FORMPDF_DATA_DIR` with a leading `~` taken as the home folder, else `Formpdf` in the home folder, then `Logs/formpdf-engine.log`.
- The read loop takes the engine's lines and two timers from one channel. The address has 90 seconds (the owner's number for every app); before this an engine that never gave its address left the loading window up for good. After the address the key line has 10 seconds, as before. When the engine stops, one more second is given for its last lines, and the message carries its exit code.
- Every failure, a start that never happened included, shows the dialog first, then closes the loading window, ends the engine and leaves.

`windows-sys` 0.61.2 was already in `Cargo.lock` (through other crates); it is now also a direct dependency on Windows, with the features for job objects and processes. A copy of `src-tauri` with `cargo update --workspace --offline` locked 0 packages and left `Cargo.lock` unchanged.

Checked here: a scratch crate holding these two files passes `cargo check --target x86_64-pc-windows-msvc`, and `cargo test` runs the 4 tests of `engine_start.rs` (all pass). Not compiled as part of the shell, which cannot be built here: `main.rs` was read line by line against FormVis `src-tauri/src/main.rs` for every name, type and `cfg`. Not run on Windows or macOS.

## 133. The shared panel module is 2.2.1: its guide names Codex, Cursor and Antigravity · _v0.64.0, logged 2026-11-20 (dock/ from FormVis 23b01889; backend/tests/test_agent_manifest.py)

kind: change · logged: v0.64.0 · 2026-11-20

Every file of `frontend/src/dock/` was copied unchanged from FormVis commit `23b01889`, `MANIFEST.json` included. Three files differ from 2.2.0: `strings.ts` (the guide's two sentences for a computer that has Claude Code, `tourInstalledBody` and `tourReadyBody`, each end with "Codex, Cursor and Antigravity each get a button of their own here when they are on this computer."), `CONTRACT.md` and `MANIFEST.json`. The adapter needs no change. FormPDF carries no translations of the panel's sentences, so no table changed. The manifest test now expects 2.2.1.

Ran: `setup/agents.py sync --check` in step; `tests/test_agent_manifest.py` and `tests/test_dock_contract.py` 25 passed.
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "formpdf",
"private": true,
"version": "0.63.0",
"version": "0.64.0",
"description": "formpdf · a PDF editor in the form family",
"license": "Apache-2.0",
"type": "module",
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/dock/CONTRACT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The dock's engine contract

Module version 2.2.0. This file travels with the shared dock folder and is the same in every app.
Module version 2.2.1. This file travels with the shared dock folder and is the same in every app.

The dock's frontend never talks to an engine. It calls the functions of `DockAdapter` (adapter.ts), and each app's adapter turns them into its engine's routes, sockets or event streams. This file says what an engine has to provide so that an adapter can deliver each function, in words that do not depend on the engine's language. Paths, header names and transports are each app's own. Where a clause says "the adapter", the engine may do the work instead; where it says "the engine", the adapter cannot make it up.

Expand Down Expand Up @@ -68,6 +68,10 @@ An adapter written for 2.1.0 compiles and behaves as before: copying the 2.2.0 f
- **Part names.** Every control of the module carries `data-dock-part`; the attribute and the names are `DOCK_PUBLIC.partAttribute`, `parts` and `partsByKind` (`launch.[kind]`, `menu.launch.[kind]`, `tab.[kind]`). Automation and command layers use these and no class name.
- **A status line for a tab.** A terminal record may carry `status`, and a channel may give `onStatus(handler)` and call the handler with new text ("reconnecting", an exit code). The text of the tab in front shows in the head between the tabs and the buttons, clipped; an empty string clears it.

## Module 2.2.1

The guide's two sentences for a computer that has Claude Code (`tourInstalledBody` and `tourReadyBody`) now end by naming the other three programs: "Codex, Cursor and Antigravity each get a button of their own here when they are on this computer." Nothing else in the folder changed, and an adapter written for 2.2.0 needs no change; an app that translates the module's sentences translates these two again.

## The manifest

`MANIFEST.json` in this folder lists the module version and the SHA-256 of every other file here, this one included. The source app (FormVis) writes it; every other app only checks it: read the file names and hashes from the manifest, hash each file's bytes, and fail naming any file that differs, is missing or is extra. The check is small enough to write in any language an app's tools use.
6 changes: 3 additions & 3 deletions frontend/src/dock/MANIFEST.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"module": "dock",
"version": "2.2.0",
"version": "2.2.1",
"files": {
"CONTRACT.md": "ccef67fcf0017569c0bf68df0eae2e1e3ddf376117ac929789b803713c427df6",
"CONTRACT.md": "9791fa9d5eb7ef7e09543d34c2d097cfe6559b7fa1792f251afb9abfa7ac0bd7",
"adapter.ts": "1128c16892424485fe68bb2bf92ebc7229a9c2ff749db2fcd2419662d9c3ada9",
"agents.ts": "db666d1042555f8bbda4a697dbfc475df23779d0c5a25abd532bcfa43ae81043",
"chat.ts": "994878030b9fbff729734d34e2baa5b018e7d0b8555c24bfb7c98962c50446fa",
Expand All @@ -14,7 +14,7 @@
"keys.ts": "1adfc7daefa35b0e6eb8957250dca3926ded1c59fd51db7d60da6346caf0d561",
"placement.ts": "0f7e03ef0b720af07995111f30dcb5ed124529d44cf5cb67ae4bfb1f96c7f880",
"state.ts": "bef508e8343737f67adfbd7ae8cb8efb446968dfd4e7e0aff37da11f996955d7",
"strings.ts": "19a6a32f235b61dfed6179e2271a6d599f4357c9a6b9c09118bb65990d1e114f",
"strings.ts": "3654a59c4d005125e248dd322f467d4ad3c513f4fd86f6dfe76f5565408ac50e",
"terminal.ts": "8bf886a7ad4dc69323e803acc13641a66e1d8614e9b85a6a60977fa30d8a56fc",
"tour.ts": "2f83994051f4370c5d1630a827b4539eb12fd50e7fe9531f5641a4bf75615782"
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/dock/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ export const STRINGS = {
tourChatTitle: 'Ask for something in plain words',
tourChatBody: 'Type what you want in this line, for example "{example}", and press Enter. Claude does it in {app}.',
tourInstalledTitle: 'Claude Code is installed',
tourInstalledBody: 'Claude Code is installed. The robot button here opens it; the first time, it may ask you to sign in.',
tourInstalledBody: 'Claude Code is installed. The robot button here opens it; the first time, it may ask you to sign in. Codex, Cursor and Antigravity each get a button of their own here when they are on this computer.',
tourMissingTitle: 'Claude Code is not on this computer yet',
tourMissingBody: 'For the bigger jobs, {app} uses a free program called Claude Code. To add it, copy the line below, open your computer\'s command window, paste it and press Enter.',
tourSignInTitle: 'Sign in to Claude Code once',
tourSignInBody: 'Claude Code is installed but not signed in. Press the robot button here: a window opens where you type /login and follow the steps. You only do this once.',
tourReadyTitle: 'Claude Code is ready',
tourReadyBody: 'Claude Code is installed and signed in. The robot button here opens it when you want it to take on a bigger job.',
tourReadyBody: 'Claude Code is installed and signed in. The robot button here opens it when you want it to take on a bigger job. Codex, Cursor and Antigravity each get a button of their own here when they are on this computer.',
tourAskTitle: 'You decide what other programs may change',
tourAskBody: 'If another AI program on this computer wants to change your {noun}, {app} asks you first in a box in the middle of the window. Choose Deny, Allow once or Always allow. You can change your answer later under Outside agents in the menu here.',
tourSideTitle: 'Put the panel where you like it',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.63.0';
export const VERSION = '0.64.0';
1 change: 1 addition & 0 deletions setup/freeze_backend
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if [ -d "$FORMPDF_ROOT/backend/app/dict" ]; then extra+=(--add-data "$(fp_native
extra+=(--hidden-import ptyprocess)
extra+=(--collect-submodules keyring)
if python -c "import winpty" 2>/dev/null; then extra+=(--hidden-import winpty); fi
if [ "$(fp_os)" = windows ] && [ "${FORMPDF_ENGINE_WINDOWED:-1}" != "0" ]; then extra+=(--noconsole); fi
release_ocr=""
no_ocr=""
[ -n "${FORMCOMPILER_VERSION:-}" ] && [ "${FORMPDF_NO_OCR:-}" != "1" ] && release_ocr=1
Expand Down
Loading
Loading