Skip to content

feat: remove legacy login check + i18n test closure + agent completeness rules - #1738

Merged
natechadwick merged 9 commits into
developmentfrom
feat/1678-remove-legacy-login-check
Aug 2, 2026
Merged

feat: remove legacy login check + i18n test closure + agent completeness rules#1738
natechadwick merged 9 commits into
developmentfrom
feat/1678-remove-legacy-login-check

Conversation

@natechadwick-intsof

Copy link
Copy Markdown
Collaborator

Summary

  • Continues feat(developer): CE controls catalog (P0.19 / UI-01 read) #1678 legacy login / locale work already on this branch.
  • Test closure for i18n corrections REST BFF: Spring TestI18nCorrectionsAdaptor so MainTest loads; I18nCorrectionsAdaptorImplTest uses PSProperties for PSServer.ms_serverProps.
  • Agent rules (please review in the Files tab — GitHub UI, not CLI):
    • Root AGENTS.md: Human review of agent rules (you review all rule commits) + Change-class completeness (full companion closure, not primary artifact + one unit test).
    • Wired into Erlang agent/patterns, java-unit-testing skill, rest / sitemanage AGENTS.

Rule review focus (GitHub Files tab)

File What to review
AGENTS.md Top: human rule-review gate; new Change-class completeness hard gate
rest/AGENTS.md MainTest Spring stubs as an instance of completeness
projects/sitemanage/AGENTS.md Completeness cross-links; PSProperties type note
modules/ai-shared-develop/src/main/resources/agents/erlang-code-review.md Gate table rows
modules/ai-shared-develop/src/main/resources/skills/erlang-review/patterns.md Hard-gate / test pattern bullets
modules/ai-shared-develop/src/main/resources/skills/java-unit-testing/SKILL.md General + instances

Commits of interest

  1. fix(rest/sitemanage): complete i18n corrections test closure — product/test
  2. docs(agents): change-class completeness + human rule review gaterule review
  3. style: Spotless format… — formatting only

Test plan

  • cd rest && ../mvnw.cmd test — 167 tests green (after Spring stub)
  • cd projects/sitemanage && ../../mvnw.cmd test -Dtest=I18nCorrectionsAdaptorImplTest — 5 tests green
  • Pre-push Spotless check green
  • CI green on PR
  • Human review of agent rule files above (explicit gate)

Co-Authored by Grok Build using Grok 4.5 with agent Grok.

Re-vendor language client 0.4 with postUrl. Add POST /rest/i18n/corrections
(resource + DTO in rest; GCM submit in sitemanage) with role gate, server.properties
config, and ENC-ready PAT. WebUI posts CSRF-backed corrections to the BFF.
Start scripts expose <installdir>/bin for mkd_gcm_ffi (LD_LIBRARY_PATH / PATH / jna).

Requires local .m2 install of dev.monkeyking:mkd-gcm-sdk until published.

> Co-Authored by Grok Build using Grok 4.5 with agent main.
Add Spring test stub for I18nCorrectionsAdaptor so MainTest context loads,
and stub PSServer.ms_serverProps with PSProperties (declared field type).

> Co-Authored by Grok Build using Grok 4.5 with agent Grok.
Codify multi-layer companion delivery as a monorepo hard gate, and require
explicit human review of all agent rule/instruction changes before commit.
Rule wording is intended for PR review in the GitHub UI.

> Co-Authored by Grok Build using Grok 4.5 with agent Grok.
> Co-Authored by Grok Build using Grok 4.5 with agent Grok.
Comment thread rest/pom.xml Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0

Notes

Incremental diff 6ac00993..cf94b10d (2 files, 18 lines) addresses the prior WARNING on MkdLanguageConfig.summaryForLog() (comment 3698949711).

Resolved (commit cf94b10d88):

  • MkdLanguageConfig.summaryForLog() no longer calls gcmTokenPlain(). It now reads the raw property via StringUtils.trimToEmpty(PSServer.getProperty(PROP_GCM_TOKEN, "")) and uses StringUtils.isNotBlank to derive tokenSet. A bad ENC(...) value can no longer crash the summary path or leak PSEncryptor internals. The new Javadoc documents the contract.
  • New unit test I18nCorrectionsAdaptorImplTest.summaryForLogDoesNotDecryptToken exercises this path with ENC(not-a-real-ciphertext) and asserts no IllegalStateException is thrown — matching the sitemanage AGENTS rule for behavioral coverage of new non-trivial logic. The test correctly uses PSProperties for the PSServer.ms_serverProps stub and restores prior state in @AfterEach.

