Skip to content

fix(aem-cloud-service): correct replication contracts - #520

Open
abhishekgarg18 wants to merge 16 commits into
mainfrom
fix/aem-replication-correctness
Open

abhishekgarg18 wants to merge 16 commits into
mainfrom
fix/aem-replication-correctness

Conversation

@abhishekgarg18

@abhishekgarg18 abhishekgarg18 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Refs #518

What and why

Correct AEM as a Cloud Service content-distribution guidance for publish/Preview targeting and per-agent status, ReplicationListener signatures, bulk-call limits, and Distribution UI queue semantics (persisted vs fully published, sourced from the Cloud Service Replication Queues docs). The nested replication and sling-distribution guides move under references/ so the top-level content-distribution skill is a concise router within the 1,000-token budget. The generic status-logging example is removed.

How I checked it

  • npm run validate
  • node scripts/check-release-configs.mjs (44 configs, 0 broken)
  • node scripts/check-skills.mjs --tokens plugins/aem/cloud-service: content-distribution/SKILL.md 970 of 1000
  • Checked ReplicationStatus#getStatusForAgent and ReplicationStatusProvider#getBatchReplicationStatus against the public AEM SDK API JAR (2026.11) and queue semantics against the public Cloud Service replication docs.
  • No live publishing or queue mutations performed.

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

Preserve supported CQ publishing and correct agent, listener, queue,
and delivery guidance against public Cloud and LTS APIs. Restrict flush
clients to trusted sources and require approval for queue mutations.

Refs #518

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Tessl Plugin Lint

⚠️ edge-delivery-services — 2 warning(s)
⚠ Skill 'code-review': SKILL.md is approximately 10350 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'figma-to-content': SKILL.md is approximately 14744 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.

✔ Plugin adobe/aem-edge-delivery-services@0.1.0 is valid
⚠️ app-management — 2 warning(s)
⚠ Skill 'commerce-app-storage': SKILL.md is approximately 5451 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'commerce-app-admin-ui': SKILL.md is approximately 5915 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.

✔ Plugin adobe/commerce-app-management@1.4.0 is valid

✅ app-migration — clean

✅ app-review — clean

⚠️ run-workflow — 1 warning(s)
⚠ Skill 'run-workflow': SKILL.md is approximately 9954 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.

✔ Plugin adobe/run-workflow@1.0.0 is valid
⚠️ stardust — 11 warning(s)
⚠ Skill 'stardust': SKILL.md is approximately 8196 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'extract': SKILL.md is approximately 11351 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'direct': SKILL.md is approximately 12333 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'prototype': SKILL.md is approximately 18042 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'migrate': SKILL.md is approximately 7590 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'uplift': SKILL.md is approximately 6612 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'audit': SKILL.md is approximately 5433 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'replica': SKILL.md is approximately 8942 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'reskin': SKILL.md is approximately 6079 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'deploy': SKILL.md is approximately 49844 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'rollout': SKILL.md is approximately 10527 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.

✔ Plugin adobe/stardust@0.21.1 is valid

✅ web — clean


✅ All 7 plugin(s) lint passed with 16 warning(s) total.

Updated by tessl-lint for commit 67d7976.

Drop guardrail notes, link rewrites, docs/compile test scripts and
example rewrites. Keep detector, validator, listener, bulk-limit,
preview-status, queue-monitoring and LTS API corrections, verified
against aem-sdk-api 2026.10 and uber-jar 6.6.3 apis.

Refs #518

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Name publish, unpublish, queue, and runtime-specific requests in skill descriptions.

Refs #518

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore code-assessment and migration files; retain only AEM replication and content-distribution skill changes.

Refs #518

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
aem-replication description: this branch's rewrite stays. main had added a
"Use when" sentence to the old text; the rewrite already says when to use
the skill.

Signed-off-by: Lars Trieloff <lars@trieloff.net>
@trieloff

Copy link
Copy Markdown
Contributor

