Skip to content

fix(aem-6-5-lts): correct replication guidance - #801

Open
abhishekgarg18 wants to merge 7 commits into
mainfrom
fix/aem-6-5-lts-replication-correctness
Open

abhishekgarg18 wants to merge 7 commits into
mainfrom
fix/aem-6-5-lts-replication-correctness

Conversation

@abhishekgarg18

@abhishekgarg18 abhishekgarg18 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Refs #518 and #495

What and why

Correct AEM 6.5 LTS replication guidance: the default agent serialization type, deny-first Dispatcher Flush /allowedClients with explicit trusted publish-source IPs (no wildcard allow), AgentManager/ReplicationQueue usage, and ReplicationListener callbacks only for synchronous replication via ReplicationOptions.setListener(). The nested guides move under references/ so the top-level aem-replication skill is a concise router within the 1,000-token budget (clients never loaded the nested SKILL.md files). The description keeps the Dispatcher cache flush trigger.

How I checked it

  • npm run validate
  • node 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.md 545 of 1000 tokens
  • tessl plugin lint plugins/aem/6.5-lts: valid
  • Checked AgentManager#getAgents, Agent#getQueue, ReplicationQueue#entries/getStatus/isPaused, ReplicationQueue.Status, ReplicationListener and ReplicationOptions#setSynchronous/setListener with javap against the public 6.5 LTS API JAR (com.adobe.aem:uber-jar:6.6.1 on Maven Central).
  • No live AEM instance or queue mutation was tested.

Checklist

  • The change is to one plugin, or to repository tooling
  • npm run validate passes
  • Paths, commands and skills that the change names exist
  • New scripts, hooks, MCP servers or network endpoints are called out above
  • The human label is set, if a person and not an agent wrote this

@abhishekgarg18
abhishekgarg18 marked this pull request as ready for review December 1, 2026 15:34
@abhishekgarg18
abhishekgarg18 marked this pull request as draft December 1, 2026 16:08
@abhishekgarg18
abhishekgarg18 marked this pull request as ready for review December 1, 2026 16:08
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

claude: approved on 791f08b

This PR corrects the AEM 6.5 LTS replication guidance. The Dispatcher Flush /allowedClients rule now denies everything first and then allows explicit publish IPs. The listed AgentManager, ReplicationQueue and ReplicationListener methods are now real ones. The nested guides, which no client loaded, move under references/, so aem-replication/SKILL.md is now a 545-token router. Both earlier reviews (claude and codex, on fda0222) found no security or broken-link problem and denied only for redundant lines.

The new commit 791f08b only deletes lines. It removes every line those reviews named:

  • the "Verify API claims…" guardrail
  • Serialization Type: Default
  • the isDeactivated(), getLastReplicationAction() and isPaused() rows in api-reference.md
  • the standalone getLastReplicationAction() signature in replication-api.md

The author replied to each line comment. npm run validate and the release config check pass on head and base. No relative link points at the old */SKILL.md paths. The PR title is a conventional commit scoped to one plugin.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the row from the api-reference table and the standalone signature in replication-api.md.


// Get last replicated revision
String getLastReplicatedRevision();
ReplicationActionType getLastReplicationAction();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the row.

| `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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the isPaused() row; the entries()/getStatus() rows stay.


// Get last replicated revision
String getLastReplicatedRevision();
ReplicationActionType getLastReplicationAction();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — the precise isActivated definition stays.

This branch has not been deployed

No deployments
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.

1 participant