Re-verified on changed lines (no regressions):

  • All other previously reported findings remain fixed at current HEAD.

New issues: None.

Files Reviewed (2 changed files)
  • projects/sitemanage/src/main/java/com/percussion/apibridge/mkd/MkdLanguageConfig.java
  • projects/sitemanage/src/test/java/com/percussion/apibridge/I18nCorrectionsAdaptorImplTest.java
Previous Review Summaries (2 snapshots, latest commit 6ac0099)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 6ac0099)

Status: 1 Issue Found (incremental) | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0

Notes

What was reviewed (incremental diff 051a477..6ac0099, ≈13k diff lines, ~16 files):

  • Java: I18nCorrectionsAdaptorImpl (now uses AtomicBoolean + injectable Supplier<List<String>>), MkdGcmBackendException (new typed exception), MkdGcmCorrectionService (no longer leaks SDK message into wrapper), MkdLanguageConfig (warns on bad port, throws IllegalStateException on ENC(...) decrypt failure, dead encryptTokenAtStartupIfPlain removed), I18nCorrectionsAdaptorImplTest (deterministic with role supplier + new tests for role-gate reject and invalid-port fallback), I18nCorrectionsResourceTest (new 502-without-leak test), rest/pom.xml (commons-email now uses ${commons-email.version}), I18nCorrectionsResource (log.error now passes the throwable), I18nCorrectionsAdaptor (Javadoc updated), sitemanage-beans.xml (5 new rest beans wired).
  • TMX: CmsUi.tmx, DeveloperUi.tmx, SystemResources.tmx — fr-ca translation additions (routine i18n work).
  • i18n cache: i18n_translate.json large refresh (build artifact; out of scope).
  • Tests: App.test.tsx minor window.history.replaceState setup; WebUI/Vitest already reviewed previously; Playwright bug-1688 now navigates to /Rhythmyx/cm/app/dashboard.jsp (a JSP that still includes header.jsp) and asserts the legacy Rhythmyx UI link is absent — the new target actually renders the JSP header (where the removal happened), so the assertion is no longer vacuous.

Previous review (commit 051a4774) — all 9 issues verified resolved against current HEAD:

# Previous finding Status
1 MkdGcmCorrectionService:73 wrapped GcmException in bare RuntimeException losing status-mapping contract Fixed — now throws new MkdGcmBackendException; I18nCorrectionsAdaptor Javadoc updated; I18nCorrectionsResourceTest.backendFailureMapsTo502WithoutLeakingMessage covers it.
2 MkdLanguageConfig:140 token decrypt silently returned null Fixed — now logs stack + throws IllegalStateException with actionable message; Javadoc documents the new contract.
3 MkdLanguageConfig:103 port parse failure silently defaulted Fixed — now log.warns with the bad value + default before falling back; new unit test invalidGcmPortFallsBackToDefault.
4 I18nCorrectionsAdaptorImpl:36 warnedEmptyRoles race Fixed — now AtomicBoolean.compareAndSet(false, true).
5 I18nCorrectionsAdaptorImplTest:125 non-deterministic Fixed — test now injects role supplier and asserts the happy path deterministically; new rejectsWhenUserNotInAllowedRoles covers the rejection branch.
6 I18nCorrectionsResource:89 log.error("...", e.toString()) Fixed — now log.error("...", e) (throwable).
7 MkdLanguageConfig:152 dead encryptTokenAtStartupIfPlain Fixed — method removed entirely (no callers).
8 bug-1688-remove-legacy-ui.spec.js:47 vacuous assertion Fixed — now navigates to /Rhythmyx/cm/app/dashboard.jsp, which actually renders includes/header.jsp where the legacy link removal happened.
9 rest/pom.xml commons-email without <version> Fixed — now uses ${commons-email.version} (defined at parent pom.xml:99).

New issue (1)

WARNING

File Line Issue
projects/sitemanage/src/main/java/com/percussion/apibridge/mkd/MkdLanguageConfig.java 143 gcmTokenPlain() now throws IllegalStateException on decrypt failure. The unchanged summaryForLog() at line 196 calls it unguarded — any caller of summaryForLog() will crash and leak PSEncryptor internals on misconfigured ENC(...) token.
Files Reviewed (16 changed files)
  • WebUI/src/test/ts/app/App.test.tsx
  • modules/perc-i18n/src/main/resources/i18n/CmsUi.tmx
  • modules/perc-i18n/src/main/resources/i18n/DeveloperUi.tmx
  • modules/perc-i18n/src/main/resources/i18n/SystemResources.tmx
  • modules/perc-i18n/scripts/cache/i18n_translate.json
  • modules/perc-qa-automation/frontend/tests/bugs/bug-1688-remove-legacy-ui.spec.js
  • projects/sitemanage/src/main/java/com/percussion/apibridge/I18nCorrectionsAdaptorImpl.java
  • projects/sitemanage/src/main/java/com/percussion/apibridge/mkd/MkdGcmBackendException.java - new
  • projects/sitemanage/src/main/java/com/percussion/apibridge/mkd/MkdGcmCorrectionService.java
  • projects/sitemanage/src/main/java/com/percussion/apibridge/mkd/MkdLanguageConfig.java - 1 issue
  • projects/sitemanage/src/main/resources/Rhythmyx/AppServer/server/rx/deploy/rxapp.ear/rxapp.war/WEB-INF/config/spring/projects/sitemanage-beans.xml
  • projects/sitemanage/src/test/java/com/percussion/apibridge/I18nCorrectionsAdaptorImplTest.java
  • rest/pom.xml
  • rest/src/main/java/com/percussion/rest/i18n/I18nCorrectionsAdaptor.java
  • rest/src/main/java/com/percussion/rest/i18n/I18nCorrectionsResource.java
  • rest/src/test/java/com/percussion/rest/i18n/I18nCorrectionsResourceTest.java

Fix these issues in Kilo Cloud

Previous review (commit 051a477)

Status: 9 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 7
SUGGESTION 2

Notes

What was reviewed (≈50 files, ~12k diff lines):

  • Java backend: rest/.../i18n/* (new REST BFF + DTOs), projects/sitemanage/.../apibridge/I18nCorrectionsAdaptorImpl.java and mkd/* (GCM client + config), rest/pom.xml + projects/sitemanage/pom.xml, Spring sitemanage-beans.xml, system/.../PSLoginServlet.java + IPSConstants.java (legacy-UI removal).
  • WebUI: mkdLanguage.ts (now POSTs to REST BFF), LoginPage.tsx + i18n.ts (legacy checkbox/key removed), header.jsp ×3 (legacy Rhythmyx UI link removed), Vitest no-legacy-ui.test.tsx + mkdLanguage.test.ts, Playwright bug-1608-1609-…spec.js and new bug-1688-remove-legacy-ui.spec.js.
  • AGENTS / skills: AGENTS.md, rest/AGENTS.md, projects/sitemanage/AGENTS.md, WebUI/AGENTS.md, erlang-code-review.md, erlang-review/patterns.md, java-unit-testing/SKILL.md — all cross-references verified accurate (PSProperties type, MainTest Spring stubs, peer stubs).
  • Jetty launchers (StartJetty.bat, StartJetty.sh, install-jetty-service.sh) — LD_LIBRARY_PATH / PATH / -Djna.library.path plumbing. Sub-agent flagged latent rxDir quoting fragility in install-jetty-service.sh heredoc (path with spaces would break); pre-existing in the file, out of scope for this PR's stated goal.

Strengths worth acknowledging:

  • Full change-class closure for the new I18nCorrectionsAdaptor surface: REST DTOs + resource + Mockito resource test + Spring test stub (TestI18nCorrectionsAdaptor @Component @Lazy) + sitemanage apibridge impl + unit tests + Playwright spec. Exactly the pattern the new AGENTS.md → Change-class completeness rule prescribes.
  • Agent-rule changes committed in a separate commit (docs(agents): change-class completeness + human rule review gate) per the human-review gate.
  • I18nCorrectionsAdaptorImplTest correctly uses PSProperties (not bare Properties) when reflectively swapping PSServer.ms_serverProps — matches the new projects/sitemanage/AGENTS.md guidance.
  • rest module boundary respected: no com.percussion.apibridge import in rest; sitemanage → rest dependency direction preserved.
  • Legacy-UI removal in PSLoginServlet is clean: LEGACY_UI_PARAM, LEGACY_INDEX_PAGE, LEGACY_UI_ATTR, legacyUI flow, addRedirect legacy branch all consistently excised.

Top issues (full inline comments on the PR):

  1. MkdGcmCorrectionService:73GcmException wrapped in bare RuntimeException with SDK message text; loses status-mapping contract.
  2. MkdLanguageConfig:140 — Token decrypt silently returns null; operator with valid ENC(...) + wrong key gets a misleading 503.
  3. MkdLanguageConfig:103 — Port parse failure silently defaults; a typo produces a confusing connection error.
  4. I18nCorrectionsAdaptorImpl:36warnedEmptyRoles field is racy in a Spring singleton.
  5. I18nCorrectionsAdaptorImplTest:125mapsToOkWhenGcmReturns accepts either pass OR SecurityException; non-deterministic.
  6. I18nCorrectionsResource:89log.error("...", e.toString()) does not print the stack under log4j2.
  7. MkdLanguageConfig:152encryptTokenAtStartupIfPlain is unused dead code that could silently rewrite server.properties.
  8. bug-1688-remove-legacy-ui.spec.js:47 — The "no Rhythmyx UI link after login" test navigates to a React SPA page that does not include the JSP it claims to verify (vacuous assertion).
  9. rest/pom.xml:30commons-email lacks a <version> and relies on transitive resolution from perc-system.

No critical / security-blocking issues found. rest does not depend on sitemanage. No hardcoded secrets, URLs, or Spring-Boot imports introduced. AGENTS/skill cross-references in the rule change are accurate.

Fix these issues in Kilo Cloud


Reply with @kilocode-bot fix it to have Kilo Code address any of the issues above.

Files Reviewed (53 files)
Click to expand

Java backend (new REST BFF + impl + tests)

  • rest/src/main/java/com/percussion/rest/i18n/I18nCorrectionResult.java
  • rest/src/main/java/com/percussion/rest/i18n/I18nCorrectionSource.java
  • rest/src/main/java/com/percussion/rest/i18n/I18nCorrectionSubmission.java
  • rest/src/main/java/com/percussion/rest/i18n/I18nCorrectionsAdaptor.java
  • rest/src/main/java/com/percussion/rest/i18n/I18nCorrectionsResource.java - 1 issue
  • rest/src/test/java/com/percussion/rest/i18n/I18nCorrectionsResourceTest.java
  • rest/src/test/java/com/percussion/rest/test/apibridge/TestI18nCorrectionsAdaptor.java
  • rest/pom.xml - 1 issue
  • rest/README.md
  • projects/sitemanage/src/main/java/com/percussion/apibridge/I18nCorrectionsAdaptorImpl.java - 1 issue
  • projects/sitemanage/src/main/java/com/percussion/apibridge/mkd/MkdGcmCorrectionService.java - 1 issue
  • projects/sitemanage/src/main/java/com/percussion/apibridge/mkd/MkdLanguageConfig.java - 3 issues
  • projects/sitemanage/src/main/resources/Rhythmyx/AppServer/server/rx/deploy/rxapp.ear/rxapp.war/WEB-INF/config/spring/projects/sitemanage-beans.xml
  • projects/sitemanage/src/test/java/com/percussion/apibridge/I18nCorrectionsAdaptorImplTest.java - 1 issue
  • projects/sitemanage/pom.xml

System / login legacy removal

  • system/src/main/java/com/percussion/servlets/PSLoginServlet.java
  • system/src/main/java/com/percussion/cms/IPSConstants.java

WebUI (TS/TSX + JSP + Vitest)

  • WebUI/src/main/ts/i18n/mkdLanguage.ts
  • WebUI/src/main/ts/login/LoginPage.tsx
  • WebUI/src/main/ts/login/i18n.ts
  • WebUI/src/main/webapp/cm/app/includes/header.jsp
  • WebUI/src/main/webapp/cm/pages/app/includes/header.jsp
  • WebUI/war/app/includes/header.jsp
  • WebUI/src/test/ts/i18n/mkdLanguage.test.ts
  • WebUI/src/test/ts/login/LoginPage.test.tsx
  • WebUI/src/test/ts/login/no-legacy-ui.test.tsx

Playwright

  • modules/perc-qa-automation/frontend/tests/bugs/bug-1608-1609-login-locale.spec.js
  • modules/perc-qa-automation/frontend/tests/bugs/bug-1688-remove-legacy-ui.spec.js - 1 issue

AGENTS / skills / agent docs

  • AGENTS.md
  • rest/AGENTS.md
  • projects/sitemanage/AGENTS.md
  • WebUI/AGENTS.md
  • modules/ai-shared-develop/src/main/resources/agents/erlang-code-review.md
  • modules/ai-shared-develop/src/main/resources/skills/erlang-review/patterns.md
  • modules/ai-shared-develop/src/main/resources/skills/java-unit-testing/SKILL.md

Jetty launchers

  • modules/perc-jetty/src/main/jetty/StartJetty.bat
  • modules/perc-jetty/src/main/jetty/StartJetty.sh
  • modules/perc-jetty/src/main/jetty/service/install-jetty-service.sh

Vendored library + lockfile (sanity checked)

  • WebUI/vendor/mkd-language/dist/index.d.ts
  • WebUI/vendor/mkd-language/dist/index.js
  • WebUI/vendor/mkd-language/package.json
  • WebUI/src/main/frontend/package-lock.json
  • modules/perc-i18n/src/main/resources/i18n/CmsUi.tmx (and other TMX + cache; out of scope)

Reviewed by minimax-m3 · Input: 42.7K · Output: 1.9K · Cached: 312.6K

Review guidance: REVIEW.md from base branch development

Resolve i18n_translate.json via resolve_i18n_cache_conflicts.py (union both sides).

> Co-Authored by Grok Build using Grok 4.5 with agent Grok.
- Log throwable as last arg in I18nCorrectionsResource
- AtomicBoolean for once-only empty-roles warn
- MkdGcmBackendException without SDK message echo
- Warn on invalid gcm port; decrypt failure vs not-configured
- Remove unused encryptTokenAtStartupIfPlain
- Deterministic role-supplier seam in adaptor tests
- Playwright header assert via dashboard.jsp
- Pin commons-email version from parent BOM

> Co-Authored by Grok Build using Grok 4.5 with agent Grok.
> Co-Authored by Grok Build using Grok 4.5 with agent Grok.
@natechadwick-intsof

Copy link
Copy Markdown
Collaborator Author

Review resolution

Merged origin/development (i18n cache conflict union via resolve_i18n_cache_conflicts.py).

Addressed all 9 Kilo threads in 58559791ed (+ Spotless 6ac0099326):

Thread Fix
log.error stack throwable as last arg
warnedEmptyRoles race AtomicBoolean.compareAndSet
GcmException wrap MkdGcmBackendException (no SDK message echo)
gcmPort silent fallback warn log + test
decrypt → misleading 503 throw distinct IllegalStateException + log stack
encryptTokenAtStartupIfPlain removed (unused)
non-deterministic happy path injectable role supplier + verify GCM
Playwright vacuous header assert dashboard.jsp (includes header.jsp)
commons-email version \ from parent

All review threads replied + resolved. Local: rest i18n/MainTest green; I18nCorrectionsAdaptorImplTest 7/7 green.

natechadwick
natechadwick previously approved these changes Aug 2, 2026
Avoid IllegalStateException / encryptor stack leakage when ENC(...) is
misconfigured; log summary only checks property presence.

> Co-Authored by Grok Build using Grok 4.5 with agent Grok.
@natechadwick
natechadwick merged commit 6278039 into development Aug 2, 2026
5 checks passed
@natechadwick
natechadwick deleted the feat/1678-remove-legacy-login-check branch August 2, 2026 12:13
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.

2 participants