For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Remove the unused jar-bundled MiSans font path and keep Docker runtime system MiSans as the single PDF font source.
Architecture: The Playwright PDF generator will no longer accept or reference bundled font loaders. Runtime PDF rendering continues to rely on the existing CSS font stack and the Docker image installing MiSans-VF.ttf into the OS font cache.
Tech Stack: Java 17, Spring Boot 3.3.5, Maven multi-module project, Playwright Java, Docker runtime image.
abilities/exam-sprint/infrastructure/src/main/resources/fonts/MiSans-VF.ttf: unused classpath font resource.abilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/BundledOutlookReportFonts.java: unused bundled font loader.abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/BundledOutlookReportFontsTest.java: tests for deleted loader.abilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGenerator.java: simplify constructors and remove Supplier<BundledOutlookReportFonts> dependency.abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGeneratorTest.java: update test-only constructor usage.docs/superpowers/plans/2026-05-07-playwright-pdf-generator.md: replace stale bundled-font wording with runtime-system-font wording.Files:
abilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGenerator.javaModify: abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGeneratorTest.java
[ ] Step 1: Update the test constructor call
In PlaywrightExamSprintReportPdfGeneratorTest.java, replace the constructor call in constructorDoesNotLaunchChromiumBeforeFirstGenerate() from:
try (PlaywrightExamSprintReportPdfGenerator generator = new PlaywrightExamSprintReportPdfGenerator(
BundledOutlookReportFonts::load,
1,
1)) {
to:
try (PlaywrightExamSprintReportPdfGenerator generator = new PlaywrightExamSprintReportPdfGenerator(1, 1)) {
Run:
mvn -pl abilities/exam-sprint/infrastructure -am -Dtest=PlaywrightExamSprintReportPdfGeneratorTest test
Expected: compilation fails because PlaywrightExamSprintReportPdfGenerator(double, double) does not exist yet.
In PlaywrightExamSprintReportPdfGenerator.java, remove this import:
import java.util.Objects;
import java.util.function.Supplier;
Add back only this import if Objects is still needed by another statement:
import java.util.Objects;
Then replace the constructors:
public PlaywrightExamSprintReportPdfGenerator() {
this(BundledOutlookReportFonts::load, DEFAULT_LAUNCH_TIMEOUT_MILLIS, DEFAULT_RENDER_TIMEOUT_MILLIS);
}
PlaywrightExamSprintReportPdfGenerator(
Supplier<BundledOutlookReportFonts> bundledFontsSupplier,
double launchTimeoutMillis,
double renderTimeoutMillis) {
Objects.requireNonNull(bundledFontsSupplier, "bundledFontsSupplier");
this.launchTimeoutMillis = launchTimeoutMillis;
this.renderTimeoutMillis = renderTimeoutMillis;
}
with:
public PlaywrightExamSprintReportPdfGenerator() {
this(DEFAULT_LAUNCH_TIMEOUT_MILLIS, DEFAULT_RENDER_TIMEOUT_MILLIS);
}
PlaywrightExamSprintReportPdfGenerator(double launchTimeoutMillis, double renderTimeoutMillis) {
this.launchTimeoutMillis = launchTimeoutMillis;
this.renderTimeoutMillis = renderTimeoutMillis;
}
Keep this line in generate(String htmlContent) unchanged, so java.util.Objects remains required:
Objects.requireNonNull(htmlContent, "htmlContent");
Run:
mvn -pl abilities/exam-sprint/infrastructure -am -Dtest=PlaywrightExamSprintReportPdfGeneratorTest test
Expected: the test compiles and passes, assuming local Playwright Chromium is installed and available.
Files:
abilities/exam-sprint/infrastructure/src/main/resources/fonts/MiSans-VF.ttfabilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/BundledOutlookReportFonts.javaDelete: abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/BundledOutlookReportFontsTest.java
[ ] Step 1: Delete the classpath font resource
Delete:
abilities/exam-sprint/infrastructure/src/main/resources/fonts/MiSans-VF.ttf
Delete:
abilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/BundledOutlookReportFonts.java
Delete:
abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/BundledOutlookReportFontsTest.java
Run:
rg "BundledOutlookReportFonts|/fonts/MiSans-VF.ttf|src/main/resources/fonts/MiSans-VF.ttf" abilities/exam-sprint/infrastructure
Expected: no matches.
Files:
Modify: docs/superpowers/plans/2026-05-07-playwright-pdf-generator.md
[ ] Step 1: Replace the stale bundled-font bullet
In docs/superpowers/plans/2026-05-07-playwright-pdf-generator.md, replace this line:
- Injects bundled MiSans as `MiSans`, `MiSans VF`, and `ReportFont` through a `file:` URL `@font-face` block when the bundled font is available.
with:
- Relies on the runtime Docker image installing MiSans as a system font so Chromium can resolve the report font stack (`'MiSans VF', MiSans, ReportFont, sans-serif`).
Run:
rg "bundled MiSans|@font-face|/fonts/MiSans-VF.ttf|BundledOutlookReportFonts" docs/superpowers/plans/2026-05-07-playwright-pdf-generator.md
Expected: no matches.
Files:
No source file changes.
[ ] Step 1: Run targeted infrastructure tests
Run:
mvn -pl abilities/exam-sprint/infrastructure -am -Dtest=PlaywrightExamSprintReportPdfGeneratorTest test
Expected: build exits with code 0 and PlaywrightExamSprintReportPdfGeneratorTest passes.
Run:
mvn -pl abilities/exam-sprint/infrastructure -am -Dtest='*Report*Test,*Pdf*Test' test
Expected: build exits with code 0. If Playwright Chromium is missing locally, install it with the existing project command before rerunning:
mvn -pl abilities/exam-sprint/infrastructure exec:java -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install chromium"
Run:
rg "MiSans-VF.ttf|fc-match \"MiSans VF\"" deploy/ability-center/runtime
Expected: matches remain in deploy/ability-center/runtime/dockerfile and the only remaining source font file is deploy/ability-center/runtime/fonts/MiSans-VF.ttf.
Run:
git diff --stat && git diff -- abilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGenerator.java abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGeneratorTest.java docs/superpowers/plans/2026-05-07-playwright-pdf-generator.md
Expected: diff only removes bundled font artifacts, simplifies the Playwright generator constructor, updates the related test call, and fixes stale documentation.
TBD, TODO, or undefined implementation instructions remain.PlaywrightExamSprintReportPdfGenerator(double, double), which Task 1 defines as a package-private constructor matching the current test package.