Skip to content
Open
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
21 changes: 13 additions & 8 deletions docs/new-example-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -94,15 +94,15 @@ 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`
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/<name>/index.html` and inspect the
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions tests/check_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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),
}


Expand Down Expand Up @@ -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))
Expand Down
25 changes: 25 additions & 0 deletions tests/test_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down