Merged main and resolved the conflict in the aem-replication description: this branch's rewrite stays. main had added a "Use when" sentence to the old text. One trigger from that sentence is not in the rewrite: flushing the dispatcher cache. skills-ref validate passes for the 6.5 LTS skills.

@abhishekgarg18 abhishekgarg18 changed the title fix(aem): correct replication contracts fix(aem-cloud-service): correct replication contracts Nov 23, 2026
@abhishekgarg18
abhishekgarg18 marked this pull request as ready for review November 30, 2026 10:27
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

claude: approved on 51ba648

Since the last review (67a1494), head 51ba648 answers both earlier findings in the aem/cloud-service content-distribution skill:

  • Codex's denial: the generic SLF4J status-printing example in references/replication.md is removed: the Logger/LoggerFactory imports, the LOG field and printReplicationInfo. The per-agent getStatusForAgent("preview") note stays.
  • Claude's source question: the persisted and fully published queue lines in SKILL.md:26, references/replication.md:562 and references/sling-distribution.md:595 now link the Cloud Service Replication Queues section. I fetched that page. Its definitions match the skill: persisted means durably stored on the publish tier; fully published means live on all publish pods with the Dispatcher cache cleared for the affected paths.

The author replied to every earlier line comment. The rest of the merge from main touches no file of this plugin.

Checks:

  • npm run validate and the release config check pass on head and base.
  • content-distribution/SKILL.md is 970 of its 1,000 tokens.
  • No file in the tree still points at the old nested paths.
  • The test drive loads 8/8 skills in claude, codex, grok and agy.

I ran no new eval. This round only removes an example and adds citation links, and the earlier round's eval already covered the Preview behaviour.

Redundant lines: none. The three lines that earlier review named (references/replication.md:317, :318 and :322) are gone. The lines changed since that review add only a source link to facts that were already there and not named, so there was nothing new to ask the baseline. Lines probed: 0, redundant: 0, not probed: 0.

- An unfiltered Replicator call uses the enabled-by-default **publish** agent only. Preview requires an explicit `AgentFilter`.
- A preview-only activation can leave aggregate `ReplicationStatus.isActivated()` false; check `getStatusForAgent("preview")` for Preview and `getStatusForAgent("publish")` for live Publish status.
- Prefer fewer than 100 paths per custom call and use Tree Activation for large hierarchies; do not promise automatic splitting.
- In **Tools > Deployment > Distribution**, distinguish the `persisted` queue from `fully published`; a queued or accepted request does not prove content is live. The latter indicates publication across Publish pods and Dispatcher invalidation.

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: What's the source for the persisted and fully published queue names and what they mean (durable on Publish, versus live across Publish pods with Dispatcher invalidation done)? The Cloud Service replication operations guide (help/operations/replication.md in AdobeDocs) only describes the publish card, the queue status, the connection test, the Logs tab and a red main queue on failure. It doesn't mention these two queues. If they come from release notes or another page, please add it under Sources. Agents will tell users to wait for fully published, so the claim needs a citable source. The same applies to references/replication.md:584 and references/sling-distribution.md:595.

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.

