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: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ jobs:
- name: Family layers and app tests
working-directory: backend
run: venv/bin/python -m pytest tests -q -p no:cacheprovider
- name: Third-party notices cover what ships
run: backend/venv/bin/python setup/notices.py --check

window:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# formencoder notices

formencoder is licensed under the Apache License 2.0 (`LICENSE`). It includes or depends on the following work.
formencoder is licensed under the Apache License 2.0 (`LICENSE`). It includes or depends on the following work. This file is the ledger: what each component is and why it is there. The full licence texts (copyright lines, conditions and disclaimers) of everything that ships are in `THIRD-PARTY-NOTICES.txt`, written and checked by `setup/notices.py`; it ships beside this file in every desktop bundle, is frozen into the engine and is shown under Help > About formencoder, Third-party notices.

| Component | Use | License |
| --- | --- | --- |
Expand All @@ -25,6 +25,7 @@ formencoder is licensed under the Apache License 2.0 (`LICENSE`). It includes or
| pydantic 2.14.1, pydantic-core 2.50.1, annotated-types 0.8.0, annotated-doc 0.0.5, typing-extensions 4.16.0 (PSF-2.0), typing-inspection 0.4.4 | request models and validation for FastAPI, frozen into the engine sidecar | MIT (typing-extensions PSF-2.0) |
| anyio 4.15.1, idna 3.20, click 8.5.0, h11 0.16.0, httptools 0.9.0, uvloop 0.23.0, watchfiles 1.3.0, websockets 17.3, python-dotenv 1.2.4, PyYAML 6.0.3 (the `uvicorn[standard]` extras and FastAPI's other requirements, frozen into the engine sidecar where PyInstaller finds them imported) | HTTP and socket serving, async I/O, configuration | MIT (anyio, h11, httptools, uvloop, watchfiles, PyYAML); BSD-3-Clause (idna, click, websockets, python-dotenv); uvloop's wheel carries both MIT and Apache-2.0 texts (its License field says MIT) |
| CPython runtime (3.12 in the release toolchain), embedded by PyInstaller in the `--onefile` engine sidecar | runs the engine service | PSF-2.0 |
| opentelemetry-api | a requirement of FastAPI, frozen into the engine sidecar | Apache-2.0 |
| pywinpty (Windows only) | the terminal on Windows | MIT |
| keyring 25.7.0, jaraco.classes, jaraco.context, jaraco.functools, more-itertools, jeepney (Linux) | keeps the key that seals the agent access choices in the system keychain, frozen into the engine sidecar | MIT |
| SecretStorage (Linux), pywin32-ctypes (Windows), cryptography, cffi and pycparser (Linux, through SecretStorage) | keychain access for keyring | BSD-3-Clause (SecretStorage, pywin32-ctypes, pycparser), Apache-2.0 OR BSD-3-Clause (cryptography), MIT (cffi) |
Expand Down
30,952 changes: 30,952 additions & 0 deletions THIRD-PARTY-NOTICES.txt

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,26 @@ Refers to `setup/install_tools.py` (`nmake_machine`, `full_perl`, `run`, `instal
- LAME: nmake gets `MSVCVER=Win64 MACHINE=/machine:X64` (a command-line macro wins over the makefile's own), or `MACHINE=/machine:ARM64` on ARM64, chosen from `VSCMD_ARG_TGT_ARCH` (the MSVC environment's target, which is what the compiler makes) and else `platform.machine()`. A 32-bit target gets the command as before. LAME 3.100's `Makefile.MSVC` could not be read here (no copy on this machine, no web), so the two macros are the ones the build log points at, not read from the file.
- c2patool: on Windows the first of `OPENSSL_SRC_PERL`, `C:\Strawberry\perl\bin\perl.exe` and the `perl` on PATH that runs `-MLocale::Maketext::Simple -e 1` is passed as `OPENSSL_SRC_PERL` to that one `cargo install` only (the `openssl-src` crate reads it). With none, it says so and runs as before, so a failure is still the `--keep-going` warning.
- Seen on Linux: the probe picks `/usr/bin/perl`; the macros are `x64` and `arm64` as above and none for `x86`. Not run: Windows itself; the first proof is the windows_x64 release build.

## The family finder is version 1.1.0 (unreleased)

Refers to `services/agent_lookup.py` (the family's file, version 1.1.0, copied byte for byte, never edited here), `routers/terminal.py` `open_tab`, `agent/connect.py` `install_claude`, `setup/agents.py` `LOOKUP_HASHES`, `backend/tests/test_agent_start.py` · kind: fix · logged: unreleased · 2026-11-29

- Why: the family settled on one Windows launcher. 1.1.0 is built on 1.0.2 (the copy this app already had) and is held to sha256 `313fcd40541199c920314516026a0b225aeb4915e9a5dc26bf51d1ba05f1da8e`, now recorded in `LOOKUP_HASHES` beside the older versions.
- What changed for this app: the program name is read as Windows opens it (`plain_name`, `batch_file`: any letter case, trailing dots or spaces, a `::$DATA` stream name); pnpm shims (which set `NODE_PATH`, allowed and not carried over) and bun shims are followed to their script, with one runner throughout or not at all; through cmd.exe every word, the program path included, is refused when it holds `& | < > ^ ( ) ! % "` or a control character, and a program path with a space may not hold `@` or be followed by a word that has a space or is empty. cmd.exe is started as `cmd /c` (no `/d`).
- The refusal is now `agent_lookup.CommandLineRefused`, an `OSError`, where it was `Refused` (a `ValueError`). `open_tab` still answers 422 `refused` with its message, and `install_claude` still says to run the `claude mcp add` line by hand; both catch the new name.
- Unchanged: every public function used here, and macOS and Linux starts.
- Tests changed, and why: `test_agent_start.py` expected `/d` and `Refused`; it now expects `cmd /c` and `CommandLineRefused`, and gains the pnpm, bun, mixed runner, own variable, letter case, stream name and spaced program path cases. `shutil.which` is replaced in the tests that need node from PATH, since off Windows it looks for `node`, not `node.exe`.
- Not run: Windows itself.

## THIRD-PARTY-NOTICES.txt holds the full licence texts of what ships (unreleased)

Refers to `setup/notices.py` (new: `generate`, `render`, `parse`, `check`), `setup/notices_python.py`, `setup/notices_crates.py`, `setup/notices_other.py` (new), `core/config.py` `notices_path`, `routers/system.py` `/api/notices`, `setup/freeze_backend`, `setup/freeze_backend.bat`, `src-tauri/tauri.conf.json` `bundle.resources`, `.github/workflows/ci.yml` (job `test`), `backend/tests/test_notices.py` · kind: feat · logged: unreleased · 2026-11-29

- Why: NOTICE.md named every component and its licence, but the app carried the full texts only for FFmpeg, OpenH264 and the delivery tools' own licence files. BSD, MIT and Apache-2.0 ask for the copyright lines, conditions and disclaimer to travel with the binaries.
- `python3 setup/notices.py` writes the file from: the interpreter's LICENSE.txt (the frozen runtime); the names in `backend/requirements.txt` and `requirements_macos.txt` without the build tools (maturin, PyInstaller) and everything they need on macOS, Linux or Windows, extras such as `uvicorn[standard]` followed, markers evaluated with `packaging`, each with every licence file its distribution lists; the npm packages `frontend/package-lock.json` does not mark dev, with their licence files from `node_modules`; the crates `src-tauri/Cargo.lock` reaches from `formencoder`, `native/Cargo.lock` from `fencoder-py` and c2patool's own lock (in the cargo registry after `install-tools`) from `c2patool`, without the dev-dependencies and WebAssembly-only dependencies of the crates built here, each marked `Used in: shell, engine, c2patool`; the two fonts compiled into fe_core; FFmpeg with `src-tauri/binaries/THIRD-PARTY-NOTICES.txt` and `LGPL-2.1.txt` reproduced; OpenH264 with Cisco's text as NOTICE.md has it; and one section per delivery tool in `install_tools.TOOLS`, pointing at the licence file the build copies into `tools/licences`.
- A package needed only on another platform (jeepney, SecretStorage, cryptography, cffi, pycparser on Linux; pywinpty, pywin32-ctypes on Windows) is read from a wheel in `--wheels DIR` (`pip download --no-deps --only-binary :all: --python-version 3.12 --platform ...`); a crate the registry cache does not hold is read from `--crates DIR`, a folder of unpacked `name-version` crates. One still missing keeps its section from the previous file and is named on stderr. A crate that publishes no licence file is listed with its SPDX id and repository and says so. Identical texts are printed once at the end. Written twice from the same inputs the file is byte-identical, and parsing and rendering it gives it back unchanged.
- `--check` (CI, job `test`, with the engine venv) needs no network and no cargo: pinned Python versions, every installed shipped Python package, the npm and crate lists against the lock files in both directions (c2patool's only when its lock is in the local registry), the fonts, the FFmpeg release in `ffmpeg-licence.json`, the OpenH264 and tool tags in `install_tools.TOOLS`, and a licence text for the runtime, fonts and binaries. Unpinned Python packages are checked by name, so a new release of one does not fail CI; regenerate before a release.
- The file ships in every bundle (`bundle.resources`) and is frozen into the engine (`--add-data`, both freeze scripts; `check_freeze_bat.py` still finds them equal). `GET /api/notices` serves it as text (404 when a build lacks it, refused over 16 MiB).
- Written here from the macOS venv (Python 3.14), so the runtime section and unpinned versions are this machine's; the release toolchain uses 3.12.
- Not run: a frozen engine or a desktop bundle with the file inside.
2 changes: 1 addition & 1 deletion backend/app/agent/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def install_claude(home: Path, dry: bool, said: list) -> None:
if claude:
try:
_add_claude(claude, cmd, args, line, dry, said)
except agent_lookup.Refused as exc:
except agent_lookup.CommandLineRefused as exc:
said.append(f" {exc} Run it yourself: claude mcp add --scope user {NAME} -- {line}")
else:
said.append(f" {agent_programs.said(found)} Once it starts, run: claude mcp add --scope user {NAME} -- {line}")
Expand Down
9 changes: 9 additions & 0 deletions backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ def bundle_dir() -> Path:
return Path(base) if base else Path(__file__).resolve().parents[2]


NOTICES_NAME = "THIRD-PARTY-NOTICES.txt"


def notices_path() -> Path:
if FROZEN:
return bundle_dir() / NOTICES_NAME
return Path(__file__).resolve().parents[3] / NOTICES_NAME


def resources_dir() -> Path:
frozen = bundle_dir() / "resources"
if frozen.is_dir():
Expand Down
16 changes: 16 additions & 0 deletions backend/app/routers/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import platform

from fastapi import APIRouter, HTTPException, Request
from fastapi.responses import PlainTextResponse

from .. import __version__, native
from ..core import config, window_key
Expand All @@ -21,6 +22,21 @@ def version() -> dict:
return {"version": __version__, "core": core if ok else None}


NOTICES_CAP = 16 * 1024 * 1024


@router.get("/api/notices", response_class=PlainTextResponse)
def notices() -> PlainTextResponse:
try:
with open(config.notices_path(), encoding="utf-8") as handle:
text = handle.read(NOTICES_CAP + 1)
except OSError:
raise HTTPException(404, "The third-party notices are not in this build") from None
if len(text) > NOTICES_CAP:
raise HTTPException(500, "The third-party notices file is larger than expected")
return PlainTextResponse(text, headers={"Cache-Control": "no-store"})


@router.post("/api/window/key")
def claim_window_key() -> dict:
if window_key.stdout_mode():
Expand Down
2 changes: 1 addition & 1 deletion backend/app/routers/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ async def open_tab(request: Request) -> dict:
path = found.path
try:
argv = agent_lookup.start_argv([path, *(["--resume", resume] if resume else []), *((["--", prompt] if prompt.startswith("-") else [prompt]) if prompt else [])])
except agent_lookup.Refused as exc:
except agent_lookup.CommandLineRefused as exc:
raise HTTPException(422, {"code": "refused", "message": str(exc)}) from None
title = body.get("title") if isinstance(body.get("title"), str) else None
cwd = body.get("cwd") if isinstance(body.get("cwd"), str) and kind != "antigravity" else None
Expand Down
Loading
Loading