From 087402f27604c12d0249a114096f4d5f3dd48108 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 18 Nov 2026 21:53:47 -0500 Subject: [PATCH 1/5] feat(profile): the apps generator reads the family spec and has a --check scripts/apps_table.py no longer fetches the formai.studio catalogue. It follows formadaptor's generator contract: `--family PATH` writes the apps table and the licence sentence in profile/README.md between their existing markers, and `--family PATH --check` writes nothing, prints profile/README.md and exits 1 when the committed file differs. A bad spec or README exits 2. No network, standard library only, runs as `python3 -I`, same spec gives the same bytes. Only entries with public true are read; an entry with public false is skipped before any other field is looked at. The rule for which apps show is kept (state live, safe machine id) and links to the site use the machine id. Rows are sorted by name. The licence sentence is derived from the licences of the listed apps. tests/test_apps_table.py is updated for the spec's shape, because the functions now take family.json content instead of the catalogue and the empty-list error changed; tests are added for private entries, the id link, ordering, licence variants and the --check exit codes. Baseline before the change: 7 passed (old suite). After: 14 passed. Ran: the script against /home/claude/form/work/scratch/family.sample.json with --check (exit 1, printed profile/README.md), then without it (wrote), then --check again (exit 0) and a second write (identical bytes). The regenerated README is committed separately. --- scripts/HASHOUT_LOG.md | 27 ++++++++ scripts/apps_table.py | 93 +++++++++++++++++++------- tests/test_apps_table.py | 140 ++++++++++++++++++++++++++++++++++----- 3 files changed, 221 insertions(+), 39 deletions(-) create mode 100644 scripts/HASHOUT_LOG.md diff --git a/scripts/HASHOUT_LOG.md b/scripts/HASHOUT_LOG.md new file mode 100644 index 0000000..87adb22 --- /dev/null +++ b/scripts/HASHOUT_LOG.md @@ -0,0 +1,27 @@ +# HASHOUT_LOG · scripts · .github + +Living log of all comment content, explainers, rationale, TODOs and removed code for the scripts and the workflow in this repository. The source files stay comment-free; everything they would have said lives here, indexed. Read this first, then edit code surgically. + +Current build version: none (this repository has no version) +Last updated: 2026-11-19 · apps_table.py reads the family spec instead of the site's catalogue + +### apps_table.py · the table and the licence line come from family.json, offline +- refers-to: scripts/apps_table.py :: main, load_family, shown, table, licences, render; .github/workflows/apps-table.yml +- kind: change +- logged: 2026-11-19 + +The owner decided that the public apps table and the licence sentence must come from the family spec that nodemode-dev/formadaptor builds (family.json, `format` `formai-family`, version 1), not from fetching the website's catalogue. The script follows formadaptor's generator contract (docs/TARGETS.md): `--family PATH` writes the two generated blocks of `profile/README.md`; `--check` writes nothing, prints `profile/README.md` and exits 1 when the committed file differs, exits 0 when it is current. Any other failure (an unreadable or wrong-format spec, a README without its markers, a listed app without a licence, no public live app at all) exits 2 and writes nothing, so drift and breakage can never be confused. There is no network call; the script is standard library only and runs as `python3 -I`. + +Which apps show is the rule the table already had, mapped onto the spec: the entry has `public` true, `state` is `live`, and the machine id passes the slug pattern. An entry with `public` false is skipped before any other field is read, so nothing about it can reach the file. `generated` and `content_sha256` are never read. + +Links go to `https://formai.studio//` with the machine id (`formslide` for FormDeck, `formai` for FormPortal), not the repository name (`formdeck`, `formportal`). The table has no repository links today; if one is added it must use `repo`. + +Order: the old table followed the catalogue's hand-kept order, which the spec does not carry (it is sorted by id, which would put FormDeck between FormSkills and FormSurface). Rows are sorted by name, case-insensitively, then id, so the same spec always gives the same bytes and a reader finds an app alphabetically. A curated order would need a field in the spec. + +Names and summaries are the registry's wording, passed through the same `cell` clean-up as before (no markup characters, no trailing full stop). That is why a few names and sentences differ from the committed file when the registry words them differently. + +The licence sentence is derived from the licences of the apps the table lists. If one licence covers more than half of them the sentence says "Most apps are X" and names the apps of every other licence ("A and B are Y"); if no licence has a majority every licence is listed with its apps; if there is only one licence it says "Every app is X". The old rule only knew Apache-2.0 and "starts with GPL"; a new licence would have been silently called Apache-2.0. + +The README is read and written as bytes so line endings are never changed. + +The tests that fetched nothing but built a catalogue dictionary were rewritten for the spec's shape (`apps`, `public`) because the function arguments and the empty-list message changed. Added: private entries leave no trace, the site link uses the id, sort order, licence variants, and a subprocess run in a temporary copy of the checkout for `--check` (writes nothing, exit 1 naming the file, exit 0 after a write, exit 2 on a bad spec) and for determinism. diff --git a/scripts/apps_table.py b/scripts/apps_table.py index 829c822..6616874 100644 --- a/scripts/apps_table.py +++ b/scripts/apps_table.py @@ -1,17 +1,19 @@ +import argparse import json import re import sys -import urllib.request from pathlib import Path -CATALOGUE = "https://formai.studio/catalog/v1/apps.json" SITE = "https://formai.studio" +FORMAT = "formai-family" +FORMAT_VERSION = 1 START = "" END = "" LICENCE_START = "" LICENCE_END = "" SLUG = re.compile(r"^[a-z0-9][a-z0-9.-]{0,40}$") README = Path(__file__).resolve().parent.parent / "profile" / "README.md" +README_NAME = "profile/README.md" def cell(text: str) -> str: @@ -19,29 +21,52 @@ def cell(text: str) -> str: return " ".join(flat.split()).rstrip(".") -def table(catalogue: dict) -> str: +def table(family: dict) -> str: rows = ["| App | What it does |", "| --- | --- |"] - for product in live(catalogue): - slug = str(product["id"]) - name = cell(product.get("name", slug)) - rows.append(f"| [{name}]({SITE}/{slug}/) | {cell(product.get('summary', ''))} |") + for app in shown(family): + slug = str(app["id"]) + name = cell(app.get("name", slug)) + rows.append(f"| [{name}]({SITE}/{slug}/) | {cell(app.get('summary', ''))} |") if len(rows) == 2: - raise ValueError("the catalogue lists no live apps") + raise ValueError("the family spec lists no public live apps") return "\n".join(rows) -def live(catalogue: dict) -> list[dict]: - return [p for p in catalogue.get("products", []) if p.get("state") == "live" and SLUG.match(str(p.get("id", "")))] +def shown(family: dict) -> list[dict]: + apps = [ + a + for a in family["apps"] + if a.get("public") is True and a.get("state") == "live" and SLUG.match(str(a.get("id", ""))) + ] + return sorted(apps, key=lambda a: (cell(a.get("name", a["id"])).casefold(), str(a["id"]))) def joined(names: list[str]) -> str: return names[0] if len(names) == 1 else f"{', '.join(names[:-1])} and {names[-1]}" -def licences(catalogue: dict) -> str: - gpl = [cell(p.get("name", p["id"])) for p in live(catalogue) if str(p.get("licence", "")).startswith("GPL")] - line = "Every repository states its own licence. Most apps are Apache-2.0" - return f"{line}; {joined(gpl)} {'is' if len(gpl) == 1 else 'are'} GPL-3.0-only." if gpl else f"{line}." +def licences(family: dict) -> str: + groups: dict[str, list[str]] = {} + for app in shown(family): + licence = cell(app.get("licence", "")) + if not licence: + raise ValueError(f"{app['id']} has no licence in the family spec") + groups.setdefault(licence, []).append(cell(app.get("name", app["id"]))) + line = "Every repository states its own licence." + if not groups: + return line + if len(groups) == 1: + return f"{line} Every app is {next(iter(groups))}." + total = sum(len(v) for v in groups.values()) + main = max(sorted(groups), key=lambda k: len(groups[k])) + parts = [] + if len(groups[main]) * 2 > total: + parts.append(f"Most apps are {main}") + del groups[main] + for licence in sorted(groups): + names = joined(sorted(groups[licence], key=str.casefold)) + parts.append(f"{names} {'is' if len(groups[licence]) == 1 else 'are'} {licence}") + return f"{line} {'; '.join(parts)}." def replace(readme: str, rows: str, start: str = START, end: str = END) -> str: @@ -51,19 +76,39 @@ def replace(readme: str, rows: str, start: str = START, end: str = END) -> str: return f"{head}{start}\n{rows}\n{end}{rest.split(end, 1)[1]}" -def fetch(url: str) -> dict: - with urllib.request.urlopen(url, timeout=30) as answer: - return json.load(answer) - - -def main() -> int: - readme = README.read_text(encoding="utf-8") - catalogue = fetch(CATALOGUE) - updated = replace(replace(readme, table(catalogue)), licences(catalogue), LICENCE_START, LICENCE_END) +def render(readme: str, family: dict) -> str: + return replace(replace(readme, table(family)), licences(family), LICENCE_START, LICENCE_END) + + +def load_family(path: str) -> dict: + family = json.loads(Path(path).read_text(encoding="utf-8")) + if not isinstance(family, dict) or family.get("format") != FORMAT or family.get("format_version") != FORMAT_VERSION: + raise ValueError(f"{path} is not a {FORMAT} version {FORMAT_VERSION} file") + apps = family.get("apps") + if not isinstance(apps, list) or not all(isinstance(a, dict) and "id" in a for a in apps): + raise ValueError(f"{path} has no usable apps list") + return family + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description="Write or check the apps table and licence line in profile/README.md from family.json.") + parser.add_argument("--family", required=True, help="path to family.json") + parser.add_argument("--check", action="store_true", help="write nothing; exit 1 naming the file when it differs") + args = parser.parse_args(argv) + try: + family = load_family(args.family) + readme = README.read_bytes().decode("utf-8") + updated = render(readme, family) + except (OSError, ValueError) as error: + print(f"apps_table: {error}", file=sys.stderr) + return 2 if updated == readme: print("apps table is current") return 0 - README.write_text(updated, encoding="utf-8") + if args.check: + print(README_NAME) + return 1 + README.write_bytes(updated.encode("utf-8")) print("apps table updated") return 0 diff --git a/tests/test_apps_table.py b/tests/test_apps_table.py index 70d708d..952f309 100644 --- a/tests/test_apps_table.py +++ b/tests/test_apps_table.py @@ -1,3 +1,6 @@ +import json +import shutil +import subprocess import sys from pathlib import Path @@ -6,25 +9,71 @@ sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "scripts")) import apps_table -CATALOGUE = { - "products": [ - {"id": "formcut", "name": "FormCut", "state": "live", "licence": "GPL-3.0-only", "summary": "Video editing: cut and export."}, - {"id": "formtxt", "name": "FormTxt", "state": "soon", "summary": "Not out yet."}, - {"id": "formmd", "name": "Form.md", "state": "live", "summary": "Notes | docs [x](y) "}, - {"id": "../evil", "name": "Evil", "state": "live", "summary": "bad slug"}, - ] +def app(id, name, state="live", licence="Apache-2.0", summary="Does one job.", repo=None): + return { + "id": id, + "public": True, + "app": id, + "repo": repo or id, + "repository": f"nodemode-dev/{repo or id}", + "site": id, + "name": name, + "kind": "x", + "summary": summary, + "licence": licence, + "state": state, + "launcher": id, + "agents": {"mcp": True, "skills": ""}, + "release": None, + } + + +FAMILY = { + "format": "formai-family", + "format_version": 1, + "generated": "2026-01-01T00:00:00Z", + "source": {"repository": "nodemode-dev/formcompiler", "registry_version": "1.0.0"}, + "content_sha256": "0" * 64, + "apps": [ + app("formcut", "FormCut", licence="GPL-3.0-only", summary="Video editing: cut and export."), + app("formtxt", "FormTxt", state="prelaunch", summary="Not out yet."), + app("formmd", "Form.md", summary="Notes | docs [x](y) "), + app("../evil", "Evil"), + app("formslide", "FormDeck", repo="formdeck"), + {"id": "formsecret", "public": False}, + {"id": "formhidden", "public": False, "name": "FormHidden", "state": "live", "summary": "private", "licence": "Apache-2.0"}, + ], } -def test_only_live_apps_with_safe_slugs_are_listed(): - rows = apps_table.table(CATALOGUE) +def test_only_public_live_apps_with_safe_slugs_are_listed(): + rows = apps_table.table(FAMILY) assert "[FormCut](https://formai.studio/formcut/) | Video editing: cut and export |" in rows assert "FormTxt" not in rows assert "Evil" not in rows +def test_nothing_about_a_private_app_is_written(): + out = apps_table.render(f"{apps_table.START}\n{apps_table.END}\n{apps_table.LICENCE_START}\n{apps_table.LICENCE_END}\n", FAMILY) + for word in ("formsecret", "FormHidden", "formhidden", "private"): + assert word not in out + + +def test_links_to_the_site_use_the_machine_id_not_the_repository_name(): + rows = apps_table.table(FAMILY) + assert "[FormDeck](https://formai.studio/formslide/) |" in rows + assert "formdeck" not in rows + + +def test_rows_are_sorted_by_name_whatever_the_order_of_the_spec(): + reordered = {**FAMILY, "apps": list(reversed(FAMILY["apps"]))} + assert apps_table.table(reordered) == apps_table.table(FAMILY) + names = [r.split("]")[0][3:] for r in apps_table.table(FAMILY).splitlines()[2:]] + assert names == ["Form.md", "FormCut", "FormDeck"] + + def test_summaries_cannot_break_the_table_or_inject_markup(): - rows = apps_table.table(CATALOGUE) + rows = apps_table.table(FAMILY) line = next(r for r in rows.splitlines() if "Form.md" in r) assert line == "| [Form.md](https://formai.studio/formmd/) | Notes docs x(y) b |" @@ -35,11 +84,13 @@ def test_replace_keeps_everything_outside_the_markers(): assert out == f"intro\n{apps_table.START}\nNEW\n{apps_table.END}\nafter\n" -def test_missing_markers_and_empty_catalogue_fail_loudly(): +def test_missing_markers_and_an_empty_spec_fail_loudly(): with pytest.raises(ValueError): apps_table.replace("no markers", "x") with pytest.raises(ValueError): - apps_table.table({"products": []}) + apps_table.table({"apps": []}) + with pytest.raises(ValueError): + apps_table.table({"apps": [{"id": "formsecret", "public": False}]}) def test_the_real_readme_has_the_markers(): @@ -47,11 +98,70 @@ def test_the_real_readme_has_the_markers(): assert text.count(apps_table.START) == 1 and text.count(apps_table.END) == 1 -def test_licence_line_names_the_live_gpl_apps(): - assert apps_table.licences(CATALOGUE) == "Every repository states its own licence. Most apps are Apache-2.0; FormCut is GPL-3.0-only." - assert apps_table.licences({"products": []}) == "Every repository states its own licence. Most apps are Apache-2.0." +def test_licence_line_is_derived_from_the_licences_of_the_listed_apps(): + assert apps_table.licences(FAMILY) == "Every repository states its own licence. Most apps are Apache-2.0; FormCut is GPL-3.0-only." + only = {"apps": [app("formmd", "Form.md")]} + assert apps_table.licences(only) == "Every repository states its own licence. Every app is Apache-2.0." + split = {"apps": [app("a", "A", licence="MIT"), app("b", "B", licence="GPL-3.0-only"), app("c", "C", licence="GPL-3.0-only"), app("d", "D", licence="MIT")]} + assert apps_table.licences(split) == "Every repository states its own licence. B and C are GPL-3.0-only; A and D are MIT." + assert apps_table.licences({"apps": []}) == "Every repository states its own licence." + + +def test_a_listed_app_without_a_licence_is_refused(): + broken = {"apps": [{**app("formcut", "FormCut"), "licence": ""}]} + with pytest.raises(ValueError): + apps_table.licences(broken) def test_the_real_readme_has_the_licence_markers(): text = apps_table.README.read_text(encoding="utf-8") assert text.count(apps_table.LICENCE_START) == 1 and text.count(apps_table.LICENCE_END) == 1 + + +@pytest.fixture() +def checkout(tmp_path): + root = tmp_path / "repo" + (root / "scripts").mkdir(parents=True) + (root / "profile").mkdir() + shutil.copy(Path(apps_table.__file__), root / "scripts" / "apps_table.py") + shutil.copy(apps_table.README, root / "profile" / "README.md") + family = tmp_path / "family.json" + family.write_text(json.dumps(FAMILY), encoding="utf-8") + return root, family + + +def run(root, family, *extra): + return subprocess.run( + [sys.executable, "-I", str(root / "scripts" / "apps_table.py"), "--family", str(family), *extra], + capture_output=True, + text=True, + cwd=root, + ) + + +def test_check_writes_nothing_names_the_file_and_exits_1_on_drift(checkout): + root, family = checkout + readme = root / "profile" / "README.md" + before = readme.read_bytes() + result = run(root, family, "--check") + assert (result.returncode, result.stdout.strip()) == (1, "profile/README.md") + assert readme.read_bytes() == before + + +def test_write_then_check_is_current_and_the_same_spec_gives_the_same_bytes(checkout): + root, family = checkout + readme = root / "profile" / "README.md" + assert run(root, family).returncode == 0 + first = readme.read_bytes() + assert run(root, family, "--check").returncode == 0 + assert run(root, family).returncode == 0 + assert readme.read_bytes() == first + text = first.decode("utf-8") + assert "FormCut" in text and "formsecret" not in text and "2026-01-01" not in text and "0" * 20 not in text + + +def test_a_bad_spec_is_an_error_not_drift(checkout): + root, family = checkout + family.write_text(json.dumps({"format": "other", "apps": []}), encoding="utf-8") + assert run(root, family, "--check").returncode == 2 + assert run(root, root / "missing.json", "--check").returncode == 2 From 997cffdbf6e9a75b65476dd8271ae080b413836f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 18 Nov 2026 21:54:20 -0500 Subject: [PATCH 2/5] docs(profile): regenerate the apps table and licence line from the family spec Regenerated with `python3 -I scripts/apps_table.py --family family.json` (the sample spec at 2026-11-19, registry 0.16.0); `--check` now exits 0. Removed: FormPortal and FormEncoder (state public, not live), FormMCP, FormSkills, FormPDF and FormTray (state prelaunch). Changed: FormDeck links to the site id formslide; form.ext takes the registry's name and summary. All rows are now sorted by name. The licence sentence now names only form.ext, because FormPortal, FormMCP and FormSkills are no longer listed. --- profile/README.md | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/profile/README.md b/profile/README.md index d56d730..235458a 100644 --- a/profile/README.md +++ b/profile/README.md @@ -19,23 +19,17 @@ Download from **[formai.studio](https://formai.studio/apps/)**. Every release is | App | What it does | | --- | --- | -| [FormPortal](https://formai.studio/formportal/) | One place to install, open and update every FormAI app | +| [form.ext](https://formai.studio/formext/) | The extension studio: make, preview, check, package and publish extensions for every Form app | +| [Form.md](https://formai.studio/formmd/) | Notes, docs and databases built on plain Markdown files | | [FormCut](https://formai.studio/formcut/) | Video editing on your own machine: cut, grade, caption and export | -| [FormVis](https://formai.studio/formvis/) | Layered image editing: layers, masks, selections, painting and export | -| [FormWav](https://formai.studio/formwav/) | Audio editing: record, edit, repair, mix and export | -| [FormLit](https://formai.studio/formlit/) | Photo library and raw development on your own machine | +| [FormDAM](https://formai.studio/formdam/) | A library for every photo, video and asset you keep | +| [FormDeck](https://formai.studio/formslide/) | Presentations: build slides, present and export | | [FormDesign](https://formai.studio/formdesign/) | Page layout and PDF work in one app: lay out, publish, read, sign and edit | +| [FormLit](https://formai.studio/formlit/) | Photo library and raw development on your own machine | | [FormPath](https://formai.studio/formpath/) | Vector illustration: paths, shapes, type and artboards | | [FormVFX](https://formai.studio/formvfx/) | Motion graphics and visual effects on a layered timeline | -| [FormEncoder](https://formai.studio/formencoder/) | Convert, compress and export media in batches, with presets | -| [Form.md](https://formai.studio/formmd/) | Notes, docs and databases built on plain Markdown files | -| [FormDAM](https://formai.studio/formdam/) | A library for every photo, video and asset you keep | -| [FormDeck](https://formai.studio/formdeck/) | Presentations: build slides, present and export | -| [FormMCP](https://formai.studio/formmcp/) | One MCP server that shows agents every FormAI app and loads an app's own tools only when a task needs it | -| [FormSkills](https://formai.studio/formskills/) | The FormAI apps' released skills: read, download, keep your own edits and install them into your agent | -| [FormPDF](https://formai.studio/formpdf/) | A PDF editor that runs on your computer: view, comment, fill, sign and edit | -| [FormTray](https://formai.studio/formtray/) | One dock icon for every FormAI app: switch, launch and arrange the family | -| [Form.ext](https://formai.studio/formext/) | The extension studio: start from a working project, preview it in a simulated app, check it against the contract, then run, sign and publish it | +| [FormVis](https://formai.studio/formvis/) | Layered image editing: layers, masks, selections, painting and export | +| [FormWav](https://formai.studio/formwav/) | Audio editing: record, edit, repair, mix and export | More apps are on the way; [formai.studio/apps](https://formai.studio/apps/) shows what is coming next. @@ -43,7 +37,7 @@ More apps are on the way; [formai.studio/apps](https://formai.studio/apps/) show ## Licences -Every repository states its own licence. Most apps are Apache-2.0; FormPortal, FormMCP, FormSkills and Form.ext are GPL-3.0-only. +Every repository states its own licence. Most apps are Apache-2.0; form.ext is GPL-3.0-only. ## Help and contributing From 249f001222679d7db61c6b0e55f16df5b65797c4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 18 Nov 2026 21:55:11 -0500 Subject: [PATCH 3/5] ci(profile): the apps table workflow only checks the table against the family spec The workflow no longer fetches formai.studio on a schedule and no longer opens bot pull requests; formadaptor opens those now. After the tests it downloads family.json from formadaptor's spec branch and runs `python3 -I scripts/apps_table.py --family --check` on pushes to main, on pull requests and by hand. Permissions stay contents: read; the action pins, Python 3.12 and pytest 8.3.3 are unchanged. Ran: the YAML parses (jobs test and check, triggers push, workflow_dispatch, pull_request); the check step's command against the sample spec exits 0. The download step was run against the real address and answered 404 because the spec branch is not published yet; it could not be run to success here, and the job itself cannot run outside GitHub. --- .github/workflows/apps-table.yml | 40 +++++++------------------------- scripts/HASHOUT_LOG.md | 11 +++++++++ 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/.github/workflows/apps-table.yml b/.github/workflows/apps-table.yml index edb8978..73aaa74 100644 --- a/.github/workflows/apps-table.yml +++ b/.github/workflows/apps-table.yml @@ -1,8 +1,9 @@ name: Apps table on: - schedule: - - cron: "17 * * * *" + push: + branches: + - main workflow_dispatch: pull_request: paths: @@ -29,40 +30,15 @@ jobs: - run: pip install pytest==8.3.3 - run: python -m pytest -q tests - refresh: + check: needs: test - if: github.event_name != 'pull_request' runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - env: - GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - - name: Regenerate the apps table from the live catalogue - run: python scripts/apps_table.py - - name: Open or update the pull request - run: | - if git diff --quiet -- profile/README.md; then - echo "README is current" - exit 0 - fi - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - branch="bot/apps-table-$(git hash-object profile/README.md | cut -c1-10)" - if git ls-remote --exit-code --heads origin "$branch" >/dev/null; then - echo "$branch already proposes this table" - exit 0 - fi - git switch -c "$branch" - git commit -m "docs: refresh the apps table from the formai.studio catalogue" -- profile/README.md - git push origin "$branch" - gh pr create --head "$branch" --base main \ - --title "docs: refresh the apps table from the formai.studio catalogue" \ - --body "The apps table and the licence line in profile/README.md, regenerated from https://formai.studio/catalog/v1/apps.json (live apps only). Opened by the Apps table workflow." - gh pr list --state open --json number,headRefName --jq '.[] | select(.headRefName | startswith("bot/apps-table-")) | select(.headRefName != "'"$branch"'") | .number' | - while read -r old; do gh pr close "$old" --delete-branch --comment "Superseded by the newer table in $branch."; done + - name: Fetch the family spec from formadaptor's spec branch + run: curl --fail --silent --show-error --location --retry 3 --max-time 60 --output "$RUNNER_TEMP/family.json" https://raw.githubusercontent.com/nodemode-dev/formadaptor/spec/family.json + - name: Check the apps table and licence line against the spec + run: python3 -I scripts/apps_table.py --family "$RUNNER_TEMP/family.json" --check diff --git a/scripts/HASHOUT_LOG.md b/scripts/HASHOUT_LOG.md index 87adb22..050064f 100644 --- a/scripts/HASHOUT_LOG.md +++ b/scripts/HASHOUT_LOG.md @@ -24,4 +24,15 @@ The licence sentence is derived from the licences of the apps the table lists. I The README is read and written as bytes so line endings are never changed. +### apps-table.yml · the workflow only checks; formadaptor opens the pull requests +- refers-to: .github/workflows/apps-table.yml :: check +- kind: change +- logged: 2026-11-19 + +The hourly job that fetched the site and opened `bot/apps-table-*` pull requests is gone. The workflow now runs the tests and then `apps_table.py --family --check` on pushes to main, on pull requests that touch the script, the tests, the README or the workflow, and by hand. There is no schedule: a scheduled check would turn red whenever the spec moves, which is exactly when formadaptor is about to open its own pull request. The `check` job needs no write permission (the workflow keeps `contents: read` only) and no token. + +Where the spec comes from: docs/TARGETS.md lets a target either keep a copy of family.json or fetch it from formadaptor's `spec` branch. A committed copy would go stale, because formadaptor may change only the files declared for this target (`profile/README.md`), so its own pull request would fail a check against an older copy. The job therefore downloads https://raw.githubusercontent.com/nodemode-dev/formadaptor/spec/family.json with curl (retried, 60 second limit, fails on any HTTP error). The generator itself never touches the network. If formadaptor is private or the `spec` branch has not been published yet, the download fails with HTTP 404 and the job is red; that is a setup problem, not drift (the generator would have exited 2 or 1 by itself). + +Action pins and Python 3.12 and pytest 8.3.3 are unchanged. Three bot pull requests (`bot/apps-table-*`) opened by the old job are still open on the live repository; the owner closes or merges them before this lands, because the new generator would rewrite the same blocks differently. + The tests that fetched nothing but built a catalogue dictionary were rewritten for the spec's shape (`apps`, `public`) because the function arguments and the empty-list message changed. Added: private entries leave no trace, the site link uses the id, sort order, licence variants, and a subprocess run in a temporary copy of the checkout for `--check` (writes nothing, exit 1 naming the file, exit 0 after a write, exit 2 on a bad spec) and for determinism. From fd656ea875bb1d1651a6d345b233de9c8f998102 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 18 Nov 2026 22:44:31 -0500 Subject: [PATCH 4/5] revert(profile): the apps table stays as published until its source is settled Regenerating the table from the family spec cut the public list from 17 rows to 11 and changed the licence line. The table lists only apps whose state is live, and the spec (built from the registry) marks six apps the page shows today as public (FormPortal, FormEncoder) or prelaunch (FormMCP, FormSkills, FormPDF, FormTray). The owner has not decided which source is right, so the page must not change until then. profile/README.md is restored to exactly what origin/main has, by hand edits of the table region and the licence line. --- profile/README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/profile/README.md b/profile/README.md index 235458a..d56d730 100644 --- a/profile/README.md +++ b/profile/README.md @@ -19,17 +19,23 @@ Download from **[formai.studio](https://formai.studio/apps/)**. Every release is | App | What it does | | --- | --- | -| [form.ext](https://formai.studio/formext/) | The extension studio: make, preview, check, package and publish extensions for every Form app | -| [Form.md](https://formai.studio/formmd/) | Notes, docs and databases built on plain Markdown files | +| [FormPortal](https://formai.studio/formportal/) | One place to install, open and update every FormAI app | | [FormCut](https://formai.studio/formcut/) | Video editing on your own machine: cut, grade, caption and export | -| [FormDAM](https://formai.studio/formdam/) | A library for every photo, video and asset you keep | -| [FormDeck](https://formai.studio/formslide/) | Presentations: build slides, present and export | -| [FormDesign](https://formai.studio/formdesign/) | Page layout and PDF work in one app: lay out, publish, read, sign and edit | +| [FormVis](https://formai.studio/formvis/) | Layered image editing: layers, masks, selections, painting and export | +| [FormWav](https://formai.studio/formwav/) | Audio editing: record, edit, repair, mix and export | | [FormLit](https://formai.studio/formlit/) | Photo library and raw development on your own machine | +| [FormDesign](https://formai.studio/formdesign/) | Page layout and PDF work in one app: lay out, publish, read, sign and edit | | [FormPath](https://formai.studio/formpath/) | Vector illustration: paths, shapes, type and artboards | | [FormVFX](https://formai.studio/formvfx/) | Motion graphics and visual effects on a layered timeline | -| [FormVis](https://formai.studio/formvis/) | Layered image editing: layers, masks, selections, painting and export | -| [FormWav](https://formai.studio/formwav/) | Audio editing: record, edit, repair, mix and export | +| [FormEncoder](https://formai.studio/formencoder/) | Convert, compress and export media in batches, with presets | +| [Form.md](https://formai.studio/formmd/) | Notes, docs and databases built on plain Markdown files | +| [FormDAM](https://formai.studio/formdam/) | A library for every photo, video and asset you keep | +| [FormDeck](https://formai.studio/formdeck/) | Presentations: build slides, present and export | +| [FormMCP](https://formai.studio/formmcp/) | One MCP server that shows agents every FormAI app and loads an app's own tools only when a task needs it | +| [FormSkills](https://formai.studio/formskills/) | The FormAI apps' released skills: read, download, keep your own edits and install them into your agent | +| [FormPDF](https://formai.studio/formpdf/) | A PDF editor that runs on your computer: view, comment, fill, sign and edit | +| [FormTray](https://formai.studio/formtray/) | One dock icon for every FormAI app: switch, launch and arrange the family | +| [Form.ext](https://formai.studio/formext/) | The extension studio: start from a working project, preview it in a simulated app, check it against the contract, then run, sign and publish it | More apps are on the way; [formai.studio/apps](https://formai.studio/apps/) shows what is coming next. @@ -37,7 +43,7 @@ More apps are on the way; [formai.studio/apps](https://formai.studio/apps/) show ## Licences -Every repository states its own licence. Most apps are Apache-2.0; form.ext is GPL-3.0-only. +Every repository states its own licence. Most apps are Apache-2.0; FormPortal, FormMCP, FormSkills and Form.ext are GPL-3.0-only. ## Help and contributing From d53000003f3273529553697b9ec3bbf599a379bd Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 18 Nov 2026 22:45:27 -0500 Subject: [PATCH 5/5] ci(profile): the workflow runs the tests only; the listing rule is one named line The page is back to its published table (see the revert) and is not generated from the family spec yet, so the apps-table workflow drops the check job and its network fetch and only runs the script's tests on push, pull request and by hand. The HASHOUT_LOG says what to switch on when the owner decides: the --check step against scripts/family.spec.json and the first regeneration. No spec copy is committed. apps_table.py names the listing rule: LISTING_RULE is one assignment, today state live, with the two other candidates beside it (rule c lists every public app that has a published release). No behaviour change and no command-line switch. Tests added for the rule and for rule c. --- .github/workflows/apps-table.yml | 13 ------------- scripts/HASHOUT_LOG.md | 32 +++++++++++++++++++++++++++++++- scripts/apps_table.py | 18 +++++++++++++++++- tests/test_apps_table.py | 21 +++++++++++++++++++++ 4 files changed, 69 insertions(+), 15 deletions(-) diff --git a/.github/workflows/apps-table.yml b/.github/workflows/apps-table.yml index 73aaa74..d84d67b 100644 --- a/.github/workflows/apps-table.yml +++ b/.github/workflows/apps-table.yml @@ -29,16 +29,3 @@ jobs: python-version: "3.12" - run: pip install pytest==8.3.3 - run: python -m pytest -q tests - - check: - needs: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Fetch the family spec from formadaptor's spec branch - run: curl --fail --silent --show-error --location --retry 3 --max-time 60 --output "$RUNNER_TEMP/family.json" https://raw.githubusercontent.com/nodemode-dev/formadaptor/spec/family.json - - name: Check the apps table and licence line against the spec - run: python3 -I scripts/apps_table.py --family "$RUNNER_TEMP/family.json" --check diff --git a/scripts/HASHOUT_LOG.md b/scripts/HASHOUT_LOG.md index 050064f..6c96e56 100644 --- a/scripts/HASHOUT_LOG.md +++ b/scripts/HASHOUT_LOG.md @@ -3,7 +3,7 @@ Living log of all comment content, explainers, rationale, TODOs and removed code for the scripts and the workflow in this repository. The source files stay comment-free; everything they would have said lives here, indexed. Read this first, then edit code surgically. Current build version: none (this repository has no version) -Last updated: 2026-11-19 · apps_table.py reads the family spec instead of the site's catalogue +Last updated: 2026-11-18 · the page is back to its published table; the workflow only runs tests; the listing rule is one named line ### apps_table.py · the table and the licence line come from family.json, offline - refers-to: scripts/apps_table.py :: main, load_family, shown, table, licences, render; .github/workflows/apps-table.yml @@ -28,6 +28,7 @@ The README is read and written as bytes so line endings are never changed. - refers-to: .github/workflows/apps-table.yml :: check - kind: change - logged: 2026-11-19 +- status: the `check` job and the network fetch described here were removed again on 2026-11-18, see "The page is not generated yet" below; the rest of this entry is the history of why the fetch was chosen and is superseded by the family decision to keep a copy of the spec in the target The hourly job that fetched the site and opened `bot/apps-table-*` pull requests is gone. The workflow now runs the tests and then `apps_table.py --family --check` on pushes to main, on pull requests that touch the script, the tests, the README or the workflow, and by hand. There is no schedule: a scheduled check would turn red whenever the spec moves, which is exactly when formadaptor is about to open its own pull request. The `check` job needs no write permission (the workflow keeps `contents: read` only) and no token. @@ -36,3 +37,32 @@ Where the spec comes from: docs/TARGETS.md lets a target either keep a copy of f Action pins and Python 3.12 and pytest 8.3.3 are unchanged. Three bot pull requests (`bot/apps-table-*`) opened by the old job are still open on the live repository; the owner closes or merges them before this lands, because the new generator would rewrite the same blocks differently. The tests that fetched nothing but built a catalogue dictionary were rewritten for the spec's shape (`apps`, `public`) because the function arguments and the empty-list message changed. Added: private entries leave no trace, the site link uses the id, sort order, licence variants, and a subprocess run in a temporary copy of the checkout for `--check` (writes nothing, exit 1 naming the file, exit 0 after a write, exit 2 on a bad spec) and for determinism. + +### profile/README.md · the page is back to what was published until its source is settled +- refers-to: profile/README.md (apps and licences blocks) +- kind: revert +- logged: 2026-11-18 + +Regenerating from the family spec (commit e56835c) cut the table from 17 rows to 11 and shortened the licence line. The table lists only apps whose spec state is `live`; the spec, built from the registry, marks FormPortal and FormEncoder `public` and FormMCP, FormSkills, FormPDF and FormTray `prelaunch`, yet the page showed all six. Whether the registry states or the page is right is the owner's decision (it may mean changing the states in formcompiler's registry, or changing the rule here), so the page must not change until then. The file was restored to exactly the bytes of origin/main by two hand edits (the table block and the licence line); `git diff origin/main -- profile/README.md` prints nothing. The earlier commits are kept. + +### apps-table.yml · The page is not generated yet, so the workflow only runs the tests +- refers-to: .github/workflows/apps-table.yml :: test +- kind: change +- logged: 2026-11-18 + +The `check` job is removed. With the page restored, `--check` against the sample spec would fail, and the job fetched the spec from a branch of formadaptor that does not exist yet. Family decision since: a target keeps a copy of the spec it was generated from in its own repository (here `scripts/family.spec.json`), the generator writes that copy only when its output changes, and CI checks against the copy with no network. This page is not generated from the spec until the owner settles the listing rule, so the workflow runs `pytest` on push to main and on pull requests (same paths), by hand too, and checks nothing else. Action pins, Python 3.12, pytest 8.3.3 and `contents: read` are unchanged. No spec copy is committed. + +To switch on when the owner decides (in this order): +1. Pick the listing rule (next entry), delete the other two rules and the unused one's tests. +2. Run `python3 -I scripts/apps_table.py --family ` once. This is the first regeneration: it rewrites the apps and licence blocks of `profile/README.md`, and the generator must also write `scripts/family.spec.json` (the copy of the spec it was generated from) in the same run, only when its output changes. That copy-writing is not in the script yet and is part of this step. +3. Add to the workflow a `check` step after the tests: `python3 -I scripts/apps_table.py --family scripts/family.spec.json --check`. Local file, no network, no token. +4. Commit the regenerated README and the spec copy together, so the check is green from the first push. + +### apps_table.py · the listing rule is one named line, with the three candidates the owner is choosing between +- refers-to: scripts/apps_table.py :: LISTING_RULE, rule_a_state_live, rule_b_state_live, rule_c_has_release, shown +- kind: change +- logged: 2026-11-18 + +`shown` keeps the entries with `public` true, a safe id and `LISTING_RULE(entry)` true. `LISTING_RULE` is one assignment, today `rule_a_state_live` (state is `live`, the rule the table already had), so behaviour is unchanged. Rule b is the same test as rule a, as the owner's brief lists it; it is a separate name only so that the choice can be written down, and if it was meant to differ it needs its definition. Rule c, `rule_c_has_release`, lists every public app that has a published release: `release` is an object with a non-empty `version`. The sample spec carries it: `release.version` (also `release.tag`, `release.published`, `release.url`, `release.skills`), present for every public app and `null` or absent for non-public ones. There is no command-line switch: the owner picks one rule, the other two go. + +Under the sample spec (registry 0.16.0) the table shows 11 rows under a and b and 23 under c. Rule c brings back the six apps the page shows today (FormPortal, FormEncoder, FormMCP, FormSkills, FormPDF, FormTray) and also adds six the page has never shown, all `prelaunch` (Format, FormCel, FormRef, FormTools, FormTxt, FormWeb). Under c the licence line becomes "Most apps are Apache-2.0; form.ext, formMCP, FormPortal and formskills are GPL-3.0-only." The names formMCP, formskills and Format are the registry's own spelling. diff --git a/scripts/apps_table.py b/scripts/apps_table.py index 6616874..5c91703 100644 --- a/scripts/apps_table.py +++ b/scripts/apps_table.py @@ -32,11 +32,27 @@ def table(family: dict) -> str: return "\n".join(rows) +def rule_a_state_live(app: dict) -> bool: + return app.get("state") == "live" + + +def rule_b_state_live(app: dict) -> bool: + return app.get("state") == "live" + + +def rule_c_has_release(app: dict) -> bool: + release = app.get("release") + return isinstance(release, dict) and bool(str(release.get("version") or "").strip()) + + +LISTING_RULE = rule_a_state_live + + def shown(family: dict) -> list[dict]: apps = [ a for a in family["apps"] - if a.get("public") is True and a.get("state") == "live" and SLUG.match(str(a.get("id", ""))) + if a.get("public") is True and LISTING_RULE(a) and SLUG.match(str(a.get("id", ""))) ] return sorted(apps, key=lambda a: (cell(a.get("name", a["id"])).casefold(), str(a["id"]))) diff --git a/tests/test_apps_table.py b/tests/test_apps_table.py index 952f309..22afbc3 100644 --- a/tests/test_apps_table.py +++ b/tests/test_apps_table.py @@ -53,6 +53,27 @@ def test_only_public_live_apps_with_safe_slugs_are_listed(): assert "Evil" not in rows +def test_the_listing_rule_today_is_state_live(): + assert apps_table.LISTING_RULE is apps_table.rule_a_state_live + assert apps_table.rule_b_state_live({"state": "live"}) and not apps_table.rule_b_state_live({"state": "public"}) + + +def test_the_release_rule_needs_a_published_version_and_still_skips_private_apps(monkeypatch): + released = {"version": "1.2.3", "tag": "v1.2.3"} + family = { + "apps": [ + {**app("formcut", "FormCut"), "release": released}, + {**app("formtxt", "FormTxt", state="prelaunch"), "release": released}, + {**app("formnew", "FormNew", state="prelaunch"), "release": None}, + {**app("formempty", "FormEmpty"), "release": {"version": ""}}, + {"id": "formsecret", "public": False, "state": "live", "release": released}, + ] + } + assert [a["id"] for a in apps_table.shown(family)] == ["formcut", "formempty"] + monkeypatch.setattr(apps_table, "LISTING_RULE", apps_table.rule_c_has_release) + assert [a["id"] for a in apps_table.shown(family)] == ["formcut", "formtxt"] + + def test_nothing_about_a_private_app_is_written(): out = apps_table.render(f"{apps_table.START}\n{apps_table.END}\n{apps_table.LICENCE_START}\n{apps_table.LICENCE_END}\n", FAMILY) for word in ("formsecret", "FormHidden", "formhidden", "private"):