Skip to content

Commit 9fcb189

Browse files
dfa1claude
andcommitted
build: enforce javadoc references at verify
CLAUDE.md claimed javadoc was "build-enforced: failOnError + failOnWarnings". Neither was configured anywhere and the plugin was not bound to any phase, so nothing ran it. That is how the seven broken references fixed in the previous commit accumulated unnoticed. Binds javadoc-no-fork to verify with failOnError=true, so a dangling [Type#member] link fails the build. verify rather than test, so contributors running ./mvnw test do not pay for it; the whole reactor costs ~3s. Confirmed to bite by pointing StructArray at a non-existent type and watching the build go red. failOnWarnings stays off globally: 313 warnings predate the check (performance 100, reader 82, writer 42, fbs-gen 35, csv 34, parquet 14, cli 6), and gating on them would mean a 313-item cleanup before anything else can merge. core and fsst are already at zero, so their POMs raise failOnWarnings to hold that line — a ratchet other modules can join as they are cleared, rather than one flag day. Confirmed to bite with a probe class carrying an undocumented parameter. CLAUDE.md now describes what is actually enforced, where, and why the two levels differ. It also records that bare `./mvnw javadoc:javadoc` fails on dependency resolution rather than javadoc (no lifecycle phase runs, so reactor jars are absent and install is forbidden), and that a target the module cannot see is an error too — the writer/reader and fbs-gen/core.fbs cases from the previous commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 594338d commit 9fcb189

4 files changed

Lines changed: 71 additions & 3 deletions

File tree

CLAUDE.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,33 @@ single audit found phantom APIs, dead service files, and pre-refactor FQNs acros
289289
Exception: low-level JDK interop taking `long ns` (`Thread.sleep`, `LockSupport.parkNanos`,
290290
`System.nanoTime` math) — convert at the call site via `duration.toNanos()`/`toMillis()`.
291291

292-
### Javadoc (build-enforced: `failOnError` + `failOnWarnings`)
292+
### Javadoc
293+
294+
Run by `javadoc-no-fork` bound to `verify` (~3s across the reactor), so `./mvnw test` skips it
295+
and `./mvnw verify` enforces it. Two enforcement levels:
296+
297+
- **Everywhere: `failOnError`.** A dangling `[Type#member]` reference fails the build. This is
298+
the class of rot that actually accumulates — a refactor renames something and the docs keep
299+
pointing at the old name.
300+
- **`core` and `fsst` only: `failOnWarnings`.** Both are warning-free; their POMs raise the bar
301+
to keep them there. The other modules carry 313 pre-existing warnings (missing `@param`,
302+
undocumented default constructors) — concentrated in `performance`, `reader`, `writer`,
303+
`fbs-gen`, `csv` — so warnings stay non-fatal there until someone clears a module and adds
304+
the same override to its POM.
305+
306+
Style rules (aspirational in the un-ratcheted modules, enforced in `core`/`fsst`):
293307

294308
- Every public method: main prose description, `@param` per parameter, `@return` (unless `void`).
295309
Every public record: `@param` per component on the class doc. `@see`-only counts as no description.
296310
- All `///` Markdown — **no HTML** (checkstyle `RegexpSingleline` blocks `<p>`,`<ul>`,`<li>`,
297311
`<strong>`,`<pre>`,`<table>`, …). Use blank `///` for paragraphs, `- ` lists, ` ```java ``` `,
298312
`**bold**`. Cross-refs `[ClassName#method(ParamType)]` — verify the target exists (wrong refs are
299-
**errors**).
300-
- Check: `./mvnw javadoc:javadoc -pl core` must produce zero output.
313+
**errors**). A target the module cannot see is also an error: writer must not link to reader
314+
types, and `fbs-gen` must not link to the `core.fbs` classes it generates — name those in
315+
backticks instead.
316+
- Ad-hoc check: `./mvnw package -DskipTests javadoc:javadoc -fae`. The bare
317+
`./mvnw javadoc:javadoc` fails on dependency resolution, not javadoc — the goal runs no
318+
lifecycle phase, so the reactor jars do not exist and `install` is forbidden.
301319

302320
### Encoding class structure
303321

core/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@
3535

3636
<build>
3737
<plugins>
38+
<!-- Ratchet: core's javadoc is warning-free today, so keep it that way. The
39+
parent leaves failOnWarnings off because 313 warnings predate the check in
40+
other modules; nothing stops the already-clean ones from holding the line. -->
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-javadoc-plugin</artifactId>
44+
<configuration>
45+
<failOnWarnings>true</failOnWarnings>
46+
</configuration>
47+
</plugin>
3848
<!-- Publish a test-jar so reader/ and writer/ tests can reuse core test
3949
helpers (DTypes, EncodeTestHelper) without duplication. -->
4050
<plugin>

fsst/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,19 @@
2828
<scope>test</scope>
2929
</dependency>
3030
</dependencies>
31+
32+
<build>
33+
<plugins>
34+
<!-- Ratchet: fsst's javadoc is warning-free today, so keep it that way. The
35+
parent leaves failOnWarnings off because 313 warnings predate the check in
36+
other modules; nothing stops the already-clean ones from holding the line. -->
37+
<plugin>
38+
<groupId>org.apache.maven.plugins</groupId>
39+
<artifactId>maven-javadoc-plugin</artifactId>
40+
<configuration>
41+
<failOnWarnings>true</failOnWarnings>
42+
</configuration>
43+
</plugin>
44+
</plugins>
45+
</build>
3146
</project>

pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,28 @@
424424
<version>${maven-javadoc-plugin.version}</version>
425425
<configuration>
426426
<excludePackageNames>io.github.dfa1.vortex.core.fbs:io.github.dfa1.vortex.core.proto</excludePackageNames>
427+
<!-- A dangling [Type#member] reference is a build failure: it means a
428+
refactor renamed or moved something and left the docs pointing at a
429+
type that no longer exists. Four such phantoms accumulated before
430+
this was enforced. Warnings (missing @param, undocumented default
431+
constructors) stay non-fatal for now — 313 of them predate this,
432+
concentrated in performance/reader/writer/fbs-gen/csv. Modules that
433+
are already warning-free raise failOnWarnings in their own POM to
434+
stop the count creeping back up. -->
435+
<failOnError>true</failOnError>
436+
<failOnWarnings>false</failOnWarnings>
427437
</configuration>
438+
<executions>
439+
<execution>
440+
<!-- verify, not test: contributors running ./mvnw test skip it, CI does not.
441+
Costs ~3s across the whole reactor. -->
442+
<id>check-javadoc</id>
443+
<phase>verify</phase>
444+
<goals>
445+
<goal>javadoc-no-fork</goal>
446+
</goals>
447+
</execution>
448+
</executions>
428449
</plugin>
429450
<plugin>
430451
<groupId>org.apache.maven.plugins</groupId>
@@ -474,6 +495,10 @@
474495
<groupId>org.apache.maven.plugins</groupId>
475496
<artifactId>maven-checkstyle-plugin</artifactId>
476497
</plugin>
498+
<plugin>
499+
<groupId>org.apache.maven.plugins</groupId>
500+
<artifactId>maven-javadoc-plugin</artifactId>
501+
</plugin>
477502
<plugin>
478503
<groupId>org.apache.maven.plugins</groupId>
479504
<artifactId>maven-dependency-plugin</artifactId>

0 commit comments

Comments
 (0)