This is the canonical release runbook for GraphCompose 1.x.
- JitPack —
com.github.DemchaAV:GraphCompose:v<version>(current) - Maven Central —
io.github.demchaav:graphcompose:<version>(planned, v1.7+)
The release workflow is automated by scripts/cut-release.ps1. The script must run from the develop branch with a clean working tree. The agent (Claude / Codex) must complete every audit gate below before a release tag is cut, and must wait for explicit human approval ("yes, cut the tag" / "делаем тег") before invoking the script.
Agent contract: audit and pre-release fixes are local-only by default. The script is the only step that mutates remotes (push develop, push tag). Never tag, push tags, or merge to
mainwithout an explicit go-signal in the chat.
Run this every time, in order. Stop on the first red gate and fix it before continuing.
The shell setup and exact PowerShell commands live in the graphcompose-release-engineer skill (loaded via Skill tool). On Git Bash use ./mvnw instead of .\mvnw.cmd; the gates are identical.
- On
developbranch (or in adevelopworktree). Never tag frommain. -
git status --shortis clean. No??zero-byte stragglers ({,,0),[Help, etc.). Verify any leftover withwc -c <file>before deleting. -
git log origin/develop..origin/main --onelineis empty. If not, mergeorigin/mainintodevelopand resolve conflicts before proceeding (a hotfix onmainblocks the fast-forward at script Step 8). -
git rev-parse develop origin/developreturns identical SHAs (script enforces this in pre-flight).
-
./mvnw -B -ntp -q clean verify -pl .exits 0. Every test must pass — no skips, no flake retries. ConfirmTests run: <N>, Failures: 0, Errors: 0, Skipped: 0fromtarget/surefire-reports/*.txt. - Examples module compiles cleanly:
./mvnw -B -ntp -q -f examples/pom.xml clean compileexits 0. Catchesdouble → floatlossy narrowing and similar bugs that don't surface in the root module. - All examples regenerate:
./mvnw -B -ntp -q -f examples/pom.xml exec:java -Dexec.mainClass=com.demcha.examples.GenerateAllExamplesproduces 26+Generated:lines, exits 0, and emits noFixed column ... is smaller than required natural widthorSpanned cell ... requires extra widtherrors. (Requires./mvnw install -DskipTests -pl .once first so the local~/.m2resolves the current SNAPSHOT/beta version.) - Architecture-guard suite explicitly green:
./mvnw -B -ntp test -pl . -Dtest='CanonicalSurfaceGuardTest,DocumentationCoverageTest,DocumentationExamplesTest,InternalAnnotationCoverageTest,PublicApiNoEngineLeakTest,SemanticLayerNoPdfBoxDependencyTest'exits 0. These guard against legacy-API leakage in docs and engine internals leaking into the public surface — they fail loudly when README/CHANGELOG drift from the canonical authoring surface.
-
CHANGELOG.mdhas a## v<target> — Plannedheader at the top. The script flipsPlanned→ today's date during release execution; if the header is missing or already dated, the script silently skips and the release ships with the wrong header. - CHANGELOG
v<target>section: every linked file resolves on disk. Common offenders: newdocs/adr/00XX-*.md,docs/migration-v1-N-to-v1-M.md, recipe pages. -
README.mdtest-count claim matches the actual surefire total (grep -E '[0-9]+ green tests' README.mdvs the surefire aggregate). -
README.mdinstall snippets stay pinned to the previously published tag (e.g.v1.5.1) with explanatory prose like "stay pinned tov1.X.Yuntilv<target>ships on JitPack". This is intentional — flipping tov<target>before the tag exists breaks JitPack for any user copying the snippet in the publish window. The README install flip happens post-release, after JitPackBUILD SUCCESSconfirms the new version resolves (see section 4.B). -
README.mdandexamples/README.mdlink audits resolve: every(./...)and(../...)link must exist on disk. Usegrep -oE '\(\.?\.?/[^)]+\.(md|java|png|pdf|jpg)\)' README.md examples/README.md | sed 's/^(//;s/)$//' | sort -u | xargs -I{} test -e {} || echo MISSING: {}. -
examples/README.mdgallery row count matches the file count:find examples/src/main/java -name '*Example.java' | wc -lequalsgrep -c '^| \[' examples/README.md. - For minor releases (
vX.Y.0):docs/migration-v1-<Y-1>-to-v1-<Y>.mdexists. Patch releases skip this.
The script's Step 1–4 mutates these. The agent only confirms the current state is one the script can transition from:
- Root
pom.xml,examples/pom.xml,benchmarks/pom.xml<version>is the in-flight value (e.g.1.6.0-beta.1) or already at the target. Anything else (e.g. a stale1.5.1-SNAPSHOT) means the develop line never bumped — fix manually before running the script. -
examples/src/main/java/com/demcha/examples/support/ShowcaseMetadata.javaGH_BASEpoints to/blob/develop. The script flips it to/blob/v<target>and regeneratesdocs/examples.json.
-
git tag -l v<target>andgit ls-remote --tags origin v<target>both return empty. The script enforces this; if a stale tag remains from a failed previous attempt, delete it intentionally (git tag -d v<target>+git push origin :refs/tags/v<target>) only with explicit user approval.
Running pwsh ./scripts/cut-release.ps1 -Version <X.Y.Z> performs:
- Pre-flight — re-checks all of A above (branch, clean tree, in-sync, no existing tag).
- Bump POM versions in
pom.xml,examples/pom.xml,benchmarks/pom.xmlto<X.Y.Z>. - Date the CHANGELOG — flips
## v<X.Y.Z> — Plannedto## v<X.Y.Z> — <today-ISO>. - Switch ShowcaseMetadata GH_BASE from
/blob/developto/blob/v<X.Y.Z>and regeneratedocs/examples.json. mvnw verify -pl .— full sanity build (skip with-SkipVerifyonly if you just ran it).- Commit as
Release v<X.Y.Z>. Files committed: 3 POMs + CHANGELOG + ShowcaseMetadata.java + docs/examples.json. Nothing else. README install snippets, examples/README.md, and any other docs are NOT touched by the script. - Annotated tag
v<X.Y.Z>(git tag -a -m "Release v<X.Y.Z>"). - Push
developand the tag toorigin(skip with-SkipPush).
The script supports -DryRun (preview every step), -SkipPush (commit + tag locally only), and -PostReleaseOnly (skip release work entirely, only flip GH_BASE back to /blob/develop and push).
The script does not handle these. They are either pre-release or post-release responsibilities:
- Stale documentation claims — examples count, gallery descriptors, version-anchored prose. Fix in a
docs: pre-release fixes — <what>commit on develop, then commit, then push (or stage and let the user push). - CHANGELOG
## v<target> — Plannedheader — must exist before the script runs. If you bumped scope mid-cycle, ensure the planned header is still on the right version line. - Missing migration guide for minor releases — write
docs/migration-v1-<prev>-to-v1-<target>.mdif absent. InternalAnnotationCoverageTestand other guard tests — fix any failures by adjusting the source (annotation propagation, doc rewording), never by suppressing the test or extending the allowlist. Allowlist edits are reviewable evidence of an architecture decision; write or update an ADR before suppressing.
Run within 1 hour of the tag push. Independent steps can run in parallel.
- Wait for JitPack
BUILD SUCCESS—https://jitpack.io/com/github/DemchaAV/GraphCompose/v<target>/build.logends inBUILD SUCCESS. Then: - Flip README install snippets to
v<target>in a separate commit. The same commit removes the "stay pinned tov<prev>untilv<target>ships on JitPack" defensive prose. Suggested commit message:docs: README install snippets — v<target> is now on JitPack. - Merge
develop→mainon GitHub so GitHub Pages picks up the new docs. Fast-forward only — never force-pushmain. If the push is rejected withnon-fast-forward, a hotfix landed onmainafter the audit and the merge has to be redone after mergingorigin/mainback intodevelop. - Verify CI green on main —
gh run list --branch main --limit 1showssuccessfor the tag commit. - Smoke-test the JitPack snippet — minimal POM in
$env:TEMP,mvn dependency:resolveagainst the snippet copy-pasted from README, expect 0 exit. - Re-run all examples against the published artifact —
./mvnw -f examples/pom.xml clean packagefollowed byexec:java -Dexec.mainClass=com.demcha.examples.GenerateAllExamples. Expect 26+Generated:lines. - Flip ShowcaseMetadata back to develop —
pwsh ./scripts/cut-release.ps1 -PostReleaseOnly. This restores linkable "View Code" buttons for ongoing v1.x.y dev work. - Create the GitHub Release —
gh release create v<target> --title "GraphCompose v<target> — <codename> release" --notes-file <CHANGELOG section>. Codename pattern:v1.4=cinematic,v1.5=intuitive,v1.6=expressive. Patch releases drop the codename. Disable "Generated release notes" — we author the body by hand from CHANGELOG. - Optional: GitHub Discussions announcement (mirror the prior release's style; close with "author intent, not coordinates"), LinkedIn post, r/java post.
The release is done only when steps 1–7 are all green.
The published jar is final. Never force-move a tag that JitPack has already built — JitPack caches by tag SHA and won't rebuild. Always fix forward with a vX.Y.Z+1 patch tag.
- Diagnose:
gh run view <run-id> --log-failed. TheTests run: <N>, Failures: <F>line is the source of truth, not the trace excerpt in the Actions UI annotation. - Fix the test or doc, not the published artifact.
- Commit + push to
develop, fast-forward tomain. - If the bug is in shipped runtime code (rare), publish a
vX.Y.Z+1patch via the full pipeline. Add a CHANGELOG patch entry under the new version header.
| Symptom | Root cause | Fix |
|---|---|---|
DocumentationCoverageTest.readme<X>SectionShouldUseCanonicalDsl red after a README rewrite |
Section-anchored guard pinned to a heading the rewrite removed | Replace with one whole-file scan: readmeShouldUseCanonicalDslAndAvoidLegacyApis |
ShapeContainerVisualRegressionTest (or any visual regression) red on Linux CI only |
Cross-platform PDFBox font drift between Windows-rendered baselines and Linux CI (~1–2 % pixel diff) | Bump mismatchedPixelBudget(0) to ~2_500 (calibrated against observed CI delta) |
Runtime Fixed column 0 width X is smaller than required natural width Y from GenerateAllExamples |
Table cell content's natural width exceeds its fixed column | Reduce font size, reduce padding, or pre-split via DocumentTableCell.lines(parts) so cellNaturalWidth measures the longest single line |
Spanned cell at row N over M fixed columns requires extra width |
Long unbroken text in a colSpan(M) cell over fixed columns |
Same fix — multi-line cells via lines(...) |
incompatible types: possible lossy conversion from double to float on .margin(...) |
DocumentInsets accessor returns double, the float overload narrows |
Switch the call to .margin(layout.margin()) (the DocumentInsets overload) |
GenerateAllExamples dies mid-run on a specific PDF |
Windows file lock from an open viewer | Ask the user to close the viewer; do not retry blindly |
cut-release.ps1 aborts at "Working tree has uncommitted changes" |
Untracked junk (zero-byte {,, 0) etc.) or unstaged pre-release fix |
Verify each is 0 bytes, delete by exact name; never git clean -fd blindly |
Each learning maps to a check above.
- v1.5.0 — README slim from 778 → 151 lines broke 4 section-anchored doc tests in a single push. Mitigation: section B ("Architecture-guard suite explicitly green") runs the guard suite on every release prep regardless of doc edits.
- v1.5.0 — Visual regression baselines were Windows-rendered, CI is Linux. 1.9 % pixel drift exceeded
mismatchedPixelBudget(0). Mitigation: any new visual regression test ships with a non-zero, CI-calibrated budget from the start. - v1.5.0 —
develophad not merged a v1.4.1 hotfix onmain;git push origin develop:mainwas rejected with non-fast-forward mid-release. Mitigation: section A enforcesgit log origin/develop..origin/main --onelineis empty before any tag work. - v1.5.0 — README claimed "the current release is v1.5.0" before the tag existed; install snippets would have failed for any new user landing on the README in that window. Mitigation: section C pins the README install snippet to the previous published tag until JitPack confirms the new tag built; the flip is post-release (section 2.B step 2).
- v1.5.0 —
Fixed column 0 width 90 is smaller than required natural width 92.44only surfaced onexec:java, notmvn test. Mitigation: section B mandates a fullGenerateAllExamplesregen before every release. - v1.5.0 — 8 zero-byte junk files (
examples/p,,{,,[Help, etc.) crept into the working tree from accidental shell-output expansions. Mitigation: section A hard-gates ongit status --shortcleanliness, not just on the script's pre-flight. - v1.6.0 prep — slimming the README to a marketing landing renamed the canonical
DocumentSession document = …example variable todoc, which silently brokeDocumentationCoverageTest.readmeShouldUseCanonicalDslAndAvoidLegacyApisbecause the test asserts the literal stringdocument.pageFlow(is present. Mitigation: any rewrite of the README "Hello world" snippet must keepDocumentSession documentas the variable name anddocument.pageFlow(,document.buildPdf(),GraphCompose.document(as the literal canonical fingerprints the guard scans for. Renaming the variable is a guard-test break, not a stylistic preference. - v1.6.0 post-release — the
examples-generationCI job introduced after v1.6.0 went red on the first run becauseexamples/pom.xmlandbenchmarks/pom.xmldeclare a<graphcompose.version>property used by theirgraphcomposedependency, andcut-release.ps1was only flipping the project's own<version>tag (the first<version>in each file). The subordinate POMs kept<graphcompose.version>1.6.0-beta.1</graphcompose.version>after the release commit; CI couldn't resolve a1.6.0-beta.1artifact (it never existed on any registry), somvnw -f examples/pom.xml clean compilefailed at dependency resolution. Mitigation:Update-PomVersionincut-release.ps1now flips both the first<version>tag and a<graphcompose.version>...</graphcompose.version>property if present, in the same call. Future agents need not touch this — running the script handles both.
- Force-move a tag JitPack has already built — publish a new patch tag instead.
- Skip the
origin/main → developmerge before tagging. - Use
git add .orgit add -A— the develop tree often has accidental untracked junk. Stage by exact filename. - Skip the full
GenerateAllExamplesregen —mvn testdoes not catch runtime layout exceptions in fixed-column tables. - Suppress a guard test or extend its allowlist to make the build green. Fix the source, or write an ADR documenting the carve-out before changing the guard.
- Commit a release with
Co-Authored-By: Claude(or any other tooling-attribution trailer). Releases are authored asDemchaAVonly. - Run
cut-release.ps1without explicit human approval in the chat for the specific version being cut. "Approved last release" does not approve this one.
The release is done when all of these are true:
- Tag visible at
https://github.com/DemchaAV/GraphCompose/releases/tag/v<version> - GitHub Release created with the CHANGELOG
v<version>body - CI green on
mainfor the tag commit - JitPack
build.logends inBUILD SUCCESS -
mvn dependency:resolvesucceeds against the README JitPack snippet - README install snippets flipped to
v<version>and the defensive "pinned until …" prose removed -
developandmainsynced at the same SHA - Working tree clean on develop (
git status --shortempty) -
ShowcaseMetadata.GH_BASEflipped back to/blob/develop(runcut-release.ps1 -PostReleaseOnly)
If any line is unchecked, the release is not done — even if the tag is up.