Fixed in 51ba648. The queue names and meanings come from the Cloud Service Replication Queues section (help/operations/replication.md, #replication-queues): persisted = durably stored on the publish tier; fully published = live on all publish pods and Dispatcher cache cleared. The link is now inline here and at references/replication.md and references/sling-distribution.md.

## Publishing to Preview Tier

The Preview tier requires explicit agent filtering.
Without an `AgentFilter`, `Replicator` targets the enabled-by-default **publish** agent only. Preview requires an explicit filter and the Preview agent must be available in the target environment.

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 already. I asked the baseline twice ("if I call Replicator.replicate with no ReplicationOptions, which tiers does the content go to?" and "do I need to do anything special for the page to appear on Preview?"). Both times it said an unfiltered call uses publish only and Preview needs an AgentFilter. It did not know that the Preview agent may be unavailable or inactive by default. The line stays. The eval run without the plugin also got the publish-only part wrong, so keeping it here and in SKILL.md:23 is justified.

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.

Acknowledged; no change — the line stays as you noted.

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

codex: approved on 51ba648

The previous blocking logging setup is removed, and Adobe’s replication documentation confirms the newly cited queue semantics. Base and head checks pass; all eight local links resolve, the changed skill meets its token budget, and all four clients load eight of eight skills. No new blocking defects found. No fresh eval was needed for this revision’s removals and citations; earlier Claude Preview evaluations are recorded in the review history.

Redundant lines: none remaining. This round: 0 lines probed, 0 redundant, 0 unable to probe; previously reviewed unchanged guidance was excluded.

```java
import com.day.cq.replication.ReplicationStatus;
import org.apache.sling.api.resource.Resource;
import org.slf4j.Logger;

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 logging setup. Asked: “How should an AEM OSGi Java service emit diagnostic replication status messages in production? Show the logger setup and an example.” Then: “Write a Java snippet for an AEM service called StatusChecker that logs the activation, deactivation, last-published date, publisher, last replication action, and pending state of a com.day.cq.replication.ReplicationStatus. Include its logger declaration and imports.” Both independently supplied this SLF4J import. Remove the generic diagnostic example/setup, retaining the AEM-specific per-agent correction, to satisfy the repository’s redundancy rule.

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.

Fixed in 51ba648: removed the generic status-printing example with its SLF4J imports and logger; the per-agent getStatusForAgent("preview") note on isPublished stays.

import com.day.cq.replication.ReplicationStatus;
import org.apache.sling.api.resource.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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 logging setup. Questions: (1) “How should an AEM OSGi Java service emit diagnostic replication status messages in production? Show the logger setup and an example.” (2) “Write a Java snippet for an AEM service called StatusChecker that logs the activation, deactivation, last-published date, publisher, last replication action, and pending state of a com.day.cq.replication.ReplicationStatus. Include its logger declaration and imports.” Both answers supplied this LoggerFactory import. Remove it with the generic diagnostic example/setup.

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.

Fixed in 51ba648: removed the generic status-printing example with its SLF4J imports and logger; the per-agent getStatusForAgent("preview") note on isPublished stays.

public class StatusChecker {


private static final Logger LOG = LoggerFactory.getLogger(StatusChecker.class);

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 logger declaration. Questions: (1) “How should an AEM OSGi Java service emit diagnostic replication status messages in production? Show the logger setup and an example.” (2) “Write a Java snippet for an AEM service called StatusChecker that logs the activation, deactivation, last-published date, publisher, last replication action, and pending state of a com.day.cq.replication.ReplicationStatus. Include its logger declaration and imports.” Both answers independently declared a private static final Logger using LoggerFactory.getLogger(the service class). Remove the generic diagnostic example/setup while preserving the per-agent status guidance.

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.

Fixed in 51ba648: removed the generic status-printing example with its SLF4J imports and logger; the per-agent getStatusForAgent("preview") note on isPublished stays.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Closed: the AI review raised findings more than 24 hours ago that nobody has answered.

  • codex denied 67a1494
  • claude on plugins/aem/cloud-service/skills/content-distribution/SKILL.md:26
  • claude on plugins/aem/cloud-service/skills/content-distribution/references/replication.md:123
  • codex on plugins/aem/cloud-service/skills/content-distribution/references/replication.md:317
  • codex on plugins/aem/cloud-service/skills/content-distribution/references/replication.md:318
  • codex on plugins/aem/cloud-service/skills/content-distribution/references/replication.md:322

Push a fix, or reply where you disagree (on the line for a line comment, on the pull request for a denial), then reopen the pull request, or open a new one: that runs the review again. A pull request written by a person rather than an agent gets the human label, and this rule does not apply to it. See the merge policy.

@github-actions github-actions Bot closed this Dec 1, 2026
@abhishekgarg18
abhishekgarg18 force-pushed the fix/aem-replication-correctness branch from 51ba648 to 67a1494 Compare December 1, 2026 15:27

This branch was successfully deployed

No deployments
eval — 308b87bb Deployed Nov 2, 2026 by abhishekgarg18 via tessl-eval #1196
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