Skip to content

fix(docs): correct contradictions and fabricated APIs in backend AI-context docs - #37258

Open
jcastro-dotcms wants to merge 19 commits into
mainfrom
issue-37126-fix-backend-contradictions
Open

fix(docs): correct contradictions and fabricated APIs in backend AI-context docs#37258
jcastro-dotcms wants to merge 19 commits into
mainfrom
issue-37126-fix-backend-contradictions

Conversation

@jcastro-dotcms

@jcastro-dotcms jcastro-dotcms commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Fixes M1 of the Backend AI-Context Rock (#37124) — contradictions, fabricated APIs, and stale references across Jose's slice of the backend AI context (docs/backend/, docs/infrastructure/, a 4-file docs/core/ slice, root CLAUDE.md). Closes acceptance criteria on #37126.

Why this matters: these docs are read by AI coding assistants (and humans) as ground truth. Several of them were citing APIs, endpoints, config properties, and infrastructure details that don't exist — meaning AI-generated code following this guidance would not compile, or a human following the setup steps would hit dead ends.

What changed, by category

Java/Angular version driftCLAUDE.md said Java 25; JAVA_STANDARDS.md, JAVA_STANDARDS_FOCUSED.md, ARCHITECTURE_OVERVIEW.md, CODE_STRUCTURE.md, and DOCKER_BUILD_PROCESS.md still said Java 21/11, and had the CLI's actual target (11, the most conservative in the repo) backwards as if it got newer features. All five fixed. Per a team decision made mid-fix, version numbers are no longer hardcoded — they now point to the real source (.sdkmanrc, parent/pom.xml, tools/dotcms-cli/pom.xml, core-web/package.json) so this can't silently go stale again.

Fabricated APIs that would not compile:

  • securityAPI.hasPermission(...) / permissionAPI.hasPermission(...) (doesn't exist, 6 occurrences across REST_API_PATTERNS.md and SECURITY_BACKEND.md) → real permissionAPI.doesUserHavePermission(...)
  • HealthCheckLocator.registerHealthCheck(...) / .getAllHealthChecks() (doesn't exist) → real CDI auto-discovery via HealthCheckRegistry/HealthCheckProvider/HealthService
  • HealthStatus.HEALTHY/UNHEALTHY (don't exist) → real UP/DOWN (DEGRADED/UNKNOWN also noted)
  • @Component, @Scheduled (Spring — not used anywhere in this codebase) → @ApplicationScoped (CDI) and a note explaining why
  • A fake Elasticsearch client (ESClient, ClusterHealthResponse, ClusterHealthStatus) → the real, verified APILocator.getESIndexAPI().getClusterStats() call
  • org.springframework.web.util.HtmlUtils / SecurityUtils.sanitizeInput(...) (both fabricated) → real com.liferay.util.Xss.encodeForHTML(...)
  • ResponseUtil documented in the wrong package in 3 files → real com.dotcms.rest.api.v1.authentication.ResponseUtil
  • "Spring/CDI" claimed as the DI mechanism in 2 files → corrected to CDI only (zero Spring usage anywhere in this codebase, verified against every pom.xml and all of dotCMS/src/main/java)

Infrastructure/build details that didn't match reality:

  • docker-maven-plugin and cargo-maven3-plugin versions were stale (now reference the real ${version.*} properties instead of hardcoded literals)
  • A fabricated apt-get install openjdk-11 step, a fake Dockerfile stage name/ARG, and a fake standalone ./dev-run script — all replaced with what's actually in the real Dockerfile/justfile
  • A genuine self-contradiction on the JVM debug port, now resolved with evidence: debug.port defaults to 5005 in parent/pom.xml (confirmed live in 4 profile configs) for the Maven docker-start,debug workflow; 8000 is a separate, also-real port the base Dockerfile exposes for CMS_JAVA_OPTS-based debugging on a directly-run image. Both are correct for different workflows — a callout in the doc now explains this so it doesn't get "corrected" backwards again
  • Wrong Postgres image (ankane/pgvector → real pgvector/pgvector:pg18)
  • just build-no-docker's description/timing didn't match its real recipe (it's a full clean install, not the fast core-only build shown next to it)
  • Wrong Kubernetes health-probe endpoints (localhost:8080/livez etc. → real is localhost:8090/dotmgt/livez, served on the separate management port) and six fabricated health.* config property names → real health.check.{name}.{property} convention

Other doc-quality fixes:

  • A broken anchor link in JAVA_STANDARDS.md
  • A flagged, unreliable Maven command now uses --am
  • A self-contradicting property-naming rule in CONFIGURATION_PATTERNS.md now states its own exception
  • A wrong compose service name (opensearch-provision → real opensearch3-provision) in the OpenSearch migration test plan's limited-user section

Explicitly NOT included in this PR

OPENSEARCH_MIGRATION_TEST_PLAN.md and OPENSEARCH_MIGRATION_TESTER_GUIDE.md have a separate, unrelated inconsistency (conflicting assumptions about which OpenSearch test stack is the default) that spans a cross-team infra decision, not a straightforward doc fix. That's being handled separately by Fabrizzio / Team Scout in #37292. This PR only includes the small, already-verified fix to the limited-user section's file path and service name (see above) — nothing else in those two files is touched here.

How this was verified

Every fix here was checked against real source — not just internal doc consistency — including a fully independent pass with no prior context on what was "supposedly" fixed, which caught several issues the first pass missed (see full evidence trail in #37125 and #37126).

Test plan

  • Every fabricated class/method/property name replaced verified to exist in real source with the exact signature shown
  • Every version number pointer verified against its real source file
  • Every file path / anchor link verified to resolve
  • Independent fresh-eyes verification pass completed, findings fixed
  • Post-merge: monitor real PRs / AI-review output through Sep 8 for the Java-version and fabricated-API failure modes (per M1 — Fix backend contradictions #37126)

Closes acceptance criteria on #37126. Part of #37124.

This PR fixes: #37126

Core modules compile to Java 25, not 21/11; tools/dotcms-cli targets
Java 11 (the conservative target), not "Java 21 features". Swapped
the two syntax-example sections to match reality.

Issue #37126
Same header fix as JAVA_STANDARDS.md — Java 25 for core modules,
Java 11 correctly framed as the CLI's conservative target.

Issue #37126
Backend compiles to Java 25, not "Java 21 runtime with Java 11
bytecode compatibility". Also fixed the CLI directory annotation,
which had the same backwards claim.

Issue #37126
Same fix as ARCHITECTURE_OVERVIEW.md — backend compiles to Java 25,
CLI targets Java 11 (the conservative target, not an exception for
newer syntax).

Issue #37126
…CESS.md

Troubleshooting note said Java 21; dotCMS runs on Java 25 per .sdkmanrc.

Issue #37126
…PI_PATTERNS.md

securityAPI.hasPermission(...) doesn't exist (3 occurrences) — replaced
with the real permissionAPI.doesUserHavePermission(...). HTMLUtils
(Spring, not present in this codebase) replaced with the real
Xss.encodeForHTML(...).

Issue #37126
permissionAPI.hasPermission(...) doesn't exist (3 call sites) —
replaced with the real doesUserHavePermission(Permissionable, int,
User) signature, verified against PermissionAPI.java's real
PERMISSION_READ/EDIT/EDIT_PERMISSIONS constants.

Issue #37126
…_PATTERNS.md

The anti-pattern rule against uppercase properties contradicted its own
cluster-config example. Now states the exception explicitly for
dotcms-config-cluster.properties and the OpenSearch config docs.

Issue #37126
…ITORING.md

HealthCheckLocator (registration + query) doesn't exist — replaced with
the real CDI auto-discovery pattern via HealthCheckRegistry/HealthCheckProvider,
and real HealthService for querying/aggregation. HealthStatus.HEALTHY/UNHEALTHY
don't exist — replaced with the real UP/DOWN values (DEGRADED/UNKNOWN also
noted). @component and @scheduled are Spring annotations not used anywhere in
this codebase — replaced with @ApplicationScoped and a note that dotCMS
doesn't use Spring scheduling. The Elasticsearch example's ESClient/
ClusterHealthResponse/ClusterHealthStatus were fabricated — replaced with the
verified real APILocator.getESIndexAPI().getClusterStats() call.

Also found during final verification: the Kubernetes probe/detailed-health
endpoints were documented on the wrong port/path entirely (localhost:8080/livez
etc. — real is localhost:8090/dotmgt/livez, served by HealthProbeServlet on
the separate management port); six health.* property names were fabricated
(real convention is health.check.{name}.{property}); log level list was
missing ALL.

Issue #37126
…, and fake health properties in JAVA_STANDARDS.md

Per team decision: replace hardcoded Java version numbers with pointers to
the real source (.sdkmanrc, parent/pom.xml's dotcms.core.compiler.release,
tools/dotcms-cli/pom.xml's maven.compiler.release) so this doesn't go stale
again the way it just did.

Also: the fast-iteration Maven command was missing --am, which CLAUDE.md
flags as able to fail on missing in-project deps — added it. Fixed a broken
anchor link to REST_API_PATTERNS.md (real header slug is
#view-object-pattern-java-records, not #view-object-pattern-valueimmutable).
Replaced two fabricated health.* property names (found during final
verification) with the real health.check.{name}.{property} convention.

Issue #37126
… JAVA_STANDARDS_FOCUSED.md

Same fixes as JAVA_STANDARDS.md: version numbers now point to the real
source instead of hardcoded literals, and the two fabricated health.*
property names are corrected to the real convention.

Issue #37126
…ENSEARCH_MIGRATION_TEST_PLAN.md

The "limited-user stack" section pointed at a docker-compose.limited-user.yml
file that doesn't exist — every credential/port/script detail in that section
already matched the real single-node-os-migration/docker-compose.yml exactly,
so this was a wrong filename, not a missing file. Also fixed the provisioning
service name (real is opensearch3-provision, not opensearch-provision),
found during final verification.

Scope note: this fixes only the limited-user section (3 of 7 originally
flagged path occurrences). The other 4 occurrences, plus this file's
"ES 7.10 + Kibana" framing more broadly, are blocked on a cross-team
decision — see issue comments.

Issue #37126
Found during final verification: doc said com.dotcms.rest.ResponseUtil;
the real class is at com.dotcms.rest.api.v1.authentication.ResponseUtil.
Would not have compiled as written.

Issue #37126
…ponseUtil package in REST_API_PATTERNS_FOCUSED.md

SecurityUtils.sanitizeInput(...) doesn't exist on either SecurityUtils class
in the codebase — replaced with the real Xss.encodeForHTML(...). Also fixed
ResponseUtil's package (real is com.dotcms.rest.api.v1.authentication.ResponseUtil),
found during final verification.

This file's permission-check example was already correct before this fix —
it's the one place in the audited docs that had doesUserHavePermission(...)
right from the start.

Issue #37126
…age in SECURITY_BACKEND.md

org.springframework.web.util.HtmlUtils doesn't exist in this codebase (zero
Spring dependencies anywhere) — replaced with the real com.liferay.util.Xss.
encodeForHTML(...). Also fixed ResponseUtil's package (real is
com.dotcms.rest.api.v1.authentication.ResponseUtil), found during final
verification.

Issue #37126
…m in ARCHITECTURE_OVERVIEW.md

Per team decision: Java/Angular versions now point to the real source
(.sdkmanrc, parent/pom.xml, tools/dotcms-cli/pom.xml, core-web/package.json)
instead of hardcoded literals.

Also found during final verification: "Spring/CDI" for backend DI — verified
zero Spring usage anywhere in this codebase (source + all poms). Corrected
to CDI only, matching this same fix set's HEALTH_MONITORING.md.

Issue #37126
…m in CODE_STRUCTURE.md

Same fixes as ARCHITECTURE_OVERVIEW.md: Java/Angular versions now point to
the real source instead of hardcoded literals, and the two fabricated
"Spring/CDI" mentions are corrected to CDI only (zero Spring usage verified
anywhere in this codebase).

Issue #37126
…rt, and more in DOCKER_BUILD_PROCESS.md

- docker-maven-plugin and cargo-maven3-plugin versions now reference the
  real ${version.*} properties instead of stale hardcoded literals
  (0.43.4 -> 0.48.0, 1.10.6 -> 1.10.12)
- Removed the fabricated apt-get openjdk-11 install step and fake Dockerfile
  stage name/ARG (container-base / SDKMAN_JAVA_VERSION are the real ones)
- Fixed the debug-port self-contradiction: the JMX section's "8000:8000" was
  the actual bug, not the "5005" elsewhere in the doc — debug.port defaults
  to 5005 in parent/pom.xml, confirmed live in 4 profile configs. Added a
  callout explaining both 5005 (Maven docker-start,debug workflow) and 8000
  (the base Dockerfile's own default, for CMS_JAVA_OPTS-based debugging) are
  real, for different run paths, so this doesn't get "corrected" backwards
  again
- Replaced the fabricated standalone ./dev-run script with the real
  `just dev-run-debug` / `just dev-run-jmx-debug-glowroot` targets
- JConsole JDK-version reference now points to .sdkmanrc instead of a
  hardcoded literal (per team decision)

Also found during final verification: wrong Postgres image (ankane/pgvector
-> real pgvector/pgvector:pg18, per environments/environment.properties),
and `just build-no-docker`'s description/timing didn't match its real
recipe (it's a full clean install, not the fast core-only build shown next
to it).

Issue #37126
@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @jcastro-dotcms's task in 1m 33s —— View job


Code Review

Docs-only PR. Since the stated purpose is replacing fabricated APIs with real ones, I verified each replacement against actual source rather than internal doc consistency.

Verified accurate against source:

  • HealthStatus values UP / DOWN / DEGRADED / UNKNOWN — ✅ com.dotcms.health.model.HealthStatus
  • HealthCheckRegistry, HealthCheckProvider, HealthService, HealthCheckBase, HealthEndpointConstants — ✅ all exist under com.dotcms.health.*
  • HealthService.getAllHealthChecks() / getOverallHealth() (returns HealthResponse) / isReady(), and HealthCheckRegistry.registerHealthCheck(HealthCheck) — ✅ all present with the documented signatures
  • permissionAPI.doesUserHavePermission(Permissionable, int, User) + PermissionAPI.PERMISSION_READ (1), PERMISSION_EDIT (2), PERMISSION_EDIT_PERMISSIONS (8) — ✅
  • com.liferay.util.Xss.encodeForHTML(String) — ✅
  • ResponseUtil at com.dotcms.rest.api.v1.authentication.ResponseUtil — ✅
  • APILocator.getESIndexAPI().getClusterStats() — ✅ (ESIndexAPI)
  • Version pointers: version.docker-maven.plugin=0.48.0, version.cargo.plugin=1.10.12, debug.port=5005, management.port:8090, dotcms.core.compiler.release=25 — ✅ parent/pom.xml; maven.compiler.release=11 — ✅ tools/dotcms-cli/pom.xml; java=25.0.2-ms — ✅ .sdkmanrc
  • docker.image.postgres=pgvector/pgvector:pg18 — ✅ environments/environment.properties
  • Anchor #view-object-pattern-java-records## View Object Pattern (Java Records) — ✅ resolves
  • OpenSearch fix: single-node-os-migration/docker-compose.yml + service opensearch3-provision — ✅ both exist; the old os-migration/docker-compose.limited-user.yml path is genuinely gone, so the correction is right

New Issues

No issues found. Every fabricated symbol, config key, version pointer, file path, and anchor introduced by this PR resolves to real source. No new contradictions or broken links introduced.

One non-blocking observation (pre-existing, not introduced here, so not flagged): in SECURITY_BACKEND.md:168 the delete-path example checks PERMISSION_EDIT_PERMISSIONS with a "Delete permission denied" message — that constant/message mismatch predates this PR (only the method name was changed on this line), so it's out of scope for this review.
· issue-37126-fix-backend-contradictions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area : Documentation PR changes documentation files

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

M1 — Fix backend contradictions

1 participant