diff --git a/.github/workflows/apps-table.yml b/.github/workflows/apps-table.yml index edb8978..d84d67b 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: @@ -28,41 +29,3 @@ jobs: python-version: "3.12" - run: pip install pytest==8.3.3 - run: python -m pytest -q tests - - refresh: - 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 diff --git a/scripts/HASHOUT_LOG.md b/scripts/HASHOUT_LOG.md new file mode 100644 index 0000000..6c96e56 --- /dev/null +++ b/scripts/HASHOUT_LOG.md @@ -0,0 +1,68 @@ +# 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-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 +- 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. + +### 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 +- 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. + +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. + +### 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 829c822..5c91703 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,68 @@ 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 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 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"]))) 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 +92,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..22afbc3 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,92 @@ 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_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"): + 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 +105,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 +119,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