Repository navigation
fix(create-chapter): render each chapter's Web Banner from its deck - #65
Conversation
Web Banner.png has the city drawn into the image, so the text rebrand never reached it and every clone kept TemplateCity's "San Francisco" banner; renamed chapters kept their old names. render_web_banner.py renders slide 4 of the chapter's own Square Logo deck through Google's renderer instead, refuses a slide that does not name the chapter, and stamps the banner with the deck's checksum so a re-run skips current banners and picks up renamed decks. create_chapter and rename_chapter call it after a write. The rename reference now lists the other surfaces a text rename misses (badges, Luma links, the feed's Summary prose). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Self-ReviewSix passes ran: code, silent failures, tests, comments, types and security. The diff is 494 lines and writes to every chapter folder, so it got the full set. Important (9)
Suggestions (8)
Strengths
Generated using wayfare. |
- Stamp the deck checksum and the chapter name, so a renamed folder with an unchanged deck is checked again instead of reported current. - Check the slide the renderer draws: resolve slide 4 by presentation order in the deck, and re-check the rendered page's own text in render_slide_png. - Match the slide text exactly (headline plus name), unescape XML entities. - render_slide_png: refuse a non-PNG download, name a short deck, and with strict_cleanup fail on an untrashed temp copy. A sweep skips TemplateCity unless it is named. - The hooks get the Result: "already current" is no longer printed as "Rendered". Create exits 2 on a banner failure and skips a dirty deck. Rename never creates a banner, warns on stderr, and says so on a failed verify. Fallback commands print the script's absolute path. - Tests: upload and stamp land on the banner, missing checksum, duplicate ids, main() exit codes, the rename hook, slide order and the renderer guards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Self-Review: ImprovementsImportant (9 / 9 fixed):
Suggestions (8 / 8 fixed):
Verification: library suite 598 passed, all Commits: 6b85073 Generated using wayfare. |
Self-ReviewSecond pass, on head 6b85073, which includes the fixes from the first review. Six agents ran on the full diff (967 lines, 10 files). Important (7)
Suggestions (9)
Strengths
Generated using wayfare. |
- A folder with no banner is absent before the Banners folder or deck is looked up, so it never fails a sweep or a rename. - New --create flag (with --chapter only). The create hook's fallback command uses it, so a render that failed before the file existed can be finished. - strict_cleanup puts the stray copy's id in the raised error even when the render also failed. - create_chapter prints "Rendered" only for a render. rename_chapter treats an unknown outcome as exit 1, not a KeyError. - A dirty existing Square Logo deck under --resume is not rendered. The advice now comes after --repair-existing. - Runs within a paragraph or shape are joined with nothing, so a split word still matches. Punctuation at the ends of the expected name is stripped too. - check_text rejects a non-string return. The fallback command is shell-quoted. --jobs must be at least 1. The stamp key notes when to rename it. - Tests: - the NO_RETRY create counted at the subprocess; - write passed through main; - sync_one end to end; - rename main wiring; - missing folder, deck and duplicate decks; - the fields mask, the strict cleanup combo, and boundary cases. - Docs now match the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Self-Review: ImprovementsImportant (7 / 7 fixed):
Suggestions (8 / 9 fixed):
Skipped:
Commits: 37a7515 Generated using wayfare. |
Problem
Web Banner.png(the square "AAIF Community Events / " image in every chapter folder) has the city drawn into the pixels.create_chapter.pyrebrands OOXML text, so it copied TemplateCity's PNG byte for byte. Measured 2026-11-03: 37 chapters' banners were byte-identical to the template and said "San Francisco", including the two created this week. Renamed chapters (Japan, New Zealand, Edinburgh, and others) still showed their old names.Fix
render_web_banner.pymakes the banner from the fourth slide of the chapter's ownBanners (…)/Square Logo.pptx. That slide is the same 2000x2000 composition, already rebranded, in the design system. It renders throughslides_export.render_slide_png(Google's renderer, no LibreOffice).md5Checksumplus the chapter name inappProperties, so a re-run skips current banners and re-checks after any deck change or rename.--chapter X --createcreates one. It is the follow-upcreate_chapterprints when its render failed before the file existed.slides_export.render_slide_pnggainscheck_textandstrict_cleanup, a PNG signature check and clearer errors.strict_cleanupputs a stray copy's id in the error even when the render also failed. Existing callers are unchanged.create_chaptercalls it after a clean write (exit 2 if the banner failed). It does not render a dirty existing deck under--resume.rename_chaptercalls it after a verified write (exit 1 if it failed, and it never creates a banner).references/rename-chapter.mdlists what a text rename misses.Verification
test_render_web_banner.py(45 tests), new renderer guard tests in the library suite (604 passed), and new hook tests intest_create_chapter.py(79) andtest_rename_chapter.py, includingmain()wiring. The NO_RETRY create is counted at the subprocess. Two mutants confirmed the new tests catch a dropped NO_RETRY and a report run that writes. Pre-commit is clean.--writeon Aarhus rendered the right name at 2000x2000, left no temp copy, and re-runs as current.--writeran on 2026-11-03: 118 rendered, 1 already current (Aarhus), 0 failed. Tatooine has no banner and was left alone.🤖 Generated with Claude Code
Generated using wayfare.