From 2099b154506be92e7c3c95cbf36767d4ea52d2c6 Mon Sep 17 00:00:00 2001 From: Ammar Elkhateeb Date: Fri, 4 Dec 2026 06:06:43 +0200 Subject: [PATCH] docs: correct three stale statements in the new-example prompt `docs/new-example-prompt.md` disagrees with `CLAUDE.md`, `AGENTS.md`, `CONTRIBUTING.md` and `blender-smoke.yml` in three places (#558): - the check-only count said "Ten of the 69"; 69 examples minus the 56 gallery entries is 13, as `CLAUDE.md` states; - the wiring list named a "plugin manifest" that references no example (the manifests carry skills, rules and an `mcpServers` pointer only); - step 7 said the smoke jobs are pull_request-only, but `blender-smoke.yml` also triggers on `push` to `main` with the same `paths-ignore`, and `release-gate.sh` waits for that run. `tests/check_counts.py` now reads the "N of the M examples ... qualify" form, number words included, so the check-only count cannot drift again; `tests/test_gates.py` covers the new rule in both directions. Signed-off-by: Ammar Elkhateeb --- docs/new-example-prompt.md | 21 +++++++++++++-------- tests/check_counts.py | 14 ++++++++++++++ tests/test_gates.py | 25 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/docs/new-example-prompt.md b/docs/new-example-prompt.md index 2ffb0867..9819fa01 100644 --- a/docs/new-example-prompt.md +++ b/docs/new-example-prompt.md @@ -59,7 +59,7 @@ metadata — so the render would be identical whether the API held or broke. The "redesign the scene until failure would be visible" instruction above is the test: attempt it first, and only when it cannot succeed in principle does the example become check-only. The exception is for contracts that are invisible, not for -renders that are hard. Ten of the 69 examples currently qualify, and `CLAUDE.md` +renders that are hard. Thirteen of the 69 examples currently qualify, and `CLAUDE.md` carries the same rule. A check-only example is otherwise a full example: it still asserts a real contract, still exits non-zero on failure, still carries a falsifier, and still takes a `tests/smoke/catalog.json` row so it runs on every PR. @@ -94,7 +94,7 @@ The example must: Complete every integration required for a shipped example. Infer the exact current shape from neighboring examples and repository configuration, including the example -directory, README, gallery metadata and assets, plugin manifest, smoke catalog +directory, README, gallery metadata and assets, smoke catalog (`tests/smoke/catalog.json`, whose row must list the falsifier under `falsifiers` with its exact `expect_exit` so CI re-proves it on every run), the skills mapping (`examples/skills.json`, then `python scripts/build_examples_index.py` @@ -102,7 +102,7 @@ to regenerate `examples/index.json` and the skills' Runnable examples sections), the top-level README's aggregate counts (it no longer carries a per-example row; the gallery is the catalog), and generated gallery pages. A check-only example skips the gallery metadata, assets, and generated pages — it wires -the plugin manifest, the smoke catalog row, the skills mapping, and its README, and nothing else. After regenerating the gallery with +the smoke catalog row, the skills mapping, and its README, and nothing else. After regenerating the gallery with `python scripts/build_gallery.py`, read the **generated** output character by character—not only `examples/gallery.json` source fields. Open `docs/gallery/index.html` and `docs/gallery//index.html` and inspect the @@ -197,11 +197,16 @@ After implementation and local verification: 7. Wait for any automated release/version-sync commit triggered by the merge, then fast-forward local `main` to `origin/main`, and verify main HEAD is green including all post-merge jobs (Release, Validate, Ecosystem drift check, Deploy - GitHub Pages where path-triggered). The smoke jobs are pull_request-triggered - and do not re-run on the merge SHA: the post-merge evidence is that both smoke - jobs passed on the PR head SHA that became the sole squash-merged commit, with - the actual Blender binary versions confirmed in the job logs. Do not hand-edit - release-owned version fields. + GitHub Pages where path-triggered, and the smoke run on the push to `main`). + `blender-smoke.yml` triggers on `pull_request` and on `push` to `main`, both with + the same `paths-ignore`, so a merge that touches anything Blender runs gets a + second smoke run on `main`; only a merge whose every changed file is a doc, + `docs/**`, `assets/**`, a plugin manifest or `live-session/**` skips it. The merge + evidence for example changes is still both smoke jobs (5.2 LTS and 4.5 LTS) + passing on the PR head SHA that became the sole squash-merged commit, with the + actual Blender binary versions confirmed in the job logs. `release-gate.sh` + mirrors those globs to decide whether a push has a smoke run to wait for. Do not + hand-edit release-owned version fields. 8. Confirm the final working tree is clean and report: PR URL, merge commit, resulting version (if released), exact local binaries used, measured check values, falsification evidence, contact-sheet link, and checks completed. diff --git a/tests/check_counts.py b/tests/check_counts.py index 93d067a2..5789172c 100644 --- a/tests/check_counts.py +++ b/tests/check_counts.py @@ -92,6 +92,13 @@ def number(word: str) -> int | None: HEADING = re.compile(r"^#+ (Skills|Rules|Templates|Snippets|Examples) \((\d+)\)\s*$") TREE = re.compile(r"^(skills|rules|templates|snippets|examples)/\S*\s+- .*?(\d+) total") GALLERY = re.compile(r"\b(\d+) of the (\d+) ship a render") +# "Thirteen of the 69 examples currently qualify": the check-only count used to slip +# past PROSE, which reads digits only and skips "of" as a subset word (#558). The +# trailing verb keeps member phrases such as "Every one of the 69 examples carries a +# falsifier" out of it. +CHECK_ONLY = re.compile( + r"\b([\w-]+) of the (\d+) examples (?:currently )?" + r"(?:qualif\w+|(?:are|is) check-only)\b") # README overview table: "| **Snippets** | 29 small standalone Python files ..." LAYER_ROW = re.compile(r"^\| \*\*(Skills|Rules|Templates|Snippets|Examples)\*\* \| (\d+)\b") @@ -121,6 +128,8 @@ def dirs_with(parent: str, marker: str | None) -> int: "examples": dirs_with("examples", "README.md"), "showcase": dirs_with("showcase", "README.md"), "gallery": len(entries), + # Check-only examples are the ones with no gallery entry (#558). + "check_only": dirs_with("examples", "README.md") - len(entries), } @@ -171,6 +180,11 @@ def expect(doc: str, line_no: int, kind: str, stated: int, phrase: str) -> None: m = TREE.match(line) if m: expect(doc, i, m.group(1), int(m.group(2)), m.group(0).strip()) + for m in CHECK_ONLY.finditer(line): + stated = number(m.group(1)) + if stated is not None: + expect(doc, i, "check_only", stated, m.group(0)) + expect(doc, i, "examples", int(m.group(2)), m.group(0)) for m in GALLERY.finditer(line): expect(doc, i, "gallery", int(m.group(1)), m.group(0)) expect(doc, i, "examples", int(m.group(2)), m.group(0)) diff --git a/tests/test_gates.py b/tests/test_gates.py index 5d62bd97..94093554 100644 --- a/tests/test_gates.py +++ b/tests/test_gates.py @@ -204,6 +204,31 @@ def test_unnamed_rule_fails(self): e = self.tree(self.GOOD.replace("Rules: `r`.", "")) self.assertTrue(any("never names rule `r`" in m for m in e), e) + def check_only_tree(self, phrase: str) -> list[str]: + # Two examples, one gallery entry: one check-only example (#558). + with tempfile.TemporaryDirectory() as td: + root = Path(td) + for rel, text in ( + ("skills/a/SKILL.md", "x"), ("skills/b/SKILL.md", "x"), + ("rules/r.mdc", "x"), ("snippets/s.py", "a\nb\nc\nd\ne\n"), + ("examples/e/README.md", "x"), ("examples/f/README.md", "x"), + ("examples/gallery.json", json.dumps({"examples": [{"name": "e"}]})), + ("README.md", self.GOOD.replace("1 example", "2 examples") + phrase), + ): + write(root, rel, text) + (root / "templates" / "t").mkdir(parents=True) + (root / "showcase").mkdir() + return check_counts.check(root) + + def test_stale_check_only_count_fails(self): + # "Ten of the 69 examples currently qualify" used a number word, which the + # prose scan skips because it reads digits only and drops "of" as a subset word. + e = self.check_only_tree("Ten of the 2 examples currently qualify.\n") + self.assertTrue(any("Ten of the 2 examples" in m for m in e), e) + + def test_current_check_only_count_passes(self): + self.assertEqual(self.check_only_tree("One of the 2 examples currently qualifies.\n"), []) + def test_snippet_over_the_cap_fails(self): with tempfile.TemporaryDirectory() as td: root = Path(td)