Skip to content

chore(api): add class-level @since to public entry points + coverage guard (H1)#89

Merged
DemchaAV merged 1 commit into
developfrom
chore/since-tags-public-api
May 31, 2026
Merged

chore(api): add class-level @since to public entry points + coverage guard (H1)#89
DemchaAV merged 1 commit into
developfrom
chore/since-tags-public-api

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Summary

Wires up Track H1 from the v1.6.5→1.7 readiness taskboard. The G3 stability policy (#88) pins what @since is supposed to mean; this PR makes it true on the canonical entry-point surface.

26 public types in the canonical user-reached packages now carry class-level @since 1.0.0 Javadoc tags so callers see the introduction version at IDE quick-doc / generated Javadoc time without trawling CHANGELOG history. A new architecture guard fails the build if a future public top-level type lands in these packages without a class-level @since.

What changes

@since 1.0.0 added (class-level Javadoc)

Package Types tagged
com.demcha.compose GraphCompose
com.demcha.compose.document.api DocumentSession, DocumentPageSize, PageBackgroundFill
com.demcha.compose.document.dsl DocumentDsl, RichText, Transformable + 19 builders (AbstractFlowBuilder, BarcodeBuilder, CanvasLayerBuilder, DividerBuilder, EllipseBuilder, ImageBuilder, LayerStackBuilder, LineBuilder, ListBuilder, ModuleBuilder, PageBreakBuilder, PageFlowBuilder, ParagraphBuilder, RowBuilder, SectionBuilder, ShapeBuilder, ShapeContainerBuilder, SpacerBuilder, TableBuilder)

Total: 26 files.

Baseline choice — why @since 1.0.0

These are foundational types that have shipped since the first GraphCompose release and predate the CHANGELOG history that could pin a more specific version. The pragmatic baseline communicates "this is in the API from the beginning"; new public types added in subsequent PRs use the upcoming release version (e.g. @since 1.6.6).

New guard — PublicApiSinceTagCoverageTest

Source-scans three entry-point roots:

  • src/main/java/com/demcha/compose/GraphCompose.java
  • src/main/java/com/demcha/compose/document/api/
  • src/main/java/com/demcha/compose/document/dsl/

Fails the build if a .java file declares a public top-level type (class / interface / record / enum / annotation) and @since does not appear in the source above the first such declaration. package-info.java and files in internal/ sub-packages are excluded by convention — InternalAnnotationCoverageTest already covers @Internal packages and the same naming rule applies to internal/ sub-packages.

Why this scope, not a full sweep

  • Method-level backfill for the ~380 public methods in these packages is intentionally out of scope. Method @since is now policy for all new public methods (the graphcompose-senior-review skill enforces it in Lane 5's Javadoc checklist) but retrofitting the existing surface is its own task — and one that benefits from per-method git archaeology that an automated sed pass can't safely do.
  • Other public packages (document.node, document.style, the template surfaces) are not scanned. The taskboard scopes H1 to the entry-point surface — GraphCompose factory, the document.api session / builder seam, and the document.dsl authoring builders. A broader sweep follows the same pattern when it lands.

Verification

$ ./mvnw -B -ntp test -pl . -Dtest=PublicApiSinceTagCoverageTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

Mentally reverting any single @since line goes red — confirmed by sed-removing one tag in RowBuilder.java and re-running the guard (then restoring it).

$ ./mvnw -B -ntp test -pl .
Tests run: 1024 (+1 from PublicApiSinceTagCoverageTest), Failures: 0, Errors: 0

Full suite green confirms the bulk Javadoc edits didn't break Javadoc parsing or unrelated tests.

CHANGELOG entry added to v1.6.6 — Planned under the existing ### Build subsection.

Test plan

  • New guard green against current state
  • Full suite green (1024 / 0 / 0)
  • All 19 builders + 7 non-builder entry points carry class-level @since 1.0.0
  • CI green on PR
  • Reviewer skim — most edits are mechanical (the sed-generated @since 1.0.0 line); the guard test itself (~95 LOC) is where the human review pays off
  • (Out of scope) follow-up: method-level @since backfill — separate PR, separate cadence; the guard does not enforce method-level today

…guard (H1)

Wires up Track H1 from the v1.6.5→1.7 readiness taskboard. 26 public
types in the canonical user-reached packages now carry class-level
@SInCE 1.0.0 Javadoc tags so callers see the introduction version at
IDE quick-doc / generated Javadoc time without trawling CHANGELOG
history.

Files updated (class-level @SInCE 1.0.0):

  com.demcha.compose.GraphCompose
  com.demcha.compose.document.api.DocumentSession
  com.demcha.compose.document.api.DocumentPageSize
  com.demcha.compose.document.api.PageBackgroundFill
  com.demcha.compose.document.dsl.DocumentDsl
  com.demcha.compose.document.dsl.RichText
  com.demcha.compose.document.dsl.Transformable
  com.demcha.compose.document.dsl.{19 *Builder.java}

Baseline @SInCE 1.0.0 is the pragmatic choice: these are foundational
types that have shipped since the first GraphCompose release and
predate the CHANGELOG history that could pin a more specific version.
New public types added in subsequent PRs should use the upcoming
release version (e.g. @SInCE 1.6.6).

New guard: PublicApiSinceTagCoverageTest source-scans the three
entry-point roots (GraphCompose.java, document.api/, document.dsl/)
and fails the build if a new public top-level type lands without a
class-level @SInCE tag. internal/ sub-packages are excluded by
convention — InternalAnnotationCoverageTest covers those.

Method-level @SInCE backfill for the ~380 public methods in these
packages is intentionally out of scope; method @SInCE is now policy
for ALL new public methods (the senior-review skill enforces this on
new code) but retrofitting the existing surface is its own task.

Verification:
- ./mvnw -B -ntp test -pl . -Dtest=PublicApiSinceTagCoverageTest
  -> 1 test, 0 failures (guard green against current state)
- ./mvnw -B -ntp test -pl .
  -> full suite green, no regression from the bulk Javadoc edits

CHANGELOG entry added to v1.6.6 — Planned ### Build section.
@DemchaAV DemchaAV merged commit e28b562 into develop May 31, 2026
10 checks passed
@DemchaAV DemchaAV deleted the chore/since-tags-public-api branch May 31, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant