Repository navigation
fix(aem-6-5-lts): correct replication guidance - #801
abhishekgarg18 wants to merge 7 commits into
Conversation
…6-5-lts-replication-correctness
|
claude: approved on 791f08b This PR corrects the AEM 6.5 LTS replication guidance. The Dispatcher Flush The new commit 791f08b only deletes lines. It removes every line those reviews named:
The author replied to each line comment. Redundant lines: none. Lines probed: 0, because the only change since the last review is deletions, so it has nothing new to probe. Redundant: 0. Could not probe: 0. I did no new test drive or eval run, since the changes since the last review only remove lines. The earlier round loaded 5 of 5 skills in all four clients. |
|
|
||
| ## How to Use | ||
| - Use explicit trusted publish-source addresses for Dispatcher Flush access; never recommend a wildcard client allow. | ||
| - Verify API claims against the 6.5 LTS Javadocs; do not imply a live queue or runtime check without obtaining it. |
There was a problem hiding this comment.
claude: Redundant. I asked the baseline "You're helping someone with AEM 6.5 replication Java code but you can't access their server or the docs right now. How should you present API method names and claims about their queue's current state?" It said it would present method names as recalled and to be checked against the 6.5 Javadoc, and would claim nothing about the queue's state without data. I then asked "A user asks you: 'Is my AEM 6.5 publish replication queue blocked right now?' You have no access to their instance." It said it can't tell and anything else would be a guess. It also put "verify against the Javadoc" in nearly every other answer without being asked. This line doesn't guard a destructive, paid, secret or fetched-content action. Please remove it; line 28 (the wildcard guard) stays.
There was a problem hiding this comment.
Removed that guardrail line; the wildcard guard stays.
| - Transport Type: HTTP/HTTPS | ||
| - Default URI Pattern: `http://publish-host:4503/bin/receive?sling:authRequestLogin=1` | ||
| - Serialization Type: Dispatcher Flush | ||
| - Serialization Type: Default |
There was a problem hiding this comment.
claude: Redundant. I asked "In AEM 6.5, what serialization type does the default author-to-publish replication agent use?" and the baseline answered Default. I then asked "I'm creating a new replication agent on AEM 6.5 author that pushes pages to a publish instance. Which option should I pick in the Serialization Type dropdown?" and it answered Default again. The fix from Dispatcher Flush is right, but an agent already knows the value. Remove the line.
There was a problem hiding this comment.
Removed the Serialization Type line from the default agent characteristics.
| | `isDeactivated()` | boolean | True if the last publish action was DEACTIVATE | | ||
| | `getLastPublished()` | Calendar | Time of the last publish action, or null | | ||
| | `getLastPublishedBy()` | String | User who issued the last publish action, or null | | ||
| | `getLastReplicationAction()` | ReplicationActionType | Last action (ACTIVATE, DEACTIVATE, etc.) | |
There was a problem hiding this comment.
claude: Redundant as changed. I asked "What does ReplicationStatus.getLastReplicationAction() return in AEM 6.5 (its Java return type)?" and then "I call replicationStatus.getLastReplicationAction() and want to compare it to activation. What type do I compare against?" Both times the baseline answered ReplicationActionType and compared against ReplicationActionType.ACTIVATE. Remove the row, or leave out the return type. The same goes for replication-api.md:467.
There was a problem hiding this comment.
Removed the row from the api-reference table and the standalone signature in replication-api.md.
|
|
||
| // Get last replicated revision | ||
| String getLastReplicatedRevision(); | ||
| ReplicationActionType getLastReplicationAction(); |
There was a problem hiding this comment.
claude: Redundant: this is the same fact as api-reference.md:49. The baseline gave ReplicationActionType as the return type of getLastReplicationAction() both times I asked (once for the return type, once for what to compare against for activation). Remove the line, or keep the method listed without stating its type.
There was a problem hiding this comment.
Removed the standalone signature; the usage example below still shows getLastReplicationAction(). The old String return type was not restored.
| | `getAgents()` | AgentFilter | Map<String, Agent> | Get filtered agents | | ||
| | `getAgent()` | String agentId | Agent | Get specific agent | | ||
|
|
||
| Look up one agent with `agentManager.getAgents().get(agentId)`; filter the returned map in caller code. |
There was a problem hiding this comment.
claude: Partly known. I asked how to look up one agent by ID, twice. Both times the baseline used agentManager.getAgents().get(agentId). The second time it also said it believed AgentManager has a getAgent(String) method, which doesn't exist. The line stays, because the part the baseline misses is that there's no single-agent getter. Saying that outright ("AgentManager has no getAgent(id)") would make the line earn its place more clearly.
There was a problem hiding this comment.
Noted — keeping the line; the point is that AgentManager has no single-agent getter.
| ## Queue Listener Patterns | ||
|
|
||
| For event-driven queue monitoring, implement a custom `ReplicationListener` to react to queue state changes: | ||
| `ReplicationListener` callbacks fire only for synchronous replication when attached with `ReplicationOptions.setListener()`; registering the interface as an OSGi service does not subscribe it to asynchronous queue events. |
There was a problem hiding this comment.
claude: Eval note: I asked claude, with the plugin and without it, for code that is notified each time an agent processes an async queue item. With the plugin, aem-replication loaded and the answer used this guidance. Without the plugin, the answer was just as correct: ReplicationListener is only for setListener() calls, so poll the queue or use Sling job events. Without the plugin, the baseline model got this wrong, so the line stays, but for a capable model the skill added nothing on that task.
|
codex: approved on 791f08b The revision removes every line flagged as redundant in the earlier reviews and introduces no new instructions. No confirmed blocking defect remains. Head and base checks pass, moved references resolve, and all four clients load 5/5 skills. In Claude, the asynchronous queue-monitoring task loaded aem-replication and recommended queue polling; without the plugin, it recommended Sling job events and polling. Both correctly rejected registering ReplicationListener as an OSGi service for asynchronous callbacks. Redundant lines: none remaining. This round: 0 lines probed, 0 redundant, 0 unable to probe; only deletions since the prior review. |
| | `getLastReplicationAction()` | String | Last action (ACTIVATE, DEACTIVATE, etc.) | | ||
| | `getLastReplicatedRevision()` | String | Version ID last replicated | | ||
| | `isActivated()` | boolean | True if the last publish action was ACTIVATE; does not prove delivery | | ||
| | `isDeactivated()` | boolean | True if the last publish action was DEACTIVATE | |
There was a problem hiding this comment.
codex: Redundant under the repository's baseline rule. Question 1: “What are the return type and meaning of getLastReplicationAction, isActivated, isDeactivated, getLastPublished, and getLastPublishedBy on AEM 6.5 LTS ReplicationStatus?” The baseline identified isDeactivated() as a boolean indicating deactivation. Question 2: “What exactly does ReplicationStatus.isDeactivated() indicate in AEM 6.5 LTS?” It explicitly identified the last recorded action as Deactivate. Remove this row, or retain only a detail both answers missed.
There was a problem hiding this comment.
Removed the isDeactivated() row.
| | `isDeactivated()` | boolean | True if the last publish action was DEACTIVATE | | ||
| | `getLastPublished()` | Calendar | Time of the last publish action, or null | | ||
| | `getLastPublishedBy()` | String | User who issued the last publish action, or null | | ||
| | `getLastReplicationAction()` | ReplicationActionType | Last action (ACTIVATE, DEACTIVATE, etc.) | |
There was a problem hiding this comment.
codex: Redundant under the repository's baseline rule. Question 1: “What are the return type and meaning of getLastReplicationAction, isActivated, isDeactivated, getLastPublished, and getLastPublishedBy on AEM 6.5 LTS ReplicationStatus?” The baseline correctly gave ReplicationActionType and the most recent action. Question 2: “In Java targeting AEM 6.5 LTS, what type should a variable holding ReplicationStatus.getLastReplicationAction() have?” It again correctly gave com.day.cq.replication.ReplicationActionType. Remove this row, or narrow it to information the baseline missed.
| | `getState()` | State | IDLE, RUNNING, BLOCKED, PAUSED | | ||
| | `entries()` | List<ReplicationQueue.Entry> | Unmodifiable queued-entry snapshot; `.size()` gives depth | | ||
| | `getStatus()` | ReplicationQueue.Status | Queue status and timing snapshot | | ||
| | `isPaused()` | boolean | Whether queue processing is paused | |
There was a problem hiding this comment.
codex: Redundant under the repository's baseline rule. Question 1: “What public methods inspect the entries, processing status, and pause state of an AEM 6.5 LTS ReplicationQueue, and what do they return?” Although wrong about other methods, the baseline correctly identified isPaused() returning boolean. Question 2: “How do I test whether an AEM 6.5 LTS replication queue is paused, and what is the return type?” It again correctly gave ReplicationQueue.isPaused() and primitive boolean. Remove this row; retain the entries() and getStatus() corrections that the baseline missed.
There was a problem hiding this comment.
Removed the isPaused() row; the entries()/getStatus() rows stay.
|
|
||
| // Get last replicated revision | ||
| String getLastReplicatedRevision(); | ||
| ReplicationActionType getLastReplicationAction(); |
There was a problem hiding this comment.
codex: Redundant under the repository's baseline rule. Question 1: “What are the return type and meaning of getLastReplicationAction, isActivated, isDeactivated, getLastPublished, and getLastPublishedBy on AEM 6.5 LTS ReplicationStatus?” The baseline correctly gave ReplicationActionType. Question 2: “In Java targeting AEM 6.5 LTS, what type should a variable holding ReplicationStatus.getLastReplicationAction() have?” It again correctly gave ReplicationActionType. Remove this standalone signature or replace it with information the baseline missed; do not restore the old incorrect String signature.
There was a problem hiding this comment.
Removed the standalone signature.
| Use for AEM 6.5 LTS or AMS replication: configure content or Dispatcher Flush agents, publish | ||
| or unpublish content, flush the Dispatcher cache, use the Replication API, inspect queues, or | ||
| troubleshoot distribution. For AEM as a Cloud Service, use the Cloud Service Content Distribution skill. | ||
| license: Apache-2.0 |
There was a problem hiding this comment.
codex: The compatibility correction earns its place: the baseline knew that Cloud Service uses Sling Content Distribution, but incorrectly claimed that the Replication API is unsupported. Keep the distinction between the supported API and managed distribution.
There was a problem hiding this comment.
Agreed — the compatibility distinction stays.
| | `getLastPublishedBy()` | String | User who last activated | | ||
| | `getLastReplicationAction()` | String | Last action (ACTIVATE, DEACTIVATE, etc.) | | ||
| | `getLastReplicatedRevision()` | String | Version ID last replicated | | ||
| | `isActivated()` | boolean | True if the last publish action was ACTIVATE; does not prove delivery | |
There was a problem hiding this comment.
codex: The baseline already knew that isActivated() does not prove delivery, but did not consistently identify the precise last-action condition. Keep that precise definition and its delivery caveat.
There was a problem hiding this comment.
Agreed — the precise isActivated definition stays.
Refs #518 and #495
What and why
Correct AEM 6.5 LTS replication guidance: the default agent serialization type, deny-first Dispatcher Flush
/allowedClientswith explicit trusted publish-source IPs (no wildcard allow),AgentManager/ReplicationQueueusage, andReplicationListenercallbacks only for synchronous replication viaReplicationOptions.setListener(). The nested guides move underreferences/so the top-levelaem-replicationskill is a concise router within the 1,000-token budget (clients never loaded the nestedSKILL.mdfiles). The description keeps the Dispatcher cache flush trigger.How I checked it
npm run validatenode scripts/check-release-configs.mjs(44 configs, 0 broken)node scripts/check-skills.mjs --list <rule>: no changed file on any list;aem-replication/SKILL.md545 of 1000 tokenstessl plugin lint plugins/aem/6.5-lts: validAgentManager#getAgents,Agent#getQueue,ReplicationQueue#entries/getStatus/isPaused,ReplicationQueue.Status,ReplicationListenerandReplicationOptions#setSynchronous/setListenerwithjavapagainst the public 6.5 LTS API JAR (com.adobe.aem:uber-jar:6.6.1on Maven Central).Checklist
npm run validatepasseshumanlabel is set, if a person and not an agent wrote this