docs(cursor-rules): fix the two live AI-context contradictions in .cursor/rules/ - #37590
Merged
Merged
Conversation
…rsor/rules/ `.cursor/rules/*.mdc` is the second entry point for AI context, loaded by glob when a matching file is edited. The Rock's M1-M3 audited docs/ and CLAUDE.md but never touched it, so two of the failure modes the Rock exists to stop are still being served to anyone working from Cursor. java-context.mdc claimed `Core: Java 11 syntax. CLI: Java 21 ok. Runtime: Java 21`. CLAUDE.md:68 no longer pins a version at all — it defers to `.sdkmanrc` for the runtime and `dotcms.core.compiler.release` in `parent/pom.xml` for core modules. #37126 fixed this in the docs; the Cursor rule was outside that slice and kept serving Java 11 idioms. Now it points at both properties, and says not to hardcode a version here again. test-context.mdc had no mention of MainSuite/Junit5Suite registration anywhere, while handing out a command for running integration tests. An unregistered test compiles, passes review and is silently never run in CI. That rule has been in CLAUDE.md's Critical Rules since #37127; it now exists in the Cursor rule too, with the real suite names. Also adds scripts/validate-integration-test-registration.sh, which measures the failure mode instead of assuming it stopped: it cross-checks every @SuiteClasses list against the concrete *Test.java classes in dotcms-integration, and reports separately on tests added in a recent window. Current state: 100 classes never run in CI, and 1 of the 28 added in the last 60 days went unregistered. That 1/28 is the baseline the monitoring gate in #37581 measures against. Refs #37577, #37581 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
10 tasks
Contributor
|
Claude finished @fabrizzio-dotCMS's task in 2m 54s —— View job ReviewDocs + tooling only, no production code. I verified the two New Issues
Resolved
Verified
Nice touch reading the suite set from Note: I couldn't execute the script in this environment (permission), so the trace above is by reading, not by run. |
nollymar
reviewed
Sep 17, 2026
…te detection Review feedback from @nollymar and @jcastro-dotcms on PR #37583: the Cursor rule restated suite mechanics that had just changed, and any doc touching integration tests should point at docs/testing/INTEGRATION_TESTS.md instead. #37583 established that the suite to register in is whichever MainSuite* has the shortest current CI runtime, and that the suite set is explicitly not fixed. The rule now gives the consequence (unregistered = silently never run in CI) and defers the choice to the doc, with a line telling the reader not to hardcode suite names here — the same drift the Java-version fix in this PR addresses. Two bugs in the script, found while acting on that feedback: - The suite list was a hardcoded glob of MainSuite*/Junit5Suite*, which missed OpenSearchUpgradeSuite (a real CI suite, 19 classes) and would have counted a future MainSuite3b as nonexistent. It now reads the suite list from .github/test-matrix.yml, which is what CI actually runs — so QuickSuite, which exists in the tree but is not in the matrix, correctly does not count. - Class extraction matched every X.class token in the file, per the bot review. Anchoring it to the @SuiteClasses block then silently dropped all of MainSuite3a, which spells the annotation @Suite.SuiteClasses. Both forms are now matched, and the script aborts if any CI suite yields zero classes rather than reporting its tests as unregistered. Corrected figures: 609 registered, 673 concrete test classes, 87 never run in CI, and 0 of the 28 added in the last 60 days unregistered. The 1-of-28 quoted in the original PR body was an artifact of the missing OpenSearchUpgradeSuite. Refs #37577, #37581 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
nollymar
approved these changes
Sep 17, 2026
fabrizzio-dotCMS
deleted the
issue-37577-cursor-rules-contradictions
branch
September 17, 2026 18:36
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.
What
Fixes the two contradictions still live in
.cursor/rules/, and adds a script that measures whether one of them actually stops recurring..cursor/rules/*.mdcis the second entry point for AI context — Cursor loads a rule automatically when the file you are editing matches itsglobs.java-context.mdcfires on every*.javaandpom.xml;test-context.mdcon every*Test.java. The Rock's M1–M3 (#37126, #37127, #37128) auditeddocs/and rootCLAUDE.mdand left this directory untouched, because it sits in Scout's slice. Result: two of the four failure modes #37124 exists to stop are still being served to anyone working from Cursor.Java version
java-context.mdcstatedCore: Java 11 syntax. CLI: Java 21 ok. Runtime: Java 21.CLAUDE.md:68no longer pins a version at all — it defers to.sdkmanrcfor the runtime,dotcms.core.compiler.releaseinparent/pom.xmlfor core modules, andmaven.compiler.releaseintools/dotcms-cli/pom.xmlfor the CLI. #37126 fixed this in the docs; the Cursor rule kept serving Java 11 idioms. It now points at the properties instead of restating a number, with a line saying not to hardcode one here again — that is what caused the drift.Integration-test registration
MainSuite/Junit5Suiteappeared nowhere under.cursor/rules/, whiletest-context.mdcdid hand out a command for running integration tests. So the rule gave the "how to run" without the "how to make CI run it".An integration test not listed in a
@SuiteClassesarray compiles, passes review, and is silently never run in CI — green build, zero coverage. That has been a Critical Rule inCLAUDE.mdsince #37127, and it is the opening example in #37124's own problem statement.Per review feedback from @nollymar and @jcastro-dotcms, the rule states the consequence and defers the mechanics to
docs/testing/INTEGRATION_TESTS.md, which #37583 rewrote the same day: the suite to pick is whicheverMainSuite*currently has the shortest CI runtime, and the suite set is explicitly not fixed. The rule tells the reader not to hardcode suite names — the same drift the Java fix above addresses.Measuring it
scripts/validate-integration-test-registration.shreads the suite list from.github/test-matrix.yml— what CI actually runs, so a futureMainSuite3bis picked up the day it lands, andQuickSuite(in the tree, not in the matrix) correctly does not count. It extracts the classes in each suite's@SuiteClassesblock, cross-checks against the concrete*Test.javaclasses indotcms-integration, and reports two different things: the standing backlog, and — the part that matters for the gate — the tests added in a recent window.The headline number is 0, and that is worth stating plainly: over the last 60 days, every new integration test was registered. The failure mode this Rock cites is not currently leaking in the flow. What remains is a standing backlog of 87 classes that exist and never run — separate work, not a regression.
An earlier revision of this PR quoted
1 of 28. That was wrong: the script's suite list was a hardcoded glob that missedOpenSearchUpgradeSuite, so a test registered there read as unregistered. Two further bugs were fixed in the same pass — the bot review's point that class extraction matched everyX.classtoken rather than the@SuiteClassesblock, and, once anchored, thatMainSuite3aspells the annotation@Suite.SuiteClassesand was silently dropped entirely. The script now aborts if any CI suite yields zero classes, so that class of error fails loudly instead of inflating the count.Caveat, documented in the script: matching is by simple class name, not fully-qualified. Two same-named classes in different packages, one registered and one not, read as registered. Fine for trending; verify by hand before quoting the number anywhere.
What this means for the gate
#37581's monitoring gate was premised on watching a leak stop. With a measured baseline of 0 leaks in 60 days, the gate's job changes: it confirms the rate stays at 0 now that Cursor users get the rule too, rather than demonstrating a drop. Worth a decision on whether that still warrants the full 1–2 week window.
Testing
Documentation and tooling only — no production code. The script was run against
mainat dfbe40f. Its 87-class backlog figure was reproduced independently, and five entries spot-checked by hand against every*Suite*.javain the module. The two.mdcedits were checked against real source:.sdkmanrc,parent/pom.xml,tools/dotcms-cli/pom.xml,.github/test-matrix.yml, and the suite files underdotcms-integration/src/test/java/com/dotcms/.Refs #37577, #37581
🤖 Generated with Claude Code
This PR fixes: #37577