Repository navigation
Ship the API reference inside the jar so offline agents stop decompiling - #177
Merged
Merged
Conversation
Agents working offline decompiled the jar to discover the API, because every agent-facing doc was behind an HTTP fetch. A dependency resolve puts only the jar and the pom in ~/.m2 — no sources jar, no classifier — so the main jar is the only channel that always arrives. - Copy api-reference.md and agent-api-reference.md into the jar under META-INF/dramafinder/, next to a new hand-written START-HERE.md (test skeleton, tag-to-wrapper rule, the three common traps). They stay generated into skills/, so there is still one source of truth. - Name all three in the manifest, and point at them from the pom description — the two files an offline reader always has. - Cover AbstractBasePlaywrightIT and HasTestView in the reference. They were in no generated doc at all, which is what sent agents to `javap -c` to work out how to obtain a Page. - Add CellElement.getText()/assertText(). getLocator() returns the grid, not the cell, and that trap cost a compile round-trip. - Document the offline `unzip -p` fallback in llms.txt, AGENTS.md, GEMINI.md, README.md and both SKILL.md files. DocumentationBundledInJarTest guards the bundling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #176.
Agents working offline decompiled the DramaFinder jar to discover its API, because every agent-facing doc was behind an HTTP fetch. A dependency resolve puts only the jar and the pom in
~/.m2— no sources jar, no classifier — so the main jar is the only channel that always arrives.What ships in the jar now
Verified on a clean
package:META-INF/dramafinder/START-HERE.mdMETA-INF/dramafinder/api-reference.mdMETA-INF/dramafinder/agent-api-reference.md22 KB compressed, on a 177 KB jar. Discovery is now two commands:
The two references stay generated into
skills/— the copy that travels with the Claude Code plugin — and are copied from there bymaven-resources-plugin, so there is one source of truth and no 110 KB duplicate committed to git.START-HERE.mdis hand-written insrc/main/resourcesand deliberately contains nothing that can drift: a working test skeleton, the tag-to-wrapper naming rule, grep recipes for navigating the full reference, and the three things that are easy to get wrong.The gap that mattered most
AbstractBasePlaywrightITandHasTestViewappeared in no generated doc —generate-api-reference.javaonly walkedelement/. That is what sent the agent in the trial tojavap -con bytecode to work out how to obtain aPage.The reference now opens with a Test setup section: a working
@SpringBootTest(RANDOM_PORT)skeleton, then both types rendered from source. The renderer gained anincludeProtectedmode for this, sincepage,getPage()andisHeadless()are the API a subclass actually writes against and the public-only renderer dropped them.Also in here
CellElement.getText()/assertText(String).getLocator()returns the grid, not the cell; the rendered text lives behindgetCellContentLocator(). That trap cost a compile round-trip in the trial. Covered by two new tests inGridBasicViewIT.unzip -p <jar> META-INF/MANIFEST.MFalso leads to them.<description>in the pom points at the bundled docs — the pom is the only other file an offline reader always has, and the trial shows agentscatit.unzip -pfallback documented inllms.txt,AGENTS.md,GEMINI.md,README.mdand bothSKILL.mdfiles. Every one of them previously assumed an HTTP fetch would succeed.src/main/java/org/vaadin/addons/dramafinder/*.java, so CI regenerates the reference when the setup API changes.WAIT_FOR_VAADIN_SCRIPTis a page of JavaScript;DateTimeFormatter ISO_LOCAL_DATE_TIMEwas already a builder chain that told the reader nothing.DocumentationBundledInJarTestfails if any of the three stops being bundled, or if the reference loses its test-setup or element-index section.Verification
mvn -o clean test— 8 tests pass (the 3 new ones included; the "0" surefire prints for the class is this repo's parallel-class reporting quirk,-Djunit.jupiter.execution.parallel.enabled=falseshows 3 + 5 = 8).mvn -Pit verify -Dit.test=GridBasicViewIT— 38 pass, includingtestCellGetTextandtestCellAssertText.package, then extracted### GridElementstraight out of the jar with oneunzip -p.Not in scope
The factory-uniformity sweep from the issue's item 4. Adding
get(Page)/getByIdacross 55 wrappers needs a per-element judgment call and changes the public API surface — worth its own PR. The narrow, concrete part of that item (theCellElementnaming trap) is done here.Unrelated, spotted while testing:
mvn -PitbakesMETA-INF/VAADIN/**intotarget/classes, so a-Pit packageproduces a 6.8 MB jar instead of 177 KB.release-build.ymlrunsmvn -Prelease deploywithoutit, so releases are unaffected — but the two profiles must never be combined.🤖 Generated with Claude Code