test(ship): P5 complete — re-render + tests (REQ-262)

---ci---
project: acdl
phase: 5
milestone: v1.22
status: complete
phase_role: execution
---/ci---
This commit is contained in:
Jon Chery
2026-08-11 19:56:42 +00:00
4 changed files with 178 additions and 93 deletions
+5 -5
View File
@@ -1,12 +1,12 @@
{
"phase": 3,
"phase": 4,
"stage": "complete",
"milestone": "v1.22",
"phase_role": "execution",
"attempts": 0,
"updated_at": "2026-08-11T14:55:00Z",
"updated_at": "2026-08-11T15:00:00Z",
"milestone_complete": false,
"tag": "v1.21.3",
"requirements": ["REQ-259","REQ-260"],
"notes": "v1.22 P3 complete. Tag v1.21.3. Both mermaid diagrams re-rendered at 2x transparent. telemetry-live-ops: TB, 0.63 aspect. platform-pipeline: TB 4-node, 0.49 aspect. Marp deck directives updated to h:480. Proceeding to P4 (deck content)."
"tag": "v1.21.4",
"requirements": ["REQ-261"],
"notes": "v1.22 P4 complete. Tag v1.21.4. 8 overflowing slides trimmed/split. Header removed from frontmatter. Slide count 18->20 main + 1 appendix. 23 slide tests pass. Proceeding to P5 (re-render + tests)."
}
File diff suppressed because one or more lines are too long
+104 -1
View File
@@ -267,4 +267,107 @@ def test_source_md_no_badges():
"""REQ-252: no maturity badges in the source-of-truth markdown."""
text = SOURCE_MD.read_text()
assert "badge" not in text.lower(), \
"Source markdown still contains badge spans"
"Source markdown still contains badge spans"
# --- v1.22 layout/aspect-ratio/theme-structural tests (REQ-262) ---
def test_theme_css_has_section_padding():
"""REQ-254: theme CSS has a section padding rule (root cause fix)."""
css = THEME_CSS.read_text()
assert "padding:" in css, "theme CSS has no padding rule"
# The section rule must have padding (not just table/td padding)
assert re.search(r"section\s*\{[^}]*padding:", css, re.DOTALL), \
"theme CSS has no padding on the section rule"
def test_theme_css_suppresses_title_chrome():
"""REQ-256: title slides suppress header/footer chrome."""
css = THEME_CSS.read_text()
assert "section.title header" in css, \
"theme CSS does not suppress title-slide header"
assert "section.title footer" in css, \
"theme CSS does not suppress title-slide footer"
assert "display: none" in css, \
"theme CSS does not set display:none on title chrome"
def test_theme_css_has_aspect_ratio_aware_images():
"""REQ-255: image rules use object-fit + max-width (not blunt max-height only)."""
css = THEME_CSS.read_text()
assert "object-fit" in css, \
"theme CSS does not use object-fit for images"
assert "max-width" in css, \
"theme CSS does not set max-width for images"
def test_png_aspect_ratios_sane():
"""REQ-259/260: PNGs referenced in the marp deck have aspect ratios
in [0.4, 4.0] (suitable for 16:9 slides with img.tall/img.wide classes).
Only checks PNGs actually referenced in the current marp deck —
legacy/unused PNGs are not checked (GRILL revision 1)."""
import struct
deck_text = MARP_DECK.read_text()
# Extract all referenced PNG paths: ![...](assets/png/X.png)
referenced = re.findall(r'!\[[^\]]*\]\(assets/png/([^)]+\.png)\)', deck_text)
assert referenced, "no PNGs referenced in the marp deck"
for png_name in referenced:
png_path = ASSETS / "png" / png_name
assert png_path.is_file(), f"referenced PNG not found: {png_name}"
with open(png_path, "rb") as fh:
data = fh.read(24)
assert data[:8] == b"\x89PNG\r\n\x1a\n", f"{png_name} is not a PNG"
w = struct.unpack(">I", data[16:20])[0]
h = struct.unpack(">I", data[20:24])[0]
ar = w / h
assert 0.4 <= ar <= 4.0, \
f"{png_name} aspect ratio {ar:.2f} outside [0.4, 4.0] ({w}x{h})"
def test_render_slides_has_2x_scale():
"""REQ-258: render_slides.sh uses -s 2 (2x scale) and -b transparent."""
text = RENDER_SCRIPT.read_text()
assert "-s 2" in text, "render_slides.sh does not use -s 2 (2x scale)"
assert "-b transparent" in text, \
"render_slides.sh does not use -b transparent"
def test_render_slides_pins_cli_versions():
"""REQ-257: render_slides.sh pins marp-cli and mermaid-cli versions
(no @latest)."""
text = RENDER_SCRIPT.read_text()
assert "marp-cli@" in text, "render_slides.sh does not pin marp-cli"
assert "mermaid-cli@" in text, \
"render_slides.sh does not pin mermaid-cli"
assert "@latest" not in text, \
"render_slides.sh still uses @latest (not pinned)"
def test_render_deck_removed():
"""REQ-257: render_deck.sh has been deleted (produced unthemed output)."""
old_script = ROOT / "scripts" / "render_deck.sh"
assert not old_script.exists(), \
"render_deck.sh still exists (should be deleted — produced unthemed output)"
def test_html_embeds_theme():
"""REQ-262: the committed HTML embeds the S&P theme (--sp-red + padding
in the inline <style> block)."""
html = (PRESENTATIONS / "nova-autonomous-cloud-delivery.html").read_text()
assert "--sp-red" in html, "committed HTML does not embed --sp-red"
assert "padding:" in html, "committed HTML does not embed padding rule"
def test_html_slide_count_matches_marp():
"""REQ-262: the committed HTML <section> count matches the marp deck
slide count (title + 20 main + 1 appendix = 22)."""
html = (PRESENTATIONS / "nova-autonomous-cloud-delivery.html").read_text()
section_count = html.count("<section ")
deck_text = MARP_DECK.read_text()
main_slides = len(re.findall(r"^## Slide ", deck_text, re.MULTILINE))
appendix_slides = len(re.findall(r"^## Appendix ", deck_text, re.MULTILINE))
# +1 for the title slide (which is an H1, not "## Slide")
expected = main_slides + appendix_slides + 1
assert section_count == expected, \
f"HTML has {section_count} sections, expected {expected} " \
f"({main_slides} main + {appendix_slides} appendix + 1 title)"