You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2026/06/04 22:46:19 UTC

(causeway) branch CAUSEWAY-4010 created (now bbaf736e1c8)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git


      at bbaf736e1c8 CAUSEWAY-4010: archives persistent replay mapping listener

This branch includes the following new commits:

     new 05ea2c79fcb CAUSEWAY-4011: moves inner actions for CommandExport/ReplayManager
     new e7ff0d71730 CAUSEWAY-4011: removes some dead code; simplifies impl
     new a92ec645d14 CAUSEWAY-4011: enhances CommandExportManager
     new 31eabda528c CAUSEWAY-4011: changes delimiter for view model
     new 54ec82d26fc CAUSEWAY-4011: cosmetic fixes
     new ef8902ce159 CAUSEWAY-4011: improves paging
     new 6af965f0e37 CAUSEWAY-4011: improves paging, cosmetics.
     new f73dd8f60d1 CAUSEWAY-4010: ran openspec init
     new a78d27cbe30 CAUSEWAY-4010: proposes extending yaml to include returned object
     new 517051b871e CAUSEWAY-4010: extends export to include 'returnedObject'
     new 4afabc169af CAUSEWAY-4010: archives returned object command export change
     new 0632e377b20 temporarily renames ${revision} -> 2.2.0-SNAPSHOT
     new e9cd5566234 CAUSEWAY-4010: proposes command import manager rework
     new d20b57357fa CAUSEWAY-4010: reworks command import manager
     new 988db33cfae CAUSEWAY-4010: archives command import rework and proposes replay result mapping
     new 546677e60f4 CAUSEWAY-4011: improves paging, cosmetics.
     new 43da447403c CAUSEWAY-4010: adds replay result mapping SPI
     new 492ddd3ebef CAUSEWAY-4010: archives replay result mapping change
     new 97bc016a4a6 CAUSEWAY-4010: proposes command replay input remapping
     new 8d681115069 CAUSEWAY-4010: adds command replay input remapping
     new 23751efd5e3 CAUSEWAY-4010: ensures that the CommandLogEntry's result ...
     new 40374aecae2 CAUSEWAY-4010: archives command replay input remapping
     new f90779fe0ec CAUSEWAY-4010: proposes listener SPI remap simplification
     new d6b26043b83 CAUSEWAY-4010: simplifies command replay remapping SPI
     new 6733cc1abbe CAUSEWAY-4010: archives listener SPI remap simplification
     new 50c9b8ccbc5 CAUSEWAY-4010: updates agent session handoff guidance
     new a81f15a3ab8 CAUSEWAY-4010: fixes command log replay state initialization
     new f473ad54214 CAUSEWAY-4010: proposes default command replay mapping listener
     new 612af06f099 CAUSEWAY-4010: adds default command replay mapping listener
     new b0deefe5b9a CAUSEWAY-4010: archives default command replay mapping listener
     new a59b9ba0511 CAUSEWAY-4010: updates OpenSpec apply commit policy
     new 8d2e611d5a6 CAUSEWAY-4010: proposes replay conflict failure handling
     new 8c508a40e47 CAUSEWAY-4010: fails replay on conflicting result mappings
     new cdfe0dbd4ef CAUSEWAY-4010: archives replay conflict failure handling
     new af587f88e6a CAUSEWAY-4010: proposes replay conflict handling configuration
     new 81498882797 CAUSEWAY-4010: adds replay conflict handling configuration
     new 5c6d9580ccc CAUSEWAY-4010: archives replay conflict handling configuration
     new 6126259a95a CAUSEWAY-4010: proposes persistent replay mapping listener
     new d9f918630ed CAUSEWAY-4010: adds persistent replay mapping listener
     new f9297f27f8f CAUSEWAY-4010: refines persistent replay mapping listener
     new 71e19a88e3b CAUSEWAY-4010: updates persistent replay mapping proposal docs
     new bbaf736e1c8 CAUSEWAY-4010: archives persistent replay mapping listener

The 42 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(causeway) 03/42: CAUSEWAY-4011: enhances CommandExportManager

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit a92ec645d14f1c57f8c7c0cf8411d557a9e455ba
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jun 3 18:28:28 2026 +0100

    CAUSEWAY-4011: enhances CommandExportManager
---
 .../commandlog/applib/app/CommandLogMenu.java      |   5 +-
 .../commandlog/applib/dom/CommandLogEntry.java     |   2 +
 .../applib/dom/CommandLogEntryRepository.java      |  16 +-
 .../dom/CommandLogEntryRepositoryAbstract.java     |  80 +++++++---
 .../applib/dom/replay/CommandExportManager.java    | 162 +++++++++++++++++++--
 .../CommandExportManager.layout.fallback.xml       |   9 +-
 .../replay/CommandExportManager_changeLimit.java   |  60 ++++++++
 .../dom/replay/CommandExportManager_nextPage.java  |  55 +++++++
 .../replay/CommandExportManager_previousPage.java  |  56 +++++++
 .../replay/CommandExportManager_toggleMode.java    |  32 ++++
 .../applib/dom/replay/CommandReplayManager.java    |  13 +-
 .../CommandReplayManager_importCommands.java       |  30 +++-
 .../CommandReplayManager_replayOrRetryNext.java    |  11 +-
 ...CommandReplayManager_replayOrRetrySelected.java |  11 +-
 .../commandlog/applib/dom/replay/HasBaseline.java  |  14 +-
 .../dom/replay/CommandExportManagerStateTest.java  | 134 +++++++++++++++++
 .../commandlog/jdo/dom/CommandLogEntry.java        |   8 +
 .../commandlog/jpa/dom/CommandLogEntry.java        |   8 +
 18 files changed, 631 insertions(+), 75 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
index 1bd57c00cd4..34172393184 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
@@ -47,6 +47,7 @@
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_changeLimit;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_importCommands;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.ReplayContext;
@@ -181,8 +182,8 @@ public DomainEvent() { }
         @MemberSupport public CommandExportManager act(
                 @ParameterLayout(describedAs = "Limits the commands shown; only commands since this timestamp are available for export.  Set to a time immediately before the commands to be replayed.")
                 final java.sql.Timestamp since
-        ) {
-            return new CommandExportManager(since, replayContext);
+                ) {
+            return new CommandExportManager(new CommandExportManager.State(since, CommandExportManager_changeLimit.MAX_LIMIT, CommandExportManager.Mode.EXPORT), replayContext);
         }
 
         @MemberSupport public java.sql.Timestamp defaultSince() {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
index 0636fa19e0a..f217f514b3f 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
@@ -151,6 +151,8 @@ public static class Nq {
         public static final String FIND_MOST_RECENT_COMPLETED           = LOGICAL_TYPE_NAME + ".findMostRecentCompleted";
         public static final String FIND_FOREGROUND_BY_TIMESTAMP_AFTER_AND_REPLAY_STATE
                                                                         = LOGICAL_TYPE_NAME + ".findForegroundByTimestampAfterAndReplayState";
+        public static final String FIND_FOREGROUND_BY_TIMESTAMP_BEFORE_AND_REPLAY_STATE
+                                                                        = LOGICAL_TYPE_NAME + ".findForegroundByTimestampBeforeAndReplayState";
         public static final String FIND_FOREGROUND_BY_TIMESTAMP_AFTER_AND_REPLAY_STATES
                                                                         = LOGICAL_TYPE_NAME + ".findForegroundByTimestampAfterAndReplayStates";
         public static final String FIND_BACKGROUND_AND_NOT_YET_STARTED  = LOGICAL_TYPE_NAME + ".findBackgroundAndNotYetStarted";
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
index cf964950e37..4fcc3141154 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
@@ -122,9 +122,21 @@ List<CommandLogEntry> findByTargetAndFromAndTo(
      */
     List<CommandLogEntry> findSince(final UUID interactionId, final Integer batchSize);
 
-    List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since);
+    default List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since) {
+        return findForegroundSinceTimestampAndCanBeExported(since, null);
+    }
+
+    List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since, final Integer limitIfAny);
+
+    List<CommandLogEntry> findForegroundBeforeTimestampAndCanBeExported(final Timestamp before, final Integer limitIfAny);
+
+    default List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since) {
+        return findForegroundSinceTimestampAndHasBeenExported(since, null);
+    }
+
+    List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since, final Integer limitIfAny);
 
-    List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since);
+    List<CommandLogEntry> findForegroundBeforeTimestampAndHasBeenExported(final Timestamp before, final Integer limitIfAny);
 
     /**
      * Command Replay feature: Can replay or retry.
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java
index d81fdebf1e1..46f82395ae6 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java
@@ -29,7 +29,8 @@
 
 import javax.inject.Inject;
 import javax.inject.Provider;
-	
+
+import org.apache.causeway.applib.query.NamedQuery;
 import org.apache.causeway.applib.query.Query;
 import org.apache.causeway.applib.query.QueryRange;
 import org.apache.causeway.applib.services.bookmark.Bookmark;
@@ -388,32 +389,37 @@ private C findByInteractionIdElseNull(final UUID interactionId) {
 
     private List<CommandLogEntry> findSince(
             final Timestamp timestamp,
-            final Integer batchSize) {
-
-        // DN generates incorrect SQL for SQL Server if count set to 1; so we set to 2 and then trim
-        // XXX that's a historic workaround, should rather be fixed upstream
-        var needsTrimFix = batchSize != null && batchSize == 1;
+            final Integer batchSizeIfAny) {
 
-        var q = Query.named(commandLogEntryClass, CommandLogEntry.Nq.FIND_SINCE)
-                .withParameter("timestamp", timestamp)
-                .withRange(QueryRange.limit(
-                        needsTrimFix ? 2L : batchSize
-                ));
+        var query = Query.named(commandLogEntryClass, CommandLogEntry.Nq.FIND_SINCE)
+                .withParameter("timestamp", timestamp);
 
-        final List<CommandLogEntry> commandJdos = _Casts.uncheckedCast(repositoryService().allMatches(q));
-        return needsTrimFix && commandJdos.size() > 1
-                ? commandJdos.subList(0,1)
-                : commandJdos;
+        return allMatches(query, batchSizeIfAny);
     }
 
     @Override
     public List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since) {
-        return findForegroundSinceTimestampWithState(since, ReplayState.UNDEFINED);
+        return findForegroundSinceTimestampAndCanBeExported(since, null);
     }
 
     @Override
-    public List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since) {
-        return findForegroundSinceTimestampWithState(since, ReplayState.EXPORTED);
+    public List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since, Integer batchSizeIfAny) {
+        return findForegroundSinceTimestampWithState(since, ReplayState.UNDEFINED, batchSizeIfAny);
+    }
+
+    @Override
+    public List<CommandLogEntry> findForegroundBeforeTimestampAndCanBeExported(final Timestamp before, Integer batchSizeIfAny) {
+        return findForegroundBeforeTimestampWithState(before, ReplayState.UNDEFINED, batchSizeIfAny);
+    }
+
+    @Override
+    public List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since, Integer batchSizeIfAny) {
+        return findForegroundSinceTimestampWithState(since, ReplayState.EXPORTED, batchSizeIfAny);
+    }
+
+    @Override
+    public List<CommandLogEntry> findForegroundBeforeTimestampAndHasBeenExported(final Timestamp before, Integer batchSizeIfAny) {
+        return findForegroundBeforeTimestampWithState(before, ReplayState.EXPORTED, batchSizeIfAny);
     }
 
     @Override
@@ -429,14 +435,23 @@ public List<CommandLogEntry> findSinceAndWithReplayOkOrExcluded(final Timestamp
         return findForegroundSinceTimestampWithStates(since, ReplayState.OK, ReplayState.EXCLUDED);
     }
 
-    private List<CommandLogEntry> findForegroundSinceTimestampWithState(Timestamp from, ReplayState replayState) {
-        return _Casts.uncheckedCast(
-                repositoryService().allMatches(
-                        Query.named(commandLogEntryClass, CommandLogEntry.Nq.FIND_FOREGROUND_BY_TIMESTAMP_AFTER_AND_REPLAY_STATE)
-                                .withParameter("from", from)
-                                .withParameter("replayState", replayState)));
+    private List<CommandLogEntry> findForegroundSinceTimestampWithState(Timestamp from, ReplayState replayState, Integer batchSizeIfAny) {
+        var query = Query.named(commandLogEntryClass, CommandLogEntry.Nq.FIND_FOREGROUND_BY_TIMESTAMP_AFTER_AND_REPLAY_STATE)
+                .withParameter("from", from)
+                .withParameter("replayState", replayState);
+
+        return allMatches(query, batchSizeIfAny);
+    }
+
+    private List<CommandLogEntry> findForegroundBeforeTimestampWithState(Timestamp to, ReplayState replayState, Integer batchSizeIfAny) {
+        var query = Query.named(commandLogEntryClass, CommandLogEntry.Nq.FIND_FOREGROUND_BY_TIMESTAMP_BEFORE_AND_REPLAY_STATE)
+                .withParameter("to", to)
+                .withParameter("replayState", replayState);
+
+        return allMatches(query, batchSizeIfAny);
     }
 
+
     private List<CommandLogEntry> findForegroundSinceTimestampWithStates(Timestamp from, ReplayState replayState1, ReplayState replayState2) {
         return _Casts.uncheckedCast(
                 repositoryService().allMatches(
@@ -461,6 +476,23 @@ private static Timestamp toTimestampStartOfDayWithOffset(
                 : null;
     }
 
+    private List<CommandLogEntry> allMatches(NamedQuery<C> query, Integer batchSizeIfAny) {
+
+        // DN generates incorrect SQL for SQL Server if count set to 1; so we set to 2 and then trim
+        // XXX that's a historic workaround, should rather be fixed upstream
+        var needsTrimFix = batchSizeIfAny != null && batchSizeIfAny == 1;
+
+        if(batchSizeIfAny != null) {
+            query = query.withRange(QueryRange.limit(needsTrimFix ? 2L : batchSizeIfAny));
+        }
+
+        final List<CommandLogEntry> commandLogEntries = _Casts.uncheckedCast(repositoryService().allMatches(query));
+        return needsTrimFix && commandLogEntries.size() > 1
+                ? commandLogEntries.subList(0, 1)
+                : commandLogEntries;
+    }
+
+
     /**
      * intended for testing purposes only
      */
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
index 895f1107aca..63166f844dc 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
@@ -21,6 +21,7 @@
 import static org.apache.causeway.extensions.commandlog.applib.dom.replay.TimestampMarshallUtil.fromString;
 
 import java.sql.Timestamp;
+import java.time.Instant;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,6 +34,7 @@
 import org.apache.causeway.applib.annotation.DomainObject;
 import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Introspection;
+import org.apache.causeway.applib.annotation.MemberSupport;
 import org.apache.causeway.applib.annotation.ObjectSupport;
 import org.apache.causeway.applib.annotation.Programmatic;
 import org.apache.causeway.applib.annotation.Property;
@@ -40,7 +42,9 @@
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
 
+import lombok.Data;
 import lombok.Getter;
+import lombok.RequiredArgsConstructor;
 
 @DomainObject(introspection = Introspection.ANNOTATION_REQUIRED)
 @DomainObjectLayout(cssClassFa = "solid share-from-square")
@@ -58,13 +62,15 @@ public static abstract class ActionDomainEvent<T>
     public CommandExportManager(
             final String memento,
             final ReplayContext replayContext) {
-        this(fromString(memento, replayContext.clockService().getClock().nowAsJavaSqlTimestamp()),  replayContext);
+        this(State.parseMemento(memento, new State(replayContext.clockService().getClock().nowAsJavaSqlTimestamp(), 50, Mode.EXPORT)),  replayContext);
     }
 
     public CommandExportManager(
-            final java.sql.Timestamp baseline,
+            final State state,
             final ReplayContext replayContext) {
-        this.baseline = baseline;
+        this.baseline = state.timestamp;
+        this.limit = state.limit;
+        this.mode = state.mode;
         this.replayContext = replayContext;
     }
 
@@ -72,19 +78,59 @@ public CommandExportManager(
         return "Command Export Manager";
     }
 
+    @RequiredArgsConstructor
+    public enum Mode {
+        EXPORT("Export commands (UNDEFINED -> EXPORTED)"),
+        UNEXPORT("Unexport commands (EXPORTED -> UNDEFINED)");
+
+        private final String title;
+
+        @ObjectSupport
+        public String title() {
+            return title;
+        }
+
+
+        Mode toggle() {
+            return this == UNEXPORT ? EXPORT : UNEXPORT;
+        }
+    }
+
 
     @Property
-    @PropertyLayout(describedAs = "Only commands after this timestamp are available for export")
+    @PropertyLayout(describedAs = "Only commands after this timestamp are available")
     @Getter
     private java.sql.Timestamp baseline;
 
+    @Property
+    @PropertyLayout(describedAs = "Number of commands per page")
+    @Getter
+    private int limit;
+
+    @Property
+    @PropertyLayout(describedAs = "Whether to export or unexport commands")
+    @Getter
+    private Mode mode;
+
+
 
     @Override
     @Programmatic
     public CommandExportManager withBaseline(Timestamp baseline) {
-        return new CommandExportManager(baseline, replayContext);
+        return new CommandExportManager(new State(baseline, this.limit, this.mode), replayContext);
     }
 
+    @Programmatic
+    public CommandExportManager withLimit(int limit) {
+        return new CommandExportManager(new State(this.baseline, limit, this.mode), replayContext);
+    }
+
+    @Programmatic
+    public CommandExportManager withMode(Mode mode) {
+        return new CommandExportManager(new State(this.baseline, this.limit, mode), replayContext);
+    }
+
+
 
     // -- NOT YET EXPORTED
 
@@ -93,7 +139,19 @@ public CommandExportManager withBaseline(Timestamp baseline) {
             describedAs = "Commands that can be exported"
     )
     public List<ReplayableCommand> getNotYetExported() {
-        return commandLogEntryRepository().findForegroundSinceTimestampAndCanBeExported(baseline).stream()
+        return commandLogEntryRepository().findForegroundSinceTimestampAndCanBeExported(baseline, limit).stream()
+            .map(entry->new ReplayableCommand(
+                    entry.getInteractionId(),
+                    replayContext))
+            .collect(Collectors.toList());
+    }
+    @MemberSupport
+    public boolean hideNotYetExported() {
+        return this.mode == Mode.UNEXPORT;
+    }
+    @Programmatic
+    public List<ReplayableCommand> getNotYetExportedPrevious() {
+        return commandLogEntryRepository().findForegroundBeforeTimestampAndCanBeExported(baseline, limit).stream()
             .map(entry->new ReplayableCommand(
                     entry.getInteractionId(),
                     replayContext))
@@ -101,12 +159,28 @@ public List<ReplayableCommand> getNotYetExported() {
     }
 
 
-    // -- EXPORTED
+
+    // -- HAVE BEEN EXPORTED
 
     @Collection
-    @CollectionLayout(describedAs = "Commands that have been exported")
+    @CollectionLayout(
+            describedAs = "Commands that have been exported"
+    )
     public List<ReplayableCommand> getExported() {
-        return commandLogEntryRepository().findForegroundSinceTimestampAndHasBeenExported(baseline).stream()
+        return commandLogEntryRepository().findForegroundSinceTimestampAndHasBeenExported(baseline, limit).stream()
+            .map(entry->new ReplayableCommand(
+                    entry.getInteractionId(),
+                    replayContext))
+            .collect(Collectors.toList());
+    }
+    @MemberSupport
+    public boolean hideExported() {
+        return this.mode == Mode.EXPORT;
+    }
+
+    @Programmatic
+    private List<ReplayableCommand> getExportedPrevious() {
+        return commandLogEntryRepository().findForegroundBeforeTimestampAndHasBeenExported(baseline, limit).stream()
             .map(entry->new ReplayableCommand(
                     entry.getInteractionId(),
                     replayContext))
@@ -114,15 +188,83 @@ public List<ReplayableCommand> getExported() {
     }
 
 
+    public enum Direction {
+        NEXT, PREVIOUS
+    }
+
+    @Programmatic
+    public List<ReplayableCommand> commands(Direction direction) {
+        switch (mode) {
+            case EXPORT:
+                switch (direction) {
+                    case NEXT:
+                        return getNotYetExported();
+                    case PREVIOUS:
+                    default:
+                        return getNotYetExportedPrevious();
+                }
+            case UNEXPORT:
+            default:
+                switch (direction) {
+                    case NEXT:
+                        return getExported();
+                    case PREVIOUS:
+                    default:
+                        return getExportedPrevious();
+                }
+        }
+    }
+
+
+
+
     // -- VM STATE
 
     @Override
     public String viewModelMemento() {
-        return TimestampMarshallUtil.toString(this.baseline);
+        return new State(baseline, limit, mode).toMemento();
     }
 
     // -- HELPER
     private CommandLogEntryRepository commandLogEntryRepository() {
         return replayContext.commandLogEntryRepository();
     }
+
+    @Data
+    public static class State {
+        private final Timestamp timestamp;
+        private final int limit;
+        private final Mode mode;
+
+        public static State parseMemento(String memento, State fallback) {
+            if(memento == null || memento.isEmpty()) {
+                return fallback;
+            }
+            try {
+                final String[] parts = memento.split("\\|", -1);
+                if(parts.length != 3) {
+                    return fallback;
+                }
+
+                final Timestamp fallbackTimestamp = fallback != null
+                        ? fallback.timestamp
+                        : Timestamp.from(Instant.now());
+                final int fallbackLimit = fallback != null ? fallback.limit : 0;
+                final Mode fallbackMode = fallback != null ? fallback.mode : Mode.EXPORT;
+
+                final Timestamp timestamp = fromString(parts[0], fallbackTimestamp);
+                final int limit = parts[1].isBlank() ? fallbackLimit : Integer.parseInt(parts[1]);
+                final Mode mode = parts[2].isBlank() ? fallbackMode : Mode.valueOf(parts[2]);
+
+                return new State(timestamp, limit, mode);
+            } catch (Exception e) {
+                return fallback;
+            }
+        }
+
+        public String toMemento() {
+            return TimestampMarshallUtil.toString(timestamp) + "|" + limit + "|" + mode;
+        }
+    }
+
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
index 272902d81be..07394fd488f 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
@@ -10,6 +10,11 @@
                 <cpt:action id="nextHour"/>
                 <cpt:property id="baseline"/>
             </cpt:fieldSet>
+            <cpt:fieldSet name=" " id="limit">
+                <cpt:action id="previousPage"/>
+                <cpt:action id="nextPage"/>
+                <cpt:property id="limit"/>
+            </cpt:fieldSet>
         </bs:col>
         <bs:col span="3">
             <bs:tabGroup>
@@ -42,10 +47,6 @@
             <bs:row>
                 <bs:col span="12" size="MD">
                     <cpt:collection defaultView="table" paged="15" id="notYetExported"/>
-                </bs:col>
-            </bs:row>
-            <bs:row>
-                <bs:col span="12" size="MD">
                     <cpt:collection defaultView="table" paged="15" id="exported"/>
                 </bs:col>
             </bs:row>
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_changeLimit.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_changeLimit.java
new file mode 100644
index 00000000000..284308278a2
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_changeLimit.java
@@ -0,0 +1,60 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import org.apache.causeway.applib.annotation.*;
+
+import static org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager.Direction.NEXT;
+
+@Action(
+        semantics = SemanticsOf.SAFE,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandExportManager_changeLimit.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "limit", sequence = "1",
+        position = ActionLayout.Position.PANEL,
+        describedAs = "Change number of commands in page"
+)
+@RequiredArgsConstructor
+public class CommandExportManager_changeLimit {
+
+    public static int MAX_LIMIT = 100;
+
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_changeLimit> { }
+
+    private final CommandExportManager commandExportManager;
+
+    @MemberSupport
+    public CommandExportManager act(int newLimit) {
+        return commandExportManager.withLimit(newLimit);
+    }
+    @MemberSupport
+    public String validateNewLimit(int newLimit) {
+        if(newLimit < 0) {
+            return "Limit must be greater than or equal to 0.";
+        }
+        if(newLimit > MAX_LIMIT) {
+            return "Limit cannot be greater than " + MAX_LIMIT + ".";
+        }
+        return null;
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        final var commands = commandExportManager.commands(NEXT);
+        final var size = commands.size();
+        if (size == 0) {
+            return "Empty";
+        }
+        final var lastReplayable = commands.get(size - 1);
+        return commandExportManager(lastReplayable).commands(NEXT).isEmpty() ? "No more commands" : null;
+    }
+
+    private CommandExportManager commandExportManager(ReplayableCommand lastReplayable) {
+        final var timestamp = lastReplayable.getTimestamp().toInstant();
+        final var baselinePlus5Millis = HasBaseline.addMillis(timestamp, 5);
+        return commandExportManager.withBaseline(baselinePlus5Millis);
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
new file mode 100644
index 00000000000..8a7a1369f10
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
@@ -0,0 +1,55 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import org.apache.causeway.applib.annotation.*;
+
+import static org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager.Direction.*;
+
+@Action(
+        semantics = SemanticsOf.SAFE,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandExportManager_nextPage.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "baseline", sequence = "4",
+        named = "Next Page",
+        position = ActionLayout.Position.PANEL,
+        describedAs = "Move forward to next page of commands"
+)
+@RequiredArgsConstructor
+public class CommandExportManager_nextPage {
+
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_nextPage> { }
+
+    private final CommandExportManager commandExportManager;
+
+    @MemberSupport
+    public CommandExportManager act() {
+        final var commands = commandExportManager.commands(NEXT);
+        final var size = commands.size();
+        if (size == 0) {
+            return commandExportManager;
+        }
+        final var lastReplayable = commands.get(size - 1);
+        return commandExportManager(lastReplayable);
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        final var commands = commandExportManager.commands(NEXT);
+        final var size = commands.size();
+        if (size == 0) {
+            return "Empty";
+        }
+        final var lastReplayable = commands.get(size - 1);
+        return commandExportManager(lastReplayable).commands(NEXT).isEmpty() ? "No more commands" : null;
+    }
+
+    private CommandExportManager commandExportManager(final ReplayableCommand replayableCommand) {
+        final var timestamp = replayableCommand.getTimestamp().toInstant();
+        final var baselinePlus5Millis = HasBaseline.addMillis(timestamp, 5);
+        return commandExportManager.withBaseline(baselinePlus5Millis);
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
new file mode 100644
index 00000000000..67374bae292
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
@@ -0,0 +1,56 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import org.apache.causeway.applib.annotation.*;
+
+import static org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager.Direction.*;
+
+@Action(
+        semantics = SemanticsOf.SAFE,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandExportManager_previousPage.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "baseline", sequence = "4",
+        named = "Next Page",
+        position = ActionLayout.Position.PANEL,
+        describedAs = "Move backwards to previous page of commands"
+)
+@RequiredArgsConstructor
+public class CommandExportManager_previousPage {
+
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_previousPage> { }
+
+    private final CommandExportManager commandExportManager;
+
+    @MemberSupport
+    public CommandExportManager act() {
+        final var commands = commandExportManager.commands(NEXT);
+        final var size = commands.size();
+        if (size == 0) {
+            return commandExportManager;
+        }
+        final var firstReplayable = commands.get(0);
+        return commandExportManager(firstReplayable);
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        final var commands = commandExportManager.commands(NEXT);
+        final var size = commands.size();
+        if (size == 0) {
+            return "No commands";
+        }
+        final var firstReplayable = commands.get(0);
+        return commandExportManager(firstReplayable).commands(PREVIOUS).isEmpty() ? "No previous commands" : null;
+    }
+
+    private CommandExportManager commandExportManager(final ReplayableCommand replayableCommand) {
+        final var timestamp = replayableCommand.getTimestamp().toInstant();
+        final var baselineMinus5Millis = HasBaseline.addMillis(timestamp, -5);
+        return commandExportManager.withBaseline(baselineMinus5Millis);
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
new file mode 100644
index 00000000000..c1941bfeec0
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
@@ -0,0 +1,32 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import org.apache.causeway.applib.annotation.*;
+
+import static org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager.Direction.NEXT;
+
+@Action(
+        semantics = SemanticsOf.SAFE,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandExportManager_toggleMode.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        sequence = "1.1",
+        cssClass = "btn-secondary",
+        describedAs = "Toggle between exporting and un-exporting."
+)
+@RequiredArgsConstructor
+public class CommandExportManager_toggleMode {
+
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_toggleMode> { }
+
+    private final CommandExportManager commandExportManager;
+
+    @MemberSupport
+    public CommandExportManager act() {
+        return commandExportManager.withMode(commandExportManager.getMode().toggle());
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
index a8c3cea8af7..b8bb8b066ec 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
@@ -21,34 +21,27 @@
 import static org.apache.causeway.extensions.commandlog.applib.dom.replay.TimestampMarshallUtil.fromString;
 
 import java.sql.Timestamp;
-import java.time.Instant;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.xml.datatype.XMLGregorianCalendar;
 
 import org.apache.causeway.applib.ViewModel;
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
 import org.apache.causeway.applib.annotation.Collection;
 import org.apache.causeway.applib.annotation.CollectionLayout;
 import org.apache.causeway.applib.annotation.DomainObject;
 import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Introspection;
-import org.apache.causeway.applib.annotation.MemberSupport;
 import org.apache.causeway.applib.annotation.ObjectSupport;
 import org.apache.causeway.applib.annotation.Programmatic;
 import org.apache.causeway.applib.annotation.Property;
 import org.apache.causeway.applib.annotation.PropertyLayout;
-import org.apache.causeway.applib.annotation.Publishing;
-import org.apache.causeway.applib.annotation.RestrictTo;
-import org.apache.causeway.applib.annotation.SemanticsOf;
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
 
+import org.eclipse.persistence.sessions.coordination.CommandManager;
 import org.jspecify.annotations.NonNull;
 
 import lombok.Getter;
@@ -91,8 +84,8 @@ public CommandReplayManager(
 
     @Override
     @Programmatic
-    public CommandExportManager withBaseline(Timestamp baseline) {
-        return new CommandExportManager(baseline, replayContext);
+    public CommandReplayManager withBaseline(Timestamp baseline) {
+        return new CommandReplayManager(baseline, replayContext);
     }
 
 
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
index 7c57ff398e7..c8ce136ce38 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
@@ -1,17 +1,25 @@
 package org.apache.causeway.extensions.commandlog.applib.dom.replay;
 
+import lombok.RequiredArgsConstructor;
+
+import java.sql.Timestamp;
+import java.time.Instant;
 import java.util.List;
 
+import javax.inject.Inject;
+import javax.xml.datatype.XMLGregorianCalendar;
+
 import org.apache.causeway.applib.annotation.*;
 import org.apache.causeway.applib.util.schema.CommandDtoUtils;
 import org.apache.causeway.applib.value.Blob;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
 import org.apache.causeway.schema.cmd.v2.CommandDto;
 
 @Action(
         restrictTo = RestrictTo.PROTOTYPING,
         semantics = SemanticsOf.IDEMPOTENT,
         commandPublishing = Publishing.DISABLED,
-        domainEvent = DomainEvent.class,
+        domainEvent = CommandReplayManager_importCommands.DomainEvent.class,
         executionPublishing = Publishing.DISABLED
 )
 @ActionLayout(
@@ -19,15 +27,13 @@
         cssClass = "btn-secondary",
         describedAs = "Imports commands from yaml format, then persists them with a replayState of PENDING."
 )
+@RequiredArgsConstructor
 public class CommandReplayManager_importCommands {
-    private final CommandReplayManager commandReplayManager;
 
-    public CommandReplayManager_importCommands(CommandReplayManager commandReplayManager) {
-        this.commandReplayManager = commandReplayManager;
+    public static class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_importCommands> {
     }
 
-    public class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_importCommands> {
-    }
+    private final CommandReplayManager commandReplayManager;
 
     public CommandReplayManager act(
             @Parameter(fileAccept = ".yml,.yaml") final Blob commandsYaml,
@@ -35,12 +41,12 @@ public CommandReplayManager act(
         var yamlDs = commandsYaml.asDataSource();
 
         final List<CommandDto> commandDtos = CommandDtoUtils.fromYaml(yamlDs);
-        commandDtos.forEach(commandReplayManager.commandLogEntryRepository()::saveForReplay);
+        commandDtos.forEach(commandLogEntryRepository::saveForReplay);
 
         return commandDtos.stream()
                 .filter(x -> moveBaselineToOldest)
                 .map(CommandDto::getTimestamp)
-                .map(CommandReplayManager::toJavaSqlTimestamp)
+                .map(CommandReplayManager_importCommands::toJavaSqlTimestamp)
                 .sorted()
                 .findFirst()
                 .map(timestamp -> new CommandReplayManager(timestamp, commandReplayManager.replayContext))
@@ -52,4 +58,12 @@ public boolean defaultMoveBaselineToOldest() {
         return true;
     }
 
+    private static Timestamp toJavaSqlTimestamp(XMLGregorianCalendar xgc) {
+        if (xgc == null) return null;
+        Instant instant = xgc.toGregorianCalendar().toZonedDateTime().toInstant();
+        return Timestamp.from(instant);
+    }
+
+    @Inject CommandLogEntryRepository commandLogEntryRepository;
+
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetryNext.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetryNext.java
index 717bf84c74f..8c7e8f0f934 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetryNext.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetryNext.java
@@ -1,5 +1,7 @@
 package org.apache.causeway.extensions.commandlog.applib.dom.replay;
 
+import lombok.RequiredArgsConstructor;
+
 import org.apache.causeway.applib.annotation.*;
 
 @Action(
@@ -15,15 +17,12 @@
         cssClassFa = "solid circle-play",
         cssClass = "btn-primary",
         describedAs = "Executes the oldest command.")
+@RequiredArgsConstructor
 public class CommandReplayManager_replayOrRetryNext {
-    private final CommandReplayManager commandReplayManager;
 
-    public CommandReplayManager_replayOrRetryNext(CommandReplayManager commandReplayManager) {
-        this.commandReplayManager = commandReplayManager;
-    }
+    public static class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_replayOrRetrySelected> { }
 
-    public class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_replayOrRetrySelected> {
-    }
+    private final CommandReplayManager commandReplayManager;
 
     @MemberSupport
     public CommandReplayManager act() {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetrySelected.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetrySelected.java
index 56f16cddadf..3154e571778 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetrySelected.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetrySelected.java
@@ -1,5 +1,7 @@
 package org.apache.causeway.extensions.commandlog.applib.dom.replay;
 
+import lombok.RequiredArgsConstructor;
+
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -21,15 +23,12 @@
                 + "If any of the given commands fails, "
                 + "its surrounding transaction is rolled back, but any successful commands so far are marked OK). "
                 + "The command, that caused the failure, gets marked FAILED.")
+@RequiredArgsConstructor
 public class CommandReplayManager_replayOrRetrySelected {
-    private final CommandReplayManager commandReplayManager;
 
-    public CommandReplayManager_replayOrRetrySelected(CommandReplayManager commandReplayManager) {
-        this.commandReplayManager = commandReplayManager;
-    }
+    public static class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_replayOrRetrySelected> { }
 
-    public class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_replayOrRetrySelected> {
-    }
+    private final CommandReplayManager commandReplayManager;
 
     @MemberSupport
     public CommandReplayManager act(final List<ReplayableCommand> selected) {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
index 578c848386b..8d45d42474a 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
@@ -1,8 +1,7 @@
 package org.apache.causeway.extensions.commandlog.applib.dom.replay;
 
-import lombok.experimental.UtilityClass;
-
 import java.sql.Timestamp;
+import java.time.Instant;
 
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 
@@ -18,7 +17,16 @@ abstract class ActionDomainEvent<T>
 
 
     static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
-        return Timestamp.from(ts.toInstant().plusSeconds(secondsToAdd));
+        Instant instant = ts.toInstant();
+        return addSeconds(instant, secondsToAdd);
+    }
+
+    static Timestamp addSeconds(Instant instant, int secondsToAdd) {
+        return Timestamp.from(instant.plusSeconds(secondsToAdd));
+    }
+
+    static Timestamp addMillis(Instant instant, int millisToAdd) {
+        return Timestamp.from(instant.plusMillis(millisToAdd));
     }
 
 }
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManagerStateTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManagerStateTest.java
new file mode 100644
index 00000000000..248eeed2c0d
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManagerStateTest.java
@@ -0,0 +1,134 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.sql.Timestamp;
+import java.time.Instant;
+
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager.Mode;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager.State;
+import org.junit.jupiter.api.Test;
+
+class CommandExportManagerStateTest {
+
+    @Test
+    void roundtrip_toMemento_and_parseMemento() {
+        final var timestamp = Timestamp.from(Instant.parse("2026-06-03T12:34:56.789Z"));
+        final var state = new State(timestamp, 25, Mode.UNEXPORT);
+
+        final String memento = state.toMemento();
+        final State parsed = State.parseMemento(memento, null);
+
+        assertThat(parsed).isNotNull();
+        assertThat(parsed.getTimestamp()).isEqualTo(timestamp);
+        assertThat(parsed.getLimit()).isEqualTo(25);
+        assertThat(parsed.getMode()).isEqualTo(Mode.UNEXPORT);
+    }
+
+    @Test
+    void parseMemento_null_returns_fallback() {
+        final State fallback = fallbackState();
+
+        final State parsed = State.parseMemento(null, fallback);
+
+        assertThat(parsed).isSameAs(fallback);
+    }
+
+    @Test
+    void parseMemento_empty_returns_fallback() {
+        final State fallback = fallbackState();
+
+        final State parsed = State.parseMemento("", fallback);
+
+        assertThat(parsed).isSameAs(fallback);
+    }
+
+    @Test
+    void parseMemento_invalid_part_count_returns_fallback() {
+        final State fallback = fallbackState();
+
+        final State parsed = State.parseMemento("only-timestamp", fallback);
+
+        assertThat(parsed).isSameAs(fallback);
+    }
+
+    @Test
+    void parseMemento_blank_limit_and_mode_uses_fallback_values() {
+        final State fallback = fallbackState();
+        final Timestamp timestamp = Timestamp.from(Instant.parse("2026-06-01T00:00:00.000Z"));
+        final String memento = TimestampMarshallUtil.toString(timestamp) + "||";
+
+        final State parsed = State.parseMemento(memento, fallback);
+
+        assertThat(parsed).isNotNull();
+        assertThat(parsed.getTimestamp()).isEqualTo(timestamp);
+        assertThat(parsed.getLimit()).isEqualTo(fallback.getLimit());
+        assertThat(parsed.getMode()).isEqualTo(fallback.getMode());
+    }
+
+    @Test
+    void parseMemento_invalid_limit_returns_fallback() {
+        final State fallback = fallbackState();
+        final String memento = TimestampMarshallUtil.toString(fallback.getTimestamp()) + "|abc|EXPORT";
+
+        final State parsed = State.parseMemento(memento, fallback);
+
+        assertThat(parsed).isSameAs(fallback);
+    }
+
+    @Test
+    void parseMemento_invalid_mode_returns_fallback() {
+        final State fallback = fallbackState();
+        final String memento = TimestampMarshallUtil.toString(fallback.getTimestamp()) + "|10|UNKNOWN";
+
+        final State parsed = State.parseMemento(memento, fallback);
+
+        assertThat(parsed).isSameAs(fallback);
+    }
+
+    @Test
+    void parseMemento_invalid_timestamp_uses_fallback_timestamp() {
+        final State fallback = fallbackState();
+
+        final State parsed = State.parseMemento("not-a-timestamp|10|UNEXPORT", fallback);
+
+        assertThat(parsed).isNotNull();
+        assertThat(parsed.getTimestamp()).isEqualTo(fallback.getTimestamp());
+        assertThat(parsed.getLimit()).isEqualTo(10);
+        assertThat(parsed.getMode()).isEqualTo(Mode.UNEXPORT);
+    }
+
+    @Test
+    void parseMemento_invalid_and_null_fallback_returns_null() {
+        final State parsed = State.parseMemento("not-three-parts", null);
+
+        assertThat(parsed).isNull();
+    }
+
+    private static State fallbackState() {
+        return new State(
+                Timestamp.from(Instant.parse("2026-05-30T01:02:03.004Z")),
+                77,
+                Mode.EXPORT);
+    }
+}
+
+
diff --git a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntry.java b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntry.java
index 49513f3859d..0ed194906ab 100644
--- a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntry.java
+++ b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandLogEntry.java
@@ -213,6 +213,14 @@
                   + "    && timestamp >= :from "
                   + "    && replayState == :replayState "
                   + " ORDER BY timestamp ASC"),
+    @Query(
+            name  = Nq.FIND_FOREGROUND_BY_TIMESTAMP_BEFORE_AND_REPLAY_STATE,
+            value = "SELECT "
+                  + "  FROM " + CommandLogEntry.FQCN + " "
+                  + " WHERE executeIn == 'FOREGROUND' "
+                  + "    && timestamp < :to "
+                  + "    && replayState == :replayState "
+                  + " ORDER BY timestamp DESC"),
     @Query(
             name  = Nq.FIND_FOREGROUND_BY_TIMESTAMP_AFTER_AND_REPLAY_STATES,
             value = "SELECT "
diff --git a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandLogEntry.java b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandLogEntry.java
index 8cc67652432..269e93f1771 100644
--- a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandLogEntry.java
+++ b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandLogEntry.java
@@ -216,6 +216,14 @@
                   + "   AND cl.timestamp >= :from "
                   + "   AND cl.replayState = :replayState "
                   + " ORDER BY cl.timestamp ASC"),
+    @NamedQuery(
+            name  = Nq.FIND_FOREGROUND_BY_TIMESTAMP_BEFORE_AND_REPLAY_STATE,
+            query = "SELECT cl "
+                  + " FROM CommandLogEntry cl "
+                  + " WHERE cl.executeIn = org.apache.causeway.extensions.commandlog.applib.dom.ExecuteIn.FOREGROUND "
+                  + "   AND cl.timestamp < :to "
+                  + "   AND cl.replayState = :replayState "
+                  + " ORDER BY cl.timestamp DESC"),
     @NamedQuery(
             name  = Nq.FIND_FOREGROUND_BY_TIMESTAMP_AFTER_AND_REPLAY_STATES,
             query = "SELECT cl "


(causeway) 17/42: CAUSEWAY-4010: adds replay result mapping SPI

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 43da447403c91ba7fb4a441e3e63a1f7b17e1c89
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 15:05:54 2026 +0100

    CAUSEWAY-4010: adds replay result mapping SPI
---
 .../applib/CausewayModuleExtCommandLogApplib.java  |   7 +-
 .../applib/dom/replay/ReplayContext.java           |   3 +
 .../applib/dom/replay/ReplayableCommand.java       |  36 +++++-
 .../applib/spi/ReplayResultMappingListener.java    |  43 +++++++
 .../replay/ReplayableCommandResultMappingTest.java | 136 +++++++++++++++++++++
 .../changes/notify-replay-result-mapping/design.md |   8 +-
 .../changes/notify-replay-result-mapping/tasks.md  |  26 ++--
 7 files changed, 237 insertions(+), 22 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
index 42277774bd1..ccb07791605 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
@@ -62,6 +62,7 @@
 import org.apache.causeway.extensions.commandlog.applib.fakescheduler.FakeScheduler;
 import org.apache.causeway.extensions.commandlog.applib.job.BackgroundCommandsJobControl;
 import org.apache.causeway.extensions.commandlog.applib.job.RunBackgroundCommandsJob;
+import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
 import org.apache.causeway.extensions.commandlog.applib.spi.RunBackgroundCommandsJobListener;
 import org.apache.causeway.extensions.commandlog.applib.subscriber.CommandSubscriberForCommandLog;
 import org.springframework.context.annotation.Bean;
@@ -171,10 +172,12 @@ public static void honorSystemEnvironment() {
             final TransactionService transactionService,
             final CommandLogEntryRepository commandLogEntryRepository,
             final CommandExecutorService commandExecutorService,
-            final ClockService clockService) {
+            final ClockService clockService,
+            final java.util.List<ReplayResultMappingListener> replayResultMappingListeners) {
         return new ReplayContext(
                 repositoryService, interactionService, transactionService,
-                commandLogEntryRepository, commandExecutorService, clockService);
+                commandLogEntryRepository, commandExecutorService, clockService,
+                replayResultMappingListeners);
     }
 
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java
index 726253a7a09..840de39b665 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java
@@ -18,6 +18,7 @@
  */
 package org.apache.causeway.extensions.commandlog.applib.dom.replay;
 
+import java.util.List;
 import java.util.Optional;
 import java.util.UUID;
 
@@ -28,6 +29,7 @@
 import org.apache.causeway.applib.services.xactn.TransactionService;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
 import org.springframework.lang.Nullable;
 
 import lombok.Value;
@@ -44,6 +46,7 @@ public final class ReplayContext {
         CommandLogEntryRepository commandLogEntryRepository;
         CommandExecutorService commandExecutorService;
         ClockService clockService;
+        List<ReplayResultMappingListener> replayResultMappingListeners;
         
     public Optional<CommandLogEntry> lookupCommandLogEntry(final @Nullable UUID interactionId) {
     	return interactionId!=null
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
index 8bdd716784c..fed88caf419 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
@@ -47,6 +47,7 @@
 import org.apache.causeway.applib.services.bookmark.BookmarkService;
 import org.apache.causeway.applib.services.command.CommandExecutorService.InteractionContextPolicy;
 import org.apache.causeway.commons.functional.Try;
+import org.apache.causeway.commons.internal.base._NullSafe;
 import org.apache.causeway.commons.internal.base._Refs.ObjectReference;
 import org.apache.causeway.commons.internal.base._Strings;
 import org.apache.causeway.commons.io.JsonUtils;
@@ -55,6 +56,7 @@
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
+import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
 import org.apache.causeway.schema.cmd.v2.CommandDto;
 import org.apache.causeway.schema.cmd.v2.MemberDto;
 import org.apache.causeway.schema.common.v2.OidDto;
@@ -66,6 +68,7 @@
 import lombok.AllArgsConstructor;
 import lombok.Value;
 import lombok.experimental.Accessors;
+import lombok.extern.log4j.Log4j2;
 
 /**
  * Viewmodel that wraps a {@link CommandLogEntry}.
@@ -74,6 +77,7 @@
 @DomainObjectLayout//(cssClassFa = "terminal")
 @Named(ReplayableCommand.LOGICAL_TYPE_NAME)
 @AllArgsConstructor
+@Log4j2
 public final class ReplayableCommand implements ViewModel, Comparable<ReplayableCommand> {
 
     public static abstract class ActionDomainEvent<T>
@@ -394,7 +398,7 @@ private Try<Bookmark> tryReplay(final CommandDto commandDto) {
                 // handle the replay outcome
                 tryResultBookmark.accept(
                         this::onReplayError,
-                        bookmarkOpt->onReplaySuccess());
+                        bookmarkOpt->onReplaySuccess(bookmarkOpt.orElse(null)));
             });
 
         // in any outcome case (OK or FAILED) the ReplayState may have changed, hence invalidate local cache
@@ -436,8 +440,34 @@ private void onReplayError(final Throwable ex) {
     /**
      * Handles the happy replay case.
      */
-    private void onReplaySuccess() {
+    private void onReplaySuccess(final Bookmark actualResult) {
         commandLogEntry() // refetch from persistence
-            .ifPresent(entry->entry.saveAnalysis(null));
+            .ifPresent(entry->{
+                entry.saveAnalysis(null);
+                notifyReplayResultMapped(entry, actualResult);
+            });
+    }
+
+    void notifyReplayResultMapped(
+            final CommandLogEntry commandLogEntry,
+            final Bookmark actualResult) {
+        final Bookmark recordedResult = commandLogEntry.getResult();
+        if (recordedResult == null || actualResult == null) {
+            return;
+        }
+        _NullSafe.stream(replayContext.replayResultMappingListeners())
+            .forEach(listener -> notifyReplayResultMapped(listener, recordedResult, actualResult, commandLogEntry));
+    }
+
+    private void notifyReplayResultMapped(
+            final ReplayResultMappingListener listener,
+            final Bookmark recordedResult,
+            final Bookmark actualResult,
+            final CommandLogEntry commandLogEntry) {
+        try {
+            listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+        } catch (Exception ex) {
+            log.warn("Replay result mapping listener failed", ex);
+        }
     }
 }
\ No newline at end of file
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/ReplayResultMappingListener.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/ReplayResultMappingListener.java
new file mode 100644
index 00000000000..691aee0c776
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/ReplayResultMappingListener.java
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.spi;
+
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+
+/**
+ * Listens for mappings from imported replay result bookmarks to actual replay result bookmarks.
+ *
+ * @since 2.1 {@index}
+ */
+public interface ReplayResultMappingListener {
+
+    /**
+     * Notifies that replay produced an actual result bookmark for a command whose imported command log entry had a recorded result bookmark.
+     *
+     * @param recordedResult the result bookmark recorded during import
+     * @param actualResult the result bookmark produced by replay execution
+     * @param commandLogEntry the replayed command log entry
+     */
+    void onReplayResultMapped(
+            Bookmark recordedResult,
+            Bookmark actualResult,
+            CommandLogEntry commandLogEntry);
+
+}
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandResultMappingTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandResultMappingTest.java
new file mode 100644
index 00000000000..bc9620074e7
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandResultMappingTest.java
@@ -0,0 +1,136 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.transaction.annotation.Propagation;
+
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.applib.services.xactn.TransactionService;
+import org.apache.causeway.commons.functional.Try;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
+import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
+import org.apache.causeway.schema.cmd.v2.CommandDto;
+
+class ReplayableCommandResultMappingTest {
+
+    @Test
+    void notifies_listener_when_recorded_and_actual_results_differ() {
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, actualResult);
+
+        verify(listener).onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+    }
+
+    @Test
+    void notifies_listener_when_recorded_and_actual_results_are_equal() {
+        Bookmark result = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(result);
+        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, result);
+
+        verify(listener).onReplayResultMapped(result, result, commandLogEntry);
+    }
+
+    @Test
+    void does_not_notify_listener_when_recorded_result_is_missing() {
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(null);
+        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, actualResult);
+
+        verify(listener, never()).onReplayResultMapped(any(), any(), any());
+    }
+
+    @Test
+    void does_not_notify_listener_when_actual_result_is_missing() {
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, null);
+
+        verify(listener, never()).onReplayResultMapped(any(), any(), any());
+    }
+
+    @Test
+    void does_not_notify_listener_when_replay_fails() throws Exception {
+        UUID interactionId = UUID.randomUUID();
+        CommandDto commandDto = new CommandDto();
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        when(commandLogEntry.getInteractionId()).thenReturn(interactionId);
+        when(commandLogEntry.getCommandDto()).thenReturn(commandDto);
+        when(commandLogEntry.getReplayState()).thenReturn(ReplayState.PENDING);
+
+        CommandLogEntryRepository commandLogEntryRepository = mock(CommandLogEntryRepository.class);
+        when(commandLogEntryRepository.findByInteractionId(interactionId)).thenReturn(Optional.of(commandLogEntry));
+
+        TransactionService transactionService = mock(TransactionService.class);
+        AtomicInteger transactionCall = new AtomicInteger();
+        when(transactionService.callTransactional(any(Propagation.class), any(Callable.class)))
+                .thenAnswer(invocation -> {
+                    @SuppressWarnings("unchecked")
+                    Callable<Object> callable = invocation.getArgument(1);
+                    if (transactionCall.getAndIncrement() == 0) {
+                        return Try.failure(new RuntimeException("replay failed"));
+                    }
+                    return Try.call(callable);
+                });
+
+        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
+        ReplayContext replayContext = new ReplayContext(
+                null, null, transactionService, commandLogEntryRepository, null, null, List.of(listener));
+
+        new ReplayableCommand(interactionId, replayContext).tryReplayOrRetry();
+
+        verify(listener, never()).onReplayResultMapped(any(), any(), any());
+    }
+
+    private static ReplayableCommand replayableCommand(final ReplayResultMappingListener listener) {
+        ReplayContext replayContext = new ReplayContext(null, null, null, null, null, null, List.of(listener));
+        return new ReplayableCommand(UUID.randomUUID(), replayContext);
+    }
+
+    private static CommandLogEntry commandLogEntryWithRecordedResult(final Bookmark recordedResult) {
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        when(commandLogEntry.getResult()).thenReturn(recordedResult);
+        return commandLogEntry;
+    }
+}
diff --git a/openspec/changes/notify-replay-result-mapping/design.md b/openspec/changes/notify-replay-result-mapping/design.md
index f095286dd6e..ea62fdb06de 100644
--- a/openspec/changes/notify-replay-result-mapping/design.md
+++ b/openspec/changes/notify-replay-result-mapping/design.md
@@ -24,7 +24,7 @@ Applications that maintain cross-environment references need a supported SPI to
 
 ## Decisions
 
-- Add an SPI interface in the command log applib replay package or an adjacent SPI package.
+- Add an SPI interface in the command log module's applib SPI package.
   The SPI should expose a method such as `onReplayResultMapped(Bookmark recordedResult, Bookmark actualResult, CommandLogEntry commandLogEntry)` or an equivalent event object.
   Alternative considered: publish a domain event, but an SPI is clearer for application services that need deterministic post-replay callbacks.
 
@@ -40,11 +40,11 @@ Applications that maintain cross-environment references need a supported SPI to
   Equality can be useful for auditing and keeps the SPI semantics simple: successful replay produced a known pair.
   Alternative considered: suppress equal pairs, but that hides successful correlation from applications that want a complete replay result stream.
 
-- Provide a no-op default implementation if module registration requires a concrete bean.
-  This keeps the extension opt-in for applications and avoids changing behavior when no application SPI is present.
+- Inject the available SPI implementations as a list and allow the list to be empty.
+  This keeps the extension opt-in for applications and avoids requiring a no-op implementation.
 
 ## Risks / Trade-offs
 
 - [Risk] SPI exceptions could interfere with replay success state updates → Catch and record SPI failures as replay failures only if the implementation policy explicitly requires it; otherwise log and keep replay success behavior stable.
 - [Risk] Applications may expect bookmarks to resolve to objects → Document that the SPI receives bookmarks only and object lookup is the application's responsibility.
-- [Risk] Multiple SPI implementations may exist → Invoke all discovered implementations in a deterministic order if the framework supplies a list, or document single-bean semantics if only one service is injected.
+- [Risk] Multiple SPI implementations may exist → Invoke all discovered implementations in the order supplied by the framework.
diff --git a/openspec/changes/notify-replay-result-mapping/tasks.md b/openspec/changes/notify-replay-result-mapping/tasks.md
index 7fbd7e328a3..5fe488637da 100644
--- a/openspec/changes/notify-replay-result-mapping/tasks.md
+++ b/openspec/changes/notify-replay-result-mapping/tasks.md
@@ -1,21 +1,21 @@
 ## 1. SPI Definition
 
-- [ ] 1.1 Add a replay result mapping SPI interface that accepts the recorded result bookmark, actual result bookmark, and replayed `CommandLogEntry` context.
-- [ ] 1.2 Add a no-op/default SPI implementation or optional injection strategy so replay works when applications do not provide an implementation.
-- [ ] 1.3 Register the SPI or default implementation with the command log applib module if required.
+- [x] 1.1 Add a replay result mapping SPI interface that accepts the recorded result bookmark, actual result bookmark, and replayed `CommandLogEntry` context.
+- [x] 1.2 Add optional listener injection so replay works when applications do not provide an implementation.
+- [x] 1.3 Wire available SPI implementations into the command replay context.
 
 ## 2. Replay Integration
 
-- [ ] 2.1 Update `ReplayableCommand#tryReplay` success handling to retain the actual replay result bookmark.
-- [ ] 2.2 Read the recorded result bookmark from the imported replay `CommandLogEntry`.
-- [ ] 2.3 Notify the SPI after successful replay when both recorded and actual result bookmarks are non-null.
-- [ ] 2.4 Do not notify the SPI for failed replay attempts, missing recorded bookmarks, or missing actual bookmarks.
-- [ ] 2.5 Keep existing replay state and analysis updates unchanged.
+- [x] 2.1 Update `ReplayableCommand#tryReplay` success handling to retain the actual replay result bookmark.
+- [x] 2.2 Read the recorded result bookmark from the imported replay `CommandLogEntry`.
+- [x] 2.3 Notify the SPI after successful replay when both recorded and actual result bookmarks are non-null.
+- [x] 2.4 Do not notify the SPI for failed replay attempts, missing recorded bookmarks, or missing actual bookmarks.
+- [x] 2.5 Keep existing replay state and analysis updates unchanged.
 
 ## 3. Tests
 
-- [ ] 3.1 Add tests that a successful replay with different recorded and actual result bookmarks notifies the SPI with both values.
-- [ ] 3.2 Add tests that a successful replay with equal recorded and actual result bookmarks still notifies the SPI.
-- [ ] 3.3 Add tests that failed replay attempts do not notify the SPI.
-- [ ] 3.4 Add tests that missing recorded or actual result bookmarks do not notify the SPI.
-- [ ] 3.5 Run focused command replay tests.
+- [x] 3.1 Add tests that a successful replay with different recorded and actual result bookmarks notifies the SPI with both values.
+- [x] 3.2 Add tests that a successful replay with equal recorded and actual result bookmarks still notifies the SPI.
+- [x] 3.3 Add tests that failed replay attempts do not notify the SPI.
+- [x] 3.4 Add tests that missing recorded or actual result bookmarks do not notify the SPI.
+- [x] 3.5 Run focused command replay tests.


(causeway) 23/42: CAUSEWAY-4010: proposes listener SPI remap simplification

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit f90779fe0ec0429a66e05cf08adf7f1a8a9edc04
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 16:50:13 2026 +0100

    CAUSEWAY-4010: proposes listener SPI remap simplification
---
 .../.openspec.yaml                                 |  2 +
 .../simplify-listener-spi-remap-method/design.md   | 50 ++++++++++++++++++++++
 .../simplify-listener-spi-remap-method/proposal.md | 27 ++++++++++++
 .../specs/command-replay-result-mapping/spec.md    | 38 ++++++++++++++++
 .../simplify-listener-spi-remap-method/tasks.md    | 19 ++++++++
 5 files changed, 136 insertions(+)

diff --git a/openspec/changes/simplify-listener-spi-remap-method/.openspec.yaml b/openspec/changes/simplify-listener-spi-remap-method/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/simplify-listener-spi-remap-method/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/simplify-listener-spi-remap-method/design.md b/openspec/changes/simplify-listener-spi-remap-method/design.md
new file mode 100644
index 00000000000..13ef1fea710
--- /dev/null
+++ b/openspec/changes/simplify-listener-spi-remap-method/design.md
@@ -0,0 +1,50 @@
+## Context
+
+The command replay mapping SPI currently supports replay input remapping through separate callbacks for command targets and reference-valued action parameters.
+Both callbacks ultimately ask the same question: whether a recorded bookmark should be replaced before replay execution.
+The reference-parameter callback also exposes parameter name and index, but that metadata is not required for the intended mapping use case and makes implementations more complex.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Simplify `CommandReplayMappingListener` so target and reference-parameter remapping both call one `remap(CommandLogEntry, Bookmark)` method.
+- Preserve existing replay behavior for target remapping, reference-parameter remapping, stored DTO immutability, and result mapping notification.
+- Keep the listener resilient by continuing to treat remapping exceptions as no-op mappings.
+- Update tests and OpenSpec coverage to describe the simplified SPI contract.
+
+**Non-Goals:**
+
+- Do not add a discriminator for whether a bookmark came from a target or reference parameter.
+- Do not expose parameter name, parameter index, or DTO internals through the remapping SPI.
+- Do not change YAML import/export formats or command DTO structures.
+- Do not change the result mapping notification method.
+
+## Decisions
+
+- Use a single `default Optional<Bookmark> remap(CommandLogEntry commandLogEntry, Bookmark recordedBookmark)` method on `CommandReplayMappingListener`.
+This keeps the SPI focused on bookmark replacement and avoids leaking replay DTO details to implementations.
+The alternative was to keep separate methods or add a context enum, but both preserve distinctions that are not needed for the current use case.
+
+- Call the same listener method from both target and reference-parameter traversal paths.
+This preserves the existing implementation structure while removing duplicated listener callback code.
+The alternative was to merge traversal into one generic DTO visitor, but that would create a larger refactor than needed for an SPI simplification.
+
+- Keep `onReplayResultMapped(...)` unchanged.
+The requested simplification only concerns replay input remapping, and result notification still needs both recorded and actual result bookmarks.
+The alternative was to rename or reshape result notification for symmetry, but that would add unrelated API churn.
+
+- Treat this as a breaking API change for the recently introduced SPI.
+Existing implementors must rename their remapping override and drop parameter-specific arguments.
+The alternative was to leave deprecated bridge methods, but the SPI was introduced recently and the goal is to remove noise rather than preserve it.
+
+## Risks / Trade-offs
+
+- Existing listener implementations that override `remapTarget(...)` or `remapReferenceParameter(...)` will no longer compile.
+Mitigation: document the breaking change in the proposal and update tests to show the replacement override.
+
+- Implementations cannot make remapping decisions based on parameter name or index.
+Mitigation: this is intentional because that information is not required for the desired SPI use case.
+
+- A single method means an implementation cannot distinguish targets from reference parameters through the SPI signature alone.
+Mitigation: callers that need different behavior can use the recorded bookmark and command log entry context, but no dedicated source discriminator will be introduced.
diff --git a/openspec/changes/simplify-listener-spi-remap-method/proposal.md b/openspec/changes/simplify-listener-spi-remap-method/proposal.md
new file mode 100644
index 00000000000..01a5fb2d4dc
--- /dev/null
+++ b/openspec/changes/simplify-listener-spi-remap-method/proposal.md
@@ -0,0 +1,27 @@
+## Why
+
+The recently introduced command replay mapping listener exposes separate target and reference-parameter remapping methods, but callers only need to provide a replacement bookmark for a recorded bookmark.
+The parameter-specific API adds names and indexes that are not required for the intended SPI use and makes implementations noisier than necessary.
+
+## What Changes
+
+- **BREAKING**: Replace the listener's separate target and reference-parameter remapping methods with a single `remap(...)` method used for both command targets and reference parameters.
+- Keep replay result mapping notification behavior unchanged.
+- Keep replay-time input remapping behavior unchanged except for the simplified listener callback shape.
+- Update tests and documentation/specification to describe the single remapping callback.
+
+## Capabilities
+
+### New Capabilities
+
+- None.
+
+### Modified Capabilities
+
+- `command-replay-result-mapping`: Simplify the command replay mapping SPI requirements so target and reference-parameter remapping use one common remapping method.
+
+## Impact
+
+- Affects the command log applib SPI `CommandReplayMappingListener`.
+- Affects replay input remapping implementation in the command log applib replay flow.
+- Affects tests and any application implementations of the recently introduced listener SPI.
diff --git a/openspec/changes/simplify-listener-spi-remap-method/specs/command-replay-result-mapping/spec.md b/openspec/changes/simplify-listener-spi-remap-method/specs/command-replay-result-mapping/spec.md
new file mode 100644
index 00000000000..33941e1793e
--- /dev/null
+++ b/openspec/changes/simplify-listener-spi-remap-method/specs/command-replay-result-mapping/spec.md
@@ -0,0 +1,38 @@
+## MODIFIED Requirements
+
+### Requirement: Replay mapping SPI can remap command targets before execution
+The system SHALL ask the command replay mapping SPI's common remap method whether each replayed command target bookmark should be remapped before command execution.
+When the SPI provides a replacement target bookmark, the system SHALL execute the replayed command using the replacement target identifier.
+When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded target identifier.
+The system SHALL use the same remap method for command targets and reference action parameters.
+
+#### Scenario: Target bookmark is remapped
+- **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
+- **AND** the command replay mapping SPI returns replacement bookmark `demoCustomer:2` from its common remap method
+- **THEN** the system executes the replayed command against target bookmark `demoCustomer:2`
+
+#### Scenario: Target bookmark is not remapped
+- **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
+- **AND** no command replay mapping SPI provides a replacement bookmark from its common remap method
+- **THEN** the system executes the replayed command against target bookmark `demoCustomer:1`
+
+### Requirement: Replay mapping SPI can remap reference action parameters before execution
+The system SHALL ask the command replay mapping SPI's common remap method whether each replayed action parameter represented as `type: "reference"` with a populated `reference` OID should be remapped before command execution.
+When the SPI provides a replacement reference bookmark, the system SHALL execute the replayed command using the replacement parameter reference.
+When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded parameter reference.
+The system MUST leave non-reference action parameters unchanged by this reference remapping flow.
+The system MUST NOT require the SPI to receive parameter name or parameter index metadata to remap a reference action parameter.
+
+#### Scenario: Reference action parameter is remapped
+- **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+- **AND** the command replay mapping SPI returns replacement bookmark `simple.SimpleObject:2` from its common remap method
+- **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "2"`
+
+#### Scenario: Reference action parameter is not remapped
+- **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+- **AND** no command replay mapping SPI provides a replacement bookmark from its common remap method
+- **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+
+#### Scenario: Non-reference action parameter is not remapped by reference flow
+- **WHEN** command replay is about to execute an action command with a parameter that is not represented as `type: "reference"`
+- **THEN** the system does not ask the command replay mapping SPI's common remap method to replace that parameter
diff --git a/openspec/changes/simplify-listener-spi-remap-method/tasks.md b/openspec/changes/simplify-listener-spi-remap-method/tasks.md
new file mode 100644
index 00000000000..dd14c357318
--- /dev/null
+++ b/openspec/changes/simplify-listener-spi-remap-method/tasks.md
@@ -0,0 +1,19 @@
+## 1. SPI Simplification
+
+- [ ] 1.1 Replace `CommandReplayMappingListener#remapTarget(...)` and `remapReferenceParameter(...)` with one default `remap(CommandLogEntry, Bookmark)` method.
+- [ ] 1.2 Update listener Javadoc to describe common bookmark remapping for targets and reference parameters.
+- [ ] 1.3 Keep `onReplayResultMapped(...)` unchanged.
+
+## 2. Replay Remapping Flow
+
+- [ ] 2.1 Update target remapping in `ReplayableCommand` to call the listener's common `remap(...)` method.
+- [ ] 2.2 Update reference-parameter remapping in `ReplayableCommand` to call the same `remap(...)` method without passing parameter name or index.
+- [ ] 2.3 Preserve no-op behavior when no listener returns a replacement or a listener throws.
+- [ ] 2.4 Preserve replay-time DTO copy behavior so recorded command data remains unchanged.
+
+## 3. Tests and Verification
+
+- [ ] 3.1 Update `ReplayableCommandMappingTest` mocks and verifications for the single remap method.
+- [ ] 3.2 Add or update assertions showing target and reference-parameter remapping both use the same SPI method.
+- [ ] 3.3 Run the command log applib replay mapping tests.
+- [ ] 3.4 Run `openspec validate --all --strict`.


(causeway) 42/42: CAUSEWAY-4010: archives persistent replay mapping listener

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit bbaf736e1c8ea1dcfac253410d2aa6b9ee119607
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 23:45:37 2026 +0100

    CAUSEWAY-4010: archives persistent replay mapping listener
---
 .../.openspec.yaml                                 |  0
 .../design.md                                      |  0
 .../proposal.md                                    |  0
 .../spec.md                                        |  0
 .../spec.md                                        |  0
 .../tasks.md                                       |  0
 .../spec.md                                        | 32 +++++++++++++++++++---
 .../spec.md                                        |  6 +++-
 8 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/openspec/changes/persistent-command-replay-mapping-listener/.openspec.yaml b/openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/.openspec.yaml
similarity index 100%
rename from openspec/changes/persistent-command-replay-mapping-listener/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/.openspec.yaml
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/design.md b/openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/design.md
similarity index 100%
rename from openspec/changes/persistent-command-replay-mapping-listener/design.md
rename to openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/design.md
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/proposal.md b/openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/proposal.md
similarity index 100%
rename from openspec/changes/persistent-command-replay-mapping-listener/proposal.md
rename to openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/proposal.md
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
similarity index 100%
rename from openspec/changes/persistent-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
rename to openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md b/openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
similarity index 100%
copy from openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
copy to openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/tasks.md b/openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/tasks.md
similarity index 100%
rename from openspec/changes/persistent-command-replay-mapping-listener/tasks.md
rename to openspec/changes/archive/2026-06-04-persistent-command-replay-mapping-listener/tasks.md
diff --git a/openspec/specs/default-command-replay-mapping-listener/spec.md b/openspec/specs/default-command-replay-mapping-listener/spec.md
index 2a3463904e4..4dd70ccb4d8 100644
--- a/openspec/specs/default-command-replay-mapping-listener/spec.md
+++ b/openspec/specs/default-command-replay-mapping-listener/spec.md
@@ -55,11 +55,35 @@ The listener SHALL perform remapping without resolving recorded or actual bookma
 - **THEN** the default listener returns no replacement
 
 ### Requirement: Default replay mapping listener uses in-memory state
-The default command replay mapping listener SHALL store mappings in memory only.
-The system SHALL NOT require the default listener to persist mappings across JVM restarts, application nodes, or Spring bean lifecycle recreation.
+When the built-in replay mapping listener storage strategy is `IN_MEMORY`, the default command replay mapping listener SHALL store mappings in memory only.
+The system SHALL NOT require the in-memory listener to persist mappings across JVM restarts, application nodes, or Spring bean lifecycle recreation.
+The system SHALL use `IN_MEMORY` as the default built-in replay mapping listener storage strategy.
 
 #### Scenario: Mapping state is scoped to listener instance
-- **WHEN** the default listener records that `demoInvoice:1` mapped to actual bookmark `demoInvoice:2`
-- **AND** a new default listener instance is created
+- **WHEN** the in-memory listener records that `demoInvoice:1` mapped to actual bookmark `demoInvoice:2`
+- **AND** a new in-memory listener instance is created
 - **THEN** the new listener instance has no required remembered mapping for `demoInvoice:1`
 
+#### Scenario: In-memory listener is the default storage strategy
+- **WHEN** the application does not configure a built-in replay mapping listener storage strategy
+- **THEN** the system uses the in-memory listener as the built-in replay mapping listener
+
+### Requirement: Built-in in-memory replay mapping listener is conditionally enabled
+When the built-in replay mapping listener storage strategy is `IN_MEMORY` and no application-defined `CommandReplayMappingListener` bean is present, the command log autoconfiguration SHALL provide the in-memory replay mapping listener.
+When an application-defined `CommandReplayMappingListener` bean is present, the command log autoconfiguration MUST NOT provide the in-memory replay mapping listener.
+When the storage strategy is not `IN_MEMORY`, the command log autoconfiguration MUST NOT provide the in-memory replay mapping listener.
+
+#### Scenario: In-memory listener is autoconfigured when selected
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `IN_MEMORY`
+- **AND** the application context contains no custom `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration provides the in-memory replay mapping listener
+
+#### Scenario: In-memory listener backs off for custom listener
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `IN_MEMORY`
+- **AND** the application context contains a custom `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration does not provide the in-memory replay mapping listener
+
+#### Scenario: In-memory listener is not created for persistent storage
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `PERSISTENT`
+- **THEN** the command log autoconfiguration does not provide the in-memory replay mapping listener
+
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md b/openspec/specs/persistent-command-replay-mapping-listener/spec.md
similarity index 97%
rename from openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
rename to openspec/specs/persistent-command-replay-mapping-listener/spec.md
index 189ef0b2f8a..2e482f5e373 100644
--- a/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
+++ b/openspec/specs/persistent-command-replay-mapping-listener/spec.md
@@ -1,5 +1,8 @@
-## ADDED Requirements
+# persistent-command-replay-mapping-listener Specification
 
+## Purpose
+TBD - created by archiving change persistent-command-replay-mapping-listener. Update Purpose after archive.
+## Requirements
 ### Requirement: Persistent replay mapping listener records result mappings
 The system SHALL provide a persistent command replay mapping listener that records non-identity replay result mappings by recorded result bookmark.
 The persisted mapping SHALL store the recorded bookmark and actual bookmark as bookmark value type properties.
@@ -96,3 +99,4 @@ The list action SHALL return persisted mappings using the abstract applib reposi
 - **WHEN** a user invokes the command log menu action for replay result mappings
 - **THEN** the system returns the persisted replay result mappings
 - **AND** each mapping displays its recorded and actual bookmarks
+


(causeway) 14/42: CAUSEWAY-4010: reworks command import manager

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit d20b57357fa2aa504279f468c246b6e735089746
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 13:22:26 2026 +0100

    CAUSEWAY-4010: reworks command import manager
---
 .../applib/util/schema/CommandDtoUtils.java        | 93 ++++++++++++++++++++++
 .../CommandDtoUtils_toYaml_fromYaml_Test.java      | 72 +++++++++++++++++
 .../CommandReplayManager_importCommands.java       | 13 ++-
 .../CommandReplayManager_importCommandsTest.java   | 85 ++++++++++++++++++++
 .../changes/rework-command-import-manager/tasks.md | 28 +++----
 5 files changed, 274 insertions(+), 17 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java b/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java
index f412bc062c0..a9feeae9d0a 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java
@@ -211,6 +211,47 @@ public List<CommandDto> fromYaml(final DataSource commandDtosYaml) {
                 .orElseGet(Collections::emptyList);
     }
 
+    public List<ImportedCommandDto> fromYamlForReplay(final DataSource commandDtosYaml) {
+        failIfYamlListRoot(commandDtosYaml);
+
+        final var customizer = yamlCommandDtoCustomizer();
+
+        final Try<List<CommandExportDto>> asWrappedMultiDocument = tryReadAsMultiDocument(
+                CommandExportDto.class, commandDtosYaml, customizer)
+                .mapSuccessAsNullable(CommandDtoUtils::requireAtLeastOneCommandExport);
+        if (asWrappedMultiDocument.isSuccess()) {
+            return importedCommandDtosFromExport(asWrappedMultiDocument.getValue().orElseGet(Collections::emptyList));
+        }
+
+        final Try<List<CommandDto>> asMultiDocument = tryReadAsMultiDocument(CommandDto.class, commandDtosYaml, customizer);
+        asMultiDocument.getFailure().ifPresent(multiDocFailure ->
+                asWrappedMultiDocument.getFailure().ifPresent(multiDocFailure::addSuppressed));
+
+        return asMultiDocument
+                .mapSuccessAsNullable(CommandDtoUtils::importedCommandDtosFromCommandDtos)
+                .ifFailureFail()
+                .getValue()
+                .orElseGet(Collections::emptyList);
+    }
+
+    private void failIfYamlListRoot(final DataSource commandDtosYaml) {
+        final String yaml = commandDtosYaml.tryReadAsStringUtf8()
+                .ifFailureFail()
+                .getValue()
+                .orElse("")
+                .stripLeading();
+        if (yaml.startsWith("- ") || yaml.startsWith("-\n")) {
+            throw new IllegalArgumentException("Command replay import requires multi-document YAML, not a YAML list");
+        }
+    }
+
+    private List<CommandExportDto> requireAtLeastOneCommandExport(final List<CommandExportDto> commandExports) {
+        if (_NullSafe.stream(commandExports).anyMatch(commandExport -> commandExport.getCommand() != null)) {
+            return commandExports;
+        }
+        throw new IllegalArgumentException("YAML does not contain any CommandExportDto documents with embedded commands");
+    }
+
     private List<CommandDto> commandDtosFromExport(final List<CommandExportDto> commandExports) {
         return _NullSafe.stream(commandExports)
                 .map(CommandExportDto::getCommand)
@@ -218,6 +259,23 @@ private List<CommandDto> commandDtosFromExport(final List<CommandExportDto> comm
                 .collect(Collectors.toList());
     }
 
+    private List<ImportedCommandDto> importedCommandDtosFromExport(final List<CommandExportDto> commandExports) {
+        return _NullSafe.stream(commandExports)
+                .filter(commandExport -> commandExport.getCommand() != null)
+                .map(commandExport -> ImportedCommandDto.of(
+                        commandExport.getCommand(),
+                        Optional.ofNullable(commandExport.getReturnedObject())
+                                .map(BookmarkDto::toBookmark)
+                                .orElse(null)))
+                .collect(Collectors.toList());
+    }
+
+    private List<ImportedCommandDto> importedCommandDtosFromCommandDtos(final List<CommandDto> commandDtos) {
+        return _NullSafe.stream(commandDtos)
+                .map(commandDto -> ImportedCommandDto.of(commandDto, null))
+                .collect(Collectors.toList());
+    }
+
     private JsonUtils.JacksonCustomizer yamlCommandDtoCustomizer() {
         return mapper -> {
             JsonUtils.jaxbAnnotationSupport(mapper);
@@ -227,6 +285,37 @@ private JsonUtils.JacksonCustomizer yamlCommandDtoCustomizer() {
         };
     }
 
+    public static class ImportedCommandDto {
+
+        private CommandDto command;
+        private Bookmark returnedObject;
+
+        public static ImportedCommandDto of(
+                final CommandDto command,
+                final Bookmark returnedObject) {
+            final var importedCommandDto = new ImportedCommandDto();
+            importedCommandDto.setCommand(command);
+            importedCommandDto.setReturnedObject(returnedObject);
+            return importedCommandDto;
+        }
+
+        public CommandDto getCommand() {
+            return command;
+        }
+
+        public void setCommand(final CommandDto command) {
+            this.command = command;
+        }
+
+        public Bookmark getReturnedObject() {
+            return returnedObject;
+        }
+
+        public void setReturnedObject(final Bookmark returnedObject) {
+            this.returnedObject = returnedObject;
+        }
+    }
+
     public static class CommandExportDto {
 
         private CommandDto command;
@@ -288,6 +377,10 @@ public String getId() {
         public void setId(final String id) {
             this.id = id;
         }
+
+        public Bookmark toBookmark() {
+            return Bookmark.forLogicalTypeNameAndIdentifier(logicalTypeName, id);
+        }
     }
 
     private <T> Try<List<T>> tryReadAsMultiDocument(
diff --git a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java
index 61d7f25bae3..b10090c686a 100644
--- a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java
+++ b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java
@@ -72,6 +72,43 @@ void from_yaml_accepts_wrapped_export_shape_and_ignores_returned_object_metadata
                 .satisfies(command -> Assertions.assertThat(command.getInteractionId()).isEqualTo("with-result"));
     }
 
+    @Test
+    void from_yaml_for_replay_accepts_wrapped_export_shape_and_keeps_returned_object_metadata() {
+        CommandDto withResult = command("with-result");
+        String yaml = CommandDtoUtils.toYamlExport(List.of(
+                CommandDtoUtils.CommandExportDto.of(
+                        withResult,
+                        Bookmark.forLogicalTypeNameAndIdentifier("demo.Invoice", "456"))));
+
+        List<CommandDtoUtils.ImportedCommandDto> importedCommandDtos = CommandDtoUtils.fromYamlForReplay(
+                DataSource.ofStringUtf8(yaml));
+
+        Assertions.assertThat(importedCommandDtos)
+                .singleElement()
+                .satisfies(importedCommandDto -> {
+                    Assertions.assertThat(importedCommandDto.getCommand().getInteractionId()).isEqualTo("with-result");
+                    Assertions.assertThat(importedCommandDto.getReturnedObject())
+                            .isEqualTo(Bookmark.forLogicalTypeNameAndIdentifier("demo.Invoice", "456"));
+                });
+    }
+
+    @Test
+    void from_yaml_for_replay_accepts_wrapped_export_shape_without_returned_object_metadata() {
+        CommandDto voidResult = command("void-result");
+        String yaml = CommandDtoUtils.toYamlExport(List.of(
+                CommandDtoUtils.CommandExportDto.of(voidResult, null)));
+
+        List<CommandDtoUtils.ImportedCommandDto> importedCommandDtos = CommandDtoUtils.fromYamlForReplay(
+                DataSource.ofStringUtf8(yaml));
+
+        Assertions.assertThat(importedCommandDtos)
+                .singleElement()
+                .satisfies(importedCommandDto -> {
+                    Assertions.assertThat(importedCommandDto.getCommand().getInteractionId()).isEqualTo("void-result");
+                    Assertions.assertThat(importedCommandDto.getReturnedObject()).isNull();
+                });
+    }
+
     @Test
     void from_yaml_keeps_legacy_command_dto_shape() {
         CommandDto legacy = command("legacy-command");
@@ -84,6 +121,41 @@ void from_yaml_keeps_legacy_command_dto_shape() {
                 .satisfies(command -> Assertions.assertThat(command.getInteractionId()).isEqualTo("legacy-command"));
     }
 
+    @Test
+    void from_yaml_for_replay_keeps_legacy_multi_document_command_dto_shape() {
+        CommandDto legacy = command("legacy-command");
+        String yaml = CommandDtoUtils.toYaml(List.of(legacy));
+
+        List<CommandDtoUtils.ImportedCommandDto> importedCommandDtos = CommandDtoUtils.fromYamlForReplay(
+                DataSource.ofStringUtf8(yaml));
+
+        Assertions.assertThat(importedCommandDtos)
+                .singleElement()
+                .satisfies(importedCommandDto -> {
+                    Assertions.assertThat(importedCommandDto.getCommand().getInteractionId()).isEqualTo("legacy-command");
+                    Assertions.assertThat(importedCommandDto.getReturnedObject()).isNull();
+                });
+    }
+
+    @Test
+    void from_yaml_for_replay_rejects_legacy_command_dto_list_shape() {
+        String yaml = "- majorVersion: \"2\"\n"
+                + "  minorVersion: \"0\"\n"
+                + "  interactionId: \"list-command\"\n"
+                + "  username: \"sven\"\n"
+                + "  targets:\n"
+                + "    oid:\n"
+                + "    - type: \"demo.Customer\"\n"
+                + "      id: \"123\"\n"
+                + "  member: !<ACT>\n"
+                + "    logicalMemberIdentifier: \"demo.Customer#noop\"\n"
+                + "    interactionType: \"action_invocation\"\n";
+
+        Throwable thrown = Assertions.catchThrowable(() -> CommandDtoUtils.fromYamlForReplay(DataSource.ofStringUtf8(yaml)));
+
+        Assertions.assertThat(thrown).isNotNull();
+    }
+
     @Test
     void localDate_roundtrips_as_date_only_without_timezone() throws Exception {
         TimeZone originalDefault = TimeZone.getDefault();
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
index c8ce136ce38..ea0d31e76db 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
@@ -12,6 +12,7 @@
 import org.apache.causeway.applib.annotation.*;
 import org.apache.causeway.applib.util.schema.CommandDtoUtils;
 import org.apache.causeway.applib.value.Blob;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
 import org.apache.causeway.schema.cmd.v2.CommandDto;
 
@@ -40,11 +41,17 @@ public CommandReplayManager act(
             @ParameterLayout(describedAs = "Change the baseline to the timestamp of the oldest, so that they are listed at top") final boolean moveBaselineToOldest) {
         var yamlDs = commandsYaml.asDataSource();
 
-        final List<CommandDto> commandDtos = CommandDtoUtils.fromYaml(yamlDs);
-        commandDtos.forEach(commandLogEntryRepository::saveForReplay);
+        final List<CommandDtoUtils.ImportedCommandDto> importedCommandDtos = CommandDtoUtils.fromYamlForReplay(yamlDs);
+        importedCommandDtos.forEach(importedCommandDto -> {
+            final CommandLogEntry commandLogEntry = commandLogEntryRepository.saveForReplay(importedCommandDto.getCommand());
+            if (importedCommandDto.getReturnedObject() != null) {
+                commandLogEntry.setResult(importedCommandDto.getReturnedObject());
+            }
+        });
 
-        return commandDtos.stream()
+        return importedCommandDtos.stream()
                 .filter(x -> moveBaselineToOldest)
+                .map(CommandDtoUtils.ImportedCommandDto::getCommand)
                 .map(CommandDto::getTimestamp)
                 .map(CommandReplayManager_importCommands::toJavaSqlTimestamp)
                 .sorted()
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommandsTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommandsTest.java
new file mode 100644
index 00000000000..1958120334e
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommandsTest.java
@@ -0,0 +1,85 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.applib.util.schema.CommandDtoUtils;
+import org.apache.causeway.applib.value.Blob;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+import org.apache.causeway.schema.cmd.v2.ActionDto;
+import org.apache.causeway.schema.cmd.v2.CommandDto;
+import org.apache.causeway.schema.common.v2.InteractionType;
+import org.apache.causeway.schema.common.v2.OidDto;
+import org.apache.causeway.schema.common.v2.OidsDto;
+
+class CommandReplayManager_importCommandsTest {
+
+    @Test
+    void imports_command_export_returned_object_as_command_log_result() {
+        CommandDto command = command("with-result");
+        Bookmark returnedObject = Bookmark.forLogicalTypeNameAndIdentifier("demo.Invoice", "456");
+        String yaml = CommandDtoUtils.toYamlExport(List.of(
+                CommandDtoUtils.CommandExportDto.of(command, returnedObject)));
+        Blob commandsYaml = new Blob("commands.yaml", "text", "yaml", yaml.getBytes(StandardCharsets.UTF_8));
+
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        CommandLogEntryRepository commandLogEntryRepository = mock(CommandLogEntryRepository.class);
+        when(commandLogEntryRepository.saveForReplay(any(CommandDto.class))).thenReturn(commandLogEntry);
+
+        CommandReplayManager_importCommands importCommands = new CommandReplayManager_importCommands(null);
+        importCommands.commandLogEntryRepository = commandLogEntryRepository;
+
+        importCommands.act(commandsYaml, false);
+
+        verify(commandLogEntryRepository).saveForReplay(any(CommandDto.class));
+        verify(commandLogEntry).setResult(returnedObject);
+    }
+
+    private static CommandDto command(final String interactionId) {
+        CommandDto command = new CommandDto();
+        command.setMajorVersion("2");
+        command.setMinorVersion("0");
+        command.setInteractionId(interactionId);
+        command.setUsername("sven");
+
+        OidDto oid = new OidDto();
+        oid.setType("demo.Customer");
+        oid.setId("123");
+        OidsDto targets = new OidsDto();
+        targets.getOid().add(oid);
+        command.setTargets(targets);
+
+        ActionDto action = new ActionDto();
+        action.setLogicalMemberIdentifier("demo.Customer#noop");
+        action.setInteractionType(InteractionType.ACTION_INVOCATION);
+        command.setMember(action);
+        return command;
+    }
+}
diff --git a/openspec/changes/rework-command-import-manager/tasks.md b/openspec/changes/rework-command-import-manager/tasks.md
index a06c5d188a4..e21063ab5c0 100644
--- a/openspec/changes/rework-command-import-manager/tasks.md
+++ b/openspec/changes/rework-command-import-manager/tasks.md
@@ -1,22 +1,22 @@
 ## 1. YAML Import Parsing
 
-- [ ] 1.1 Add a `CommandDtoUtils` import result type that exposes each parsed `CommandDto` with its optional returned object bookmark.
-- [ ] 1.2 Add a command replay import parser that first reads multi-document `CommandExportDto` YAML.
-- [ ] 1.3 Add fallback parsing for multi-document `CommandDto` YAML when `CommandExportDto` parsing fails.
-- [ ] 1.4 Remove list-of-`CommandDto` parsing from the command replay import path.
-- [ ] 1.5 Preserve useful failure details when neither supported multi-document format can be parsed.
+- [x] 1.1 Add a `CommandDtoUtils` import result type that exposes each parsed `CommandDto` with its optional returned object bookmark.
+- [x] 1.2 Add a command replay import parser that first reads multi-document `CommandExportDto` YAML.
+- [x] 1.3 Add fallback parsing for multi-document `CommandDto` YAML when `CommandExportDto` parsing fails.
+- [x] 1.4 Remove list-of-`CommandDto` parsing from the command replay import path.
+- [x] 1.5 Preserve useful failure details when neither supported multi-document format can be parsed.
 
 ## 2. Replay Import Persistence
 
-- [ ] 2.1 Update `CommandReplayManager_importCommands` to use the new import result model rather than only `List<CommandDto>`.
-- [ ] 2.2 Persist each imported command for replay through `CommandLogEntryRepository#saveForReplay`.
-- [ ] 2.3 Set the created `CommandLogEntry` result bookmark from `CommandExportDto.returnedObject` when present.
-- [ ] 2.4 Keep baseline movement based on the embedded command DTO timestamps.
+- [x] 2.1 Update `CommandReplayManager_importCommands` to use the new import result model rather than only `List<CommandDto>`.
+- [x] 2.2 Persist each imported command for replay through `CommandLogEntryRepository#saveForReplay`.
+- [x] 2.3 Set the created `CommandLogEntry` result bookmark from `CommandExportDto.returnedObject` when present.
+- [x] 2.4 Keep baseline movement based on the embedded command DTO timestamps.
 
 ## 3. Tests
 
-- [ ] 3.1 Add or update tests for importing multi-document `CommandExportDto` YAML with returned object metadata.
-- [ ] 3.2 Add or update tests for importing multi-document `CommandExportDto` YAML without returned object metadata.
-- [ ] 3.3 Add or update tests for legacy multi-document `CommandDto` YAML fallback.
-- [ ] 3.4 Add or update tests that a YAML list of `CommandDto` values is rejected by command replay import.
-- [ ] 3.5 Run the focused command DTO and command replay import test suite.
+- [x] 3.1 Add or update tests for importing multi-document `CommandExportDto` YAML with returned object metadata.
+- [x] 3.2 Add or update tests for importing multi-document `CommandExportDto` YAML without returned object metadata.
+- [x] 3.3 Add or update tests for legacy multi-document `CommandDto` YAML fallback.
+- [x] 3.4 Add or update tests that a YAML list of `CommandDto` values is rejected by command replay import.
+- [x] 3.5 Run the focused command DTO and command replay import test suite.


(causeway) 07/42: CAUSEWAY-4011: improves paging, cosmetics.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 6af965f0e37a8fba01ba7d1f64b807c1dfa28cd2
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 13:02:36 2026 +0100

    CAUSEWAY-4011: improves paging, cosmetics.
---
 .../applib/dom/replay/CommandExportManager.java    |  3 +-
 .../CommandExportManager.layout.fallback.xml       | 11 +++----
 .../replay/CommandExportManager_changeLimit.java   | 38 +++++++---------------
 .../dom/replay/CommandExportManager_nextPage.java  |  4 +--
 .../replay/CommandExportManager_previousPage.java  | 18 ++++------
 .../replay/CommandExportManager_toggleMode.java    |  3 +-
 .../CommandReplayManager.layout.fallback.xml       | 10 +++---
 .../dom/replay/HasBaseline_changeBaseline.java     |  4 +--
 .../applib/dom/replay/HasBaseline_nextHour.java    |  5 ++-
 .../dom/replay/HasBaseline_previousHour.java       |  2 +-
 10 files changed, 35 insertions(+), 63 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
index dac2f949750..e7aa2b43fed 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
@@ -107,8 +107,7 @@ Mode toggle() {
     @Getter
     private int limit;
 
-    @Property
-    @PropertyLayout(describedAs = "Whether to export or unexport commands")
+    @Programmatic
     @Getter
     private Mode mode;
 
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
index fe52c33b98a..0a76431e269 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
@@ -4,19 +4,16 @@
             <cpt:domainObject/>
         </bs:col>
         <bs:col span="3">
-            <cpt:fieldSet name=" " id="baseline">
+            <cpt:fieldSet name="Control" id="control">
+                <cpt:action id="toggleMode"/>
                 <cpt:property id="baseline">
                     <cpt:action id="previousHour"/>
-                    <cpt:action id="changeBaseline"/>
                     <cpt:action id="nextHour"/>
                 </cpt:property>
                 <cpt:property id="limit">
                     <cpt:action id="previousPage"/>
                     <cpt:action id="nextPage"/>
                 </cpt:property>
-                <cpt:property id="mode">
-                    <cpt:action id="ToggleMode"/>
-                </cpt:property>
             </cpt:fieldSet>
         </bs:col>
         <bs:col span="3">
@@ -49,8 +46,8 @@
         <bs:col span="12">
             <bs:row>
                 <bs:col span="12" size="MD">
-                    <cpt:collection defaultView="table" paged="15" id="notYetExported"/>
-                    <cpt:collection defaultView="table" paged="15" id="exported"/>
+                    <cpt:collection defaultView="table" paged="100" id="notYetExported"/>
+                    <cpt:collection defaultView="table" paged="100" id="exported"/>
                 </bs:col>
             </bs:row>
         </bs:col>
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_changeLimit.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_changeLimit.java
index 284308278a2..9a82c8a8937 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_changeLimit.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_changeLimit.java
@@ -4,8 +4,6 @@
 
 import org.apache.causeway.applib.annotation.*;
 
-import static org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager.Direction.NEXT;
-
 @Action(
         semantics = SemanticsOf.SAFE,
         commandPublishing = Publishing.DISABLED,
@@ -13,16 +11,15 @@
         executionPublishing = Publishing.DISABLED
 )
 @ActionLayout(
-        associateWith = "limit", sequence = "1",
-        position = ActionLayout.Position.PANEL,
-        describedAs = "Change number of commands in page"
+        associateWith = "limit", sequence = "2",
+        promptStyle = PromptStyle.INLINE_AS_IF_EDIT
 )
 @RequiredArgsConstructor
 public class CommandExportManager_changeLimit {
 
     public static int MAX_LIMIT = 100;
 
-    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_changeLimit> { }
+    public static class DomainEvent extends CommandExportManager.ActionDomainEvent<CommandExportManager_changeLimit> { }
 
     private final CommandExportManager commandExportManager;
 
@@ -30,31 +27,18 @@ public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExp
     public CommandExportManager act(int newLimit) {
         return commandExportManager.withLimit(newLimit);
     }
+
+
     @MemberSupport
-    public String validateNewLimit(int newLimit) {
-        if(newLimit < 0) {
-            return "Limit must be greater than or equal to 0.";
-        }
-        if(newLimit > MAX_LIMIT) {
-            return "Limit cannot be greater than " + MAX_LIMIT + ".";
-        }
-        return null;
+    public int defaultNewLimit() {
+        return commandExportManager.getLimit();
     }
 
     @MemberSupport
-    public String disableAct() {
-        final var commands = commandExportManager.commands(NEXT);
-        final var size = commands.size();
-        if (size == 0) {
-            return "Empty";
+    public String validateNewLimit(int newLimit) {
+        if(newLimit <= 0 || newLimit > MAX_LIMIT) {
+            return "Limit must be a in range [1, " + MAX_LIMIT + "].";
         }
-        final var lastReplayable = commands.get(size - 1);
-        return commandExportManager(lastReplayable).commands(NEXT).isEmpty() ? "No more commands" : null;
-    }
-
-    private CommandExportManager commandExportManager(ReplayableCommand lastReplayable) {
-        final var timestamp = lastReplayable.getTimestamp().toInstant();
-        final var baselinePlus5Millis = HasBaseline.addMillis(timestamp, 5);
-        return commandExportManager.withBaseline(baselinePlus5Millis);
+        return null;
     }
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
index 84021cd3466..e840c6c4987 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
@@ -14,14 +14,14 @@
 )
 @ActionLayout(
         associateWith = "limit", sequence = "2",
-        named = "Next Page",
+        named = "+1 page",
         position = ActionLayout.Position.BELOW,
         describedAs = "Move forward to next page of commands"
 )
 @RequiredArgsConstructor
 public class CommandExportManager_nextPage {
 
-    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_nextPage> { }
+    public static class DomainEvent extends CommandExportManager.ActionDomainEvent<CommandExportManager_nextPage> { }
 
     private final CommandExportManager commandExportManager;
 
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
index 4b4a59638b0..278a3331c26 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
@@ -14,37 +14,33 @@
 )
 @ActionLayout(
         associateWith = "limit", sequence = "1",
-        named = "Previous",
+        named = "-1 page",
         position = ActionLayout.Position.BELOW,
         describedAs = "Move backwards to previous page of commands"
 )
 @RequiredArgsConstructor
 public class CommandExportManager_previousPage {
 
-    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_previousPage> { }
+    public static class DomainEvent extends CommandExportManager.ActionDomainEvent<CommandExportManager_previousPage> { }
 
     private final CommandExportManager commandExportManager;
 
     @MemberSupport
     public CommandExportManager act() {
-        final var commands = commandExportManager.commands(NEXT);
+        final var commands = commandExportManager.commands(PREVIOUS);   // returns descending, latest (youngest) first
         final var size = commands.size();
         if (size == 0) {
             return commandExportManager;
         }
-        final var firstReplayable = commands.get(0);
-        return commandExportManager(firstReplayable);
+        final var earliestReplayable = commands.get(size - 1);
+        return commandExportManager(earliestReplayable);
     }
 
     @MemberSupport
     public String disableAct() {
-        final var commands = commandExportManager.commands(NEXT);
+        final var commands = commandExportManager.commands(PREVIOUS);
         final var size = commands.size();
-        if (size == 0) {
-            return "No commands";
-        }
-        final var firstReplayable = commands.get(0);
-        return commandExportManager(firstReplayable).commands(PREVIOUS).isEmpty() ? "No previous commands" : null;
+        return size == 0 ? "No commands" : null;
     }
 
     private CommandExportManager commandExportManager(final ReplayableCommand replayableCommand) {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
index 83c931da0ff..c2866b120d0 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
@@ -14,14 +14,13 @@
 )
 @ActionLayout(
         sequence = "1.1",
-        named = "Toggle",
         cssClass = "btn-secondary",
         describedAs = "Toggle between exporting and un-exporting."
 )
 @RequiredArgsConstructor
 public class CommandExportManager_toggleMode {
 
-    public static class DomainEvent extends HasBaseline.ActionDomainEvent<CommandExportManager_toggleMode> { }
+    public static class DomainEvent extends CommandExportManager.ActionDomainEvent<CommandExportManager_toggleMode> { }
 
     private final CommandExportManager commandExportManager;
 
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.layout.fallback.xml b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.layout.fallback.xml
index f10b0445aa8..f102949032c 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.layout.fallback.xml
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.layout.fallback.xml
@@ -4,11 +4,11 @@
             <cpt:domainObject/>
         </bs:col>
         <bs:col span="3">
-            <cpt:fieldSet name=" " id="baseline">
-                <cpt:action id="previousHour"/>
-                <cpt:action id="changeBaseline"/>
-                <cpt:action id="nextHour"/>
-                <cpt:property id="baseline"/>
+            <cpt:fieldSet name="Control" id="control">
+                <cpt:property id="baseline">
+                    <cpt:action id="previousHour"/>
+                    <cpt:action id="nextHour"/>
+                </cpt:property>
             </cpt:fieldSet>
         </bs:col>
         <bs:col span="3">
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_changeBaseline.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_changeBaseline.java
index 9c42bb34bc4..e1d7d0c3d0c 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_changeBaseline.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_changeBaseline.java
@@ -5,7 +5,6 @@
 import org.apache.causeway.applib.annotation.*;
 
 @Action(
-        restrictTo = RestrictTo.PROTOTYPING,
         semantics = SemanticsOf.SAFE,
         commandPublishing = Publishing.DISABLED,
         domainEvent = HasBaseline_changeBaseline.DomainEvent.class,
@@ -13,8 +12,7 @@
 )
 @ActionLayout(
         associateWith = "baseline", sequence = "2",
-        named = "Change",
-        position = ActionLayout.Position.PANEL
+        promptStyle = PromptStyle.INLINE_AS_IF_EDIT
 )
 @RequiredArgsConstructor
 public class HasBaseline_changeBaseline {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
index 41f4d53586e..81ceb34d41c 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
@@ -12,15 +12,14 @@
 )
 @ActionLayout(
         associateWith = "baseline", sequence = "3",
-        named = "Next",
+        named = "+1 hour",
         position = ActionLayout.Position.PANEL,
         describedAs = "Move forward one hour"
 )
 @RequiredArgsConstructor
 public class HasBaseline_nextHour {
 
-    public static class DomainEvent extends HasBaseline.ActionDomainEvent<HasBaseline_nextHour> {
-    }
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<HasBaseline_nextHour> { }
 
     private final HasBaseline hasBaseline;
 
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
index 74fcc899af8..3ef5b9448f6 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
@@ -12,7 +12,7 @@
 )
 @ActionLayout(
         associateWith = "baseline", sequence = "1",
-        named = "Previous",
+        named = "-1 hour",
         position = ActionLayout.Position.PANEL,
         describedAs = "Move back one hour"
 )


(causeway) 13/42: CAUSEWAY-4010: proposes command import manager rework

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit e9cd55662347ba1eaa8395d3b85c56774b999add
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 13:13:15 2026 +0100

    CAUSEWAY-4010: proposes command import manager rework
---
 .../rework-command-import-manager/.openspec.yaml   |  2 +
 .../rework-command-import-manager/design.md        | 46 ++++++++++++++++++++++
 .../rework-command-import-manager/proposal.md      | 28 +++++++++++++
 .../specs/command-export-yaml-result/spec.md       | 33 ++++++++++++++++
 .../changes/rework-command-import-manager/tasks.md | 22 +++++++++++
 5 files changed, 131 insertions(+)

diff --git a/openspec/changes/rework-command-import-manager/.openspec.yaml b/openspec/changes/rework-command-import-manager/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/rework-command-import-manager/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/rework-command-import-manager/design.md b/openspec/changes/rework-command-import-manager/design.md
new file mode 100644
index 00000000000..1b05786eff9
--- /dev/null
+++ b/openspec/changes/rework-command-import-manager/design.md
@@ -0,0 +1,46 @@
+## Context
+
+`CommandExportManager_exportSelected` now exports selected commands as multi-document YAML entries whose root type is `CommandExportDto`.
+Each export entry contains the replayable `CommandDto` plus optional `returnedObject` metadata derived from `CommandLogEntry#getResult()`.
+
+`CommandReplayManager_importCommands` currently delegates YAML decoding to `CommandDtoUtils.fromYaml(...)` and persists only the returned `CommandDto` values through `CommandLogEntryRepository#saveForReplay`.
+The current utility also accepts a YAML list of `CommandDto` values and does not expose returned object metadata to the importer.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Prefer importing multi-document `CommandExportDto` YAML as the canonical export/import format.
+- Preserve compatibility with legacy multi-document `CommandDto` YAML.
+- Store `CommandExportDto.returnedObject` as the persisted `CommandLogEntry` result bookmark when importing exported commands.
+- Remove support for importing a single YAML list of `CommandDto` values.
+
+**Non-Goals:**
+
+- Do not change how command export selects commands or serializes `CommandDto` content.
+- Do not require the returned object bookmark to resolve to a live domain object during import.
+- Do not change command replay execution semantics beyond the imported metadata stored on `CommandLogEntry`.
+
+## Decisions
+
+- Add an import result model that carries each `CommandDto` together with the optional returned object bookmark.
+  This keeps parsing concerns in `CommandDtoUtils` while giving `CommandReplayManager_importCommands` enough information to persist the result.
+  Alternative considered: encode returned object back into `CommandDto.userData`, but that would blur the new export envelope with legacy command DTO data and make the import path harder to reason about.
+
+- Attempt `CommandExportDto` multi-document parsing before `CommandDto` multi-document parsing.
+  This matches the new export shape and prevents a wrapped export document from being accidentally treated as an empty or malformed command DTO.
+  Alternative considered: retain the old order and add post-processing, but that would make error handling dependent on Jackson's partial binding behavior.
+
+- Remove list parsing from the command replay import path.
+  The supported formats become explicit multi-document streams, which matches the export manager output and avoids ambiguity between list and document-stream formats.
+  Alternative considered: keep list support as an undocumented fallback, but the requested behavior explicitly removes that compatibility surface.
+
+- Persist returned object metadata after creating the replay `CommandLogEntry`.
+  `CommandLogEntryRepository#saveForReplay` already owns replay entry creation, and the importer can set `CommandLogEntry#setResult(...)` on the returned entity when the parsed export entry includes a returned object.
+  Alternative considered: add an overload to the repository that accepts both values; that is reasonable if implementations need stricter encapsulation, but the import action can remain the orchestration point.
+
+## Risks / Trade-offs
+
+- YAML documents that were previously accepted only because they were lists will fail import → document the supported multi-document alternatives and update tests to assert rejection.
+- Parsing order changes can alter error messages for malformed YAML → keep suppressed failures or otherwise surface both attempted formats when neither import path succeeds.
+- Returned object bookmarks might refer to objects absent on the importing system → store the bookmark without resolving it, matching the export metadata contract.
diff --git a/openspec/changes/rework-command-import-manager/proposal.md b/openspec/changes/rework-command-import-manager/proposal.md
new file mode 100644
index 00000000000..a1ef6289164
--- /dev/null
+++ b/openspec/changes/rework-command-import-manager/proposal.md
@@ -0,0 +1,28 @@
+## Why
+
+Command replay import currently needs to align with the export format that can carry returned object metadata.
+The import manager should prefer the richer `CommandExportDto` multi-document YAML shape while retaining replay compatibility for the legacy multi-document `CommandDto` shape.
+
+## What Changes
+
+- Import documents containing multiple `CommandExportDto` YAML documents and extract the embedded command DTOs for replay.
+- When importing `CommandExportDto` YAML, persist each export entry's `returnedObject` value as the result bookmark of the corresponding `CommandLogEntry`.
+- If parsing as multiple `CommandExportDto` documents fails, fall back to parsing the same input as multiple `CommandDto` YAML documents.
+- **BREAKING** Remove support for importing a single YAML list of `CommandDto` values.
+
+## Capabilities
+
+### New Capabilities
+
+- None.
+
+### Modified Capabilities
+
+- `command-export-yaml-result`: Command replay import changes to consume `CommandExportDto` multi-document YAML, retain multi-document `CommandDto` fallback, persist returned object metadata on import, and drop list-of-`CommandDto` import support.
+
+## Impact
+
+- Affects command replay import logic in the command import manager.
+- Affects YAML parsing behavior for command import inputs.
+- Affects `CommandLogEntry` creation or update behavior by setting the result bookmark when returned object metadata is present.
+- Affects tests and documentation for supported command replay import formats.
diff --git a/openspec/changes/rework-command-import-manager/specs/command-export-yaml-result/spec.md b/openspec/changes/rework-command-import-manager/specs/command-export-yaml-result/spec.md
new file mode 100644
index 00000000000..1299a510392
--- /dev/null
+++ b/openspec/changes/rework-command-import-manager/specs/command-export-yaml-result/spec.md
@@ -0,0 +1,33 @@
+## ADDED Requirements
+
+### Requirement: Imported command export YAML stores returned object result
+The system SHALL store returned object metadata from each imported `CommandExportDto` as the result bookmark of the corresponding replay `CommandLogEntry`.
+The system MUST NOT require the returned object bookmark to resolve to an existing domain object during import.
+
+#### Scenario: Import command export with returned object
+- **WHEN** command replay import receives a multi-document YAML file containing a `CommandExportDto` whose `returnedObject` has `logicalTypeName` and `id`
+- **THEN** the system persists the embedded command DTO for replay and sets the created `CommandLogEntry` result bookmark from that returned object metadata
+
+#### Scenario: Import command export without returned object
+- **WHEN** command replay import receives a multi-document YAML file containing a `CommandExportDto` without `returnedObject`
+- **THEN** the system persists the embedded command DTO for replay and leaves the created `CommandLogEntry` result bookmark unset
+
+## MODIFIED Requirements
+
+### Requirement: Exported command YAML remains replay compatible
+The system SHALL preserve the command DTO data required by command replay import when adding returned object metadata to exported YAML.
+Command replay import SHALL first attempt to read the input as a multi-document stream of `CommandExportDto` values.
+If that fails, command replay import SHALL fall back to reading the input as a multi-document stream of `CommandDto` values.
+Command replay import MUST NOT support a single YAML list of `CommandDto` values.
+
+#### Scenario: Import legacy multi-document command DTO YAML
+- **WHEN** command replay import receives a YAML file using the legacy multi-document `CommandDto` export shape
+- **THEN** the system imports the command DTOs as before
+
+#### Scenario: Import YAML with returned object metadata
+- **WHEN** command replay import receives a YAML file generated with returned object metadata
+- **THEN** the system imports the command DTOs needed for replay and stores the returned object metadata as the corresponding command log result when present
+
+#### Scenario: Reject command DTO list YAML
+- **WHEN** command replay import receives a YAML file containing a single list of `CommandDto` values
+- **THEN** the system rejects the import instead of importing the list entries
diff --git a/openspec/changes/rework-command-import-manager/tasks.md b/openspec/changes/rework-command-import-manager/tasks.md
new file mode 100644
index 00000000000..a06c5d188a4
--- /dev/null
+++ b/openspec/changes/rework-command-import-manager/tasks.md
@@ -0,0 +1,22 @@
+## 1. YAML Import Parsing
+
+- [ ] 1.1 Add a `CommandDtoUtils` import result type that exposes each parsed `CommandDto` with its optional returned object bookmark.
+- [ ] 1.2 Add a command replay import parser that first reads multi-document `CommandExportDto` YAML.
+- [ ] 1.3 Add fallback parsing for multi-document `CommandDto` YAML when `CommandExportDto` parsing fails.
+- [ ] 1.4 Remove list-of-`CommandDto` parsing from the command replay import path.
+- [ ] 1.5 Preserve useful failure details when neither supported multi-document format can be parsed.
+
+## 2. Replay Import Persistence
+
+- [ ] 2.1 Update `CommandReplayManager_importCommands` to use the new import result model rather than only `List<CommandDto>`.
+- [ ] 2.2 Persist each imported command for replay through `CommandLogEntryRepository#saveForReplay`.
+- [ ] 2.3 Set the created `CommandLogEntry` result bookmark from `CommandExportDto.returnedObject` when present.
+- [ ] 2.4 Keep baseline movement based on the embedded command DTO timestamps.
+
+## 3. Tests
+
+- [ ] 3.1 Add or update tests for importing multi-document `CommandExportDto` YAML with returned object metadata.
+- [ ] 3.2 Add or update tests for importing multi-document `CommandExportDto` YAML without returned object metadata.
+- [ ] 3.3 Add or update tests for legacy multi-document `CommandDto` YAML fallback.
+- [ ] 3.4 Add or update tests that a YAML list of `CommandDto` values is rejected by command replay import.
+- [ ] 3.5 Run the focused command DTO and command replay import test suite.


(causeway) 37/42: CAUSEWAY-4010: archives replay conflict handling configuration

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 5c6d9580ccca3c12ee86a48fde7af81621baeacf
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 19:13:43 2026 +0100

    CAUSEWAY-4010: archives replay conflict handling configuration
---
 .../.openspec.yaml                                         |  0
 .../design.md                                              |  0
 .../proposal.md                                            |  0
 .../specs/default-command-replay-mapping-listener/spec.md  |  0
 .../tasks.md                                               |  0
 .../specs/default-command-replay-mapping-listener/spec.md  | 14 ++++++++++++--
 6 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/openspec/changes/configure-replay-result-conflict-handling/.openspec.yaml b/openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/.openspec.yaml
similarity index 100%
rename from openspec/changes/configure-replay-result-conflict-handling/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/.openspec.yaml
diff --git a/openspec/changes/configure-replay-result-conflict-handling/design.md b/openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/design.md
similarity index 100%
rename from openspec/changes/configure-replay-result-conflict-handling/design.md
rename to openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/design.md
diff --git a/openspec/changes/configure-replay-result-conflict-handling/proposal.md b/openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/proposal.md
similarity index 100%
rename from openspec/changes/configure-replay-result-conflict-handling/proposal.md
rename to openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/proposal.md
diff --git a/openspec/changes/configure-replay-result-conflict-handling/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/specs/default-command-replay-mapping-listener/spec.md
similarity index 100%
rename from openspec/changes/configure-replay-result-conflict-handling/specs/default-command-replay-mapping-listener/spec.md
rename to openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/specs/default-command-replay-mapping-listener/spec.md
diff --git a/openspec/changes/configure-replay-result-conflict-handling/tasks.md b/openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/tasks.md
similarity index 100%
rename from openspec/changes/configure-replay-result-conflict-handling/tasks.md
rename to openspec/changes/archive/2026-06-04-configure-replay-result-conflict-handling/tasks.md
diff --git a/openspec/specs/default-command-replay-mapping-listener/spec.md b/openspec/specs/default-command-replay-mapping-listener/spec.md
index 262f0b76895..2a3463904e4 100644
--- a/openspec/specs/default-command-replay-mapping-listener/spec.md
+++ b/openspec/specs/default-command-replay-mapping-listener/spec.md
@@ -7,7 +7,9 @@ The system SHALL provide a default command replay mapping listener that records
 When replay notifies the listener with a recorded result bookmark and a different actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark if no mapping already exists.
 When replay notifies the listener with equal recorded and actual result bookmarks, the listener MUST NOT remember a mapping for that notification.
 When the same recorded bookmark is notified more than once with the same actual result bookmark, the listener SHALL treat the notification as idempotent.
-When the same recorded bookmark is notified more than once with different actual result bookmarks, the listener SHALL throw an exception and MUST NOT replace the remembered actual bookmark.
+When the same recorded bookmark is notified more than once with different actual result bookmarks, the listener SHALL apply its configured conflict policy and MUST NOT replace the remembered actual bookmark.
+The system SHALL default the conflict policy to throwing an exception.
+The system SHALL provide a configuration property that can change the conflict policy to log the conflict and continue.
 
 #### Scenario: Different result mapping is recorded
 - **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
@@ -23,12 +25,20 @@ When the same recorded bookmark is notified more than once with different actual
 - **THEN** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
 - **AND** no exception is thrown
 
-#### Scenario: Result mapping conflict is rejected
+#### Scenario: Result mapping conflict is rejected by default
 - **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
 - **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
 - **THEN** the default listener throws an exception
 - **AND** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
 
+#### Scenario: Result mapping conflict is logged and ignored when configured
+- **GIVEN** the default listener conflict policy is configured to log and continue
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
+- **THEN** the default listener logs the conflict
+- **AND** no exception is thrown
+- **AND** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+
 ### Requirement: Default replay mapping listener remaps from recorded results
 The default command replay mapping listener SHALL return a remembered actual bookmark when replay asks it to remap a recorded bookmark that was previously stored from a replay result mapping.
 When no mapping is remembered for the recorded bookmark, the listener SHALL return no replacement.


(causeway) 08/42: CAUSEWAY-4010: ran openspec init

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit f73dd8f60d1532feb16a46ff1e9a981dd756fdac
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 07:26:54 2026 +0100

    CAUSEWAY-4010: ran openspec init
---
 .pi/prompts/opsx-apply.md                   | 150 +++++++++++++++
 .pi/prompts/opsx-archive.md                 | 155 +++++++++++++++
 .pi/prompts/opsx-explore.md                 | 171 +++++++++++++++++
 .pi/prompts/opsx-propose.md                 | 104 ++++++++++
 .pi/skills/openspec-apply-change/SKILL.md   | 156 +++++++++++++++
 .pi/skills/openspec-archive-change/SKILL.md | 114 +++++++++++
 .pi/skills/openspec-explore/SKILL.md        | 288 ++++++++++++++++++++++++++++
 .pi/skills/openspec-propose/SKILL.md        | 110 +++++++++++
 openspec/config.yaml                        |  20 ++
 9 files changed, 1268 insertions(+)

diff --git a/.pi/prompts/opsx-apply.md b/.pi/prompts/opsx-apply.md
new file mode 100644
index 00000000000..d92897f2623
--- /dev/null
+++ b/.pi/prompts/opsx-apply.md
@@ -0,0 +1,150 @@
+---
+description: Implement tasks from an OpenSpec change (Experimental)
+---
+
+Implement tasks from an OpenSpec change.
+
+**Input**: Optionally specify a change name (e.g., `/opsx-apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
+**Provided arguments**: $@
+
+**Steps**
+
+1. **Select the change**
+
+   If a name is provided, use it. Otherwise:
+   - Infer from conversation context if the user mentioned a change
+   - Auto-select if only one active change exists
+   - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
+
+   Always announce: "Using change: <name>" and how to override (e.g., `/opsx-apply <other>`).
+
+2. **Check status to understand the schema**
+   ```bash
+   openspec status --change "<name>" --json
+   ```
+   Parse the JSON to understand:
+   - `schemaName`: The workflow being used (e.g., "spec-driven")
+   - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
+
+3. **Get apply instructions**
+
+   ```bash
+   openspec instructions apply --change "<name>" --json
+   ```
+
+   This returns:
+   - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
+   - Progress (total, complete, remaining)
+   - Task list with status
+   - Dynamic instruction based on current state
+
+   **Handle states:**
+   - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx-continue`
+   - If `state: "all_done"`: congratulate, suggest archive
+   - Otherwise: proceed to implementation
+
+4. **Read context files**
+
+   Read every file path listed under `contextFiles` from the apply instructions output.
+   The files depend on the schema being used:
+   - **spec-driven**: proposal, specs, design, tasks
+   - Other schemas: follow the contextFiles from CLI output
+
+5. **Show current progress**
+
+   Display:
+   - Schema being used
+   - Progress: "N/M tasks complete"
+   - Remaining tasks overview
+   - Dynamic instruction from CLI
+
+6. **Implement tasks (loop until done or blocked)**
+
+   For each pending task:
+   - Show which task is being worked on
+   - Make the code changes required
+   - Keep changes minimal and focused
+   - Mark task complete in the tasks file: `- [ ]` → `- [x]`
+   - Continue to next task
+
+   **Pause if:**
+   - Task is unclear → ask for clarification
+   - Implementation reveals a design issue → suggest updating artifacts
+   - Error or blocker encountered → report and wait for guidance
+   - User interrupts
+
+7. **On completion or pause, show status**
+
+   Display:
+   - Tasks completed this session
+   - Overall progress: "N/M tasks complete"
+   - If all done: suggest archive
+   - If paused: explain why and wait for guidance
+
+**Output During Implementation**
+
+```
+## Implementing: <change-name> (schema: <schema-name>)
+
+Working on task 3/7: <task description>
+[...implementation happening...]
+✓ Task complete
+
+Working on task 4/7: <task description>
+[...implementation happening...]
+✓ Task complete
+```
+
+**Output On Completion**
+
+```
+## Implementation Complete
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Progress:** 7/7 tasks complete ✓
+
+### Completed This Session
+- [x] Task 1
+- [x] Task 2
+...
+
+All tasks complete! You can archive this change with `/opsx-archive`.
+```
+
+**Output On Pause (Issue Encountered)**
+
+```
+## Implementation Paused
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Progress:** 4/7 tasks complete
+
+### Issue Encountered
+<description of the issue>
+
+**Options:**
+1. <option 1>
+2. <option 2>
+3. Other approach
+
+What would you like to do?
+```
+
+**Guardrails**
+- Keep going through tasks until done or blocked
+- Always read context files before starting (from the apply instructions output)
+- If task is ambiguous, pause and ask before implementing
+- If implementation reveals issues, pause and suggest artifact updates
+- Keep code changes minimal and scoped to each task
+- Update task checkbox immediately after completing each task
+- Pause on errors, blockers, or unclear requirements - don't guess
+- Use contextFiles from CLI output, don't assume specific file names
+
+**Fluid Workflow Integration**
+
+This skill supports the "actions on a change" model:
+
+- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
+- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
diff --git a/.pi/prompts/opsx-archive.md b/.pi/prompts/opsx-archive.md
new file mode 100644
index 00000000000..245f889474e
--- /dev/null
+++ b/.pi/prompts/opsx-archive.md
@@ -0,0 +1,155 @@
+---
+description: Archive a completed change in the experimental workflow
+---
+
+Archive a completed change in the experimental workflow.
+
+**Input**: Optionally specify a change name after `/opsx-archive` (e.g., `/opsx-archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
+**Provided arguments**: $@
+
+**Steps**
+
+1. **If no change name provided, prompt for selection**
+
+   Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
+
+   Show only active changes (not already archived).
+   Include the schema used for each change if available.
+
+   **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
+
+2. **Check artifact completion status**
+
+   Run `openspec status --change "<name>" --json` to check artifact completion.
+
+   Parse the JSON to understand:
+   - `schemaName`: The workflow being used
+   - `artifacts`: List of artifacts with their status (`done` or other)
+
+   **If any artifacts are not `done`:**
+   - Display warning listing incomplete artifacts
+   - Prompt user for confirmation to continue
+   - Proceed if user confirms
+
+3. **Check task completion status**
+
+   Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
+
+   Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
+
+   **If incomplete tasks found:**
+   - Display warning showing count of incomplete tasks
+   - Prompt user for confirmation to continue
+   - Proceed if user confirms
+
+   **If no tasks file exists:** Proceed without task-related warning.
+
+4. **Assess delta spec sync state**
+
+   Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
+
+   **If delta specs exist:**
+   - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
+   - Determine what changes would be applied (adds, modifications, removals, renames)
+   - Show a combined summary before prompting
+
+   **Prompt options:**
+   - If changes needed: "Sync now (recommended)", "Archive without syncing"
+   - If already synced: "Archive now", "Sync anyway", "Cancel"
+
+   If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
+
+5. **Perform the archive**
+
+   Create the archive directory if it doesn't exist:
+   ```bash
+   mkdir -p openspec/changes/archive
+   ```
+
+   Generate target name using current date: `YYYY-MM-DD-<change-name>`
+
+   **Check if target already exists:**
+   - If yes: Fail with error, suggest renaming existing archive or using different date
+   - If no: Move the change directory to archive
+
+   ```bash
+   mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
+   ```
+
+6. **Display summary**
+
+   Show archive completion summary including:
+   - Change name
+   - Schema that was used
+   - Archive location
+   - Spec sync status (synced / sync skipped / no delta specs)
+   - Note about any warnings (incomplete artifacts/tasks)
+
+**Output On Success**
+
+```
+## Archive Complete
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
+**Specs:** ✓ Synced to main specs
+
+All artifacts complete. All tasks complete.
+```
+
+**Output On Success (No Delta Specs)**
+
+```
+## Archive Complete
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
+**Specs:** No delta specs
+
+All artifacts complete. All tasks complete.
+```
+
+**Output On Success With Warnings**
+
+```
+## Archive Complete (with warnings)
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
+**Specs:** Sync skipped (user chose to skip)
+
+**Warnings:**
+- Archived with 2 incomplete artifacts
+- Archived with 3 incomplete tasks
+- Delta spec sync was skipped (user chose to skip)
+
+Review the archive if this was not intentional.
+```
+
+**Output On Error (Archive Exists)**
+
+```
+## Archive Failed
+
+**Change:** <change-name>
+**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
+
+Target archive directory already exists.
+
+**Options:**
+1. Rename the existing archive
+2. Delete the existing archive if it's a duplicate
+3. Wait until a different date to archive
+```
+
+**Guardrails**
+- Always prompt for change selection if not provided
+- Use artifact graph (openspec status --json) for completion checking
+- Don't block archive on warnings - just inform and confirm
+- Preserve .openspec.yaml when moving to archive (it moves with the directory)
+- Show clear summary of what happened
+- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
+- If delta specs exist, always run the sync assessment and show the combined summary before prompting
diff --git a/.pi/prompts/opsx-explore.md b/.pi/prompts/opsx-explore.md
new file mode 100644
index 00000000000..153badb5aae
--- /dev/null
+++ b/.pi/prompts/opsx-explore.md
@@ -0,0 +1,171 @@
+---
+description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
+---
+
+Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
+
+**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
+
+**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
+
+**Input**: The argument after `/opsx-explore` is whatever the user wants to think about. Could be:
+**Provided arguments**: $@
+- A vague idea: "real-time collaboration"
+- A specific problem: "the auth system is getting unwieldy"
+- A change name: "add-dark-mode" (to explore in context of that change)
+- A comparison: "postgres vs sqlite for this"
+- Nothing (just enter explore mode)
+
+---
+
+## The Stance
+
+- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
+- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
+- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
+- **Adaptive** - Follow interesting threads, pivot when new information emerges
+- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
+- **Grounded** - Explore the actual codebase when relevant, don't just theorize
+
+---
+
+## What You Might Do
+
+Depending on what the user brings, you might:
+
+**Explore the problem space**
+- Ask clarifying questions that emerge from what they said
+- Challenge assumptions
+- Reframe the problem
+- Find analogies
+
+**Investigate the codebase**
+- Map existing architecture relevant to the discussion
+- Find integration points
+- Identify patterns already in use
+- Surface hidden complexity
+
+**Compare options**
+- Brainstorm multiple approaches
+- Build comparison tables
+- Sketch tradeoffs
+- Recommend a path (if asked)
+
+**Visualize**
+```
+┌─────────────────────────────────────────┐
+│     Use ASCII diagrams liberally        │
+├─────────────────────────────────────────┤
+│                                         │
+│      ┌────────┐         ┌────────┐      │
+│      │ State  │────────▶│ State  │      │
+│      │   A    │         │   B    │      │
+│      └────────┘         └────────┘      │
+│                                         │
+│   System diagrams, state machines,      │
+│   data flows, architecture sketches,    │
+│   dependency graphs, comparison tables  │
+│                                         │
+└─────────────────────────────────────────┘
+```
+
+**Surface risks and unknowns**
+- Identify what could go wrong
+- Find gaps in understanding
+- Suggest spikes or investigations
+
+---
+
+## OpenSpec Awareness
+
+You have full context of the OpenSpec system. Use it naturally, don't force it.
+
+### Check for context
+
+At the start, quickly check what exists:
+```bash
+openspec list --json
+```
+
+This tells you:
+- If there are active changes
+- Their names, schemas, and status
+- What the user might be working on
+
+If the user mentioned a specific change name, read its artifacts for context.
+
+### When no change exists
+
+Think freely. When insights crystallize, you might offer:
+
+- "This feels solid enough to start a change. Want me to create a proposal?"
+- Or keep exploring - no pressure to formalize
+
+### When a change exists
+
+If the user mentions a change or you detect one is relevant:
+
+1. **Read existing artifacts for context**
+   - `openspec/changes/<name>/proposal.md`
+   - `openspec/changes/<name>/design.md`
+   - `openspec/changes/<name>/tasks.md`
+   - etc.
+
+2. **Reference them naturally in conversation**
+   - "Your design mentions using Redis, but we just realized SQLite fits better..."
+   - "The proposal scopes this to premium users, but we're now thinking everyone..."
+
+3. **Offer to capture when decisions are made**
+
+    | Insight Type               | Where to Capture               |
+    |----------------------------|--------------------------------|
+    | New requirement discovered | `specs/<capability>/spec.md` |
+    | Requirement changed        | `specs/<capability>/spec.md` |
+    | Design decision made       | `design.md`                  |
+    | Scope changed              | `proposal.md`                |
+    | New work identified        | `tasks.md`                   |
+    | Assumption invalidated     | Relevant artifact              |
+
+   Example offers:
+   - "That's a design decision. Capture it in design.md?"
+   - "This is a new requirement. Add it to specs?"
+   - "This changes scope. Update the proposal?"
+
+4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
+
+---
+
+## What You Don't Have To Do
+
+- Follow a script
+- Ask the same questions every time
+- Produce a specific artifact
+- Reach a conclusion
+- Stay on topic if a tangent is valuable
+- Be brief (this is thinking time)
+
+---
+
+## Ending Discovery
+
+There's no required ending. Discovery might:
+
+- **Flow into a proposal**: "Ready to start? I can create a change proposal."
+- **Result in artifact updates**: "Updated design.md with these decisions"
+- **Just provide clarity**: User has what they need, moves on
+- **Continue later**: "We can pick this up anytime"
+
+When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
+
+---
+
+## Guardrails
+
+- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
+- **Don't fake understanding** - If something is unclear, dig deeper
+- **Don't rush** - Discovery is thinking time, not task time
+- **Don't force structure** - Let patterns emerge naturally
+- **Don't auto-capture** - Offer to save insights, don't just do it
+- **Do visualize** - A good diagram is worth many paragraphs
+- **Do explore the codebase** - Ground discussions in reality
+- **Do question assumptions** - Including the user's and your own
diff --git a/.pi/prompts/opsx-propose.md b/.pi/prompts/opsx-propose.md
new file mode 100644
index 00000000000..60acdffe34c
--- /dev/null
+++ b/.pi/prompts/opsx-propose.md
@@ -0,0 +1,104 @@
+---
+description: Propose a new change - create it and generate all artifacts in one step
+---
+
+Propose a new change - create the change and generate all artifacts in one step.
+
+I'll create a change with artifacts:
+- proposal.md (what & why)
+- design.md (how)
+- tasks.md (implementation steps)
+
+When ready to implement, run /opsx-apply
+
+---
+
+**Input**: The argument after `/opsx-propose` is the change name (kebab-case), OR a description of what the user wants to build.
+**Provided arguments**: $@
+
+**Steps**
+
+1. **If no input provided, ask what they want to build**
+
+   Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
+   > "What change do you want to work on? Describe what you want to build or fix."
+
+   From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
+
+   **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
+
+2. **Create the change directory**
+   ```bash
+   openspec new change "<name>"
+   ```
+   This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
+
+3. **Get the artifact build order**
+   ```bash
+   openspec status --change "<name>" --json
+   ```
+   Parse the JSON to get:
+   - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
+   - `artifacts`: list of all artifacts with their status and dependencies
+
+4. **Create artifacts in sequence until apply-ready**
+
+   Use the **TodoWrite tool** to track progress through the artifacts.
+
+   Loop through artifacts in dependency order (artifacts with no pending dependencies first):
+
+   a. **For each artifact that is `ready` (dependencies satisfied)**:
+      - Get instructions:
+        ```bash
+        openspec instructions <artifact-id> --change "<name>" --json
+        ```
+      - The instructions JSON includes:
+        - `context`: Project background (constraints for you - do NOT include in output)
+        - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
+        - `template`: The structure to use for your output file
+        - `instruction`: Schema-specific guidance for this artifact type
+        - `outputPath`: Where to write the artifact
+        - `dependencies`: Completed artifacts to read for context
+      - Read any completed dependency files for context
+      - Create the artifact file using `template` as the structure
+      - Apply `context` and `rules` as constraints - but do NOT copy them into the file
+      - Show brief progress: "Created <artifact-id>"
+
+   b. **Continue until all `applyRequires` artifacts are complete**
+      - After creating each artifact, re-run `openspec status --change "<name>" --json`
+      - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
+      - Stop when all `applyRequires` artifacts are done
+
+   c. **If an artifact requires user input** (unclear context):
+      - Use **AskUserQuestion tool** to clarify
+      - Then continue with creation
+
+5. **Show final status**
+   ```bash
+   openspec status --change "<name>"
+   ```
+
+**Output**
+
+After completing all artifacts, summarize:
+- Change name and location
+- List of artifacts created with brief descriptions
+- What's ready: "All artifacts created! Ready for implementation."
+- Prompt: "Run `/opsx-apply` to start implementing."
+
+**Artifact Creation Guidelines**
+
+- Follow the `instruction` field from `openspec instructions` for each artifact type
+- The schema defines what each artifact should contain - follow it
+- Read dependency artifacts for context before creating new ones
+- Use `template` as the structure for your output file - fill in its sections
+- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
+  - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
+  - These guide what you write, but should never appear in the output
+
+**Guardrails**
+- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
+- Always read dependency artifacts before creating a new one
+- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
+- If a change with that name already exists, ask if user wants to continue it or create a new one
+- Verify each artifact file exists after writing before proceeding to next
diff --git a/.pi/skills/openspec-apply-change/SKILL.md b/.pi/skills/openspec-apply-change/SKILL.md
new file mode 100644
index 00000000000..86c881d9d0f
--- /dev/null
+++ b/.pi/skills/openspec-apply-change/SKILL.md
@@ -0,0 +1,156 @@
+---
+name: openspec-apply-change
+description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
+license: MIT
+compatibility: Requires openspec CLI.
+metadata:
+  author: openspec
+  version: "1.0"
+  generatedBy: "1.3.1"
+---
+
+Implement tasks from an OpenSpec change.
+
+**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
+
+**Steps**
+
+1. **Select the change**
+
+   If a name is provided, use it. Otherwise:
+   - Infer from conversation context if the user mentioned a change
+   - Auto-select if only one active change exists
+   - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
+
+   Always announce: "Using change: <name>" and how to override (e.g., `/opsx-apply <other>`).
+
+2. **Check status to understand the schema**
+   ```bash
+   openspec status --change "<name>" --json
+   ```
+   Parse the JSON to understand:
+   - `schemaName`: The workflow being used (e.g., "spec-driven")
+   - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
+
+3. **Get apply instructions**
+
+   ```bash
+   openspec instructions apply --change "<name>" --json
+   ```
+
+   This returns:
+   - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
+   - Progress (total, complete, remaining)
+   - Task list with status
+   - Dynamic instruction based on current state
+
+   **Handle states:**
+   - If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change
+   - If `state: "all_done"`: congratulate, suggest archive
+   - Otherwise: proceed to implementation
+
+4. **Read context files**
+
+   Read every file path listed under `contextFiles` from the apply instructions output.
+   The files depend on the schema being used:
+   - **spec-driven**: proposal, specs, design, tasks
+   - Other schemas: follow the contextFiles from CLI output
+
+5. **Show current progress**
+
+   Display:
+   - Schema being used
+   - Progress: "N/M tasks complete"
+   - Remaining tasks overview
+   - Dynamic instruction from CLI
+
+6. **Implement tasks (loop until done or blocked)**
+
+   For each pending task:
+   - Show which task is being worked on
+   - Make the code changes required
+   - Keep changes minimal and focused
+   - Mark task complete in the tasks file: `- [ ]` → `- [x]`
+   - Continue to next task
+
+   **Pause if:**
+   - Task is unclear → ask for clarification
+   - Implementation reveals a design issue → suggest updating artifacts
+   - Error or blocker encountered → report and wait for guidance
+   - User interrupts
+
+7. **On completion or pause, show status**
+
+   Display:
+   - Tasks completed this session
+   - Overall progress: "N/M tasks complete"
+   - If all done: suggest archive
+   - If paused: explain why and wait for guidance
+
+**Output During Implementation**
+
+```
+## Implementing: <change-name> (schema: <schema-name>)
+
+Working on task 3/7: <task description>
+[...implementation happening...]
+✓ Task complete
+
+Working on task 4/7: <task description>
+[...implementation happening...]
+✓ Task complete
+```
+
+**Output On Completion**
+
+```
+## Implementation Complete
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Progress:** 7/7 tasks complete ✓
+
+### Completed This Session
+- [x] Task 1
+- [x] Task 2
+...
+
+All tasks complete! Ready to archive this change.
+```
+
+**Output On Pause (Issue Encountered)**
+
+```
+## Implementation Paused
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Progress:** 4/7 tasks complete
+
+### Issue Encountered
+<description of the issue>
+
+**Options:**
+1. <option 1>
+2. <option 2>
+3. Other approach
+
+What would you like to do?
+```
+
+**Guardrails**
+- Keep going through tasks until done or blocked
+- Always read context files before starting (from the apply instructions output)
+- If task is ambiguous, pause and ask before implementing
+- If implementation reveals issues, pause and suggest artifact updates
+- Keep code changes minimal and scoped to each task
+- Update task checkbox immediately after completing each task
+- Pause on errors, blockers, or unclear requirements - don't guess
+- Use contextFiles from CLI output, don't assume specific file names
+
+**Fluid Workflow Integration**
+
+This skill supports the "actions on a change" model:
+
+- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
+- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
diff --git a/.pi/skills/openspec-archive-change/SKILL.md b/.pi/skills/openspec-archive-change/SKILL.md
new file mode 100644
index 00000000000..12e2f70e9ce
--- /dev/null
+++ b/.pi/skills/openspec-archive-change/SKILL.md
@@ -0,0 +1,114 @@
+---
+name: openspec-archive-change
+description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
+license: MIT
+compatibility: Requires openspec CLI.
+metadata:
+  author: openspec
+  version: "1.0"
+  generatedBy: "1.3.1"
+---
+
+Archive a completed change in the experimental workflow.
+
+**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
+
+**Steps**
+
+1. **If no change name provided, prompt for selection**
+
+   Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
+
+   Show only active changes (not already archived).
+   Include the schema used for each change if available.
+
+   **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
+
+2. **Check artifact completion status**
+
+   Run `openspec status --change "<name>" --json` to check artifact completion.
+
+   Parse the JSON to understand:
+   - `schemaName`: The workflow being used
+   - `artifacts`: List of artifacts with their status (`done` or other)
+
+   **If any artifacts are not `done`:**
+   - Display warning listing incomplete artifacts
+   - Use **AskUserQuestion tool** to confirm user wants to proceed
+   - Proceed if user confirms
+
+3. **Check task completion status**
+
+   Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
+
+   Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
+
+   **If incomplete tasks found:**
+   - Display warning showing count of incomplete tasks
+   - Use **AskUserQuestion tool** to confirm user wants to proceed
+   - Proceed if user confirms
+
+   **If no tasks file exists:** Proceed without task-related warning.
+
+4. **Assess delta spec sync state**
+
+   Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
+
+   **If delta specs exist:**
+   - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
+   - Determine what changes would be applied (adds, modifications, removals, renames)
+   - Show a combined summary before prompting
+
+   **Prompt options:**
+   - If changes needed: "Sync now (recommended)", "Archive without syncing"
+   - If already synced: "Archive now", "Sync anyway", "Cancel"
+
+   If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
+
+5. **Perform the archive**
+
+   Create the archive directory if it doesn't exist:
+   ```bash
+   mkdir -p openspec/changes/archive
+   ```
+
+   Generate target name using current date: `YYYY-MM-DD-<change-name>`
+
+   **Check if target already exists:**
+   - If yes: Fail with error, suggest renaming existing archive or using different date
+   - If no: Move the change directory to archive
+
+   ```bash
+   mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
+   ```
+
+6. **Display summary**
+
+   Show archive completion summary including:
+   - Change name
+   - Schema that was used
+   - Archive location
+   - Whether specs were synced (if applicable)
+   - Note about any warnings (incomplete artifacts/tasks)
+
+**Output On Success**
+
+```
+## Archive Complete
+
+**Change:** <change-name>
+**Schema:** <schema-name>
+**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
+**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
+
+All artifacts complete. All tasks complete.
+```
+
+**Guardrails**
+- Always prompt for change selection if not provided
+- Use artifact graph (openspec status --json) for completion checking
+- Don't block archive on warnings - just inform and confirm
+- Preserve .openspec.yaml when moving to archive (it moves with the directory)
+- Show clear summary of what happened
+- If sync is requested, use openspec-sync-specs approach (agent-driven)
+- If delta specs exist, always run the sync assessment and show the combined summary before prompting
diff --git a/.pi/skills/openspec-explore/SKILL.md b/.pi/skills/openspec-explore/SKILL.md
new file mode 100644
index 00000000000..8c7225ceb5d
--- /dev/null
+++ b/.pi/skills/openspec-explore/SKILL.md
@@ -0,0 +1,288 @@
+---
+name: openspec-explore
+description: Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.
+license: MIT
+compatibility: Requires openspec CLI.
+metadata:
+  author: openspec
+  version: "1.0"
+  generatedBy: "1.3.1"
+---
+
+Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
+
+**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
+
+**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
+
+---
+
+## The Stance
+
+- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
+- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
+- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
+- **Adaptive** - Follow interesting threads, pivot when new information emerges
+- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
+- **Grounded** - Explore the actual codebase when relevant, don't just theorize
+
+---
+
+## What You Might Do
+
+Depending on what the user brings, you might:
+
+**Explore the problem space**
+- Ask clarifying questions that emerge from what they said
+- Challenge assumptions
+- Reframe the problem
+- Find analogies
+
+**Investigate the codebase**
+- Map existing architecture relevant to the discussion
+- Find integration points
+- Identify patterns already in use
+- Surface hidden complexity
+
+**Compare options**
+- Brainstorm multiple approaches
+- Build comparison tables
+- Sketch tradeoffs
+- Recommend a path (if asked)
+
+**Visualize**
+```
+┌─────────────────────────────────────────┐
+│     Use ASCII diagrams liberally        │
+├─────────────────────────────────────────┤
+│                                         │
+│      ┌────────┐         ┌────────┐      │
+│      │ State  │────────▶│ State  │      │
+│      │   A    │         │   B    │      │
+│      └────────┘         └────────┘      │
+│                                         │
+│   System diagrams, state machines,      │
+│   data flows, architecture sketches,    │
+│   dependency graphs, comparison tables  │
+│                                         │
+└─────────────────────────────────────────┘
+```
+
+**Surface risks and unknowns**
+- Identify what could go wrong
+- Find gaps in understanding
+- Suggest spikes or investigations
+
+---
+
+## OpenSpec Awareness
+
+You have full context of the OpenSpec system. Use it naturally, don't force it.
+
+### Check for context
+
+At the start, quickly check what exists:
+```bash
+openspec list --json
+```
+
+This tells you:
+- If there are active changes
+- Their names, schemas, and status
+- What the user might be working on
+
+### When no change exists
+
+Think freely. When insights crystallize, you might offer:
+
+- "This feels solid enough to start a change. Want me to create a proposal?"
+- Or keep exploring - no pressure to formalize
+
+### When a change exists
+
+If the user mentions a change or you detect one is relevant:
+
+1. **Read existing artifacts for context**
+   - `openspec/changes/<name>/proposal.md`
+   - `openspec/changes/<name>/design.md`
+   - `openspec/changes/<name>/tasks.md`
+   - etc.
+
+2. **Reference them naturally in conversation**
+   - "Your design mentions using Redis, but we just realized SQLite fits better..."
+   - "The proposal scopes this to premium users, but we're now thinking everyone..."
+
+3. **Offer to capture when decisions are made**
+
+    | Insight Type               | Where to Capture               |
+    |----------------------------|--------------------------------|
+    | New requirement discovered | `specs/<capability>/spec.md` |
+    | Requirement changed        | `specs/<capability>/spec.md` |
+    | Design decision made       | `design.md`                  |
+    | Scope changed              | `proposal.md`                |
+    | New work identified        | `tasks.md`                   |
+    | Assumption invalidated     | Relevant artifact              |
+
+   Example offers:
+   - "That's a design decision. Capture it in design.md?"
+   - "This is a new requirement. Add it to specs?"
+   - "This changes scope. Update the proposal?"
+
+4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
+
+---
+
+## What You Don't Have To Do
+
+- Follow a script
+- Ask the same questions every time
+- Produce a specific artifact
+- Reach a conclusion
+- Stay on topic if a tangent is valuable
+- Be brief (this is thinking time)
+
+---
+
+## Handling Different Entry Points
+
+**User brings a vague idea:**
+```
+User: I'm thinking about adding real-time collaboration
+
+You: Real-time collab is a big space. Let me think about this...
+
+      COLLABORATION SPECTRUM
+      ════════════════════════════════════════════
+
+      Awareness          Coordination         Sync
+          │                   │                 │
+          ▼                   ▼                 ▼
+      ┌────────┐         ┌────────┐        ┌────────┐
+      │Presence│         │Cursors │        │  CRDT  │
+      │  "3    │         │ Multi  │        │Conflict│
+      │online" │         │ select │        │  free  │
+      └────────┘         └────────┘        └────────┘
+          │                   │                 │
+       trivial            moderate           complex
+
+      Where's your head at?
+```
+
+**User brings a specific problem:**
+```
+User: The auth system is a mess
+
+You: [reads codebase]
+
+     ┌─────────────────────────────────────────────┐
+     │              CURRENT AUTH FLOW              │
+     └─────────────────────────────────────────────┘
+                        │
+          ┌─────────────┼─────────────┐
+          ▼             ▼             ▼
+     ┌─────────┐  ┌─────────┐  ┌─────────┐
+     │ Google  │  │  GitHub │  │  Email  │
+     │  OAuth  │  │  OAuth  │  │  Magic  │
+     └────┬────┘  └────┬────┘  └────┬────┘
+          │             │             │
+          └─────────────┼─────────────┘
+                        ▼
+                  ┌───────────┐
+                  │  Session  │
+                  └─────┬─────┘
+                        │
+                        ▼
+                  ┌───────────┐
+                  │   Perms   │
+                  └───────────┘
+
+     I see three tangles. Which one's burning?
+```
+
+**User is stuck mid-implementation:**
+```
+User: /opsx-explore add-auth-system
+      The OAuth integration is more complex than expected
+
+You: [reads change artifacts]
+
+     You're on task 4: "Implement OAuth flow"
+
+     Let me trace what's involved...
+
+     [draws diagram, explores options, suggests paths]
+
+     Want to update the design to reflect this?
+     Or add a spike task to investigate?
+```
+
+**User wants to compare options:**
+```
+User: Should we use Postgres or SQLite?
+
+You: Generic answer is boring. What's the context?
+
+User: A CLI tool that tracks local dev environments
+
+You: That changes everything.
+
+     ┌─────────────────────────────────────────────────┐
+     │          CLI TOOL DATA STORAGE                  │
+     └─────────────────────────────────────────────────┘
+
+     Key constraints:
+     • No daemon running
+     • Must work offline
+     • Single user
+
+                  SQLite          Postgres
+     Deployment   embedded ✓      needs server ✗
+     Offline      yes ✓           no ✗
+     Single file  yes ✓           no ✗
+
+     SQLite. Not even close.
+
+     Unless... is there a sync component?
+```
+
+---
+
+## Ending Discovery
+
+There's no required ending. Discovery might:
+
+- **Flow into a proposal**: "Ready to start? I can create a change proposal."
+- **Result in artifact updates**: "Updated design.md with these decisions"
+- **Just provide clarity**: User has what they need, moves on
+- **Continue later**: "We can pick this up anytime"
+
+When it feels like things are crystallizing, you might summarize:
+
+```
+## What We Figured Out
+
+**The problem**: [crystallized understanding]
+
+**The approach**: [if one emerged]
+
+**Open questions**: [if any remain]
+
+**Next steps** (if ready):
+- Create a change proposal
+- Keep exploring: just keep talking
+```
+
+But this summary is optional. Sometimes the thinking IS the value.
+
+---
+
+## Guardrails
+
+- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
+- **Don't fake understanding** - If something is unclear, dig deeper
+- **Don't rush** - Discovery is thinking time, not task time
+- **Don't force structure** - Let patterns emerge naturally
+- **Don't auto-capture** - Offer to save insights, don't just do it
+- **Do visualize** - A good diagram is worth many paragraphs
+- **Do explore the codebase** - Ground discussions in reality
+- **Do question assumptions** - Including the user's and your own
diff --git a/.pi/skills/openspec-propose/SKILL.md b/.pi/skills/openspec-propose/SKILL.md
new file mode 100644
index 00000000000..05fdc6220f2
--- /dev/null
+++ b/.pi/skills/openspec-propose/SKILL.md
@@ -0,0 +1,110 @@
+---
+name: openspec-propose
+description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
+license: MIT
+compatibility: Requires openspec CLI.
+metadata:
+  author: openspec
+  version: "1.0"
+  generatedBy: "1.3.1"
+---
+
+Propose a new change - create the change and generate all artifacts in one step.
+
+I'll create a change with artifacts:
+- proposal.md (what & why)
+- design.md (how)
+- tasks.md (implementation steps)
+
+When ready to implement, run /opsx-apply
+
+---
+
+**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
+
+**Steps**
+
+1. **If no clear input provided, ask what they want to build**
+
+   Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
+   > "What change do you want to work on? Describe what you want to build or fix."
+
+   From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
+
+   **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
+
+2. **Create the change directory**
+   ```bash
+   openspec new change "<name>"
+   ```
+   This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
+
+3. **Get the artifact build order**
+   ```bash
+   openspec status --change "<name>" --json
+   ```
+   Parse the JSON to get:
+   - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
+   - `artifacts`: list of all artifacts with their status and dependencies
+
+4. **Create artifacts in sequence until apply-ready**
+
+   Use the **TodoWrite tool** to track progress through the artifacts.
+
+   Loop through artifacts in dependency order (artifacts with no pending dependencies first):
+
+   a. **For each artifact that is `ready` (dependencies satisfied)**:
+      - Get instructions:
+        ```bash
+        openspec instructions <artifact-id> --change "<name>" --json
+        ```
+      - The instructions JSON includes:
+        - `context`: Project background (constraints for you - do NOT include in output)
+        - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
+        - `template`: The structure to use for your output file
+        - `instruction`: Schema-specific guidance for this artifact type
+        - `outputPath`: Where to write the artifact
+        - `dependencies`: Completed artifacts to read for context
+      - Read any completed dependency files for context
+      - Create the artifact file using `template` as the structure
+      - Apply `context` and `rules` as constraints - but do NOT copy them into the file
+      - Show brief progress: "Created <artifact-id>"
+
+   b. **Continue until all `applyRequires` artifacts are complete**
+      - After creating each artifact, re-run `openspec status --change "<name>" --json`
+      - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
+      - Stop when all `applyRequires` artifacts are done
+
+   c. **If an artifact requires user input** (unclear context):
+      - Use **AskUserQuestion tool** to clarify
+      - Then continue with creation
+
+5. **Show final status**
+   ```bash
+   openspec status --change "<name>"
+   ```
+
+**Output**
+
+After completing all artifacts, summarize:
+- Change name and location
+- List of artifacts created with brief descriptions
+- What's ready: "All artifacts created! Ready for implementation."
+- Prompt: "Run `/opsx-apply` or ask me to implement to start working on the tasks."
+
+**Artifact Creation Guidelines**
+
+- Follow the `instruction` field from `openspec instructions` for each artifact type
+- The schema defines what each artifact should contain - follow it
+- Read dependency artifacts for context before creating new ones
+- Use `template` as the structure for your output file - fill in its sections
+- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
+  - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
+  - These guide what you write, but should never appear in the output
+
+**Guardrails**
+- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
+- Always read dependency artifacts before creating a new one
+- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
+- If a change with that name already exists, ask if user wants to continue it or create a new one
+- Verify each artifact file exists after writing before proceeding to next
diff --git a/openspec/config.yaml b/openspec/config.yaml
new file mode 100644
index 00000000000..392946c67c0
--- /dev/null
+++ b/openspec/config.yaml
@@ -0,0 +1,20 @@
+schema: spec-driven
+
+# Project context (optional)
+# This is shown to AI when creating artifacts.
+# Add your tech stack, conventions, style guides, domain knowledge, etc.
+# Example:
+#   context: |
+#     Tech stack: TypeScript, React, Node.js
+#     We use conventional commits
+#     Domain: e-commerce platform
+
+# Per-artifact rules (optional)
+# Add custom rules for specific artifacts.
+# Example:
+#   rules:
+#     proposal:
+#       - Keep proposals under 500 words
+#       - Always include a "Non-goals" section
+#     tasks:
+#       - Break tasks into chunks of max 2 hours


(causeway) 15/42: CAUSEWAY-4010: archives command import rework and proposes replay result mapping

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 988db33cfaefe0a3bc2b7f602e1c0bec08dfd0d8
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 14:30:01 2026 +0100

    CAUSEWAY-4010: archives command import rework and proposes replay result mapping
---
 .../.openspec.yaml                                 |  0
 .../design.md                                      |  0
 .../proposal.md                                    |  0
 .../specs/command-export-yaml-result/spec.md       |  0
 .../tasks.md                                       |  0
 .../.openspec.yaml                                 |  0
 .../changes/notify-replay-result-mapping/design.md | 50 ++++++++++++++++++++++
 .../notify-replay-result-mapping/proposal.md       | 28 ++++++++++++
 .../specs/command-replay-result-mapping/spec.md    | 39 +++++++++++++++++
 .../changes/notify-replay-result-mapping/tasks.md  | 21 +++++++++
 openspec/specs/command-export-yaml-result/spec.md  | 32 +++++++++++---
 11 files changed, 165 insertions(+), 5 deletions(-)

diff --git a/openspec/changes/rework-command-import-manager/.openspec.yaml b/openspec/changes/archive/2026-06-04-rework-command-import-manager/.openspec.yaml
similarity index 100%
copy from openspec/changes/rework-command-import-manager/.openspec.yaml
copy to openspec/changes/archive/2026-06-04-rework-command-import-manager/.openspec.yaml
diff --git a/openspec/changes/rework-command-import-manager/design.md b/openspec/changes/archive/2026-06-04-rework-command-import-manager/design.md
similarity index 100%
rename from openspec/changes/rework-command-import-manager/design.md
rename to openspec/changes/archive/2026-06-04-rework-command-import-manager/design.md
diff --git a/openspec/changes/rework-command-import-manager/proposal.md b/openspec/changes/archive/2026-06-04-rework-command-import-manager/proposal.md
similarity index 100%
rename from openspec/changes/rework-command-import-manager/proposal.md
rename to openspec/changes/archive/2026-06-04-rework-command-import-manager/proposal.md
diff --git a/openspec/changes/rework-command-import-manager/specs/command-export-yaml-result/spec.md b/openspec/changes/archive/2026-06-04-rework-command-import-manager/specs/command-export-yaml-result/spec.md
similarity index 100%
rename from openspec/changes/rework-command-import-manager/specs/command-export-yaml-result/spec.md
rename to openspec/changes/archive/2026-06-04-rework-command-import-manager/specs/command-export-yaml-result/spec.md
diff --git a/openspec/changes/rework-command-import-manager/tasks.md b/openspec/changes/archive/2026-06-04-rework-command-import-manager/tasks.md
similarity index 100%
rename from openspec/changes/rework-command-import-manager/tasks.md
rename to openspec/changes/archive/2026-06-04-rework-command-import-manager/tasks.md
diff --git a/openspec/changes/rework-command-import-manager/.openspec.yaml b/openspec/changes/notify-replay-result-mapping/.openspec.yaml
similarity index 100%
rename from openspec/changes/rework-command-import-manager/.openspec.yaml
rename to openspec/changes/notify-replay-result-mapping/.openspec.yaml
diff --git a/openspec/changes/notify-replay-result-mapping/design.md b/openspec/changes/notify-replay-result-mapping/design.md
new file mode 100644
index 00000000000..f095286dd6e
--- /dev/null
+++ b/openspec/changes/notify-replay-result-mapping/design.md
@@ -0,0 +1,50 @@
+## Context
+
+Command replay imports can now store the recorded returned object bookmark on the replay `CommandLogEntry`.
+During replay, `CommandExecutorService#executeCommand(...)` returns the actual result bookmark produced by executing the command in the target environment.
+
+Those bookmarks can differ when replay creates a new object or resolves to an environment-specific instance.
+Applications that maintain cross-environment references need a supported SPI to observe the mapping from the recorded bookmark to the actual bookmark.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Introduce a public SPI for replay result mapping notifications.
+- Notify the SPI after successful replay when both recorded and actual result bookmarks are known.
+- Pass bookmarks as bookmark values and avoid resolving domain objects inside the replay infrastructure.
+- Keep replay state handling and existing replay success behavior intact.
+
+**Non-Goals:**
+
+- Do not persist a generic mapping table in the command log extension.
+- Do not transform future replay commands using mappings in this change.
+- Do not require applications to implement the SPI.
+- Do not notify the SPI for failed replay attempts.
+
+## Decisions
+
+- Add an SPI interface in the command log applib replay package or an adjacent SPI package.
+  The SPI should expose a method such as `onReplayResultMapped(Bookmark recordedResult, Bookmark actualResult, CommandLogEntry commandLogEntry)` or an equivalent event object.
+  Alternative considered: publish a domain event, but an SPI is clearer for application services that need deterministic post-replay callbacks.
+
+- Invoke the SPI from `ReplayableCommand` after replay execution succeeds and before or during the existing replay success handling transaction.
+  This location already has access to the imported command log entry and the actual bookmark returned by `CommandExecutorService`.
+  Alternative considered: hook into `CommandLogEntry` persistence, but that layer cannot distinguish imported recorded results from actual replay results without additional context.
+
+- Only notify when both recorded and actual bookmarks are non-null.
+  The mapping is only meaningful when there is a recorded returned object and replay produced an actual returned object.
+  Alternative considered: notify for null values as well, but that pushes non-mapping cases onto every application implementation.
+
+- Allow notification when the recorded and actual bookmarks are equal.
+  Equality can be useful for auditing and keeps the SPI semantics simple: successful replay produced a known pair.
+  Alternative considered: suppress equal pairs, but that hides successful correlation from applications that want a complete replay result stream.
+
+- Provide a no-op default implementation if module registration requires a concrete bean.
+  This keeps the extension opt-in for applications and avoids changing behavior when no application SPI is present.
+
+## Risks / Trade-offs
+
+- [Risk] SPI exceptions could interfere with replay success state updates → Catch and record SPI failures as replay failures only if the implementation policy explicitly requires it; otherwise log and keep replay success behavior stable.
+- [Risk] Applications may expect bookmarks to resolve to objects → Document that the SPI receives bookmarks only and object lookup is the application's responsibility.
+- [Risk] Multiple SPI implementations may exist → Invoke all discovered implementations in a deterministic order if the framework supplies a list, or document single-bean semantics if only one service is injected.
diff --git a/openspec/changes/notify-replay-result-mapping/proposal.md b/openspec/changes/notify-replay-result-mapping/proposal.md
new file mode 100644
index 00000000000..1896d1623ab
--- /dev/null
+++ b/openspec/changes/notify-replay-result-mapping/proposal.md
@@ -0,0 +1,28 @@
+## Why
+
+Command replay can legitimately create a different domain object than the object recorded during export/import.
+Applications need an explicit extension point so they can learn that the recorded result bookmark, such as `demoInvoice:1`, now corresponds to the actual replay result bookmark, such as `demoInvoice:2`.
+
+## What Changes
+
+- Add an SPI that is invoked after a successful command replay when both recorded and actual result bookmarks are available.
+- Provide the SPI with the recorded returned object bookmark from the imported `CommandLogEntry` and the actual bookmark returned by replay execution.
+- Invoke the SPI only after replay succeeds, and avoid invoking it for failed replay attempts.
+- Do not require either bookmark to resolve to a live domain object before notifying the SPI.
+
+## Capabilities
+
+### New Capabilities
+
+- `command-replay-result-mapping`: Allows applications to observe mappings from recorded replay result bookmarks to actual replay result bookmarks.
+
+### Modified Capabilities
+
+- None.
+
+## Impact
+
+- Affects command replay success handling in `ReplayableCommand`.
+- Adds a command log replay SPI type for application-provided mapping handlers.
+- Adds module registration for the default/no-op SPI implementation if required.
+- Adds tests for SPI invocation, non-invocation, and bookmark values.
diff --git a/openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md b/openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md
new file mode 100644
index 00000000000..97ff0ea95cc
--- /dev/null
+++ b/openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md
@@ -0,0 +1,39 @@
+## ADDED Requirements
+
+### Requirement: Replay result mapping SPI is notified after successful replay
+The system SHALL provide an SPI that applications can implement to receive replay result bookmark mappings.
+After a command replay succeeds, the system SHALL notify the SPI when the imported command log entry has a recorded returned object bookmark and replay execution returns an actual result bookmark.
+The notification SHALL include the recorded returned object bookmark and the actual replay result bookmark.
+
+#### Scenario: Successful replay produces a different result bookmark
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:2`
+- **THEN** the system notifies the replay result mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:2`
+
+#### Scenario: Successful replay produces the same result bookmark
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:1`
+- **THEN** the system notifies the replay result mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
+
+### Requirement: Replay result mapping SPI is not notified when mapping data is unavailable
+The system MUST NOT notify the replay result mapping SPI unless replay succeeds and both recorded and actual result bookmarks are available.
+
+#### Scenario: Replay fails
+- **WHEN** command replay fails for an imported command whose recorded result bookmark is available
+- **THEN** the system does not notify the replay result mapping SPI
+
+#### Scenario: Recorded result is absent
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is absent
+- **THEN** the system does not notify the replay result mapping SPI
+
+#### Scenario: Actual result is absent
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is available
+- **AND** replay execution does not return an actual result bookmark
+- **THEN** the system does not notify the replay result mapping SPI
+
+### Requirement: Replay result mapping SPI uses bookmarks without resolving objects
+The system SHALL pass recorded and actual result bookmarks to the replay result mapping SPI without requiring those bookmarks to resolve to live domain objects.
+
+#### Scenario: Recorded object is not resolvable
+- **WHEN** command replay succeeds and the recorded result bookmark does not resolve to a local domain object
+- **THEN** the system can still notify the replay result mapping SPI with the recorded bookmark and actual bookmark
diff --git a/openspec/changes/notify-replay-result-mapping/tasks.md b/openspec/changes/notify-replay-result-mapping/tasks.md
new file mode 100644
index 00000000000..7fbd7e328a3
--- /dev/null
+++ b/openspec/changes/notify-replay-result-mapping/tasks.md
@@ -0,0 +1,21 @@
+## 1. SPI Definition
+
+- [ ] 1.1 Add a replay result mapping SPI interface that accepts the recorded result bookmark, actual result bookmark, and replayed `CommandLogEntry` context.
+- [ ] 1.2 Add a no-op/default SPI implementation or optional injection strategy so replay works when applications do not provide an implementation.
+- [ ] 1.3 Register the SPI or default implementation with the command log applib module if required.
+
+## 2. Replay Integration
+
+- [ ] 2.1 Update `ReplayableCommand#tryReplay` success handling to retain the actual replay result bookmark.
+- [ ] 2.2 Read the recorded result bookmark from the imported replay `CommandLogEntry`.
+- [ ] 2.3 Notify the SPI after successful replay when both recorded and actual result bookmarks are non-null.
+- [ ] 2.4 Do not notify the SPI for failed replay attempts, missing recorded bookmarks, or missing actual bookmarks.
+- [ ] 2.5 Keep existing replay state and analysis updates unchanged.
+
+## 3. Tests
+
+- [ ] 3.1 Add tests that a successful replay with different recorded and actual result bookmarks notifies the SPI with both values.
+- [ ] 3.2 Add tests that a successful replay with equal recorded and actual result bookmarks still notifies the SPI.
+- [ ] 3.3 Add tests that failed replay attempts do not notify the SPI.
+- [ ] 3.4 Add tests that missing recorded or actual result bookmarks do not notify the SPI.
+- [ ] 3.5 Run focused command replay tests.
diff --git a/openspec/specs/command-export-yaml-result/spec.md b/openspec/specs/command-export-yaml-result/spec.md
index 3ef77f38469..b1c0cb24bc1 100644
--- a/openspec/specs/command-export-yaml-result/spec.md
+++ b/openspec/specs/command-export-yaml-result/spec.md
@@ -1,4 +1,8 @@
-## ADDED Requirements
+## Purpose
+
+Define command export YAML and replay import compatibility for command DTOs and returned object metadata.
+
+## Requirements
 
 ### Requirement: Exported command YAML includes returned object metadata
 The system SHALL include returned object metadata for each exported command whose underlying `CommandLogEntry` has a non-null returned object bookmark.
@@ -14,12 +18,30 @@ The returned object metadata SHALL contain `logicalTypeName` and `id` fields der
 
 ### Requirement: Exported command YAML remains replay compatible
 The system SHALL preserve the command DTO data required by command replay import when adding returned object metadata to exported YAML.
-Existing YAML exports that contain only command DTO data MUST remain importable.
+Command replay import SHALL first attempt to read the input as a multi-document stream of `CommandExportDto` values.
+If that fails, command replay import SHALL fall back to reading the input as a multi-document stream of `CommandDto` values.
+Command replay import MUST NOT support a single YAML list of `CommandDto` values.
 
-#### Scenario: Import legacy command DTO YAML
-- **WHEN** command replay import receives a YAML file using the legacy command DTO-only export shape
+#### Scenario: Import legacy multi-document command DTO YAML
+- **WHEN** command replay import receives a YAML file using the legacy multi-document `CommandDto` export shape
 - **THEN** the system imports the command DTOs as before
 
 #### Scenario: Import YAML with returned object metadata
 - **WHEN** command replay import receives a YAML file generated with returned object metadata
-- **THEN** the system imports the command DTOs needed for replay and does not require the returned object metadata to resolve to an object
+- **THEN** the system imports the command DTOs needed for replay and stores the returned object metadata as the corresponding command log result when present
+
+#### Scenario: Reject command DTO list YAML
+- **WHEN** command replay import receives a YAML file containing a single list of `CommandDto` values
+- **THEN** the system rejects the import instead of importing the list entries
+
+### Requirement: Imported command export YAML stores returned object result
+The system SHALL store returned object metadata from each imported `CommandExportDto` as the result bookmark of the corresponding replay `CommandLogEntry`.
+The system MUST NOT require the returned object bookmark to resolve to an existing domain object during import.
+
+#### Scenario: Import command export with returned object
+- **WHEN** command replay import receives a multi-document YAML file containing a `CommandExportDto` whose `returnedObject` has `logicalTypeName` and `id`
+- **THEN** the system persists the embedded command DTO for replay and sets the created `CommandLogEntry` result bookmark from that returned object metadata
+
+#### Scenario: Import command export without returned object
+- **WHEN** command replay import receives a multi-document YAML file containing a `CommandExportDto` without `returnedObject`
+- **THEN** the system persists the embedded command DTO for replay and leaves the created `CommandLogEntry` result bookmark unset


(causeway) 06/42: CAUSEWAY-4011: improves paging

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit ef8902ce159c1b873f01d49974fefbbc37eeb161
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 10:30:33 2026 +0100

    CAUSEWAY-4011: improves paging
---
 .../commandlog/applib/CausewayModuleExtCommandLogApplib.java      | 8 ++++++++
 .../commandlog/applib/dom/replay/CommandExportManager.java        | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
index 57f50056ed4..dae0c747ea6 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
@@ -35,6 +35,10 @@
 import org.apache.causeway.extensions.commandlog.applib.dom.mixins.CommandLogEntry_openResultObject;
 import org.apache.causeway.extensions.commandlog.applib.dom.mixins.CommandLogEntry_siblingCommands;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_changeLimit;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_nextPage;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_previousPage;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_toggleMode;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.HasBaseline_changeBaseline;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_exportSelected;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_makeSelectedExportable;
@@ -92,6 +96,10 @@
         HasBaseline_nextHour.class,
         CommandExportManager_exportSelected.class,
         CommandExportManager_makeSelectedExportable.class,
+        CommandExportManager_previousPage.class,
+        CommandExportManager_nextPage.class,
+        CommandExportManager_toggleMode.class,
+        CommandExportManager_changeLimit.class,
         CommandReplayManager_importCommands.class,
         CommandReplayManager_replayOrRetrySelected.class,
         CommandReplayManager_excludeSelectedFromReplay.class,
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
index 493b84b32fb..dac2f949750 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
@@ -80,8 +80,8 @@ public CommandExportManager(
 
     @RequiredArgsConstructor
     public enum Mode {
-        EXPORT("Export commands (UNDEFINED -> EXPORTED)"),
-        UNEXPORT("Unexport commands (EXPORTED -> UNDEFINED)");
+        EXPORT("Export"),
+        UNEXPORT("Unexport");
 
         private final String title;
 


(causeway) 30/42: CAUSEWAY-4010: archives default command replay mapping listener

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit b0deefe5b9a9af75c90e20d286c07abdadace6dc
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 18:13:03 2026 +0100

    CAUSEWAY-4010: archives default command replay mapping listener
---
 .../.openspec.yaml                                      |  0
 .../design.md                                           |  0
 .../proposal.md                                         |  0
 .../specs/command-replay-result-mapping/spec.md         |  0
 .../default-command-replay-mapping-listener/spec.md     |  0
 .../tasks.md                                            |  0
 openspec/specs/command-replay-result-mapping/spec.md    | 17 +++++++++++++++++
 .../default-command-replay-mapping-listener/spec.md     |  6 +++++-
 8 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/openspec/changes/default-command-replay-mapping-listener/.openspec.yaml b/openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/.openspec.yaml
similarity index 100%
rename from openspec/changes/default-command-replay-mapping-listener/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/.openspec.yaml
diff --git a/openspec/changes/default-command-replay-mapping-listener/design.md b/openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/design.md
similarity index 100%
rename from openspec/changes/default-command-replay-mapping-listener/design.md
rename to openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/design.md
diff --git a/openspec/changes/default-command-replay-mapping-listener/proposal.md b/openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/proposal.md
similarity index 100%
rename from openspec/changes/default-command-replay-mapping-listener/proposal.md
rename to openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/proposal.md
diff --git a/openspec/changes/default-command-replay-mapping-listener/specs/command-replay-result-mapping/spec.md b/openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/specs/command-replay-result-mapping/spec.md
similarity index 100%
rename from openspec/changes/default-command-replay-mapping-listener/specs/command-replay-result-mapping/spec.md
rename to openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/specs/command-replay-result-mapping/spec.md
diff --git a/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
similarity index 100%
copy from openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
copy to openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
diff --git a/openspec/changes/default-command-replay-mapping-listener/tasks.md b/openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/tasks.md
similarity index 100%
rename from openspec/changes/default-command-replay-mapping-listener/tasks.md
rename to openspec/changes/archive/2026-06-04-default-command-replay-mapping-listener/tasks.md
diff --git a/openspec/specs/command-replay-result-mapping/spec.md b/openspec/specs/command-replay-result-mapping/spec.md
index f554554fcba..a145815ca99 100644
--- a/openspec/specs/command-replay-result-mapping/spec.md
+++ b/openspec/specs/command-replay-result-mapping/spec.md
@@ -92,3 +92,20 @@ The system SHALL pass target bookmarks to the command replay mapping SPI without
 - **WHEN** command replay is about to execute a command whose recorded target bookmark does not resolve to a local domain object
 - **THEN** the system can still ask the command replay mapping SPI for a replacement target bookmark
 
+### Requirement: Replay mapping SPI has a conditional default listener
+The system SHALL autoconfigure a default `CommandReplayMappingListener` bean when no application-defined `CommandReplayMappingListener` bean is present.
+The system MUST NOT instantiate the default listener bean when another `CommandReplayMappingListener` bean is already defined.
+The conditional default listener SHALL participate in the same replay mapping listener collection used for replay input remapping and replay result mapping notifications.
+
+#### Scenario: Default listener is autoconfigured when missing
+- **WHEN** the application context contains no `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration provides the default `CommandReplayMappingListener` bean
+
+#### Scenario: Default listener backs off for custom listener
+- **WHEN** the application context already contains a custom `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration does not provide the default `CommandReplayMappingListener` bean
+
+#### Scenario: Autoconfigured listener participates in replay
+- **WHEN** the command log autoconfiguration provides the default `CommandReplayMappingListener` bean
+- **THEN** command replay includes that listener when requesting input remaps and sending result mapping notifications
+
diff --git a/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md b/openspec/specs/default-command-replay-mapping-listener/spec.md
similarity index 94%
rename from openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
rename to openspec/specs/default-command-replay-mapping-listener/spec.md
index aa0fa5df820..d6776751278 100644
--- a/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
+++ b/openspec/specs/default-command-replay-mapping-listener/spec.md
@@ -1,4 +1,8 @@
-## ADDED Requirements
+## Purpose
+
+Provide an out-of-the-box replay mapping listener that remembers non-identity replay result mappings and remaps later replay inputs from those mappings.
+
+## Requirements
 
 ### Requirement: Default replay mapping listener records result mappings
 The system SHALL provide a default command replay mapping listener that records each replay result mapping by recorded result bookmark.


(causeway) 19/42: CAUSEWAY-4010: proposes command replay input remapping

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 97bc016a4a6d993234d52d1b096341428144e073
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 15:27:25 2026 +0100

    CAUSEWAY-4010: proposes command replay input remapping
---
 .../remap-command-replay-inputs/.openspec.yaml     |  2 +
 .../changes/remap-command-replay-inputs/design.md  | 56 +++++++++++++
 .../remap-command-replay-inputs/proposal.md        | 29 +++++++
 .../specs/command-replay-result-mapping/spec.md    | 91 ++++++++++++++++++++++
 .../changes/remap-command-replay-inputs/tasks.md   | 26 +++++++
 5 files changed, 204 insertions(+)

diff --git a/openspec/changes/remap-command-replay-inputs/.openspec.yaml b/openspec/changes/remap-command-replay-inputs/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/remap-command-replay-inputs/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/remap-command-replay-inputs/design.md b/openspec/changes/remap-command-replay-inputs/design.md
new file mode 100644
index 00000000000..62cbcb0302f
--- /dev/null
+++ b/openspec/changes/remap-command-replay-inputs/design.md
@@ -0,0 +1,56 @@
+## Context
+
+The command log applib now has a replay mapping SPI that receives recorded-to-actual result bookmark mappings after successful replay.
+Replay still executes the imported `CommandDto` as recorded, so target identifiers and action parameter values remain fixed to the source environment at recording time.
+
+When replay happens later or in another environment, those identifiers may no longer point at the intended objects.
+The same application service that records result mappings is the natural place to answer replay-time remapping questions before the command is executed.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Broaden the replay result mapping SPI into a command replay mapping SPI.
+- Ask the SPI for target identifier remapping before executing a replayed command.
+- Ask the SPI for reference-valued action parameter remapping before executing a replayed action command.
+- Preserve existing recorded-to-actual result mapping notifications after successful replay.
+- Keep replay unchanged when no SPI implementation exists or when the SPI does not provide replacements.
+
+**Non-Goals:**
+
+- Do not introduce a persisted mapping table in the command log extension.
+- Do not infer mappings automatically from object lookup failures.
+- Do not remap property commands unless their DTO representation explicitly exposes parameter-like values through the same supported path.
+- Do not mutate the persisted imported `CommandDto` unless that is already required by existing replay execution semantics.
+
+## Decisions
+
+- Rename the SPI from result-specific naming to command replay mapping naming.
+  A name such as `CommandReplayMappingListener` better describes both pre-execution remapping and post-execution result notification.
+  Alternative considered: add a second SPI, but splitting related mapping behavior would force applications to coordinate two services.
+
+- Use optional list injection for SPI implementations, matching the existing opt-in behavior.
+  Replay proceeds unchanged when the list is empty.
+  Alternative considered: require a default implementation, but the repository policy is to avoid a no-op implementation for this SPI.
+
+- Apply remapping to a replay copy of the command DTO before calling `CommandExecutorService#executeCommand(...)`.
+  This prevents application-provided remapping from changing the stored imported command record and keeps audit data aligned with the original recording.
+  Alternative considered: mutate the persisted DTO, but that would make subsequent inspection lose the originally recorded values.
+
+- Ask for target remapping using bookmark-like values derived from each target OID.
+  The SPI should be able to return a replacement bookmark or replacement identifier for the same logical type.
+  Alternative considered: pass only raw identifier strings, but bookmarks give applications both logical type and identifier context.
+
+- Ask for action parameter remapping for parameters represented as `ParamDto` entries with `type: "reference"` and a populated `reference` OID.
+  The SPI should receive enough context to identify the command, action member, parameter name or index, and current reference bookmark, then return an optional replacement reference bookmark.
+  Alternative considered: support every `ParamDto` value shape immediately, but the supplied replay use case is specifically object reference remapping and reference DTOs provide bookmark-like type/id data.
+
+- Preserve existing result mapping notification semantics after successful replay.
+  The renamed SPI should continue to be notified only when both recorded and actual result bookmarks are present.
+
+## Risks / Trade-offs
+
+- [Risk] Deep copying `CommandDto` can be error-prone → Use existing schema marshalling or utility support where available, and cover remapped replay command content with tests.
+- [Risk] Parameter DTOs support many value shapes → Limit the first implementation to reference parameters represented by `ParamDto.reference`, and make no-op behavior explicit for non-reference parameters.
+- [Risk] Multiple SPI implementations could return conflicting remaps → Apply implementations in framework-supplied order, passing each replacement to the next implementation.
+- [Risk] SPI exceptions could break replay → Treat remapping SPI exceptions consistently with existing result notification policy, preferably logging and continuing with the current value unless implementation reveals a stronger requirement.
diff --git a/openspec/changes/remap-command-replay-inputs/proposal.md b/openspec/changes/remap-command-replay-inputs/proposal.md
new file mode 100644
index 00000000000..ea605ae604e
--- /dev/null
+++ b/openspec/changes/remap-command-replay-inputs/proposal.md
@@ -0,0 +1,29 @@
+## Why
+
+Command recordings can be replayed later against an environment whose object identifiers have moved on since the recording was captured.
+Replay needs an application SPI to remap command targets and action parameters before execution, while still reporting recorded-to-actual result mappings after execution.
+
+## What Changes
+
+- Extend and likely rename the existing replay result mapping SPI so it represents command replay mapping rather than only result notifications.
+- Before executing a replayed command, ask the SPI whether the command target identifier should be remapped.
+- Before executing a replayed action command, ask the SPI whether any reference-valued action parameter should be remapped, for example a parameter represented by `type: "reference"` with a `reference.type` and `reference.id`.
+- Continue notifying the SPI about recorded-to-actual result bookmark mappings after successful replay.
+- Keep replay behavior unchanged when no SPI implementation is registered or when the SPI returns no remapping.
+
+## Capabilities
+
+### New Capabilities
+
+- None.
+
+### Modified Capabilities
+
+- `command-replay-result-mapping`: Extends the replay mapping SPI from result-only notification to bidirectional replay mapping support for target identifiers, reference-valued action parameters, and result bookmarks.
+
+## Impact
+
+- Affects the command log applib SPI introduced for replay result mapping.
+- Affects `ReplayableCommand` or the replay preparation path before `CommandExecutorService#executeCommand(...)` is called.
+- Affects command DTO cloning or mutation logic for replay-time remapping of targets and reference-valued action parameters.
+- Adds tests for target remapping, reference action parameter remapping, no-op behavior, and continued result mapping notification.
diff --git a/openspec/changes/remap-command-replay-inputs/specs/command-replay-result-mapping/spec.md b/openspec/changes/remap-command-replay-inputs/specs/command-replay-result-mapping/spec.md
new file mode 100644
index 00000000000..55dc39454b6
--- /dev/null
+++ b/openspec/changes/remap-command-replay-inputs/specs/command-replay-result-mapping/spec.md
@@ -0,0 +1,91 @@
+## ADDED Requirements
+
+### Requirement: Replay mapping SPI can remap command targets before execution
+The system SHALL ask the command replay mapping SPI whether each replayed command target bookmark should be remapped before command execution.
+When the SPI provides a replacement target bookmark, the system SHALL execute the replayed command using the replacement target identifier.
+When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded target identifier.
+
+#### Scenario: Target bookmark is remapped
+- **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
+- **AND** the command replay mapping SPI returns replacement target bookmark `demoCustomer:2`
+- **THEN** the system executes the replayed command against target bookmark `demoCustomer:2`
+
+#### Scenario: Target bookmark is not remapped
+- **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
+- **AND** no command replay mapping SPI provides a replacement target bookmark
+- **THEN** the system executes the replayed command against target bookmark `demoCustomer:1`
+
+### Requirement: Replay mapping SPI can remap reference action parameters before execution
+The system SHALL ask the command replay mapping SPI whether each replayed action parameter represented as `type: "reference"` with a populated `reference` OID should be remapped before command execution.
+When the SPI provides a replacement reference bookmark, the system SHALL execute the replayed command using the replacement parameter reference.
+When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded parameter reference.
+The system MUST leave non-reference action parameters unchanged by this reference remapping flow.
+
+#### Scenario: Reference action parameter is remapped
+- **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+- **AND** the command replay mapping SPI returns replacement reference bookmark `simple.SimpleObject:2`
+- **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "2"`
+
+#### Scenario: Reference action parameter is not remapped
+- **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+- **AND** no command replay mapping SPI provides a replacement reference bookmark
+- **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+
+#### Scenario: Non-reference action parameter is not remapped by reference flow
+- **WHEN** command replay is about to execute an action command with a parameter that is not represented as `type: "reference"`
+- **THEN** the system does not ask the reference parameter remapping flow to replace that parameter
+
+### Requirement: Replay input remapping does not mutate recorded command data
+The system SHALL preserve the imported command log entry's recorded command DTO when applying replay-time target or reference parameter remapping.
+Replay input remapping SHALL affect the command DTO supplied to replay execution, not the recorded command DTO retained for audit and inspection.
+
+#### Scenario: Remapped replay preserves recorded command
+- **WHEN** command replay remaps recorded target bookmark `demoCustomer:1` to actual target bookmark `demoCustomer:2`
+- **THEN** the replay execution receives target bookmark `demoCustomer:2`
+- **AND** the imported command log entry still records target bookmark `demoCustomer:1`
+
+## MODIFIED Requirements
+
+### Requirement: Replay result mapping SPI is notified after successful replay
+The system SHALL provide a command replay mapping SPI that applications can implement to receive replay result bookmark mappings and provide replay input remappings.
+After a command replay succeeds, the system SHALL notify the SPI when the imported command log entry has a recorded returned object bookmark and replay execution returns an actual result bookmark.
+The notification SHALL include the recorded returned object bookmark and the actual replay result bookmark.
+
+#### Scenario: Successful replay produces a different result bookmark
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:2`
+- **THEN** the system notifies the command replay mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:2`
+
+#### Scenario: Successful replay produces the same result bookmark
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:1`
+- **THEN** the system notifies the command replay mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
+
+### Requirement: Replay result mapping SPI is not notified when mapping data is unavailable
+The system MUST NOT notify the command replay mapping SPI of result mappings unless replay succeeds and both recorded and actual result bookmarks are available.
+Replay input remapping methods MAY still be called before execution even if result mapping data is unavailable.
+
+#### Scenario: Replay fails
+- **WHEN** command replay fails for an imported command whose recorded result bookmark is available
+- **THEN** the system does not notify the command replay mapping SPI of a result mapping
+
+#### Scenario: Recorded result is absent
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is absent
+- **THEN** the system does not notify the command replay mapping SPI of a result mapping
+
+#### Scenario: Actual result is absent
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is available
+- **AND** replay execution does not return an actual result bookmark
+- **THEN** the system does not notify the command replay mapping SPI of a result mapping
+
+### Requirement: Replay result mapping SPI uses bookmarks without resolving objects
+The system SHALL pass recorded and actual result bookmarks to the command replay mapping SPI without requiring those bookmarks to resolve to live domain objects.
+The system SHALL pass target bookmarks to the command replay mapping SPI without requiring those bookmarks to resolve to live domain objects.
+
+#### Scenario: Recorded object is not resolvable
+- **WHEN** command replay succeeds and the recorded result bookmark does not resolve to a local domain object
+- **THEN** the system can still notify the command replay mapping SPI with the recorded bookmark and actual bookmark
+
+#### Scenario: Target object is not resolvable before remapping
+- **WHEN** command replay is about to execute a command whose recorded target bookmark does not resolve to a local domain object
+- **THEN** the system can still ask the command replay mapping SPI for a replacement target bookmark
diff --git a/openspec/changes/remap-command-replay-inputs/tasks.md b/openspec/changes/remap-command-replay-inputs/tasks.md
new file mode 100644
index 00000000000..025969b2a56
--- /dev/null
+++ b/openspec/changes/remap-command-replay-inputs/tasks.md
@@ -0,0 +1,26 @@
+## 1. SPI Refactor
+
+- [ ] 1.1 Rename `ReplayResultMappingListener` to a broader command replay mapping SPI name.
+- [ ] 1.2 Preserve the existing recorded-to-actual result mapping notification method under the renamed SPI.
+- [ ] 1.3 Add a target remapping method that receives the replay command context and recorded target bookmark, and returns an optional replacement target bookmark.
+- [ ] 1.4 Add a reference action parameter remapping method that receives the replay command context, parameter context, and current reference bookmark, and returns an optional replacement reference bookmark.
+- [ ] 1.5 Update module wiring and replay context references to use the renamed SPI.
+
+## 2. Replay Input Remapping
+
+- [ ] 2.1 Add a utility or method to create a replay-time copy of the imported `CommandDto` before applying remaps.
+- [ ] 2.2 Apply target bookmark remapping to the replay-time command DTO copy before execution.
+- [ ] 2.3 Apply reference action parameter remapping to `ParamDto.reference` values on the replay-time command DTO copy before execution.
+- [ ] 2.4 Pass the remapped command DTO copy to `CommandExecutorService#executeCommand(...)`.
+- [ ] 2.5 Preserve the stored imported command DTO unchanged after remapping.
+- [ ] 2.6 Keep existing result mapping notification behavior after successful replay.
+
+## 3. Tests
+
+- [ ] 3.1 Add tests that target bookmark remapping changes the command DTO supplied to replay execution.
+- [ ] 3.2 Add tests that missing target remapping leaves replay execution unchanged.
+- [ ] 3.3 Add tests that reference action parameter remapping changes the command DTO supplied to replay execution using a `type: "reference"` parameter with `reference.type` and `reference.id`.
+- [ ] 3.4 Add tests that missing reference action parameter remapping leaves replay execution unchanged.
+- [ ] 3.5 Add tests that remapping does not mutate the command DTO stored on the imported command log entry.
+- [ ] 3.6 Update existing result mapping tests for the renamed SPI.
+- [ ] 3.7 Run focused command replay tests.


(causeway) 38/42: CAUSEWAY-4010: proposes persistent replay mapping listener

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 6126259a95a4b83934d4c989138b799891c0ee92
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 21:43:42 2026 +0100

    CAUSEWAY-4010: proposes persistent replay mapping listener
---
 .../.openspec.yaml                                 |  2 +
 .../design.md                                      | 70 ++++++++++++++++
 .../proposal.md                                    | 32 +++++++
 .../spec.md                                        | 36 ++++++++
 .../spec.md                                        | 98 ++++++++++++++++++++++
 .../tasks.md                                       | 45 ++++++++++
 6 files changed, 283 insertions(+)

diff --git a/openspec/changes/persistent-command-replay-mapping-listener/.openspec.yaml b/openspec/changes/persistent-command-replay-mapping-listener/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/persistent-command-replay-mapping-listener/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/design.md b/openspec/changes/persistent-command-replay-mapping-listener/design.md
new file mode 100644
index 00000000000..8ef7e095794
--- /dev/null
+++ b/openspec/changes/persistent-command-replay-mapping-listener/design.md
@@ -0,0 +1,70 @@
+## Context
+
+The command log applib currently provides a built-in `CommandReplayMappingListenerDefault` that remembers non-identity replay result mappings in an in-memory `HashMap`.
+The listener also remaps later replay inputs by looking up recorded bookmarks in that map.
+A recently added conflict policy controls whether conflicting mappings throw an exception or are logged and ignored.
+
+This is sufficient for a single JVM replay run, but the mapping state is lost when the listener instance is recreated.
+A persistent implementation needs to follow the existing command log persistence split: abstract applib domain and repository contracts, with concrete JDO and JPA entities and repositories in their respective modules.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Add an optional persistent built-in replay mapping listener.
+- Preserve the current in-memory listener as the default storage strategy.
+- Use a configuration property to choose between in-memory and persistent built-in storage.
+- Keep custom `CommandReplayMappingListener` beans authoritative over both built-in implementations.
+- Persist recorded and actual bookmarks as logical type plus identifier columns.
+- Provide abstract applib entity and repository types plus concrete JDO and JPA implementations.
+- Provide menu access and fallback layout metadata for the persisted mappings.
+- Reuse the existing conflict policy semantics for both built-in listener implementations.
+
+**Non-Goals:**
+
+- Do not change the `CommandReplayMappingListener` SPI.
+- Do not persist equal recorded/actual mappings.
+- Do not resolve bookmarks to live domain objects while recording or remapping.
+- Do not introduce a distributed cache or external storage dependency.
+- Do not change command replay transaction boundaries.
+
+## Decisions
+
+- Add a storage strategy enum near the existing replay result mapping configuration.
+  Suggested values are `IN_MEMORY` and `PERSISTENT`, with `IN_MEMORY` as the default.
+  This keeps the current listener behavior unchanged unless applications opt in to persistence.
+
+- Keep the existing in-memory listener class as the implementation for `IN_MEMORY`.
+  Its bean factory should be guarded by no custom `CommandReplayMappingListener` and by storage strategy `IN_MEMORY`.
+  The persistent listener should use the same no-custom-listener guard and a storage strategy `PERSISTENT` guard.
+
+- Introduce an abstract applib entity, for example `CommandReplayResultMapping`, with fields for recorded logical type, recorded identifier, actual logical type, and actual identifier.
+  Store the bookmark components separately rather than serializing a whole bookmark string so queries and uniqueness constraints can target recorded bookmark identity directly.
+
+- Introduce an abstract applib repository, for example `CommandReplayResultMappingRepository`, with operations to find by recorded bookmark, list all mappings, and create or retrieve mappings.
+  Concrete JDO and JPA repositories should follow the `CommandLogEntryRepository` pattern and live in the matching persistence modules.
+
+- Implement the persistent listener in applib against the abstract repository.
+  `remap(...)` finds a mapping by recorded bookmark and returns the actual bookmark if present.
+  `onReplayResultMapped(...)` ignores equal bookmarks, creates the first non-identity mapping, treats repeated identical mappings as idempotent, and delegates conflicts to the configured conflict policy.
+
+- Put the command log menu action in applib so the UI contract is common across persistence technologies.
+  The action should delegate to the abstract repository and return all persisted mappings.
+  Concrete persistence modules provide the entity implementations that make the returned objects renderable.
+
+- Add a `.fallback.layout.xml` for the abstract applib mapping entity or for each concrete entity following existing command log layout conventions.
+  The layout should expose recorded and actual bookmark components and hide technical persistence details where appropriate.
+
+## Risks / Trade-offs
+
+- Persistent mode requires one of the command log persistence modules to supply the concrete repository.
+  Mitigation: condition persistent listener creation on the configured storage strategy and the repository bean being available.
+
+- Uniqueness semantics can differ between JDO and JPA implementations.
+  Mitigation: enforce lookup-before-create in the repository/listener and add persistence-specific tests for repeated and conflicting mappings.
+
+- Listing all persisted mappings can become large.
+  Mitigation: implement the menu action consistently with existing command log menu patterns and consider repository ordering, but leave paging/filtering out of scope for this change.
+
+- Two built-in listener factories could accidentally both create beans.
+  Mitigation: use mutually exclusive storage strategy conditions and tests for `IN_MEMORY`, `PERSISTENT`, and custom listener back-off cases.
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/proposal.md b/openspec/changes/persistent-command-replay-mapping-listener/proposal.md
new file mode 100644
index 00000000000..01579f9e1a6
--- /dev/null
+++ b/openspec/changes/persistent-command-replay-mapping-listener/proposal.md
@@ -0,0 +1,32 @@
+## Why
+
+The current default replay mapping listener can remember result mappings only for the lifetime of a single in-memory listener instance.
+Replay workflows that span JVM restarts, multiple operators, or long-running imported command batches need an optional persistent mapping store while retaining the existing lightweight in-memory mode.
+
+## What Changes
+
+- Add a persistent `CommandReplayMappingListener` implementation backed by command log persistence entities.
+- Store recorded bookmark logical type and identifier together with actual bookmark logical type and identifier, matching the structure used by the in-memory map but persisted in the datastore.
+- Add abstract applib domain and repository types for replay result mappings, plus concrete JDO and JPA implementations following the `CommandLogEntry` pattern.
+- Add configuration to select the built-in listener storage strategy, with `IN_MEMORY` preserving the current default and `PERSISTENT` enabling the new persistent implementation.
+- Rework the current default in-memory listener so it is conditionally enabled only when the storage strategy is `IN_MEMORY` and no custom listener exists.
+- Configure the persistent listener so it is enabled only when the storage strategy is `PERSISTENT` and no custom listener exists.
+- Make the persistent listener honor the existing conflict policy for throwing an exception versus logging and continuing.
+- Add a fallback layout XML for the persistent mapping entity.
+- Add a command log menu action to list the persisted replay result mappings.
+
+## Capabilities
+
+### New Capabilities
+- `persistent-command-replay-mapping-listener`: Provides persisted replay result mapping entities, repositories, menu access, and a persistent built-in `CommandReplayMappingListener` implementation.
+
+### Modified Capabilities
+- `default-command-replay-mapping-listener`: Add built-in listener storage selection so the existing in-memory listener and the new persistent listener are mutually exclusive conditional defaults.
+
+## Impact
+
+- Affects command log applib, persistence-jdo, and persistence-jpa modules.
+- Adds new persistence entities, repositories, and layout metadata.
+- Adds or changes command log configuration properties for storage strategy and listener conflict behavior.
+- Updates autoconfiguration tests for in-memory and persistent listener activation.
+- Adds persistence tests for JDO and JPA implementations.
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/persistent-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
new file mode 100644
index 00000000000..c00813a130c
--- /dev/null
+++ b/openspec/changes/persistent-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
@@ -0,0 +1,36 @@
+## MODIFIED Requirements
+
+### Requirement: Default replay mapping listener uses in-memory state
+When the built-in replay mapping listener storage strategy is `IN_MEMORY`, the default command replay mapping listener SHALL store mappings in memory only.
+The system SHALL NOT require the in-memory listener to persist mappings across JVM restarts, application nodes, or Spring bean lifecycle recreation.
+The system SHALL use `IN_MEMORY` as the default built-in replay mapping listener storage strategy.
+
+#### Scenario: Mapping state is scoped to listener instance
+- **WHEN** the in-memory listener records that `demoInvoice:1` mapped to actual bookmark `demoInvoice:2`
+- **AND** a new in-memory listener instance is created
+- **THEN** the new listener instance has no required remembered mapping for `demoInvoice:1`
+
+#### Scenario: In-memory listener is the default storage strategy
+- **WHEN** the application does not configure a built-in replay mapping listener storage strategy
+- **THEN** the system uses the in-memory listener as the built-in replay mapping listener
+
+## ADDED Requirements
+
+### Requirement: Built-in in-memory replay mapping listener is conditionally enabled
+When the built-in replay mapping listener storage strategy is `IN_MEMORY` and no application-defined `CommandReplayMappingListener` bean is present, the command log autoconfiguration SHALL provide the in-memory replay mapping listener.
+When an application-defined `CommandReplayMappingListener` bean is present, the command log autoconfiguration MUST NOT provide the in-memory replay mapping listener.
+When the storage strategy is not `IN_MEMORY`, the command log autoconfiguration MUST NOT provide the in-memory replay mapping listener.
+
+#### Scenario: In-memory listener is autoconfigured when selected
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `IN_MEMORY`
+- **AND** the application context contains no custom `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration provides the in-memory replay mapping listener
+
+#### Scenario: In-memory listener backs off for custom listener
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `IN_MEMORY`
+- **AND** the application context contains a custom `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration does not provide the in-memory replay mapping listener
+
+#### Scenario: In-memory listener is not created for persistent storage
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `PERSISTENT`
+- **THEN** the command log autoconfiguration does not provide the in-memory replay mapping listener
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md b/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
new file mode 100644
index 00000000000..49ad8c327d4
--- /dev/null
+++ b/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
@@ -0,0 +1,98 @@
+## ADDED Requirements
+
+### Requirement: Persistent replay mapping listener records result mappings
+The system SHALL provide a persistent command replay mapping listener that records non-identity replay result mappings by recorded result bookmark.
+The persisted mapping SHALL store the recorded bookmark logical type, recorded bookmark identifier, actual bookmark logical type, and actual bookmark identifier.
+When replay notifies the persistent listener with equal recorded and actual result bookmarks, the listener MUST NOT persist a mapping for that notification.
+When no mapping exists for a recorded result bookmark, the persistent listener SHALL create a mapping to the actual result bookmark.
+When the same recorded bookmark is notified more than once with the same actual bookmark, the persistent listener SHALL treat the notification as idempotent.
+When the same recorded bookmark is notified more than once with a different actual bookmark, the persistent listener SHALL apply the configured conflict policy and MUST NOT replace the persisted actual bookmark.
+
+#### Scenario: Persistent mapping is recorded
+- **WHEN** command replay notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the system persists a mapping with recorded logical type `demoInvoice`, recorded identifier `1`, actual logical type `demoInvoice`, and actual identifier `2`
+
+#### Scenario: Equal result mapping is not persisted
+- **WHEN** command replay notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:1`
+- **THEN** the system persists no mapping for `demoInvoice:1`
+
+#### Scenario: Repeated persistent mapping is idempotent
+- **WHEN** command replay notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the system keeps one persisted mapping from `demoInvoice:1` to `demoInvoice:2`
+- **AND** no exception is thrown
+
+#### Scenario: Persistent mapping conflict is rejected when configured to throw
+- **GIVEN** the replay mapping conflict policy is configured to throw an exception
+- **WHEN** command replay notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
+- **THEN** the persistent listener throws an exception
+- **AND** the persisted mapping remains from `demoInvoice:1` to `demoInvoice:2`
+
+#### Scenario: Persistent mapping conflict is logged when configured to continue
+- **GIVEN** the replay mapping conflict policy is configured to log and continue
+- **WHEN** command replay notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
+- **THEN** the persistent listener logs the conflict
+- **AND** no exception is thrown
+- **AND** the persisted mapping remains from `demoInvoice:1` to `demoInvoice:2`
+
+### Requirement: Persistent replay mapping listener remaps from persisted mappings
+The persistent command replay mapping listener SHALL return a persisted actual bookmark when replay asks it to remap a recorded bookmark that has a stored mapping.
+When no persisted mapping exists for the recorded bookmark, the listener SHALL return no replacement.
+The persistent listener SHALL perform remapping without resolving recorded or actual bookmarks to live domain objects.
+
+#### Scenario: Recorded bookmark is remapped from persisted mapping
+- **WHEN** the persistent listener has stored that `demoInvoice:1` mapped to actual bookmark `demoInvoice:2`
+- **AND** command replay asks the listener to remap recorded bookmark `demoInvoice:1`
+- **THEN** the persistent listener returns replacement bookmark `demoInvoice:2`
+
+#### Scenario: Unmapped recorded bookmark is not replaced
+- **WHEN** the persistent listener has no persisted mapping for bookmark `demoInvoice:1`
+- **AND** command replay asks the listener to remap recorded bookmark `demoInvoice:1`
+- **THEN** the persistent listener returns no replacement
+
+### Requirement: Persistent replay mappings are represented by applib and persistence-specific types
+The system SHALL define an abstract applib replay result mapping entity that exposes recorded and actual bookmark components.
+The system SHALL define an abstract applib repository for finding, listing, and creating replay result mappings.
+The JDO command log persistence module SHALL provide a concrete replay result mapping entity and repository.
+The JPA command log persistence module SHALL provide a concrete replay result mapping entity and repository.
+
+#### Scenario: JDO module provides persistent mapping types
+- **WHEN** the command log JDO persistence module is active
+- **THEN** the system provides a concrete JDO replay result mapping entity and repository implementing the applib contracts
+
+#### Scenario: JPA module provides persistent mapping types
+- **WHEN** the command log JPA persistence module is active
+- **THEN** the system provides a concrete JPA replay result mapping entity and repository implementing the applib contracts
+
+### Requirement: Persistent replay mapping listener is conditionally enabled
+The system SHALL provide a configuration property that selects the built-in replay mapping listener storage strategy.
+When the storage strategy is `PERSISTENT` and no application-defined `CommandReplayMappingListener` bean is present, the command log autoconfiguration SHALL provide the persistent replay mapping listener if a replay result mapping repository is available.
+When an application-defined `CommandReplayMappingListener` bean is present, the command log autoconfiguration MUST NOT provide the persistent replay mapping listener.
+When the storage strategy is not `PERSISTENT`, the command log autoconfiguration MUST NOT provide the persistent replay mapping listener.
+
+#### Scenario: Persistent listener is autoconfigured when selected
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `PERSISTENT`
+- **AND** the application context contains no custom `CommandReplayMappingListener` bean
+- **AND** a replay result mapping repository bean is available
+- **THEN** the command log autoconfiguration provides the persistent replay mapping listener
+
+#### Scenario: Persistent listener backs off for custom listener
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `PERSISTENT`
+- **AND** the application context contains a custom `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration does not provide the persistent replay mapping listener
+
+#### Scenario: Persistent listener is not created for in-memory storage
+- **GIVEN** the built-in replay mapping listener storage strategy is configured as `IN_MEMORY`
+- **THEN** the command log autoconfiguration does not provide the persistent replay mapping listener
+
+### Requirement: Persistent replay mappings are listable from the command log menu
+The system SHALL provide a command log menu action that lists persisted replay result mappings.
+The system SHALL provide fallback layout metadata for the persisted replay result mapping entity.
+The list action SHALL return persisted mappings using the abstract applib repository.
+
+#### Scenario: User lists persisted replay mappings
+- **WHEN** a user invokes the command log menu action for replay result mappings
+- **THEN** the system returns the persisted replay result mappings
+- **AND** each mapping displays its recorded and actual bookmark components
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/tasks.md b/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
new file mode 100644
index 00000000000..e6b3852fb73
--- /dev/null
+++ b/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
@@ -0,0 +1,45 @@
+## 1. Configuration and Conditional Beans
+
+- [ ] 1.1 Add a built-in replay mapping listener storage strategy enum with `IN_MEMORY` and `PERSISTENT` values.
+- [ ] 1.2 Add the storage strategy property to `CausewayConfiguration` with `IN_MEMORY` as the default.
+- [ ] 1.3 Update the existing in-memory listener bean factory so it is created only for `IN_MEMORY`, only when no custom listener exists, and still receives the conflict policy.
+- [ ] 1.4 Add tests for in-memory listener autoconfiguration, persistent-storage back-off, and custom listener back-off.
+
+## 2. Applib Persistent Mapping Model
+
+- [ ] 2.1 Add an abstract applib replay result mapping entity with recorded and actual bookmark logical type and identifier properties.
+- [ ] 2.2 Add bookmark conversion helpers on the applib entity for recorded and actual bookmarks.
+- [ ] 2.3 Add an abstract applib replay result mapping repository contract for lookup by recorded bookmark, listing all mappings, and creating mappings.
+- [ ] 2.4 Add a fallback layout XML for the replay result mapping entity.
+- [ ] 2.5 Add a command log menu action that lists persisted replay result mappings through the applib repository.
+
+## 3. Persistent Listener Implementation
+
+- [ ] 3.1 Add a persistent `CommandReplayMappingListener` implementation that depends on the applib repository and conflict policy.
+- [ ] 3.2 Implement remapping from persisted recorded bookmark mappings without resolving domain objects.
+- [ ] 3.3 Implement result mapping persistence for first non-identity mappings.
+- [ ] 3.4 Implement idempotent repeated mapping handling.
+- [ ] 3.5 Implement conflict handling that throws or logs-and-continues according to the existing conflict policy.
+- [ ] 3.6 Add conditional bean creation for the persistent listener when storage strategy is `PERSISTENT`, no custom listener exists, and a repository is available.
+- [ ] 3.7 Add tests for persistent listener remapping, recording, idempotency, strict conflicts, lenient conflicts, and conditional bean creation.
+
+## 4. JDO Persistence Implementation
+
+- [ ] 4.1 Add a concrete JDO replay result mapping entity following the command log persistence JDO conventions.
+- [ ] 4.2 Add a concrete JDO replay result mapping repository implementing the applib repository contract.
+- [ ] 4.3 Register the JDO entity and repository with the command log JDO persistence module.
+- [ ] 4.4 Add JDO tests for create, find by recorded bookmark, list all, idempotent repeated mapping, and conflict preservation.
+
+## 5. JPA Persistence Implementation
+
+- [ ] 5.1 Add a concrete JPA replay result mapping entity following the command log persistence JPA conventions.
+- [ ] 5.2 Add a concrete JPA replay result mapping repository implementing the applib repository contract.
+- [ ] 5.3 Register the JPA entity and repository with the command log JPA persistence module.
+- [ ] 5.4 Add JPA tests for create, find by recorded bookmark, list all, idempotent repeated mapping, and conflict preservation.
+
+## 6. Validation
+
+- [ ] 6.1 Run targeted command log applib tests covering both built-in listener implementations and menu action behavior.
+- [ ] 6.2 Run targeted command log JDO persistence tests for the new replay result mapping entity and repository.
+- [ ] 6.3 Run targeted command log JPA persistence tests for the new replay result mapping entity and repository.
+- [ ] 6.4 Run `openspec validate persistent-command-replay-mapping-listener --type change --strict`.


(causeway) 09/42: CAUSEWAY-4010: proposes extending yaml to include returned object

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit a78d27cbe303c3e5eca42ea4733e56f7a27bcb5c
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 07:31:33 2026 +0100

    CAUSEWAY-4010: proposes extending yaml to include returned object
---
 .../.openspec.yaml                                 |  2 +
 .../design.md                                      | 50 ++++++++++++++++++++++
 .../proposal.md                                    | 24 +++++++++++
 .../specs/command-export-yaml-result/spec.md       | 25 +++++++++++
 .../tasks.md                                       | 24 +++++++++++
 5 files changed, 125 insertions(+)

diff --git a/openspec/changes/include-returned-object-in-command-export/.openspec.yaml b/openspec/changes/include-returned-object-in-command-export/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/include-returned-object-in-command-export/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/include-returned-object-in-command-export/design.md b/openspec/changes/include-returned-object-in-command-export/design.md
new file mode 100644
index 00000000000..fab85038cf4
--- /dev/null
+++ b/openspec/changes/include-returned-object-in-command-export/design.md
@@ -0,0 +1,50 @@
+## Context
+
+`CommandExportManager_exportSelected` currently builds an export file by mapping selected `ReplayableCommand` instances back to their `CommandLogEntry` entities and serializing only `CommandLogEntry#getCommandDto()` through `CommandDtoUtils.toYaml(...)`.
+`CommandLogEntry` already persists the returned object as a `Bookmark` via `getResult()`, while the command DTO includes target OIDs in a `logicalTypeName` plus `id` form.
+The requested change is additive: export consumers need the returned object alongside the command information, but replay import should continue to rely on the command DTO payload.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Add returned object metadata to each exported command when the command log entry has a result bookmark.
+- Use a returned object representation that mirrors target identity fields: `logicalTypeName` and `id`.
+- Keep the exported YAML readable and deterministic for tests and users.
+- Preserve import compatibility for existing command replay workflows.
+
+**Non-Goals:**
+
+- Do not change how command execution captures or persists `CommandLogEntry#getResult()`.
+- Do not change replay semantics to use the returned object during command execution.
+- Do not introduce a new external YAML dependency.
+- Do not backfill returned object metadata into historical export files.
+
+## Decisions
+
+- Introduce an export-specific wrapper record rather than mutating `CommandDto`.
+  This keeps replay DTO semantics stable and avoids adding result metadata to the schema-backed command DTO model.
+  Alternative considered: storing result metadata in `CommandDto` user data, but that would blur replay input with export diagnostics and could affect import behavior.
+
+- Serialize target and returned object bookmarks using the same two fields, `logicalTypeName` and `id`.
+  This matches the user's requested shape and follows the existing command target identity naming convention.
+  Alternative considered: serializing `Bookmark#toString()`, but that is less structured and harder to assert in YAML tests.
+
+- Omit the returned object block when `CommandLogEntry#getResult()` is null.
+  This keeps void command exports concise and follows existing non-null YAML serialization conventions.
+  Alternative considered: always emit `returnedObject: null`, but that adds noise without improving replay behavior.
+
+- Keep import tolerant by extracting command DTOs from either the new wrapper form or the legacy bare command DTO list if import support needs to read freshly exported files.
+  This protects replay workflows while allowing the export file shape to evolve.
+  Alternative considered: changing export only and leaving import untouched, but that could surprise users who export and immediately import the same YAML.
+
+## Risks / Trade-offs
+
+- [Risk] Existing consumers may expect a top-level YAML list of command DTOs only.
+  Mitigation: Keep command DTO content intact and, where import is in scope, support both the new wrapper and legacy list shapes.
+
+- [Risk] The returned object bookmark may refer to an object that no longer exists on an importing system.
+  Mitigation: Treat returned object metadata as informational export data, not replay input.
+
+- [Risk] YAML field naming could diverge from existing command target naming.
+  Mitigation: Use explicit `logicalTypeName` and `id` fields and add assertions for exact YAML output.
diff --git a/openspec/changes/include-returned-object-in-command-export/proposal.md b/openspec/changes/include-returned-object-in-command-export/proposal.md
new file mode 100644
index 00000000000..3745548266f
--- /dev/null
+++ b/openspec/changes/include-returned-object-in-command-export/proposal.md
@@ -0,0 +1,24 @@
+## Why
+
+Command export YAML currently serializes each selected `CommandLogEntry` through its underlying `CommandDto`, which includes the command target but does not expose the persisted returned object from `CommandLogEntry#getResult()` in the exported data.
+Including the returned object makes exported commands easier to inspect, correlate, and replay-aware tooling can reason about action results without querying the original command log entry.
+
+## What Changes
+
+- Extend exported command YAML to include a returned object entry for each command when `CommandLogEntry#getResult()` is present.
+- Represent the returned object with the same bookmark shape used for the target: `logicalTypeName` and `id`.
+- Preserve existing export behavior for commands with no returned object by omitting the returned object entry or leaving it null, as appropriate for the existing YAML serialization conventions.
+- Keep import/replay compatibility so existing command import continues to consume the command DTO data required for replay.
+
+## Capabilities
+
+### New Capabilities
+- `command-export-yaml-result`: Exported command YAML records the returned object bookmark alongside existing command information.
+
+### Modified Capabilities
+
+## Impact
+
+- Affected code is expected in the command log replay/export package, especially `CommandExportManager_exportSelected` and supporting DTO/YAML transformation code.
+- Tests should cover YAML output for commands with and without `CommandLogEntry#getResult()`.
+- The generated YAML file structure changes additively, with no breaking change expected for existing command replay imports.
diff --git a/openspec/changes/include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md b/openspec/changes/include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md
new file mode 100644
index 00000000000..3ef77f38469
--- /dev/null
+++ b/openspec/changes/include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md
@@ -0,0 +1,25 @@
+## ADDED Requirements
+
+### Requirement: Exported command YAML includes returned object metadata
+The system SHALL include returned object metadata for each exported command whose underlying `CommandLogEntry` has a non-null returned object bookmark.
+The returned object metadata SHALL contain `logicalTypeName` and `id` fields derived from the returned object's bookmark.
+
+#### Scenario: Export command with returned object
+- **WHEN** a command selected for export has a non-null `CommandLogEntry#getResult()` bookmark
+- **THEN** the generated YAML contains returned object metadata for that command with `logicalTypeName` set to the bookmark logical type name and `id` set to the bookmark identifier
+
+#### Scenario: Export command without returned object
+- **WHEN** a command selected for export has a null `CommandLogEntry#getResult()` bookmark
+- **THEN** the generated YAML does not include returned object metadata for that command
+
+### Requirement: Exported command YAML remains replay compatible
+The system SHALL preserve the command DTO data required by command replay import when adding returned object metadata to exported YAML.
+Existing YAML exports that contain only command DTO data MUST remain importable.
+
+#### Scenario: Import legacy command DTO YAML
+- **WHEN** command replay import receives a YAML file using the legacy command DTO-only export shape
+- **THEN** the system imports the command DTOs as before
+
+#### Scenario: Import YAML with returned object metadata
+- **WHEN** command replay import receives a YAML file generated with returned object metadata
+- **THEN** the system imports the command DTOs needed for replay and does not require the returned object metadata to resolve to an object
diff --git a/openspec/changes/include-returned-object-in-command-export/tasks.md b/openspec/changes/include-returned-object-in-command-export/tasks.md
new file mode 100644
index 00000000000..8aef413fb6d
--- /dev/null
+++ b/openspec/changes/include-returned-object-in-command-export/tasks.md
@@ -0,0 +1,24 @@
+## 1. Export Data Shape
+
+- [ ] 1.1 Add an export-specific DTO or record that wraps the command DTO and optional returned object metadata.
+- [ ] 1.2 Add a bookmark metadata type with `logicalTypeName` and `id` fields derived from a `Bookmark`.
+- [ ] 1.3 Ensure returned object metadata is absent when `CommandLogEntry#getResult()` is null.
+
+## 2. YAML Export Integration
+
+- [ ] 2.1 Update `CommandExportManager_exportSelected` to serialize wrapped export entries instead of bare command DTOs.
+- [ ] 2.2 Preserve existing ordering, filename generation, YAML mime type, and replay state updates.
+- [ ] 2.3 Verify exported YAML includes returned object metadata for commands with results and omits it for void commands.
+
+## 3. Import Compatibility
+
+- [ ] 3.1 Update YAML import utilities or import action code to accept the new wrapped export shape.
+- [ ] 3.2 Keep legacy command DTO-only YAML import behavior unchanged.
+- [ ] 3.3 Ensure returned object metadata is treated as informational and is not required for replay execution.
+
+## 4. Tests
+
+- [ ] 4.1 Add unit tests for bookmark metadata mapping from returned object bookmarks.
+- [ ] 4.2 Add export tests covering commands with and without returned object bookmarks.
+- [ ] 4.3 Add import compatibility tests for legacy command DTO YAML and new wrapped YAML.
+- [ ] 4.4 Run the relevant commandlog applib test suite or targeted Maven tests.


(causeway) 11/42: CAUSEWAY-4010: archives returned object command export change

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 4afabc169af6d042fa0ab34b7398b130a1432c96
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 10:40:52 2026 +0100

    CAUSEWAY-4010: archives returned object command export change
---
 AGENTS.md                                          | 11 +++++++++
 ...ands_with_returned_object_metadata.approved.txt | 28 ++++++++++++++++++++++
 .../.openspec.yaml                                 |  0
 .../design.md                                      |  0
 .../proposal.md                                    |  0
 .../specs/command-export-yaml-result/spec.md       |  0
 .../tasks.md                                       |  0
 .../specs/command-export-yaml-result/spec.md       |  0
 8 files changed, 39 insertions(+)

diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 00000000000..3842174a4e8
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,11 @@
+# Repository agent instructions
+
+## Git commit messages
+
+When committing changes in this repository, prefix the commit message with the current git branch name.
+The branch name typically reflects the Jira ticket, for example `CAUSEWAY-4010`.
+Use the form `CAUSEWAY-4010: adds foo to bar`.
+
+Write the commit subject so it completes the phrase "this commit, if applied, ...".
+Prefer present-tense verbs such as `adds`, `updates`, `removes`, `fixes`, or `refactors`.
+Avoid past-tense verbs such as `added`, `updated`, `removed`, or `fixed`.
diff --git a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_Approval_Test.marshals_exported_commands_with_returned_object_metadata.approved.txt b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_Approval_Test.marshals_exported_commands_with_returned_object_metadata.approved.txt
new file mode 100644
index 00000000000..0e36470cb72
--- /dev/null
+++ b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_Approval_Test.marshals_exported_commands_with_returned_object_metadata.approved.txt
@@ -0,0 +1,28 @@
+command:
+  majorVersion: "2"
+  minorVersion: "0"
+  interactionId: "with-result"
+  username: "approval-user"
+  targets:
+    oid:
+    - type: "demo.Customer"
+      id: "123"
+  member: !<ACT>
+    logicalMemberIdentifier: "demo.Customer#noop"
+    interactionType: "action_invocation"
+returnedObject:
+  logicalTypeName: "demo.Invoice"
+  id: "456"
+---
+command:
+  majorVersion: "2"
+  minorVersion: "0"
+  interactionId: "void-result"
+  username: "approval-user"
+  targets:
+    oid:
+    - type: "demo.Customer"
+      id: "123"
+  member: !<ACT>
+    logicalMemberIdentifier: "demo.Customer#noop"
+    interactionType: "action_invocation"
diff --git a/openspec/changes/include-returned-object-in-command-export/.openspec.yaml b/openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/.openspec.yaml
similarity index 100%
rename from openspec/changes/include-returned-object-in-command-export/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/.openspec.yaml
diff --git a/openspec/changes/include-returned-object-in-command-export/design.md b/openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/design.md
similarity index 100%
rename from openspec/changes/include-returned-object-in-command-export/design.md
rename to openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/design.md
diff --git a/openspec/changes/include-returned-object-in-command-export/proposal.md b/openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/proposal.md
similarity index 100%
rename from openspec/changes/include-returned-object-in-command-export/proposal.md
rename to openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/proposal.md
diff --git a/openspec/changes/include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md b/openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md
similarity index 100%
copy from openspec/changes/include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md
copy to openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md
diff --git a/openspec/changes/include-returned-object-in-command-export/tasks.md b/openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/tasks.md
similarity index 100%
rename from openspec/changes/include-returned-object-in-command-export/tasks.md
rename to openspec/changes/archive/2026-06-04-include-returned-object-in-command-export/tasks.md
diff --git a/openspec/changes/include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md b/openspec/specs/command-export-yaml-result/spec.md
similarity index 100%
rename from openspec/changes/include-returned-object-in-command-export/specs/command-export-yaml-result/spec.md
rename to openspec/specs/command-export-yaml-result/spec.md


(causeway) 18/42: CAUSEWAY-4010: archives replay result mapping change

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 492ddd3ebefb805ea85e87febff059df8345f818
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 15:17:32 2026 +0100

    CAUSEWAY-4010: archives replay result mapping change
---
 AGENTS.md                                                          | 7 +++++++
 .../2026-06-04-notify-replay-result-mapping}/.openspec.yaml        | 0
 .../2026-06-04-notify-replay-result-mapping}/design.md             | 0
 .../2026-06-04-notify-replay-result-mapping}/proposal.md           | 0
 .../specs/command-replay-result-mapping/spec.md                    | 0
 .../2026-06-04-notify-replay-result-mapping}/tasks.md              | 0
 .../specs/command-replay-result-mapping/spec.md                    | 6 +++++-
 7 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/AGENTS.md b/AGENTS.md
index 3842174a4e8..69b5ef80131 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -9,3 +9,10 @@ Use the form `CAUSEWAY-4010: adds foo to bar`.
 Write the commit subject so it completes the phrase "this commit, if applied, ...".
 Prefer present-tense verbs such as `adds`, `updates`, `removes`, `fixes`, or `refactors`.
 Avoid past-tense verbs such as `added`, `updated`, `removed`, or `fixed`.
+
+## OpenSpec archive policy
+
+When running `/opsx-archive` without an explicit change name, if there is exactly one active change then select it automatically and do not ask for confirmation.
+When archiving a change with delta specs, sync the delta specs to the main specs automatically because syncing is the recommended path.
+After archiving and syncing, create a git commit for the archive and spec-sync changes.
+Use the repository git commit message rules above for that commit.
diff --git a/openspec/changes/notify-replay-result-mapping/.openspec.yaml b/openspec/changes/archive/2026-06-04-notify-replay-result-mapping/.openspec.yaml
similarity index 100%
rename from openspec/changes/notify-replay-result-mapping/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-notify-replay-result-mapping/.openspec.yaml
diff --git a/openspec/changes/notify-replay-result-mapping/design.md b/openspec/changes/archive/2026-06-04-notify-replay-result-mapping/design.md
similarity index 100%
rename from openspec/changes/notify-replay-result-mapping/design.md
rename to openspec/changes/archive/2026-06-04-notify-replay-result-mapping/design.md
diff --git a/openspec/changes/notify-replay-result-mapping/proposal.md b/openspec/changes/archive/2026-06-04-notify-replay-result-mapping/proposal.md
similarity index 100%
rename from openspec/changes/notify-replay-result-mapping/proposal.md
rename to openspec/changes/archive/2026-06-04-notify-replay-result-mapping/proposal.md
diff --git a/openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md b/openspec/changes/archive/2026-06-04-notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md
similarity index 100%
copy from openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md
copy to openspec/changes/archive/2026-06-04-notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md
diff --git a/openspec/changes/notify-replay-result-mapping/tasks.md b/openspec/changes/archive/2026-06-04-notify-replay-result-mapping/tasks.md
similarity index 100%
rename from openspec/changes/notify-replay-result-mapping/tasks.md
rename to openspec/changes/archive/2026-06-04-notify-replay-result-mapping/tasks.md
diff --git a/openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md b/openspec/specs/command-replay-result-mapping/spec.md
similarity index 93%
rename from openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md
rename to openspec/specs/command-replay-result-mapping/spec.md
index 97ff0ea95cc..f37807e1e2e 100644
--- a/openspec/changes/notify-replay-result-mapping/specs/command-replay-result-mapping/spec.md
+++ b/openspec/specs/command-replay-result-mapping/spec.md
@@ -1,4 +1,8 @@
-## ADDED Requirements
+## Purpose
+
+Define the replay result mapping SPI that lets applications observe mappings from recorded returned object bookmarks to actual replay result bookmarks.
+
+## Requirements
 
 ### Requirement: Replay result mapping SPI is notified after successful replay
 The system SHALL provide an SPI that applications can implement to receive replay result bookmark mappings.


(causeway) 29/42: CAUSEWAY-4010: adds default command replay mapping listener

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 612af06f0994cc334d79adac5824a030677af79f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 18:11:47 2026 +0100

    CAUSEWAY-4010: adds default command replay mapping listener
---
 .../applib/CausewayModuleExtCommandLogApplib.java  |   2 +
 .../spi/CommandReplayMappingListenerDefault.java   |  69 ++++++++++++
 .../CommandReplayMappingListenerDefaultTest.java   | 116 +++++++++++++++++++++
 .../design.md                                      |   6 +-
 .../proposal.md                                    |   2 +-
 .../spec.md                                        |  11 +-
 .../tasks.md                                       |  26 ++---
 7 files changed, 213 insertions(+), 19 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
index e4f03388583..cfcb63e8040 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
@@ -63,6 +63,7 @@
 import org.apache.causeway.extensions.commandlog.applib.job.BackgroundCommandsJobControl;
 import org.apache.causeway.extensions.commandlog.applib.job.RunBackgroundCommandsJob;
 import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListener;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListenerDefault;
 import org.apache.causeway.extensions.commandlog.applib.spi.RunBackgroundCommandsJobListener;
 import org.apache.causeway.extensions.commandlog.applib.subscriber.CommandSubscriberForCommandLog;
 import org.springframework.context.annotation.Bean;
@@ -112,6 +113,7 @@
         // @Component's
         RunBackgroundCommandsJob.class,
         RunBackgroundCommandsJobListener.Noop.class,
+        CommandReplayMappingListenerDefault.BeanFactory.class,
 
         // @Service's
         CommandSubscriberForCommandLog.class,
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
new file mode 100644
index 00000000000..2512909ba88
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.spi;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+
+/**
+ * Default in-memory implementation of {@link CommandReplayMappingListener}.
+ *
+ * @since 2.1 {@index}
+ */
+public class CommandReplayMappingListenerDefault implements CommandReplayMappingListener {
+
+    private final Map<Bookmark, Bookmark> actualBookmarkByRecordedBookmark = new HashMap<>();
+
+    @Override
+    public Optional<Bookmark> remap(
+            final CommandLogEntry commandLogEntry,
+            final Bookmark recordedBookmark) {
+        return Optional.ofNullable(actualBookmarkByRecordedBookmark.get(recordedBookmark));
+    }
+
+    @Override
+    public void onReplayResultMapped(
+            final Bookmark recordedResult,
+            final Bookmark actualResult,
+            final CommandLogEntry commandLogEntry) {
+        if(!recordedResult.equals(actualResult)) {
+            actualBookmarkByRecordedBookmark.put(recordedResult, actualResult);
+        }
+    }
+
+    @Configuration(proxyBeanMethods = false)
+    public static class BeanFactory {
+
+        @Bean
+        @ConditionalOnMissingBean(CommandReplayMappingListener.class)
+        CommandReplayMappingListener commandReplayMappingListenerDefault() {
+            return new CommandReplayMappingListenerDefault();
+        }
+
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
new file mode 100644
index 00000000000..862e0a47935
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
@@ -0,0 +1,116 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.spi;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+
+class CommandReplayMappingListenerDefaultTest {
+
+    @Test
+    void records_result_mapping_and_returns_it_from_remap() {
+        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+
+        listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+
+        assertThat(listener.remap(commandLogEntry, recordedResult)).contains(actualResult);
+    }
+
+    @Test
+    void equal_recorded_and_actual_bookmark_is_not_recorded() {
+        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+
+        listener.onReplayResultMapped(recordedResult, recordedResult, commandLogEntry);
+
+        assertThat(listener.remap(commandLogEntry, recordedResult)).isEmpty();
+    }
+
+    @Test
+    void repeated_recorded_bookmark_mapping_uses_latest_actual_bookmark() {
+        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        Bookmark secondActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "3");
+
+        listener.onReplayResultMapped(recordedResult, firstActualResult, commandLogEntry);
+        listener.onReplayResultMapped(recordedResult, secondActualResult, commandLogEntry);
+
+        assertThat(listener.remap(commandLogEntry, recordedResult)).contains(secondActualResult);
+    }
+
+    @Test
+    void unmapped_bookmark_returns_no_replacement() {
+        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        Bookmark recordedBookmark = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+
+        assertThat(listener.remap(commandLogEntry, recordedBookmark)).isEmpty();
+    }
+
+    @Test
+    void autoconfiguration_creates_default_listener_when_missing() {
+        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+
+            assertThat(context.getBean(CommandReplayMappingListener.class))
+                    .isInstanceOf(CommandReplayMappingListenerDefault.class);
+        }
+    }
+
+    @Test
+    void autoconfiguration_backs_off_when_custom_listener_exists() {
+        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+                CustomListenerConfiguration.class,
+                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+
+            assertThat(context.getBeansOfType(CommandReplayMappingListener.class))
+                    .hasSize(1)
+                    .containsKey("customCommandReplayMappingListener");
+            assertThat(context.getBean(CommandReplayMappingListener.class))
+                    .isSameAs(CustomListenerConfiguration.CUSTOM_LISTENER);
+        }
+    }
+
+    @Configuration(proxyBeanMethods = false)
+    static class CustomListenerConfiguration {
+
+        static final CommandReplayMappingListener CUSTOM_LISTENER = new CommandReplayMappingListener() {};
+
+        @Bean
+        CommandReplayMappingListener customCommandReplayMappingListener() {
+            return CUSTOM_LISTENER;
+        }
+
+    }
+
+}
diff --git a/openspec/changes/default-command-replay-mapping-listener/design.md b/openspec/changes/default-command-replay-mapping-listener/design.md
index 62be40e473c..dd100090866 100644
--- a/openspec/changes/default-command-replay-mapping-listener/design.md
+++ b/openspec/changes/default-command-replay-mapping-listener/design.md
@@ -27,8 +27,10 @@ Today the SPI provides the hooks, but applications must supply their own listene
   An alternative was to add a separate mapping store service, but that would add indirection without current persistence or distribution requirements.
 
 - Use a simple in-memory `HashMap<Bookmark, Bookmark>` keyed by the recorded bookmark and valued by the actual replay bookmark.
-  `onReplayResultMapped(...)` will update the map, and `remap(...)` will return the mapped actual bookmark when present.
-  An alternative was to use a concurrent map, but command replay is expected to use this listener in a straightforward replay flow and the requested implementation explicitly calls for a simple hashmap.
+  `onReplayResultMapped(...)` will update the map only when the actual bookmark differs from the recorded bookmark, and `remap(...)` will return the mapped actual bookmark when present.
+  Equal recorded and actual bookmarks do not need saved mappings because replay can keep using the recorded bookmark unchanged.
+  An alternative was to store identity mappings too, but that would grow the map without changing later remapping behavior.
+  Another alternative was to use a concurrent map, but command replay is expected to use this listener in a straightforward replay flow and the requested implementation explicitly calls for a simple hashmap.
 
 - Register the default listener with Spring Boot autoconfiguration guarded by `@ConditionalOnMissingBean(CommandReplayMappingListener.class)`.
   This lets applications override the default by declaring their own listener bean while giving simpler applications out-of-the-box remapping behavior.
diff --git a/openspec/changes/default-command-replay-mapping-listener/proposal.md b/openspec/changes/default-command-replay-mapping-listener/proposal.md
index 85575dc94b9..27b6faae79a 100644
--- a/openspec/changes/default-command-replay-mapping-listener/proposal.md
+++ b/openspec/changes/default-command-replay-mapping-listener/proposal.md
@@ -6,7 +6,7 @@ Without a default implementation, each application must repeat the same simple i
 ## What Changes
 
 - Add a default command replay mapping listener implementation backed by a simple in-memory `HashMap` from recorded bookmarks to actual replay result bookmarks.
-- Record mappings when replay reports `onReplayResultMapped(...)` and consult the recorded-to-actual map from `remap(...)` before command execution.
+- Record mappings when replay reports `onReplayResultMapped(...)` and the actual bookmark differs from the recorded bookmark, then consult the recorded-to-actual map from `remap(...)` before command execution.
 - Register the default listener through Spring Boot autoconfiguration only when no other `CommandReplayMappingListener` bean is present.
 - Leave existing custom listener implementations in control by ensuring the default bean is conditional on missing bean.
 
diff --git a/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
index 1110bea6bb6..aa0fa5df820 100644
--- a/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
+++ b/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
@@ -2,13 +2,18 @@
 
 ### Requirement: Default replay mapping listener records result mappings
 The system SHALL provide a default command replay mapping listener that records each replay result mapping by recorded result bookmark.
-When replay notifies the listener with a recorded result bookmark and an actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark.
-When the same recorded bookmark is notified more than once, the listener SHALL use the most recent actual bookmark for later remapping.
+When replay notifies the listener with a recorded result bookmark and a different actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark.
+When replay notifies the listener with equal recorded and actual result bookmarks, the listener MUST NOT remember a mapping for that notification.
+When the same recorded bookmark is notified more than once with different actual result bookmarks, the listener SHALL use the most recent actual bookmark for later remapping.
 
-#### Scenario: Result mapping is recorded
+#### Scenario: Different result mapping is recorded
 - **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
 - **THEN** the default listener records `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
 
+#### Scenario: Equal result mapping is not recorded
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:1`
+- **THEN** the default listener records no mapping for `demoInvoice:1`
+
 #### Scenario: Result mapping is replaced
 - **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
 - **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
diff --git a/openspec/changes/default-command-replay-mapping-listener/tasks.md b/openspec/changes/default-command-replay-mapping-listener/tasks.md
index 423344459d8..a481c0d8efd 100644
--- a/openspec/changes/default-command-replay-mapping-listener/tasks.md
+++ b/openspec/changes/default-command-replay-mapping-listener/tasks.md
@@ -1,24 +1,24 @@
 ## 1. Default Listener Implementation
 
-- [ ] 1.1 Add a default `CommandReplayMappingListener` implementation in the command log applib that stores recorded-to-actual mappings in a `HashMap<Bookmark, Bookmark>`.
-- [ ] 1.2 Implement `onReplayResultMapped(...)` to store or replace the actual bookmark for the recorded result bookmark.
-- [ ] 1.3 Implement `remap(...)` to return the remembered actual bookmark for a recorded bookmark, or `Optional.empty()` when none exists.
-- [ ] 1.4 Keep the implementation bookmark-based and avoid resolving recorded or actual bookmarks to domain objects.
+- [x] 1.1 Add a default `CommandReplayMappingListener` implementation in the command log applib that stores recorded-to-actual mappings in a `HashMap<Bookmark, Bookmark>`.
+- [x] 1.2 Implement `onReplayResultMapped(...)` to store or replace the actual bookmark for the recorded result bookmark.
+- [x] 1.3 Implement `remap(...)` to return the remembered actual bookmark for a recorded bookmark, or `Optional.empty()` when none exists.
+- [x] 1.4 Keep the implementation bookmark-based and avoid resolving recorded or actual bookmarks to domain objects.
 
 ## 2. Autoconfiguration
 
-- [ ] 2.1 Register the default listener as a Spring bean from the command log applib module configuration.
-- [ ] 2.2 Guard the bean with `@ConditionalOnMissingBean(CommandReplayMappingListener.class)` so custom listener beans replace the default.
-- [ ] 2.3 Ensure the autoconfigured listener is available to the existing replay listener collection used by `ReplayContext`.
+- [x] 2.1 Register the default listener as a Spring bean from the command log applib module configuration.
+- [x] 2.2 Guard the bean with `@ConditionalOnMissingBean(CommandReplayMappingListener.class)` so custom listener beans replace the default.
+- [x] 2.3 Ensure the autoconfigured listener is available to the existing replay listener collection used by `ReplayContext`.
 
 ## 3. Tests
 
-- [ ] 3.1 Add unit tests proving the default listener records result mappings and returns them from `remap(...)`.
-- [ ] 3.2 Add a unit test proving a repeated recorded bookmark mapping uses the latest actual bookmark.
-- [ ] 3.3 Add a unit test proving an unmapped bookmark returns no replacement.
-- [ ] 3.4 Add Spring context tests proving the default listener bean is created when missing and backs off when a custom listener bean exists.
+- [x] 3.1 Add unit tests proving the default listener records result mappings and returns them from `remap(...)`.
+- [x] 3.2 Add a unit test proving a repeated recorded bookmark mapping uses the latest actual bookmark.
+- [x] 3.3 Add a unit test proving an unmapped bookmark returns no replacement.
+- [x] 3.4 Add Spring context tests proving the default listener bean is created when missing and backs off when a custom listener bean exists.
 
 ## 4. Verification
 
-- [ ] 4.1 Run the command log applib test suite for the new listener and autoconfiguration coverage.
-- [ ] 4.2 Run `openspec validate --change default-command-replay-mapping-listener --strict`.
+- [x] 4.1 Run the command log applib test suite for the new listener and autoconfiguration coverage.
+- [x] 4.2 Run `openspec validate --change default-command-replay-mapping-listener --strict`.


(causeway) 32/42: CAUSEWAY-4010: proposes replay conflict failure handling

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 8d2e611d5a63ef0767f5634d09d0471949f1afde
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 18:28:51 2026 +0100

    CAUSEWAY-4010: proposes replay conflict failure handling
---
 .../.openspec.yaml                                 |  2 +
 .../design.md                                      | 66 ++++++++++++++++++++++
 .../proposal.md                                    | 34 +++++++++++
 .../specs/command-replay-result-mapping/spec.md    | 25 ++++++++
 .../spec.md                                        | 28 +++++++++
 .../tasks.md                                       | 25 ++++++++
 6 files changed, 180 insertions(+)

diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/.openspec.yaml b/openspec/changes/fail-replay-on-conflicting-result-mapping/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/fail-replay-on-conflicting-result-mapping/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/design.md b/openspec/changes/fail-replay-on-conflicting-result-mapping/design.md
new file mode 100644
index 00000000000..5b7ac9b61bb
--- /dev/null
+++ b/openspec/changes/fail-replay-on-conflicting-result-mapping/design.md
@@ -0,0 +1,66 @@
+## Context
+
+Command replay imports recorded command DTOs and re-executes them locally.
+The replay mapping SPI lets applications remap replay inputs and observe mappings from recorded result bookmarks to actual replay result bookmarks.
+
+The current replay flow executes the command in one `REQUIRES_NEW` transaction and then handles replay success or failure in a second `REQUIRES_NEW` transaction.
+Result-mapping listener notification happens in the second transaction, and listener exceptions are caught and logged.
+That means a listener consistency failure cannot fail or roll back the replayed command.
+
+The default listener stores mappings in an in-memory `HashMap<Bookmark, Bookmark>` keyed by recorded result bookmark.
+It currently replaces an existing mapping with the latest actual bookmark.
+For replay consistency, a recorded original result that was already mapped to one actual bookmark must not later be mapped to a different actual bookmark.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Detect conflicting result mappings in the default listener.
+- Make repeated identical result mappings idempotent.
+- Keep ignoring identity mappings where recorded and actual bookmarks are equal.
+- Run replay execution, success bookkeeping, and result-mapping listener notification in one transaction.
+- Propagate result-mapping listener exceptions so consistency failures mark replay as failed and prevent successful command execution.
+
+**Non-Goals:**
+
+- Do not persist default listener mappings beyond the existing in-memory listener instance.
+- Do not change the `CommandReplayMappingListener` method signatures.
+- Do not change target or reference parameter remapping exception handling before command execution.
+- Do not introduce distributed coordination for mapping state across JVMs or nodes.
+
+## Decisions
+
+### Use the default listener as the consistency guard
+
+The default listener already owns the in-memory recorded-to-actual result map.
+It will inspect the existing mapping before writing a new non-identity mapping.
+If the recorded result has no existing mapping, it records the actual result.
+If the existing mapping equals the new actual result, it leaves the map unchanged and returns normally.
+If the existing mapping differs from the new actual result, it throws an exception with the conflicting bookmarks.
+
+An alternative was to let the latest mapping continue to win and add a separate audit warning.
+That would not protect downstream remapping from ambiguous original results, so it is rejected.
+
+### Notify result-mapping listeners inside the replay command transaction
+
+`ReplayableCommand` will move successful replay bookkeeping and result-mapping listener notification into the transaction that calls `CommandExecutorService#executeCommand(...)`.
+The command execution result bookmark is available before that transaction returns, so the replay can save success analysis and notify listeners before commit.
+If a listener throws, the transaction fails and the command replay result is reported as a failure.
+
+An alternative was to keep the second transaction and rethrow listener exceptions there.
+That would fail the post-processing transaction but still leave the replayed command execution committed, which does not satisfy the consistency requirement.
+
+### Keep replay failure bookkeeping in a separate transaction
+
+When command execution or listener notification fails, the existing failure bookkeeping still needs to save replay analysis on the imported command log entry.
+That failure analysis should run after the failed command transaction has rolled back, using a separate transaction as today.
+Success bookkeeping does not need a second transaction because it now belongs to the successful command transaction.
+
+## Risks / Trade-offs
+
+- Custom listeners that previously threw without affecting replay will now cause replay failure.
+  → This is intentional for result-mapping notifications; document it in tests and specs.
+- Failure analysis still depends on a follow-up transaction after rollback.
+  → Preserve the existing failure handling pattern for replay errors.
+- The default listener remains in-memory and is not synchronized across application nodes.
+  → This change only strengthens consistency for one listener instance, matching the current non-persistence scope.
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/proposal.md b/openspec/changes/fail-replay-on-conflicting-result-mapping/proposal.md
new file mode 100644
index 00000000000..1dbfd4d55cc
--- /dev/null
+++ b/openspec/changes/fail-replay-on-conflicting-result-mapping/proposal.md
@@ -0,0 +1,34 @@
+## Why
+
+The default command replay mapping listener currently allows a recorded result bookmark to be overwritten with a later, different actual bookmark.
+That can hide replay divergence and allow downstream commands to remap against an ambiguous original result.
+
+Replay also currently handles replay execution and listener notification in separate transactions.
+A listener failure during result mapping therefore cannot make the command replay itself fail, which prevents consistency checks from protecting the replay outcome.
+
+## What Changes
+
+- Update the default command replay mapping listener to reject conflicting result mappings for the same recorded result bookmark.
+- Treat a repeated notification for the same recorded result and the same actual result as idempotent.
+- Keep ignoring identity mappings where recorded and actual bookmarks are equal.
+- Change replay transaction handling so replay execution, success bookkeeping, and result-mapping listener notification run in the same command transaction.
+- Let result-mapping listener exceptions propagate so a failed consistency check causes command replay execution to fail.
+- Continue not notifying result-mapping listeners when replay fails or when recorded or actual result bookmarks are unavailable.
+
+## Capabilities
+
+### New Capabilities
+
+None.
+
+### Modified Capabilities
+
+- `command-replay-result-mapping`: Result-mapping listener failures must fail the replayed command, and listener notification must occur in the same transaction as command execution.
+- `default-command-replay-mapping-listener`: The default listener must reject conflicting actual bookmarks for a recorded result bookmark.
+
+## Impact
+
+- Affects command replay transaction flow in the command log applib replay implementation.
+- Affects `CommandReplayMappingListenerDefault` behavior for repeated mappings.
+- Affects tests for replay listener exception handling and default listener consistency.
+- Existing applications with custom listeners that throw from result mapping will now cause replay command execution to fail instead of only logging a warning.
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/command-replay-result-mapping/spec.md b/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/command-replay-result-mapping/spec.md
new file mode 100644
index 00000000000..141578bf8ef
--- /dev/null
+++ b/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/command-replay-result-mapping/spec.md
@@ -0,0 +1,25 @@
+## MODIFIED Requirements
+
+### Requirement: Replay result mapping SPI is notified after successful replay
+The system SHALL provide a command replay mapping SPI that applications can implement to receive replay result bookmark mappings and provide replay input remappings.
+After a command replay succeeds, the system SHALL notify the SPI when the imported command log entry has a recorded returned object bookmark and replay execution returns an actual result bookmark.
+The notification SHALL include the recorded returned object bookmark and the actual replay result bookmark.
+The system SHALL notify the SPI in the same transaction as replay command execution.
+The system SHALL propagate result-mapping notification exceptions so the replayed command execution fails and rolls back.
+
+#### Scenario: Successful replay produces a different result bookmark
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:2`
+- **THEN** the system notifies the command replay mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:2`
+
+#### Scenario: Successful replay produces the same result bookmark
+- **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:1`
+- **THEN** the system notifies the command replay mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
+
+#### Scenario: Result mapping listener rejects the replay result
+- **WHEN** command replay execution succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:2`
+- **AND** a command replay mapping SPI throws while handling the result mapping notification
+- **THEN** the replayed command execution fails
+- **AND** the replayed command transaction rolls back
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/default-command-replay-mapping-listener/spec.md
new file mode 100644
index 00000000000..866abd303cd
--- /dev/null
+++ b/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/default-command-replay-mapping-listener/spec.md
@@ -0,0 +1,28 @@
+## MODIFIED Requirements
+
+### Requirement: Default replay mapping listener records result mappings
+The system SHALL provide a default command replay mapping listener that records each replay result mapping by recorded result bookmark.
+When replay notifies the listener with a recorded result bookmark and a different actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark if no mapping already exists.
+When replay notifies the listener with equal recorded and actual result bookmarks, the listener MUST NOT remember a mapping for that notification.
+When the same recorded bookmark is notified more than once with the same actual result bookmark, the listener SHALL treat the notification as idempotent.
+When the same recorded bookmark is notified more than once with different actual result bookmarks, the listener SHALL throw an exception and MUST NOT replace the remembered actual bookmark.
+
+#### Scenario: Different result mapping is recorded
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the default listener records `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+
+#### Scenario: Equal result mapping is not recorded
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:1`
+- **THEN** the default listener records no mapping for `demoInvoice:1`
+
+#### Scenario: Result mapping is repeated with the same actual bookmark
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+- **AND** no exception is thrown
+
+#### Scenario: Result mapping conflict is rejected
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
+- **THEN** the default listener throws an exception
+- **AND** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md b/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md
new file mode 100644
index 00000000000..dfc813d768a
--- /dev/null
+++ b/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md
@@ -0,0 +1,25 @@
+## 1. Default Listener Consistency
+
+- [ ] 1.1 Update `CommandReplayMappingListenerDefault#onReplayResultMapped(...)` to check for an existing non-identity mapping before writing.
+- [ ] 1.2 Throw an exception when a recorded result bookmark is already mapped to a different actual bookmark.
+- [ ] 1.3 Preserve idempotent behavior when a repeated notification uses the same actual bookmark.
+- [ ] 1.4 Preserve no-op behavior when recorded and actual bookmarks are equal.
+
+## 2. Replay Transaction Handling
+
+- [ ] 2.1 Refactor `ReplayableCommand#tryReplay(...)` so command execution and successful result-mapping notification happen inside the same `REQUIRES_NEW` transaction.
+- [ ] 2.2 Preserve separate failure-analysis persistence after the failed command transaction rolls back.
+- [ ] 2.3 Remove exception swallowing for result-mapping notification failures so listener exceptions propagate from the command transaction.
+- [ ] 2.4 Keep target and reference parameter remapping exception handling unchanged.
+
+## 3. Tests
+
+- [ ] 3.1 Update default listener tests to cover conflict rejection, idempotent duplicate notification, and unchanged mapping after conflict.
+- [ ] 3.2 Update replay mapping tests to verify result-mapping listener exceptions fail replay execution.
+- [ ] 3.3 Add or update transaction-service test stubbing to verify successful listener notification happens in the same transaction as command execution.
+- [ ] 3.4 Verify missing recorded or actual result bookmarks still skip result-mapping notification.
+
+## 4. Verification
+
+- [ ] 4.1 Run the command log applib tests that cover `CommandReplayMappingListenerDefaultTest` and `ReplayableCommandMappingTest`.
+- [ ] 4.2 Run `openspec validate fail-replay-on-conflicting-result-mapping --type change --strict`.


(causeway) 24/42: CAUSEWAY-4010: simplifies command replay remapping SPI

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit d6b26043b834a42f83617c2c4f02ac3234d17122
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 17:10:03 2026 +0100

    CAUSEWAY-4010: simplifies command replay remapping SPI
---
 .../applib/dom/replay/ReplayableCommand.java       | 19 ++++---------
 .../applib/spi/CommandReplayMappingListener.java   | 31 +++++-----------------
 .../dom/replay/ReplayableCommandMappingTest.java   | 21 ++++++++-------
 .../simplify-listener-spi-remap-method/tasks.md    | 22 +++++++--------
 4 files changed, 35 insertions(+), 58 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
index 5bd2dc772d6..4a20386bef9 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
@@ -428,7 +428,7 @@ private void remapTarget(
             final OidDto target,
             final Bookmark recordedTarget) {
         try {
-            Optional.ofNullable(listener.remapTarget(commandLogEntry, recordedTarget))
+            Optional.ofNullable(listener.remap(commandLogEntry, recordedTarget))
                 .orElseGet(Optional::empty)
                 .ifPresent(replacement -> copyBookmarkToOidDto(replacement, target));
         } catch (Exception ex) {
@@ -445,37 +445,28 @@ private void remapReferenceParameters(
         Optional.ofNullable(((ActionDto) commandDto.getMember()).getParameters())
             .stream()
             .flatMap(parameters -> parameters.getParameter().stream())
-            .forEach(new java.util.function.Consumer<ParamDto>() {
-                private int parameterIndex = 0;
-                @Override
-                public void accept(final ParamDto parameter) {
-                    remapReferenceParameter(commandLogEntry, parameter, parameterIndex++);
-                }
-            });
+            .forEach(parameter -> remapReferenceParameter(commandLogEntry, parameter));
     }
 
     private void remapReferenceParameter(
             final CommandLogEntry commandLogEntry,
-            final ParamDto parameter,
-            final int parameterIndex) {
+            final ParamDto parameter) {
         if (parameter.getType() != ValueType.REFERENCE || parameter.getReference() == null) {
             return;
         }
         final Bookmark recordedReference = Bookmark.forOidDto(parameter.getReference());
         _NullSafe.stream(replayContext.commandReplayMappingListeners())
             .forEach(listener -> remapReferenceParameter(
-                    listener, commandLogEntry, parameter, parameterIndex, recordedReference));
+                    listener, commandLogEntry, parameter, recordedReference));
     }
 
     private void remapReferenceParameter(
             final CommandReplayMappingListener listener,
             final CommandLogEntry commandLogEntry,
             final ParamDto parameter,
-            final int parameterIndex,
             final Bookmark recordedReference) {
         try {
-            Optional.ofNullable(listener.remapReferenceParameter(
-                    commandLogEntry, parameter.getName(), parameterIndex, recordedReference))
+            Optional.ofNullable(listener.remap(commandLogEntry, recordedReference))
                 .orElseGet(Optional::empty)
                 .ifPresent(replacement -> copyBookmarkToOidDto(replacement, parameter.getReference()));
         } catch (Exception ex) {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListener.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListener.java
index 8305cfa5573..813cbf37324 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListener.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListener.java
@@ -31,32 +31,15 @@
 public interface CommandReplayMappingListener {
 
     /**
-     * Optionally remaps a command target bookmark before replay execution.
+     * Optionally remaps a recorded command target or reference-valued action parameter bookmark before replay execution.
      *
      * @param commandLogEntry the command log entry being replayed
-     * @param recordedTarget the target bookmark recorded in the imported command DTO
-     * @return replacement target bookmark, or empty to keep the recorded target
+     * @param recordedBookmark the target or reference parameter bookmark recorded in the imported command DTO
+     * @return replacement bookmark, or empty to keep the recorded bookmark
      */
-    default Optional<Bookmark> remapTarget(
+    default Optional<Bookmark> remap(
             final CommandLogEntry commandLogEntry,
-            final Bookmark recordedTarget) {
-        return Optional.empty();
-    }
-
-    /**
-     * Optionally remaps a reference-valued action parameter before replay execution.
-     *
-     * @param commandLogEntry the command log entry being replayed
-     * @param parameterName the parameter name from the command DTO
-     * @param parameterIndex the zero-based parameter index from the command DTO
-     * @param recordedReference the reference bookmark recorded for the parameter
-     * @return replacement reference bookmark, or empty to keep the recorded reference
-     */
-    default Optional<Bookmark> remapReferenceParameter(
-            final CommandLogEntry commandLogEntry,
-            final String parameterName,
-            final int parameterIndex,
-            final Bookmark recordedReference) {
+            final Bookmark recordedBookmark) {
         return Optional.empty();
     }
 
@@ -67,9 +50,9 @@ default Optional<Bookmark> remapReferenceParameter(
      * @param actualResult the result bookmark produced by replay execution
      * @param commandLogEntry the replayed command log entry
      */
-    void onReplayResultMapped(
+    default void onReplayResultMapped(
             Bookmark recordedResult,
             Bookmark actualResult,
-            CommandLogEntry commandLogEntry);
+            CommandLogEntry commandLogEntry) {}
 
 }
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
index 4608640af59..4ade6116409 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
@@ -62,7 +62,7 @@ void target_remapping_changes_replay_command_dto() {
         CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter("simple.SimpleObject", "1", "simple.SimpleObject", "3");
         CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
         CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
-        when(listener.remapTarget(
+        when(listener.remap(
                 commandLogEntry,
                 Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "1")))
                 .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "2")));
@@ -91,10 +91,8 @@ void reference_parameter_remapping_changes_replay_command_dto() {
         CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter("simple.SimpleObject", "1", "simple.SimpleObject", "3");
         CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
         CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
-        when(listener.remapReferenceParameter(
+        when(listener.remap(
                 commandLogEntry,
-                "simpleObject",
-                0,
                 Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "3")))
                 .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "4")));
 
@@ -135,7 +133,8 @@ void non_reference_parameter_is_not_remapped_by_reference_flow() {
         ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
 
         assertThat(replayParameter.getString()).isEqualTo("unchanged");
-        verify(listener, never()).remapReferenceParameter(any(), any(), any(Integer.class), any());
+        verify(listener, never()).remap(
+                any(), eq(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "3")));
     }
 
     @Test
@@ -163,14 +162,12 @@ void replay_execution_receives_remapped_command_dto() throws Exception {
                 .thenReturn(Try.success(null));
 
         CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
-        when(listener.remapTarget(
+        when(listener.remap(
                 commandLogEntry,
                 Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "1")))
                 .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "2")));
-        when(listener.remapReferenceParameter(
+        when(listener.remap(
                 commandLogEntry,
-                "simpleObject",
-                0,
                 Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "3")))
                 .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "4")));
         ReplayContext replayContext = new ReplayContext(
@@ -189,6 +186,12 @@ void replay_execution_receives_remapped_command_dto() throws Exception {
         assertThat(replayParameter.getReference().getId()).isEqualTo("4");
         assertThat(recordedCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("1");
         assertThat(recordedParameter.getReference().getId()).isEqualTo("3");
+        verify(listener).remap(
+                commandLogEntry,
+                Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "1"));
+        verify(listener).remap(
+                commandLogEntry,
+                Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "3"));
     }
 
     @Test
diff --git a/openspec/changes/simplify-listener-spi-remap-method/tasks.md b/openspec/changes/simplify-listener-spi-remap-method/tasks.md
index dd14c357318..6fedcf16e40 100644
--- a/openspec/changes/simplify-listener-spi-remap-method/tasks.md
+++ b/openspec/changes/simplify-listener-spi-remap-method/tasks.md
@@ -1,19 +1,19 @@
 ## 1. SPI Simplification
 
-- [ ] 1.1 Replace `CommandReplayMappingListener#remapTarget(...)` and `remapReferenceParameter(...)` with one default `remap(CommandLogEntry, Bookmark)` method.
-- [ ] 1.2 Update listener Javadoc to describe common bookmark remapping for targets and reference parameters.
-- [ ] 1.3 Keep `onReplayResultMapped(...)` unchanged.
+- [x] 1.1 Replace `CommandReplayMappingListener#remapTarget(...)` and `remapReferenceParameter(...)` with one default `remap(CommandLogEntry, Bookmark)` method.
+- [x] 1.2 Update listener Javadoc to describe common bookmark remapping for targets and reference parameters.
+- [x] 1.3 Keep `onReplayResultMapped(...)` unchanged.
 
 ## 2. Replay Remapping Flow
 
-- [ ] 2.1 Update target remapping in `ReplayableCommand` to call the listener's common `remap(...)` method.
-- [ ] 2.2 Update reference-parameter remapping in `ReplayableCommand` to call the same `remap(...)` method without passing parameter name or index.
-- [ ] 2.3 Preserve no-op behavior when no listener returns a replacement or a listener throws.
-- [ ] 2.4 Preserve replay-time DTO copy behavior so recorded command data remains unchanged.
+- [x] 2.1 Update target remapping in `ReplayableCommand` to call the listener's common `remap(...)` method.
+- [x] 2.2 Update reference-parameter remapping in `ReplayableCommand` to call the same `remap(...)` method without passing parameter name or index.
+- [x] 2.3 Preserve no-op behavior when no listener returns a replacement or a listener throws.
+- [x] 2.4 Preserve replay-time DTO copy behavior so recorded command data remains unchanged.
 
 ## 3. Tests and Verification
 
-- [ ] 3.1 Update `ReplayableCommandMappingTest` mocks and verifications for the single remap method.
-- [ ] 3.2 Add or update assertions showing target and reference-parameter remapping both use the same SPI method.
-- [ ] 3.3 Run the command log applib replay mapping tests.
-- [ ] 3.4 Run `openspec validate --all --strict`.
+- [x] 3.1 Update `ReplayableCommandMappingTest` mocks and verifications for the single remap method.
+- [x] 3.2 Add or update assertions showing target and reference-parameter remapping both use the same SPI method.
+- [x] 3.3 Run the command log applib replay mapping tests.
+- [x] 3.4 Run `openspec validate --all --strict`.


(causeway) 26/42: CAUSEWAY-4010: updates agent session handoff guidance

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 50c9b8ccbc5ca269bb5b735bd893af4630021b47
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 17:11:14 2026 +0100

    CAUSEWAY-4010: updates agent session handoff guidance
---
 AGENTS.md | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/AGENTS.md b/AGENTS.md
index 69b5ef80131..d1d795c78e3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -16,3 +16,7 @@ When running `/opsx-archive` without an explicit change name, if there is exactl
 When archiving a change with delta specs, sync the delta specs to the main specs automatically because syncing is the recommended path.
 After archiving and syncing, create a git commit for the archive and spec-sync changes.
 Use the repository git commit message rules above for that commit.
+
+## Session handoff
+
+If `SESSION_HANDOFF.md` exists at the repository root, read it at the start of a new session for recent context.


(causeway) 35/42: CAUSEWAY-4010: proposes replay conflict handling configuration

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit af587f88e6a2f84fcbd8ef6678ec7625fb4e5458
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 19:06:35 2026 +0100

    CAUSEWAY-4010: proposes replay conflict handling configuration
---
 .../.openspec.yaml                                 |  2 +
 .../design.md                                      | 56 ++++++++++++++++++++++
 .../proposal.md                                    | 25 ++++++++++
 .../spec.md                                        | 38 +++++++++++++++
 .../tasks.md                                       | 20 ++++++++
 5 files changed, 141 insertions(+)

diff --git a/openspec/changes/configure-replay-result-conflict-handling/.openspec.yaml b/openspec/changes/configure-replay-result-conflict-handling/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/configure-replay-result-conflict-handling/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/configure-replay-result-conflict-handling/design.md b/openspec/changes/configure-replay-result-conflict-handling/design.md
new file mode 100644
index 00000000000..164ed34bff6
--- /dev/null
+++ b/openspec/changes/configure-replay-result-conflict-handling/design.md
@@ -0,0 +1,56 @@
+## Context
+
+The command log applib provides `CommandReplayMappingListenerDefault` as the conditional default implementation of `CommandReplayMappingListener`.
+It records non-identity replay result mappings in memory and uses them to remap later replay inputs.
+The current conflict behavior is strict: when a recorded result bookmark already has a remembered actual bookmark and replay reports a different actual bookmark, the default listener throws an exception.
+Because result mapping notification runs in the same transaction as replay execution, that exception causes the replayed command to fail and roll back.
+
+Some users want this fail-fast protection, while other replay workflows prefer to keep the first mapping, log the conflict, and continue processing.
+The new option should therefore be a property-driven policy on the default listener rather than a change to the SPI contract.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Preserve strict conflict rejection as the default behavior.
+- Allow applications to configure a lenient conflict policy that logs and continues.
+- Keep the existing recorded-to-actual mapping unchanged when a conflict is ignored.
+- Keep custom `CommandReplayMappingListener` implementations unaffected.
+- Make the property available through the standard `CausewayConfiguration` binding model.
+
+**Non-Goals:**
+
+- Do not change the `CommandReplayMappingListener` SPI methods.
+- Do not make the default listener persist mappings.
+- Do not add per-command or runtime UI controls for conflict behavior.
+- Do not change replay transaction boundaries.
+
+## Decisions
+
+- Add a nested configuration property for default replay mapping listener conflict handling under the command log extension configuration.
+  A concrete shape such as `CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping` with `onConflictPolicy` keeps the option near the extension that owns the default listener.
+  The external property name should follow existing relaxed binding conventions, for example `causeway.extensions.command-log.replay-result-mapping.on-conflict-policy`.
+
+- Represent behavior with an enum rather than a boolean.
+  Suggested values are `THROW_EXCEPTION` and `LOG_AND_CONTINUE`.
+  This mirrors existing policy-style configuration such as background command `OnFailurePolicy` and leaves room for additional behaviors without renaming the property.
+
+- Inject `CausewayConfiguration` into `CommandReplayMappingListenerDefault` or its factory and pass the selected policy into the listener.
+  This keeps the policy centralized and avoids introducing a separate application bean just to configure the default listener.
+
+- In `THROW_EXCEPTION`, preserve the current behavior exactly.
+  The listener throws and keeps the existing mapping unchanged.
+
+- In `LOG_AND_CONTINUE`, log the recorded bookmark, existing actual bookmark, and conflicting actual bookmark at error level, keep the existing mapping unchanged, and return without throwing.
+  This lets replay continue while still leaving an operational signal that the replay stream is inconsistent.
+
+## Risks / Trade-offs
+
+- Lenient mode can hide replay data inconsistency if logs are not monitored.
+  Mitigation: keep strict mode as the default and log conflicts at error level in lenient mode.
+
+- The property path might be confused with the separate command replay configuration namespace.
+  Mitigation: document the property in tests and code comments around the default command log listener.
+
+- Injecting configuration into the default listener factory changes construction in tests.
+  Mitigation: update unit tests to cover explicit policy construction and Spring bean creation with default configuration.
diff --git a/openspec/changes/configure-replay-result-conflict-handling/proposal.md b/openspec/changes/configure-replay-result-conflict-handling/proposal.md
new file mode 100644
index 00000000000..c894f3be2d1
--- /dev/null
+++ b/openspec/changes/configure-replay-result-conflict-handling/proposal.md
@@ -0,0 +1,25 @@
+## Why
+
+The default replay mapping listener currently always fails replay when the same recorded bookmark later maps to a different actual bookmark.
+Some import/replay workflows need the strict behavior for safety, while others prefer to log conflicting mappings and continue processing subsequent commands.
+
+## What Changes
+
+- Add a configuration property that controls how the default command replay mapping listener handles conflicting replay result mappings.
+- Keep the current strict behavior as the default, so a conflicting mapping throws an exception and fails replay.
+- Add an alternative lenient behavior that logs the conflicting mapping and continues without replacing the existing recorded-to-actual mapping.
+- Document the accepted property values and the default value.
+
+## Capabilities
+
+### New Capabilities
+
+### Modified Capabilities
+- `default-command-replay-mapping-listener`: Make conflict handling configurable while preserving strict conflict rejection as the default behavior.
+
+## Impact
+
+- Affects the command log applib default `CommandReplayMappingListener` implementation and its autoconfiguration.
+- Adds a new command log configuration property, likely under the extensions command log replay namespace.
+- Updates unit tests for strict default behavior and lenient log-and-continue behavior.
+- No breaking changes are expected because the current exception-throwing behavior remains the default.
diff --git a/openspec/changes/configure-replay-result-conflict-handling/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/configure-replay-result-conflict-handling/specs/default-command-replay-mapping-listener/spec.md
new file mode 100644
index 00000000000..e0e75425569
--- /dev/null
+++ b/openspec/changes/configure-replay-result-conflict-handling/specs/default-command-replay-mapping-listener/spec.md
@@ -0,0 +1,38 @@
+## MODIFIED Requirements
+
+### Requirement: Default replay mapping listener records result mappings
+The system SHALL provide a default command replay mapping listener that records each replay result mapping by recorded result bookmark.
+When replay notifies the listener with a recorded result bookmark and a different actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark if no mapping already exists.
+When replay notifies the listener with equal recorded and actual result bookmarks, the listener MUST NOT remember a mapping for that notification.
+When the same recorded bookmark is notified more than once with the same actual result bookmark, the listener SHALL treat the notification as idempotent.
+When the same recorded bookmark is notified more than once with different actual result bookmarks, the listener SHALL apply its configured conflict policy and MUST NOT replace the remembered actual bookmark.
+The system SHALL default the conflict policy to throwing an exception.
+The system SHALL provide a configuration property that can change the conflict policy to log the conflict and continue.
+
+#### Scenario: Different result mapping is recorded
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the default listener records `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+
+#### Scenario: Equal result mapping is not recorded
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:1`
+- **THEN** the default listener records no mapping for `demoInvoice:1`
+
+#### Scenario: Result mapping is repeated with the same actual bookmark
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+- **AND** no exception is thrown
+
+#### Scenario: Result mapping conflict is rejected by default
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
+- **THEN** the default listener throws an exception
+- **AND** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+
+#### Scenario: Result mapping conflict is logged and ignored when configured
+- **GIVEN** the default listener conflict policy is configured to log and continue
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
+- **THEN** the default listener logs the conflict
+- **AND** no exception is thrown
+- **AND** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
diff --git a/openspec/changes/configure-replay-result-conflict-handling/tasks.md b/openspec/changes/configure-replay-result-conflict-handling/tasks.md
new file mode 100644
index 00000000000..3c8d341da14
--- /dev/null
+++ b/openspec/changes/configure-replay-result-conflict-handling/tasks.md
@@ -0,0 +1,20 @@
+## 1. Configuration Model
+
+- [ ] 1.1 Add a command log replay result mapping conflict policy enum with strict and log-and-continue values.
+- [ ] 1.2 Add a `CausewayConfiguration` property for the default listener conflict policy with strict throwing behavior as the default.
+- [ ] 1.3 Document the property name and accepted values in code comments or generated configuration metadata if applicable.
+
+## 2. Default Listener Behavior
+
+- [ ] 2.1 Update `CommandReplayMappingListenerDefault` construction to receive the configured conflict policy.
+- [ ] 2.2 Preserve the existing exception-throwing conflict behavior when the policy is strict.
+- [ ] 2.3 Implement the log-and-continue policy so conflicts are logged and the existing mapping is retained without throwing.
+- [ ] 2.4 Update the default listener bean factory to obtain the policy from `CausewayConfiguration`.
+
+## 3. Tests and Validation
+
+- [ ] 3.1 Update default listener unit tests to verify strict conflict handling remains the default.
+- [ ] 3.2 Add unit tests for the log-and-continue policy, including retained original mapping and no thrown exception.
+- [ ] 3.3 Add or update bean factory tests to verify configuration is passed into the default listener.
+- [ ] 3.4 Run the command log applib test suite covering `CommandReplayMappingListenerDefaultTest` and `ReplayableCommandMappingTest`.
+- [ ] 3.5 Run `openspec validate configure-replay-result-conflict-handling --type change --strict`.


(causeway) 36/42: CAUSEWAY-4010: adds replay conflict handling configuration

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 8149888279755ab59ccdbddb1cdc26aabb702516
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 19:13:26 2026 +0100

    CAUSEWAY-4010: adds replay conflict handling configuration
---
 .../core/config/CausewayConfiguration.java         | 33 +++++++++++
 .../spi/CommandReplayMappingListenerDefault.java   | 32 +++++++++--
 .../CommandReplayMappingListenerDefaultTest.java   | 64 +++++++++++++++++++++-
 .../tasks.md                                       | 24 ++++----
 4 files changed, 136 insertions(+), 17 deletions(-)

diff --git a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
index b6c863dd5a6..350ffe943d4 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
@@ -3979,6 +3979,39 @@ public enum PersistPolicy {
              */
             private PersistPolicy persist = PersistPolicy.ENABLED;
 
+            private final ReplayResultMapping replayResultMapping = new ReplayResultMapping();
+            @Data
+            public static class ReplayResultMapping {
+
+                /**
+                 * How the default command replay mapping listener handles a conflicting replay result mapping.
+                 *
+                 * <p>
+                 *     External property: {@code causeway.extensions.command-log.replay-result-mapping.on-conflict-policy}.
+                 *     Accepted values are {@code THROW_EXCEPTION} and {@code LOG_AND_CONTINUE}.
+                 * </p>
+                 */
+                public enum OnConflictPolicy {
+                    /**
+                     * Throw an exception when the same recorded result bookmark maps to different actual bookmarks.
+                     *
+                     * <p>
+                     *     This is the default fail-fast behavior.
+                     * </p>
+                     */
+                    THROW_EXCEPTION,
+                    /**
+                     * Log the conflicting mapping and continue without replacing the remembered mapping.
+                     */
+                    LOG_AND_CONTINUE;
+                }
+
+                /**
+                 * If replay result mapping conflicts, what should the default listener do?
+                 */
+                private OnConflictPolicy onConflictPolicy = OnConflictPolicy.THROW_EXCEPTION;
+            }
+
             private final RunBackgroundCommands runBackgroundCommands = new RunBackgroundCommands();
             @Data
             public static class RunBackgroundCommands {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
index b118d0b8e73..39a58bdce6d 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
@@ -27,16 +27,30 @@
 import org.springframework.context.annotation.Configuration;
 
 import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.core.config.CausewayConfiguration;
+import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping.OnConflictPolicy;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 
+import lombok.extern.log4j.Log4j2;
+
 /**
  * Default in-memory implementation of {@link CommandReplayMappingListener}.
  *
  * @since 2.1 {@index}
  */
+@Log4j2
 public class CommandReplayMappingListenerDefault implements CommandReplayMappingListener {
 
     private final Map<Bookmark, Bookmark> actualBookmarkByRecordedBookmark = new HashMap<>();
+    private final OnConflictPolicy onConflictPolicy;
+
+    public CommandReplayMappingListenerDefault() {
+        this(OnConflictPolicy.THROW_EXCEPTION);
+    }
+
+    CommandReplayMappingListenerDefault(final OnConflictPolicy onConflictPolicy) {
+        this.onConflictPolicy = onConflictPolicy;
+    }
 
     @Override
     public Optional<Bookmark> remap(
@@ -59,11 +73,16 @@ public void onReplayResultMapped(
             return;
         }
         if(!existingActualResult.equals(actualResult)) {
-            throw new IllegalStateException(String.format(
+            final String message = String.format(
                     "Recorded result bookmark '%s' was already mapped to actual bookmark '%s', cannot remap to '%s'",
                     recordedResult,
                     existingActualResult,
-                    actualResult));
+                    actualResult);
+            if(onConflictPolicy == OnConflictPolicy.LOG_AND_CONTINUE) {
+                log.error(message);
+                return;
+            }
+            throw new IllegalStateException(message);
         }
     }
 
@@ -72,8 +91,13 @@ public static class BeanFactory {
 
         @Bean
         @ConditionalOnMissingBean(CommandReplayMappingListener.class)
-        CommandReplayMappingListener commandReplayMappingListenerDefault() {
-            return new CommandReplayMappingListenerDefault();
+        CommandReplayMappingListener commandReplayMappingListenerDefault(
+                final CausewayConfiguration causewayConfiguration) {
+            return new CommandReplayMappingListenerDefault(causewayConfiguration
+                    .getExtensions()
+                    .getCommandLog()
+                    .getReplayResultMapping()
+                    .getOnConflictPolicy());
         }
 
     }
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
index 957d7c72693..4cd09e11d6d 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
@@ -22,12 +22,17 @@
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 
+import java.util.Optional;
+
 import org.junit.jupiter.api.Test;
 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.StandardEnvironment;
 
 import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.core.config.CausewayConfiguration;
+import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping.OnConflictPolicy;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 
 class CommandReplayMappingListenerDefaultTest {
@@ -69,7 +74,7 @@ void repeated_recorded_bookmark_mapping_with_same_actual_bookmark_is_idempotent(
     }
 
     @Test
-    void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_rejected() {
+    void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_rejected_by_default() {
         CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
@@ -86,6 +91,20 @@ void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_reject
         assertThat(listener.remap(commandLogEntry, recordedResult)).contains(firstActualResult);
     }
 
+    @Test
+    void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_logged_and_ignored_when_configured() {
+        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault(OnConflictPolicy.LOG_AND_CONTINUE);
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        Bookmark secondActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "3");
+
+        listener.onReplayResultMapped(recordedResult, firstActualResult, commandLogEntry);
+        listener.onReplayResultMapped(recordedResult, secondActualResult, commandLogEntry);
+
+        assertThat(listener.remap(commandLogEntry, recordedResult)).contains(firstActualResult);
+    }
+
     @Test
     void unmapped_bookmark_returns_no_replacement() {
         CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
@@ -98,6 +117,7 @@ void unmapped_bookmark_returns_no_replacement() {
     @Test
     void autoconfiguration_creates_default_listener_when_missing() {
         try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+                CausewayConfigurationForTest.class,
                 CommandReplayMappingListenerDefault.BeanFactory.class)) {
 
             assertThat(context.getBean(CommandReplayMappingListener.class))
@@ -108,6 +128,7 @@ void autoconfiguration_creates_default_listener_when_missing() {
     @Test
     void autoconfiguration_backs_off_when_custom_listener_exists() {
         try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+                CausewayConfigurationForTest.class,
                 CustomListenerConfiguration.class,
                 CommandReplayMappingListenerDefault.BeanFactory.class)) {
 
@@ -119,6 +140,47 @@ void autoconfiguration_backs_off_when_custom_listener_exists() {
         }
     }
 
+    @Test
+    void autoconfiguration_uses_configured_conflict_policy() {
+        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+                LogAndContinueCausewayConfigurationForTest.class,
+                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+            CommandReplayMappingListener listener = context.getBean(CommandReplayMappingListener.class);
+            CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+            Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+            Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+            Bookmark secondActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "3");
+
+            listener.onReplayResultMapped(recordedResult, firstActualResult, commandLogEntry);
+            listener.onReplayResultMapped(recordedResult, secondActualResult, commandLogEntry);
+
+            assertThat(listener.remap(commandLogEntry, recordedResult)).contains(firstActualResult);
+        }
+    }
+
+    @Configuration(proxyBeanMethods = false)
+    static class CausewayConfigurationForTest {
+
+        @Bean
+        CausewayConfiguration causewayConfiguration() {
+            return new CausewayConfiguration(new StandardEnvironment(), Optional.empty());
+        }
+
+    }
+
+    @Configuration(proxyBeanMethods = false)
+    static class LogAndContinueCausewayConfigurationForTest {
+
+        @Bean
+        CausewayConfiguration causewayConfiguration() {
+            CausewayConfiguration causewayConfiguration = new CausewayConfiguration(new StandardEnvironment(), Optional.empty());
+            causewayConfiguration.getExtensions().getCommandLog().getReplayResultMapping()
+                    .setOnConflictPolicy(OnConflictPolicy.LOG_AND_CONTINUE);
+            return causewayConfiguration;
+        }
+
+    }
+
     @Configuration(proxyBeanMethods = false)
     static class CustomListenerConfiguration {
 
diff --git a/openspec/changes/configure-replay-result-conflict-handling/tasks.md b/openspec/changes/configure-replay-result-conflict-handling/tasks.md
index 3c8d341da14..6dd03419608 100644
--- a/openspec/changes/configure-replay-result-conflict-handling/tasks.md
+++ b/openspec/changes/configure-replay-result-conflict-handling/tasks.md
@@ -1,20 +1,20 @@
 ## 1. Configuration Model
 
-- [ ] 1.1 Add a command log replay result mapping conflict policy enum with strict and log-and-continue values.
-- [ ] 1.2 Add a `CausewayConfiguration` property for the default listener conflict policy with strict throwing behavior as the default.
-- [ ] 1.3 Document the property name and accepted values in code comments or generated configuration metadata if applicable.
+- [x] 1.1 Add a command log replay result mapping conflict policy enum with strict and log-and-continue values.
+- [x] 1.2 Add a `CausewayConfiguration` property for the default listener conflict policy with strict throwing behavior as the default.
+- [x] 1.3 Document the property name and accepted values in code comments or generated configuration metadata if applicable.
 
 ## 2. Default Listener Behavior
 
-- [ ] 2.1 Update `CommandReplayMappingListenerDefault` construction to receive the configured conflict policy.
-- [ ] 2.2 Preserve the existing exception-throwing conflict behavior when the policy is strict.
-- [ ] 2.3 Implement the log-and-continue policy so conflicts are logged and the existing mapping is retained without throwing.
-- [ ] 2.4 Update the default listener bean factory to obtain the policy from `CausewayConfiguration`.
+- [x] 2.1 Update `CommandReplayMappingListenerDefault` construction to receive the configured conflict policy.
+- [x] 2.2 Preserve the existing exception-throwing conflict behavior when the policy is strict.
+- [x] 2.3 Implement the log-and-continue policy so conflicts are logged and the existing mapping is retained without throwing.
+- [x] 2.4 Update the default listener bean factory to obtain the policy from `CausewayConfiguration`.
 
 ## 3. Tests and Validation
 
-- [ ] 3.1 Update default listener unit tests to verify strict conflict handling remains the default.
-- [ ] 3.2 Add unit tests for the log-and-continue policy, including retained original mapping and no thrown exception.
-- [ ] 3.3 Add or update bean factory tests to verify configuration is passed into the default listener.
-- [ ] 3.4 Run the command log applib test suite covering `CommandReplayMappingListenerDefaultTest` and `ReplayableCommandMappingTest`.
-- [ ] 3.5 Run `openspec validate configure-replay-result-conflict-handling --type change --strict`.
+- [x] 3.1 Update default listener unit tests to verify strict conflict handling remains the default.
+- [x] 3.2 Add unit tests for the log-and-continue policy, including retained original mapping and no thrown exception.
+- [x] 3.3 Add or update bean factory tests to verify configuration is passed into the default listener.
+- [x] 3.4 Run the command log applib test suite covering `CommandReplayMappingListenerDefaultTest` and `ReplayableCommandMappingTest`.
+- [x] 3.5 Run `openspec validate configure-replay-result-conflict-handling --type change --strict`.


(causeway) 01/42: CAUSEWAY-4011: moves inner actions for CommandExport/ReplayManager

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 05ea2c79fcb5cfedb5844ec4bf370ee03ca9c061
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jun 3 13:51:26 2026 +0100

    CAUSEWAY-4011: moves inner actions for CommandExport/ReplayManager
    
    as top-level mixins, so can make their domain event static.
    Also introduced HasBaseline so can factor out some duplication
---
 .../applib/CausewayModuleExtCommandLogApplib.java  |  34 ++-
 .../commandlog/applib/app/CommandLogMenu.java      |  25 +-
 .../applib/dom/replay/CommandExportManager.java    | 204 +------------
 .../CommandExportManager_exportSelected.java       | 102 +++++++
 ...ommandExportManager_makeSelectedExportable.java |  49 ++++
 .../applib/dom/replay/CommandReplayManager.java    | 321 +--------------------
 ...eplayManager_deleteSelectedPendingOrFailed.java |  51 ++++
 ...yManager_deleteSelectedSucceededOrExcluded.java |  49 ++++
 ...andReplayManager_excludeSelectedFromReplay.java |  52 ++++
 .../CommandReplayManager_importCommands.java       |  55 ++++
 .../CommandReplayManager_replayOrRetryNext.java    |  40 +++
 ...CommandReplayManager_replayOrRetrySelected.java |  64 ++++
 .../commandlog/applib/dom/replay/HasBaseline.java  |  27 ++
 .../dom/replay/HasBaseline_changeBaseline.java     |  35 +++
 .../applib/dom/replay/HasBaseline_nextHour.java    |  32 ++
 .../dom/replay/HasBaseline_previousHour.java       |  31 ++
 16 files changed, 643 insertions(+), 528 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
index 026d19f6833..57f50056ed4 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
@@ -35,7 +35,17 @@
 import org.apache.causeway.extensions.commandlog.applib.dom.mixins.CommandLogEntry_openResultObject;
 import org.apache.causeway.extensions.commandlog.applib.dom.mixins.CommandLogEntry_siblingCommands;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.HasBaseline_changeBaseline;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_exportSelected;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_makeSelectedExportable;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.HasBaseline_nextHour;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.HasBaseline_previousHour;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_deleteSelectedPendingOrFailed;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_deleteSelectedSucceededOrExcluded;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_excludeSelectedFromReplay;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_importCommands;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_replayOrRetrySelected;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.ReplayContext;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.ReplayableCommand_delete;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.ReplayableCommand_excludeFromReplay;
@@ -76,19 +86,17 @@
         ReplayableCommand_replayOrRetry.class,
         ReplayableCommand_excludeFromReplay.class,
         ReplayableCommand_delete.class,
-        CommandExportManager.changeBaseline.class,
-        CommandExportManager.previousHour.class,
-        CommandExportManager.nextHour.class,
-        CommandExportManager.exportSelected.class,
-        CommandExportManager.makeSelectedExportable.class,
-        CommandReplayManager.changeBaseline.class,
-        CommandExportManager.previousHour.class,
-        CommandReplayManager.nextHour.class,
-        CommandReplayManager.importCommands.class,
-        CommandReplayManager.replayOrRetrySelected.class,
-        CommandReplayManager.excludeSelectedFromReplay.class,
-        CommandReplayManager.deleteSelectedSucceededOrExcluded.class,
-        CommandReplayManager.deleteSelectedPendingOrFailed.class,
+        HasBaseline_changeBaseline.class,
+        HasBaseline_previousHour.class,
+        HasBaseline_previousHour.class,
+        HasBaseline_nextHour.class,
+        CommandExportManager_exportSelected.class,
+        CommandExportManager_makeSelectedExportable.class,
+        CommandReplayManager_importCommands.class,
+        CommandReplayManager_replayOrRetrySelected.class,
+        CommandReplayManager_excludeSelectedFromReplay.class,
+        CommandReplayManager_deleteSelectedSucceededOrExcluded.class,
+        CommandReplayManager_deleteSelectedPendingOrFailed.class,
 
         // @Component's
         RunBackgroundCommandsJob.class,
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
index 523b470f22d..1bd57c00cd4 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
@@ -48,6 +48,7 @@
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_importCommands;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.ReplayContext;
 import org.jspecify.annotations.NonNull;
 import org.springframework.lang.Nullable;
@@ -90,7 +91,9 @@ public static abstract class ActionDomainEvent<T>
     )
     @ActionLayout(cssClassFa = "fa-bolt", sequence="10")
     public class activeCommands {
-        public class DomainEvent extends ActionDomainEvent<activeCommands> { }
+        public class DomainEvent extends ActionDomainEvent<activeCommands> {
+            public DomainEvent() { }
+        }
 
         @MemberSupport public List<? extends CommandLogEntry> act() {
             return commandLogEntryRepository.findCurrent();
@@ -124,7 +127,9 @@ public class DomainEvent extends ActionDomainEvent<findMostRecent> { }
     )
     @ActionLayout(cssClassFa = "fa-search", sequence="30")
     public class findCommands {
-        public class DomainEvent extends ActionDomainEvent<findCommands> { }
+        public class DomainEvent extends ActionDomainEvent<findCommands> {
+            public DomainEvent() { }
+        }
 
         @MemberSupport public List<? extends CommandLogEntry> act(
                 final @Nullable LocalDate from,
@@ -151,7 +156,9 @@ public class DomainEvent extends ActionDomainEvent<findCommands> { }
     )
     @ActionLayout(cssClassFa = "fa-search", sequence="40")
     public class findAll {
-        public class DomainEvent extends ActionDomainEvent<findAll> { }
+        public class DomainEvent extends ActionDomainEvent<findAll> {
+            public DomainEvent() { }
+        }
 
         @MemberSupport public List<? extends CommandLogEntry> act() {
             return commandLogEntryRepository.findAll();
@@ -167,7 +174,9 @@ public class DomainEvent extends ActionDomainEvent<findAll> { }
     )
     @ActionLayout(cssClassFa = "solid share-from-square", sequence="50")
     public class exportManager {
-        public class DomainEvent extends ActionDomainEvent<exportManager> { }
+        public class DomainEvent extends ActionDomainEvent<exportManager> {
+            public DomainEvent() { }
+        }
 
         @MemberSupport public CommandExportManager act(
                 @ParameterLayout(describedAs = "Limits the commands shown; only commands since this timestamp are available for export.  Set to a time immediately before the commands to be replayed.")
@@ -191,7 +200,9 @@ public class DomainEvent extends ActionDomainEvent<exportManager> { }
     )
     @ActionLayout(cssClassFa = "solid circle-play", sequence="51")
     public class replayManager {
-        public class DomainEvent extends ActionDomainEvent<replayManager> { }
+        public class DomainEvent extends ActionDomainEvent<replayManager> {
+            public DomainEvent() { }
+        }
 
         @MemberSupport public CommandReplayManager act(
                 @Parameter(
@@ -207,8 +218,8 @@ public class DomainEvent extends ActionDomainEvent<replayManager> { }
                     .orElse(commandReplayManager);
         }
 
-        private CommandReplayManager.importCommands importCommands(CommandReplayManager commandReplayManager) {
-            return factoryService.mixin(CommandReplayManager.importCommands.class, commandReplayManager);
+        private CommandReplayManager_importCommands importCommands(CommandReplayManager commandReplayManager) {
+            return factoryService.mixin(CommandReplayManager_importCommands.class, commandReplayManager);
         }
     }
 
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
index e24078a6f29..895f1107aca 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
@@ -21,52 +21,38 @@
 import static org.apache.causeway.extensions.commandlog.applib.dom.replay.TimestampMarshallUtil.fromString;
 
 import java.sql.Timestamp;
-import java.time.Instant;
-import java.time.chrono.ChronoZonedDateTime;
 import java.util.List;
-import java.util.Optional;
 import java.util.stream.Collectors;
 
 import javax.inject.Inject;
 import javax.inject.Named;
 
 import org.apache.causeway.applib.ViewModel;
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
 import org.apache.causeway.applib.annotation.Collection;
 import org.apache.causeway.applib.annotation.CollectionLayout;
 import org.apache.causeway.applib.annotation.DomainObject;
 import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Introspection;
-import org.apache.causeway.applib.annotation.MemberSupport;
 import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.ParameterLayout;
+import org.apache.causeway.applib.annotation.Programmatic;
 import org.apache.causeway.applib.annotation.Property;
 import org.apache.causeway.applib.annotation.PropertyLayout;
-import org.apache.causeway.applib.annotation.Publishing;
-import org.apache.causeway.applib.annotation.RestrictTo;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-import org.apache.causeway.applib.util.schema.CommandDtoUtils;
-import org.apache.causeway.applib.value.Clob;
-import org.apache.causeway.applib.value.NamedWithMimeType.CommonMimeType;
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
-import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
-import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
 
 import lombok.Getter;
 
 @DomainObject(introspection = Introspection.ANNOTATION_REQUIRED)
 @DomainObjectLayout(cssClassFa = "solid share-from-square")
 @Named(CommandExportManager.LOGICAL_TYPE_NAME)
-public final class CommandExportManager implements ViewModel {
+public final class CommandExportManager implements ViewModel, HasBaseline {
 
 	public static final String LOGICAL_TYPE_NAME = CausewayModuleExtCommandLogApplib.NAMESPACE + ".CommandExportManager";
 
     public static abstract class ActionDomainEvent<T>
             extends CausewayModuleExtCommandLogApplib.ActionDomainEvent<T> { }
 
-    private ReplayContext replayContext;
+    ReplayContext replayContext;
 
     @Inject
     public CommandExportManager(
@@ -92,69 +78,11 @@ public CommandExportManager(
     @Getter
     private java.sql.Timestamp baseline;
 
-    @Action(
-            semantics = SemanticsOf.SAFE,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = previousHour.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "baseline", sequence = "1",
-            named = "Previous",
-            position = ActionLayout.Position.PANEL,
-            describedAs = "Move back one hour"
-    )
-    public class previousHour {
-        public class DomainEvent extends ActionDomainEvent<previousHour> { }
-
-        @MemberSupport public CommandExportManager act() {
-            return new CommandExportManager(addSeconds(baseline, -3600), replayContext);
-        }
-    }
-
-    @Action(
-            semantics = SemanticsOf.SAFE,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = nextHour.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "baseline", sequence = "3",
-            named = "Next",
-            position = ActionLayout.Position.PANEL,
-            describedAs = "Move forward one hour"
-    )
-    public class nextHour {
-        public class DomainEvent extends ActionDomainEvent<nextHour> { }
-        @MemberSupport public CommandExportManager act() {
-            return new CommandExportManager(addSeconds(baseline, +3600), replayContext);
-        }
-    }
 
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            semantics = SemanticsOf.SAFE,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = changeBaseline.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "baseline", sequence = "2",
-            named = "Change",
-            position = ActionLayout.Position.PANEL
-    )
-    public class changeBaseline {
-        public class DomainEvent extends ActionDomainEvent<nextHour> { }
-        @MemberSupport public CommandExportManager act(final java.sql.Timestamp baseline) {
-            return new CommandExportManager(baseline, replayContext);
-        }
-        @MemberSupport public java.sql.Timestamp defaultBaseline() {
-            return CommandExportManager.this.baseline;
-        }
-    }
-
-    private static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
-        return Timestamp.from(ts.toInstant().plusSeconds(secondsToAdd));
+    @Override
+    @Programmatic
+    public CommandExportManager withBaseline(Timestamp baseline) {
+        return new CommandExportManager(baseline, replayContext);
     }
 
 
@@ -172,85 +100,6 @@ public List<ReplayableCommand> getNotYetExported() {
             .collect(Collectors.toList());
     }
 
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            choicesFrom = "notYetExported",
-            semantics = SemanticsOf.NON_IDEMPOTENT,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = exportSelected.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "notYetExported", sequence = "1.1",
-            cssClassFa = "solid share-from-square",
-            cssClass = "btn-primary",
-            describedAs = "Exports selected Commands as zipped DTOs for import later. "
-                        + "Refresh the page to see changed states."
-    )
-    public class exportSelected {
-        public class DomainEvent extends ActionDomainEvent<exportSelected> { }
-
-        @MemberSupport public Clob act(
-                final List<ReplayableCommand> selected,
-                @ParameterLayout(describedAs = "File name for the exported file." )
-                final String filenamePrefix,
-                @ParameterLayout(describedAs = "Whether to add a timestamp suffix to the exported file's name." )
-                final boolean filenameTimestamp) {
-
-            var selectedCommandLogEntries = selected.stream()
-                .map(ReplayableCommand::commandLogEntry)
-                .filter(Optional::isPresent)
-                .map(Optional::get)
-                .filter(entry->!ReplayState.isExported(entry.getReplayState())) // shouldn't be necessary unless a race condition
-                .sorted()
-                .collect(Collectors.toList());
-
-            var yaml = CommandDtoUtils.toYaml(
-                selectedCommandLogEntries.stream()
-                    .map(CommandLogEntry::getCommandDto)
-                    .collect(Collectors.toList()));
-
-            final var replayableCommand = selected.get(0);  // validate ensures there is at least one command
-            final var timestamp = filenameTimestamp
-                    ? replayableCommand.getTimestampIfAny()
-                        .map(ChronoZonedDateTime::toInstant)
-                        .map(Instant::toString)
-                        .map(x -> "." + x.replaceAll("[^A-Za-z0-9._-]", "_"))   // make safe within filename
-                        .orElse("")
-                    : "";
-            final var filename = filenamePrefix + timestamp;
-
-            var clob = Clob.of(filename, CommonMimeType.YAML, yaml);
-
-            // do this last once we have successfully created the Clob
-            selectedCommandLogEntries.forEach(c->c.setReplayState(ReplayState.EXPORTED));
-
-            return clob;
-        }
-
-        @MemberSupport public String disableAct() {
-            return getNotYetExported().isEmpty() ? "No commands in collection" : null;
-        }
-
-        @MemberSupport public String defaultFilenamePrefix() {
-            return "commands";
-        }
-
-        @MemberSupport public boolean defaultFilenameTimestamp() {
-            return true;
-        }
-
-        @MemberSupport public String validateSelected(final List<ReplayableCommand> selected) {
-            return selected != null && selected.isEmpty() ? "Select at least one command to export" : null;
-        }
-
-        // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
-        @MemberSupport
-        public List<ReplayableCommand> choicesSelected() {
-            return getNotYetExported();
-        }
-    }
-
 
     // -- EXPORTED
 
@@ -265,45 +114,6 @@ public List<ReplayableCommand> getExported() {
     }
 
 
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            choicesFrom = "exported",
-            commandPublishing = Publishing.DISABLED,
-            semantics =  SemanticsOf.IDEMPOTENT,
-            domainEvent = makeSelectedExportable.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "exported", sequence = "2.1",
-            describedAs = "Makes selected Commands exportable (again)"
-    )
-    public class makeSelectedExportable {
-        public class DomainEvent extends ActionDomainEvent<makeSelectedExportable> { }
-
-        @MemberSupport
-        public CommandExportManager act(final List<ReplayableCommand> selected) {
-            selected.forEach(ReplayableCommand::makeExportable); // filtered on its own responsibility
-            return CommandExportManager.this;
-        }
-
-        @MemberSupport
-        public String disableAct() {
-            return getExported().isEmpty() ? "No commands in collection" : null;
-        }
-
-        @MemberSupport
-        public String validateSelected(final List<ReplayableCommand> selected) {
-            return selected != null && selected.isEmpty() ? "Select at least one command" : null;
-        }
-
-        // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
-        @MemberSupport
-        public List<ReplayableCommand> choicesSelected() {
-            return getExported();
-        }
-    }
-
-
     // -- VM STATE
 
     @Override
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_exportSelected.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_exportSelected.java
new file mode 100644
index 00000000000..923f353f212
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_exportSelected.java
@@ -0,0 +1,102 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import java.time.Instant;
+import java.time.chrono.ChronoZonedDateTime;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.apache.causeway.applib.annotation.*;
+import org.apache.causeway.applib.util.schema.CommandDtoUtils;
+import org.apache.causeway.applib.value.Clob;
+import org.apache.causeway.applib.value.NamedWithMimeType;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        choicesFrom = "notYetExported",
+        semantics = SemanticsOf.NON_IDEMPOTENT,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandExportManager_exportSelected.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "notYetExported", sequence = "1.1",
+        cssClassFa = "solid share-from-square",
+        cssClass = "btn-primary",
+        describedAs = "Exports selected Commands as zipped DTOs for import later. "
+                + "Refresh the page to see changed states."
+)
+@RequiredArgsConstructor
+public class CommandExportManager_exportSelected {
+
+    public static class DomainEvent extends CommandExportManager.ActionDomainEvent<CommandExportManager_exportSelected> { }
+
+    private final CommandExportManager commandExportManager;
+
+    @MemberSupport
+    public Clob act(
+            final List<ReplayableCommand> selected,
+            @ParameterLayout(describedAs = "File name for the exported file.") final String filenamePrefix,
+            @ParameterLayout(describedAs = "Whether to add a timestamp suffix to the exported file's name.") final boolean filenameTimestamp) {
+
+        var selectedCommandLogEntries = selected.stream()
+                .map(ReplayableCommand::commandLogEntry)
+                .filter(Optional::isPresent)
+                .map(Optional::get)
+                .filter(entry -> !ReplayState.isExported(entry.getReplayState())) // shouldn't be necessary unless a race condition
+                .sorted()
+                .collect(Collectors.toList());
+
+        var yaml = CommandDtoUtils.toYaml(
+                selectedCommandLogEntries.stream()
+                        .map(CommandLogEntry::getCommandDto)
+                        .collect(Collectors.toList()));
+
+        final var replayableCommand = selected.get(0);  // validate ensures there is at least one command
+        final var timestamp = filenameTimestamp
+                ? replayableCommand.getTimestampIfAny()
+                .map(ChronoZonedDateTime::toInstant)
+                .map(Instant::toString)
+                .map(x -> "." + x.replaceAll("[^A-Za-z0-9._-]", "_"))   // make safe within filename
+                .orElse("")
+                : "";
+        final var filename = filenamePrefix + timestamp;
+
+        var clob = Clob.of(filename, NamedWithMimeType.CommonMimeType.YAML, yaml);
+
+        // do this last once we have successfully created the Clob
+        selectedCommandLogEntries.forEach(c -> c.setReplayState(ReplayState.EXPORTED));
+
+        return clob;
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        return commandExportManager.getNotYetExported().isEmpty() ? "No commands in collection" : null;
+    }
+
+    @MemberSupport
+    public String defaultFilenamePrefix() {
+        return "commands";
+    }
+
+    @MemberSupport
+    public boolean defaultFilenameTimestamp() {
+        return true;
+    }
+
+    @MemberSupport
+    public String validateSelected(final List<ReplayableCommand> selected) {
+        return selected != null && selected.isEmpty() ? "Select at least one command to export" : null;
+    }
+
+    // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
+    @MemberSupport
+    public List<ReplayableCommand> choicesSelected() {
+        return commandExportManager.getNotYetExported();
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_makeSelectedExportable.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_makeSelectedExportable.java
new file mode 100644
index 00000000000..86710d605a6
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_makeSelectedExportable.java
@@ -0,0 +1,49 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        choicesFrom = "exported",
+        commandPublishing = Publishing.DISABLED,
+        semantics = SemanticsOf.IDEMPOTENT,
+        domainEvent = CommandExportManager_makeSelectedExportable.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "exported", sequence = "2.1",
+        describedAs = "Makes selected Commands exportable (again)"
+)
+@RequiredArgsConstructor
+public class CommandExportManager_makeSelectedExportable {
+
+    public static class DomainEvent extends CommandExportManager.ActionDomainEvent<CommandExportManager_makeSelectedExportable> { }
+
+    private final CommandExportManager commandExportManager;
+
+    @MemberSupport
+    public CommandExportManager act(final List<ReplayableCommand> selected) {
+        selected.forEach(ReplayableCommand::makeExportable); // filtered on its own responsibility
+        return commandExportManager;
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        return commandExportManager.getExported().isEmpty() ? "No commands in collection" : null;
+    }
+
+    @MemberSupport
+    public String validateSelected(final List<ReplayableCommand> selected) {
+        return selected != null && selected.isEmpty() ? "Select at least one command" : null;
+    }
+
+    // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
+    @MemberSupport
+    public List<ReplayableCommand> choicesSelected() {
+        return commandExportManager.getExported();
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
index 217318d7f14..8d98cda80fb 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
@@ -40,18 +40,14 @@
 import org.apache.causeway.applib.annotation.Introspection;
 import org.apache.causeway.applib.annotation.MemberSupport;
 import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.Parameter;
-import org.apache.causeway.applib.annotation.ParameterLayout;
+import org.apache.causeway.applib.annotation.Programmatic;
 import org.apache.causeway.applib.annotation.Property;
 import org.apache.causeway.applib.annotation.PropertyLayout;
 import org.apache.causeway.applib.annotation.Publishing;
 import org.apache.causeway.applib.annotation.RestrictTo;
 import org.apache.causeway.applib.annotation.SemanticsOf;
-import org.apache.causeway.applib.util.schema.CommandDtoUtils;
-import org.apache.causeway.applib.value.Blob;
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
-import org.apache.causeway.schema.cmd.v2.CommandDto;
 
 import org.jspecify.annotations.NonNull;
 
@@ -60,14 +56,14 @@
 @DomainObject(introspection = Introspection.ANNOTATION_REQUIRED)
 @DomainObjectLayout(cssClassFa = "solid circle-play")
 @Named(CommandReplayManager.LOGICAL_TYPE_NAME)
-public final class CommandReplayManager implements ViewModel {
+public final class CommandReplayManager implements ViewModel, HasBaseline {
 
     public static final String LOGICAL_TYPE_NAME = CausewayModuleExtCommandLogApplib.NAMESPACE + ".CommandReplayManager";
 
     public static abstract class ActionDomainEvent<T>
             extends CausewayModuleExtCommandLogApplib.ActionDomainEvent<T> { }
 
-    private ReplayContext replayContext;
+    ReplayContext replayContext;
 
     @Inject
     public CommandReplayManager(
@@ -93,111 +89,16 @@ public CommandReplayManager(
     @Getter
     private java.sql.Timestamp baseline;
 
-    @Action(
-            semantics = SemanticsOf.SAFE,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = previousHour.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "baseline", sequence = "1",
-            named = "Previous",
-            position = ActionLayout.Position.PANEL,
-            describedAs = "Move back one hour"
-    )
-    public class previousHour {
-        public class DomainEvent extends ActionDomainEvent<previousHour> { }
-
-        @MemberSupport public CommandReplayManager act() {
-            return new CommandReplayManager(addSeconds(baseline, -3600), replayContext);
-        }
-    }
-
-    @Action(
-            semantics = SemanticsOf.SAFE,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = nextHour.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "baseline", sequence = "3",
-            named = "Next",
-            position = ActionLayout.Position.PANEL,
-            describedAs = "Move forward one hour"
-    )
-    public class nextHour {
-        public class DomainEvent extends ActionDomainEvent<nextHour> { }
-        @MemberSupport public CommandReplayManager act() {
-            return new CommandReplayManager(addSeconds(baseline, +3600), replayContext);
-        }
-    }
-
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            semantics = SemanticsOf.SAFE,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = changeBaseline.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "baseline", sequence = "2",
-            named = "Change",
-            position = ActionLayout.Position.PANEL
-    )
-    public class changeBaseline {
-        public class DomainEvent extends ActionDomainEvent<nextHour> { }
-        @MemberSupport public CommandReplayManager act(final java.sql.Timestamp baseline) {
-            return new CommandReplayManager(baseline, replayContext);
-        }
-        @MemberSupport public java.sql.Timestamp defaultBaseline() {
-            return CommandReplayManager.this.baseline;
-        }
+    @Override
+    @Programmatic
+    public CommandExportManager withBaseline(Timestamp baseline) {
+        return new CommandExportManager(baseline, replayContext);
     }
 
-    private static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
+    static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
         return Timestamp.from(ts.toInstant().plusSeconds(secondsToAdd));
     }
 
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            semantics = SemanticsOf.IDEMPOTENT,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = importCommands.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            sequence = "1.1",
-            cssClass = "btn-secondary",
-            describedAs = "Imports commands from yaml format, then persists them with a replayState of PENDING."
-    )
-    public class importCommands {
-        public class DomainEvent extends ActionDomainEvent<importCommands> { }
-        public CommandReplayManager act(
-                @Parameter(fileAccept = ".yml,.yaml")
-                final Blob commandsYaml,
-                @ParameterLayout(describedAs = "Change the baseline to the timestamp of the oldest, so that they are listed at top")
-                final boolean moveBaselineToOldest) {
-            var yamlDs = commandsYaml.asDataSource();
-
-            final List<CommandDto> commandDtos = CommandDtoUtils.fromYaml(yamlDs);
-            commandDtos.forEach(commandLogEntryRepository()::saveForReplay);
-
-            return commandDtos.stream()
-                    .filter(x -> moveBaselineToOldest)
-                    .map(CommandDto::getTimestamp)
-                    .map(CommandReplayManager::toJavaSqlTimestamp)
-                    .sorted()
-                    .findFirst()
-                    .map(timestamp -> new CommandReplayManager(timestamp, replayContext))
-                    .orElse(CommandReplayManager.this);
-        }
-
-        @MemberSupport public boolean defaultMoveBaselineToOldest() {
-            return true;
-        }
-
-    }
-
     private static Timestamp toJavaSqlTimestamp(XMLGregorianCalendar xgc) {
         if (xgc == null) return null;
         Instant instant = xgc.toGregorianCalendar().toZonedDateTime().toInstant();
@@ -216,182 +117,18 @@ public List<ReplayableCommand> getPendingOrFailed() {
             .collect(Collectors.toList());
     }
 
-    private @NonNull Stream<ReplayableCommand> streamPendingOrFailed() {
+    @NonNull Stream<ReplayableCommand> streamPendingOrFailed() {
         return commandLogEntryRepository().findForegroundSinceTimestampAndWithReplayPendingOrFailed(baseline).stream()
                 .map(entry -> new ReplayableCommand(
                         entry.getInteractionId(),
                         replayContext));
     }
 
-    private long sizePendingOrFailed() {
+    long sizePendingOrFailed() {
         return streamPendingOrFailed().count();
     }
 
 
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            choicesFrom = "pendingOrFailed",
-            semantics = SemanticsOf.NON_IDEMPOTENT,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = replayOrRetrySelected.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "pendingOrFailed", sequence = "1.2",
-            cssClass = "btn-secondary",
-            cssClassFa = "solid forward",
-            describedAs = "Executes the list of commands in sequence, after having sorted them by their timestamp. "
-                    + "If any of the given commands fails, "
-                    + "its surrounding transaction is rolled back, but any successful commands so far are marked OK). "
-                    + "The command, that caused the failure, gets marked FAILED.")
-    public class replayOrRetrySelected {
-        public class DomainEvent extends ActionDomainEvent<replayOrRetrySelected> { }
-        @MemberSupport public CommandReplayManager act(final List<ReplayableCommand> selected) {
-            var replayables = selected.stream()
-                .sorted()
-                .collect(Collectors.toList());
-            for(var replayableCommand : replayables) {
-                var tryReplayOrRetry = replayableCommand.tryReplayOrRetry(); // filtered on its own responsibility
-                if(tryReplayOrRetry.isFailure()) {
-                    return CommandReplayManager.this; // stop further execution
-                }
-            }
-            return CommandReplayManager.this;
-        }
-
-
-        @MemberSupport
-        public String disableAct() {
-            return getPendingOrFailed().isEmpty() ? "No commands in collection" : null;
-        }
-
-        @MemberSupport
-        public String validateSelected(final List<ReplayableCommand> selected) {
-            return selected != null && selected.isEmpty() ? "Select at least one command" : null;
-        }
-
-        // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
-        @MemberSupport
-        public List<ReplayableCommand> choicesSelected() {
-            return getPendingOrFailed();
-        }
-    }
-
-
-
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            choicesFrom = "pendingOrFailed",
-            semantics = SemanticsOf.NON_IDEMPOTENT,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = replayOrRetrySelected.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "pendingOrFailed", sequence = "1.1",
-            cssClassFa = "solid circle-play",
-            cssClass = "btn-primary",
-            describedAs = "Executes the oldest command.")
-    public class replayOrRetryNext {
-        public class DomainEvent extends ActionDomainEvent<replayOrRetrySelected> { }
-        @MemberSupport public CommandReplayManager act() {
-            var nextIfAny = streamPendingOrFailed().findFirst();
-            // should always be present, due to our guard
-            nextIfAny.ifPresent(ReplayableCommand::tryReplayOrRetry);
-            return CommandReplayManager.this;
-        }
-
-        @MemberSupport
-        public String disableAct() {
-            return sizePendingOrFailed() == 0 ? "No commands in collection" : null;
-        }
-    }
-
-
-
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            choicesFrom = "pendingOrFailed",
-            semantics = SemanticsOf.NON_IDEMPOTENT,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = excludeSelectedFromReplay.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "pendingOrFailed", sequence = "1.3",
-            cssClass = "btn-secondary",
-            describedAs = "Marks selected Commands to be EXCLUDED from replay"
-    )
-    public class excludeSelectedFromReplay {
-        public class DomainEvent extends ActionDomainEvent<excludeSelectedFromReplay> { }
-        @MemberSupport
-        public CommandReplayManager act(final List<ReplayableCommand> selected) {
-            selected.stream()
-                .forEach(ReplayableCommand::excludeFromReplay); // filtered on its own responsibility
-            return CommandReplayManager.this;
-        }
-
-        @MemberSupport
-        public String disableAct() {
-            return sizePendingOrFailed() == 0 ? "No commands in collection" : null;
-        }
-
-        @MemberSupport
-        public String validateSelected(final List<ReplayableCommand> selected) {
-            return selected != null && selected.isEmpty() ? "Select at least one command" : null;
-        }
-
-        // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
-        @MemberSupport
-        public List<ReplayableCommand> choicesSelected() {
-            return getPendingOrFailed();
-        }
-
-    }
-
-
-
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            choicesFrom = "pendingOrFailed",
-            semantics = SemanticsOf.NON_IDEMPOTENT,
-            commandPublishing = Publishing.DISABLED,
-            domainEvent = deleteSelectedPendingOrFailed.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "pendingOrFailed", sequence = "1.4",
-            cssClass = "btn-danger",
-            describedAs = "Deletes selected Commands (cannot be undone)"
-    )
-    public class deleteSelectedPendingOrFailed {
-        public class DomainEvent extends ActionDomainEvent<deleteSelectedPendingOrFailed> { }
-        public CommandReplayManager act(final List<ReplayableCommand> selected) {
-            selected.stream()
-                .forEach(ReplayableCommand::deleteObj); // filtered on its own responsibility
-            return CommandReplayManager.this;
-        }
-
-        @MemberSupport
-        public String disableAct() {
-            return getPendingOrFailed().isEmpty() ? "No commands in collection" : null;
-        }
-
-        @MemberSupport
-        public String validateSelected(final List<ReplayableCommand> selected) {
-            return selected != null && selected.isEmpty() ? "Select at least one command" : null;
-        }
-
-        // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
-        @MemberSupport
-        public List<ReplayableCommand> choicesSelected() {
-            return getPendingOrFailed();
-        }
-
-    }
-
-
-
     // -- OK OR EXCLUDE
 
     @Collection
@@ -408,44 +145,6 @@ public List<ReplayableCommand> getSucceededOrExcluded() {
     }
 
 
-    @Action(
-            restrictTo = RestrictTo.PROTOTYPING,
-            choicesFrom = "succeededOrExcluded",
-            semantics = SemanticsOf.IDEMPOTENT,
-            domainEvent = deleteSelectedSucceededOrExcluded.DomainEvent.class,
-            executionPublishing = Publishing.DISABLED
-    )
-    @ActionLayout(
-            associateWith = "succeededOrExcluded",
-            named = "Delete Selected",
-            describedAs = "Deletes selected Commands (cannot be undone)"
-    )
-    public class deleteSelectedSucceededOrExcluded {
-        public class DomainEvent extends ActionDomainEvent<deleteSelectedSucceededOrExcluded> { }
-        public CommandReplayManager act(final List<ReplayableCommand> selected) {
-            selected.stream()
-                .forEach(ReplayableCommand::deleteObj); // filtered on its own responsibility
-            return CommandReplayManager.this;
-        }
-
-        @MemberSupport
-        public String disableAct() {
-            return getSucceededOrExcluded().isEmpty() ? "No commands in collection" : null;
-        }
-
-        @MemberSupport
-        public String validateSelected(final List<ReplayableCommand> selected) {
-            return selected != null && selected.isEmpty() ? "Select at least one command" : null;
-        }
-
-        // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
-        @MemberSupport
-        public List<ReplayableCommand> choicesSelected() {
-            return getSucceededOrExcluded();
-        }
-    }
-
-
     // -- VM STATE
 
     @Override
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_deleteSelectedPendingOrFailed.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_deleteSelectedPendingOrFailed.java
new file mode 100644
index 00000000000..43d65d2b9d3
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_deleteSelectedPendingOrFailed.java
@@ -0,0 +1,51 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        choicesFrom = "pendingOrFailed",
+        semantics = SemanticsOf.NON_IDEMPOTENT,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandReplayManager_deleteSelectedPendingOrFailed.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "pendingOrFailed", sequence = "1.4",
+        cssClass = "btn-danger",
+        describedAs = "Deletes selected Commands (cannot be undone)"
+)
+@RequiredArgsConstructor
+public class CommandReplayManager_deleteSelectedPendingOrFailed {
+
+    public static class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_deleteSelectedPendingOrFailed> { }
+
+    private final CommandReplayManager commandReplayManager;
+
+    public CommandReplayManager act(final List<ReplayableCommand> selected) {
+        selected.stream()
+                .forEach(ReplayableCommand::deleteObj); // filtered on its own responsibility
+        return commandReplayManager;
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        return commandReplayManager.getPendingOrFailed().isEmpty() ? "No commands in collection" : null;
+    }
+
+    @MemberSupport
+    public String validateSelected(final List<ReplayableCommand> selected) {
+        return selected != null && selected.isEmpty() ? "Select at least one command" : null;
+    }
+
+    // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
+    @MemberSupport
+    public List<ReplayableCommand> choicesSelected() {
+        return commandReplayManager.getPendingOrFailed();
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_deleteSelectedSucceededOrExcluded.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_deleteSelectedSucceededOrExcluded.java
new file mode 100644
index 00000000000..1c6e246b0a3
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_deleteSelectedSucceededOrExcluded.java
@@ -0,0 +1,49 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        choicesFrom = "succeededOrExcluded",
+        semantics = SemanticsOf.IDEMPOTENT,
+        domainEvent = CommandReplayManager_deleteSelectedSucceededOrExcluded.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "succeededOrExcluded",
+        named = "Delete Selected",
+        describedAs = "Deletes selected Commands (cannot be undone)"
+)
+@RequiredArgsConstructor
+public class CommandReplayManager_deleteSelectedSucceededOrExcluded {
+
+    public static class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_deleteSelectedSucceededOrExcluded> { }
+
+    private final CommandReplayManager commandReplayManager;
+
+    public CommandReplayManager act(final List<ReplayableCommand> selected) {
+        selected.stream()
+                .forEach(ReplayableCommand::deleteObj); // filtered on its own responsibility
+        return commandReplayManager;
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        return commandReplayManager.getSucceededOrExcluded().isEmpty() ? "No commands in collection" : null;
+    }
+
+    @MemberSupport
+    public String validateSelected(final List<ReplayableCommand> selected) {
+        return selected != null && selected.isEmpty() ? "Select at least one command" : null;
+    }
+
+    // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
+    @MemberSupport
+    public List<ReplayableCommand> choicesSelected() {
+        return commandReplayManager.getSucceededOrExcluded();
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_excludeSelectedFromReplay.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_excludeSelectedFromReplay.java
new file mode 100644
index 00000000000..ecd036ee658
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_excludeSelectedFromReplay.java
@@ -0,0 +1,52 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        choicesFrom = "pendingOrFailed",
+        semantics = SemanticsOf.NON_IDEMPOTENT,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandReplayManager_excludeSelectedFromReplay.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "pendingOrFailed", sequence = "1.3",
+        cssClass = "btn-secondary",
+        describedAs = "Marks selected Commands to be EXCLUDED from replay"
+)
+@RequiredArgsConstructor
+public class CommandReplayManager_excludeSelectedFromReplay {
+
+    public static class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_excludeSelectedFromReplay> { }
+
+    private final CommandReplayManager commandReplayManager;
+
+    @MemberSupport
+    public CommandReplayManager act(final List<ReplayableCommand> selected) {
+        selected.stream()
+                .forEach(ReplayableCommand::excludeFromReplay); // filtered on its own responsibility
+        return commandReplayManager;
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        return commandReplayManager.sizePendingOrFailed() == 0 ? "No commands in collection" : null;
+    }
+
+    @MemberSupport
+    public String validateSelected(final List<ReplayableCommand> selected) {
+        return selected != null && selected.isEmpty() ? "Select at least one command" : null;
+    }
+
+    // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
+    @MemberSupport
+    public List<ReplayableCommand> choicesSelected() {
+        return commandReplayManager.getPendingOrFailed();
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
new file mode 100644
index 00000000000..7c57ff398e7
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_importCommands.java
@@ -0,0 +1,55 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import java.util.List;
+
+import org.apache.causeway.applib.annotation.*;
+import org.apache.causeway.applib.util.schema.CommandDtoUtils;
+import org.apache.causeway.applib.value.Blob;
+import org.apache.causeway.schema.cmd.v2.CommandDto;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        semantics = SemanticsOf.IDEMPOTENT,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        sequence = "1.1",
+        cssClass = "btn-secondary",
+        describedAs = "Imports commands from yaml format, then persists them with a replayState of PENDING."
+)
+public class CommandReplayManager_importCommands {
+    private final CommandReplayManager commandReplayManager;
+
+    public CommandReplayManager_importCommands(CommandReplayManager commandReplayManager) {
+        this.commandReplayManager = commandReplayManager;
+    }
+
+    public class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_importCommands> {
+    }
+
+    public CommandReplayManager act(
+            @Parameter(fileAccept = ".yml,.yaml") final Blob commandsYaml,
+            @ParameterLayout(describedAs = "Change the baseline to the timestamp of the oldest, so that they are listed at top") final boolean moveBaselineToOldest) {
+        var yamlDs = commandsYaml.asDataSource();
+
+        final List<CommandDto> commandDtos = CommandDtoUtils.fromYaml(yamlDs);
+        commandDtos.forEach(commandReplayManager.commandLogEntryRepository()::saveForReplay);
+
+        return commandDtos.stream()
+                .filter(x -> moveBaselineToOldest)
+                .map(CommandDto::getTimestamp)
+                .map(CommandReplayManager::toJavaSqlTimestamp)
+                .sorted()
+                .findFirst()
+                .map(timestamp -> new CommandReplayManager(timestamp, commandReplayManager.replayContext))
+                .orElse(commandReplayManager);
+    }
+
+    @MemberSupport
+    public boolean defaultMoveBaselineToOldest() {
+        return true;
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetryNext.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetryNext.java
new file mode 100644
index 00000000000..717bf84c74f
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetryNext.java
@@ -0,0 +1,40 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        choicesFrom = "pendingOrFailed",
+        semantics = SemanticsOf.NON_IDEMPOTENT,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandReplayManager_replayOrRetrySelected.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "pendingOrFailed", sequence = "1.1",
+        cssClassFa = "solid circle-play",
+        cssClass = "btn-primary",
+        describedAs = "Executes the oldest command.")
+public class CommandReplayManager_replayOrRetryNext {
+    private final CommandReplayManager commandReplayManager;
+
+    public CommandReplayManager_replayOrRetryNext(CommandReplayManager commandReplayManager) {
+        this.commandReplayManager = commandReplayManager;
+    }
+
+    public class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_replayOrRetrySelected> {
+    }
+
+    @MemberSupport
+    public CommandReplayManager act() {
+        var nextIfAny = commandReplayManager.streamPendingOrFailed().findFirst();
+        // should always be present, due to our guard
+        nextIfAny.ifPresent(ReplayableCommand::tryReplayOrRetry);
+        return commandReplayManager;
+    }
+
+    @MemberSupport
+    public String disableAct() {
+        return commandReplayManager.sizePendingOrFailed() == 0 ? "No commands in collection" : null;
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetrySelected.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetrySelected.java
new file mode 100644
index 00000000000..56f16cddadf
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager_replayOrRetrySelected.java
@@ -0,0 +1,64 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        choicesFrom = "pendingOrFailed",
+        semantics = SemanticsOf.NON_IDEMPOTENT,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = CommandReplayManager_replayOrRetrySelected.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "pendingOrFailed", sequence = "1.2",
+        cssClass = "btn-secondary",
+        cssClassFa = "solid forward",
+        describedAs = "Executes the list of commands in sequence, after having sorted them by their timestamp. "
+                + "If any of the given commands fails, "
+                + "its surrounding transaction is rolled back, but any successful commands so far are marked OK). "
+                + "The command, that caused the failure, gets marked FAILED.")
+public class CommandReplayManager_replayOrRetrySelected {
+    private final CommandReplayManager commandReplayManager;
+
+    public CommandReplayManager_replayOrRetrySelected(CommandReplayManager commandReplayManager) {
+        this.commandReplayManager = commandReplayManager;
+    }
+
+    public class DomainEvent extends CommandReplayManager.ActionDomainEvent<CommandReplayManager_replayOrRetrySelected> {
+    }
+
+    @MemberSupport
+    public CommandReplayManager act(final List<ReplayableCommand> selected) {
+        var replayables = selected.stream()
+                .sorted()
+                .collect(Collectors.toList());
+        for (var replayableCommand : replayables) {
+            var tryReplayOrRetry = replayableCommand.tryReplayOrRetry(); // filtered on its own responsibility
+            if (tryReplayOrRetry.isFailure()) {
+                return commandReplayManager; // stop further execution
+            }
+        }
+        return commandReplayManager;
+    }
+
+
+    @MemberSupport
+    public String disableAct() {
+        return commandReplayManager.getPendingOrFailed().isEmpty() ? "No commands in collection" : null;
+    }
+
+    @MemberSupport
+    public String validateSelected(final List<ReplayableCommand> selected) {
+        return selected != null && selected.isEmpty() ? "Select at least one command" : null;
+    }
+
+    // TODO: shouldn't be required because of 'choicesFrom', but in v2 there seems to be a MM validation error due to a missing choicesFacet
+    @MemberSupport
+    public List<ReplayableCommand> choicesSelected() {
+        return commandReplayManager.getPendingOrFailed();
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
new file mode 100644
index 00000000000..0a462d313d2
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
@@ -0,0 +1,27 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.Getter;
+import lombok.experimental.UtilityClass;
+
+import java.sql.Timestamp;
+
+import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
+
+public interface HasBaseline {
+
+    abstract class ActionDomainEvent<T>
+            extends CausewayModuleExtCommandLogApplib.ActionDomainEvent<T> { }
+
+
+    java.sql.Timestamp getBaseline();
+
+    HasBaseline withBaseline(Timestamp baseline);
+
+    @UtilityClass
+    class Util {
+
+        static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
+            return Timestamp.from(ts.toInstant().plusSeconds(secondsToAdd));
+        }
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_changeBaseline.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_changeBaseline.java
new file mode 100644
index 00000000000..9c42bb34bc4
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_changeBaseline.java
@@ -0,0 +1,35 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        restrictTo = RestrictTo.PROTOTYPING,
+        semantics = SemanticsOf.SAFE,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = HasBaseline_changeBaseline.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "baseline", sequence = "2",
+        named = "Change",
+        position = ActionLayout.Position.PANEL
+)
+@RequiredArgsConstructor
+public class HasBaseline_changeBaseline {
+
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<HasBaseline_changeBaseline> { }
+
+    private final HasBaseline hasBaseline;
+
+    @MemberSupport
+    public HasBaseline act(final java.sql.Timestamp baseline) {
+        return hasBaseline.withBaseline(baseline);
+    }
+
+    @MemberSupport
+    public java.sql.Timestamp defaultBaseline() {
+        return hasBaseline.getBaseline();
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
new file mode 100644
index 00000000000..a142a7f61e5
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
@@ -0,0 +1,32 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        semantics = SemanticsOf.SAFE,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = HasBaseline_nextHour.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "baseline", sequence = "3",
+        named = "Next",
+        position = ActionLayout.Position.PANEL,
+        describedAs = "Move forward one hour"
+)
+@RequiredArgsConstructor
+public class HasBaseline_nextHour {
+
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<HasBaseline_nextHour> {
+    }
+
+    private final HasBaseline hasBaseline;
+
+    @MemberSupport
+    public HasBaseline act() {
+        final var baseline = HasBaseline.Util.addSeconds(hasBaseline.getBaseline(), +3600);
+        return hasBaseline.withBaseline(baseline);
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
new file mode 100644
index 00000000000..44e68ee8f9a
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
@@ -0,0 +1,31 @@
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import lombok.RequiredArgsConstructor;
+
+import org.apache.causeway.applib.annotation.*;
+
+@Action(
+        semantics = SemanticsOf.SAFE,
+        commandPublishing = Publishing.DISABLED,
+        domainEvent = HasBaseline_previousHour.DomainEvent.class,
+        executionPublishing = Publishing.DISABLED
+)
+@ActionLayout(
+        associateWith = "baseline", sequence = "1",
+        named = "Previous",
+        position = ActionLayout.Position.PANEL,
+        describedAs = "Move back one hour"
+)
+@RequiredArgsConstructor
+public class HasBaseline_previousHour {
+    public static class DomainEvent extends HasBaseline.ActionDomainEvent<HasBaseline_previousHour> {
+    }
+
+    private final HasBaseline hasBaseline;
+
+    @MemberSupport
+    public HasBaseline act() {
+        final var baseline = HasBaseline.Util.addSeconds(hasBaseline.getBaseline(), -3600);
+        return hasBaseline.withBaseline(baseline);
+    }
+}


(causeway) 02/42: CAUSEWAY-4011: removes some dead code; simplifies impl

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit e7ff0d71730b1eeaf0fd15e9602c60466693df1f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jun 3 13:52:46 2026 +0100

    CAUSEWAY-4011: removes some dead code; simplifies impl
---
 .../commandlog/applib/dom/replay/CommandReplayManager.java     | 10 ----------
 .../extensions/commandlog/applib/dom/replay/HasBaseline.java   |  9 +++------
 .../commandlog/applib/dom/replay/HasBaseline_nextHour.java     |  2 +-
 .../commandlog/applib/dom/replay/HasBaseline_previousHour.java |  2 +-
 4 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
index 8d98cda80fb..a8c3cea8af7 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandReplayManager.java
@@ -95,16 +95,6 @@ public CommandExportManager withBaseline(Timestamp baseline) {
         return new CommandExportManager(baseline, replayContext);
     }
 
-    static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
-        return Timestamp.from(ts.toInstant().plusSeconds(secondsToAdd));
-    }
-
-    private static Timestamp toJavaSqlTimestamp(XMLGregorianCalendar xgc) {
-        if (xgc == null) return null;
-        Instant instant = xgc.toGregorianCalendar().toZonedDateTime().toInstant();
-        return Timestamp.from(instant);
-    }
-
 
     // -- PENDING OR FAILED
 
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
index 0a462d313d2..578c848386b 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline.java
@@ -1,6 +1,5 @@
 package org.apache.causeway.extensions.commandlog.applib.dom.replay;
 
-import lombok.Getter;
 import lombok.experimental.UtilityClass;
 
 import java.sql.Timestamp;
@@ -17,11 +16,9 @@ abstract class ActionDomainEvent<T>
 
     HasBaseline withBaseline(Timestamp baseline);
 
-    @UtilityClass
-    class Util {
 
-        static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
-            return Timestamp.from(ts.toInstant().plusSeconds(secondsToAdd));
-        }
+    static Timestamp addSeconds(Timestamp ts, int secondsToAdd) {
+        return Timestamp.from(ts.toInstant().plusSeconds(secondsToAdd));
     }
+
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
index a142a7f61e5..41f4d53586e 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_nextHour.java
@@ -26,7 +26,7 @@ public static class DomainEvent extends HasBaseline.ActionDomainEvent<HasBaselin
 
     @MemberSupport
     public HasBaseline act() {
-        final var baseline = HasBaseline.Util.addSeconds(hasBaseline.getBaseline(), +3600);
+        final var baseline = HasBaseline.addSeconds(hasBaseline.getBaseline(), +3600);
         return hasBaseline.withBaseline(baseline);
     }
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
index 44e68ee8f9a..74fcc899af8 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/HasBaseline_previousHour.java
@@ -25,7 +25,7 @@ public static class DomainEvent extends HasBaseline.ActionDomainEvent<HasBaselin
 
     @MemberSupport
     public HasBaseline act() {
-        final var baseline = HasBaseline.Util.addSeconds(hasBaseline.getBaseline(), -3600);
+        final var baseline = HasBaseline.addSeconds(hasBaseline.getBaseline(), -3600);
         return hasBaseline.withBaseline(baseline);
     }
 }


(causeway) 27/42: CAUSEWAY-4010: fixes command log replay state initialization

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit a81f15a3ab8e6bb2bde0c7977f6e09913c2bd51f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 17:30:24 2026 +0100

    CAUSEWAY-4010: fixes command log replay state initialization
---
 .../causeway/extensions/commandlog/applib/dom/CommandLogEntry.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
index 39b4778ac0a..03885b5b4a1 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
@@ -174,7 +174,7 @@ public void sync(final Command command) {
         setStartedAt(command.getStartedAt());
         setCompletedAt(command.getCompletedAt());
 
-        if (getReplayState().isPendingOrFailed()) {
+        if (org.apache.causeway.extensions.commandlog.applib.dom.ReplayState.isPendingOrFailed(getReplayState())) {
             // we DON'T overwrite the result if we're replaying.
         } else {
             setResult(command.getResult());


(causeway) 31/42: CAUSEWAY-4010: updates OpenSpec apply commit policy

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit a59b9ba0511cef60d78efba86ae6a56b5bdc316a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 18:23:58 2026 +0100

    CAUSEWAY-4010: updates OpenSpec apply commit policy
---
 AGENTS.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/AGENTS.md b/AGENTS.md
index d1d795c78e3..01c55fe0974 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -17,6 +17,12 @@ When archiving a change with delta specs, sync the delta specs to the main specs
 After archiving and syncing, create a git commit for the archive and spec-sync changes.
 Use the repository git commit message rules above for that commit.
 
+## OpenSpec apply policy
+
+When running `/opsx-apply`, first check whether there are uncommitted OpenSpec proposal artifacts for the active change.
+If proposal artifacts are uncommitted, create a git commit for those proposal docs before starting implementation.
+Use the repository git commit message rules above for that commit.
+
 ## Session handoff
 
 If `SESSION_HANDOFF.md` exists at the repository root, read it at the start of a new session for recent context.


(causeway) 10/42: CAUSEWAY-4010: extends export to include 'returnedObject'

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 517051b871e06736b7c80d6182f0fff73d86a1c8
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 10:35:49 2026 +0100

    CAUSEWAY-4010: extends export to include 'returnedObject'
---
 .../applib/util/schema/CommandDtoUtils.java        | 123 ++++++++++++++++++---
 .../CommandDtoUtils_toYaml_Approval_Test.java      |  27 +++++
 .../CommandDtoUtils_toYaml_fromYaml_Test.java      |  78 +++++++++++--
 .../CommandExportManager_exportSelected.java       |   6 +-
 .../tasks.md                                       |  26 ++---
 5 files changed, 217 insertions(+), 43 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java b/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java
index 0a8cfd4dcdd..f412bc062c0 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/util/schema/CommandDtoUtils.java
@@ -155,25 +155,31 @@ private MapDto userDataFor(final CommandDto commandDto) {
     // -- YAML SUPPORT
 
     public String toYaml(final Iterable<CommandDto> commandDtos) {
-    	final var customizer = new JacksonCustomizer() {
-			@Override
-			public ObjectMapper apply(ObjectMapper mapper) {
-				JsonUtils.jaxbAnnotationSupport(mapper);
-				CommandDtoUtils.memberDtoSupport(mapper);
-				CommandDtoUtils.valueDtoSupport(mapper);
-				JsonUtils.onlyIncludeNonNull(mapper);
-				return mapper;
-			}
-		};
         final var commandDtoList = _NullSafe.stream(commandDtos)
                 .collect(Collectors.toList());
+        return toYamlList(commandDtoList, yamlCommandDtoCustomizer());
+    }
+
+    public String toYamlExport(final Iterable<CommandExportDto> commandExports) {
+        final var commandExportList = _NullSafe.stream(commandExports)
+                .collect(Collectors.toList());
+        return toYamlList(commandExportList, yamlCommandDtoCustomizer());
+    }
+
+    private String toYamlList(
+            final List<?> elements,
+            final JacksonCustomizer customizer) {
         return YamlUtils.toStringUtf8ForList(
-                commandDtoList, YamlUtils.Marshalling.MULTI_DOC,
-                customizer);
+                elements, YamlUtils.Marshalling.MULTI_DOC,
+                mapper -> {
+                    customizer.apply(mapper);
+                    JsonUtils.onlyIncludeNonNull(mapper);
+                    return mapper;
+                });
     }
 
     public List<CommandDto> fromYaml(final DataSource commandDtosYaml) {
-	    final var customizer = yamlCommandDtoCustomizer();
+        final var customizer = yamlCommandDtoCustomizer();
 
         final Try<List<CommandDto>> asList = YamlUtils.tryReadAsList(CommandDto.class, commandDtosYaml, customizer);
         if (asList.isSuccess()) {
@@ -181,15 +187,37 @@ public List<CommandDto> fromYaml(final DataSource commandDtosYaml) {
         }
 
         final Try<List<CommandDto>> asMultiDocument = tryReadAsMultiDocument(CommandDto.class, commandDtosYaml, customizer);
-        asMultiDocument.getFailure().ifPresent(multiDocFailure ->
-            asList.getFailure().ifPresent(multiDocFailure::addSuppressed));
+        if (asMultiDocument.isSuccess()) {
+            return asMultiDocument.getValue().orElseGet(Collections::emptyList);
+        }
+
+        final Try<List<CommandExportDto>> asWrappedList = YamlUtils.tryReadAsList(CommandExportDto.class, commandDtosYaml, customizer);
+        if (asWrappedList.isSuccess()) {
+            return commandDtosFromExport(asWrappedList.getValue().orElseGet(Collections::emptyList));
+        }
 
-        return asMultiDocument
+        final Try<List<CommandExportDto>> asWrappedMultiDocument = tryReadAsMultiDocument(
+                CommandExportDto.class, commandDtosYaml, customizer);
+        asWrappedMultiDocument.getFailure().ifPresent(wrappedMultiDocFailure -> {
+            asList.getFailure().ifPresent(wrappedMultiDocFailure::addSuppressed);
+            asMultiDocument.getFailure().ifPresent(wrappedMultiDocFailure::addSuppressed);
+            asWrappedList.getFailure().ifPresent(wrappedMultiDocFailure::addSuppressed);
+        });
+
+        return asWrappedMultiDocument
+                .mapSuccessAsNullable(CommandDtoUtils::commandDtosFromExport)
                 .ifFailureFail()
                 .getValue()
                 .orElseGet(Collections::emptyList);
     }
 
+    private List<CommandDto> commandDtosFromExport(final List<CommandExportDto> commandExports) {
+        return _NullSafe.stream(commandExports)
+                .map(CommandExportDto::getCommand)
+                .filter(java.util.Objects::nonNull)
+                .collect(Collectors.toList());
+    }
+
     private JsonUtils.JacksonCustomizer yamlCommandDtoCustomizer() {
         return mapper -> {
             JsonUtils.jaxbAnnotationSupport(mapper);
@@ -199,6 +227,69 @@ private JsonUtils.JacksonCustomizer yamlCommandDtoCustomizer() {
         };
     }
 
+    public static class CommandExportDto {
+
+        private CommandDto command;
+        private BookmarkDto returnedObject;
+
+        public static CommandExportDto of(
+                final CommandDto command,
+                final Bookmark returnedObject) {
+            final var commandExportDto = new CommandExportDto();
+            commandExportDto.setCommand(command);
+            commandExportDto.setReturnedObject(BookmarkDto.of(returnedObject));
+            return commandExportDto;
+        }
+
+        public CommandDto getCommand() {
+            return command;
+        }
+
+        public void setCommand(final CommandDto command) {
+            this.command = command;
+        }
+
+        public BookmarkDto getReturnedObject() {
+            return returnedObject;
+        }
+
+        public void setReturnedObject(final BookmarkDto returnedObject) {
+            this.returnedObject = returnedObject;
+        }
+    }
+
+    public static class BookmarkDto {
+
+        private String logicalTypeName;
+        private String id;
+
+        public static BookmarkDto of(final Bookmark bookmark) {
+            if (bookmark == null) {
+                return null;
+            }
+            final var bookmarkDto = new BookmarkDto();
+            bookmarkDto.setLogicalTypeName(bookmark.getLogicalTypeName());
+            bookmarkDto.setId(bookmark.getIdentifier());
+            return bookmarkDto;
+        }
+
+        public String getLogicalTypeName() {
+            return logicalTypeName;
+        }
+
+        public void setLogicalTypeName(final String logicalTypeName) {
+            this.logicalTypeName = logicalTypeName;
+        }
+
+        public String getId() {
+            return id;
+        }
+
+        public void setId(final String id) {
+            this.id = id;
+        }
+    }
+
     private <T> Try<List<T>> tryReadAsMultiDocument(
             final Class<T> elementType,
             final DataSource source,
diff --git a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_Approval_Test.java b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_Approval_Test.java
index 72e35d59914..21c0941bd18 100644
--- a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_Approval_Test.java
+++ b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_Approval_Test.java
@@ -31,6 +31,7 @@
 import org.assertj.core.api.Assertions;
 import org.junit.jupiter.api.Test;
 
+import org.apache.causeway.applib.services.bookmark.Bookmark;
 import org.apache.causeway.schema.cmd.v2.ActionDto;
 import org.apache.causeway.schema.cmd.v2.CommandDto;
 import org.apache.causeway.schema.cmd.v2.ParamDto;
@@ -65,6 +66,17 @@ void marshals_all_date_time_datatypes_when_default_timezone_is_cest() {
         });
     }
 
+    @Test
+    void marshals_exported_commands_with_returned_object_metadata() {
+        String yaml = CommandDtoUtils.toYamlExport(List.of(
+                CommandDtoUtils.CommandExportDto.of(
+                        command("with-result"),
+                        Bookmark.forLogicalTypeNameAndIdentifier("demo.Invoice", "456")),
+                CommandDtoUtils.CommandExportDto.of(command("void-result"), null)));
+
+        Approvals.verify(yaml);
+    }
+
     private static CommandDto commandWithAllDateTimeParams() {
         CommandDto command = new CommandDto();
         command.setMajorVersion("2");
@@ -97,6 +109,21 @@ private String readApprovalSnapshot() throws IOException {
         return StreamUtils.copyToString(stream, StandardCharsets.UTF_8);
     }
 
+    private static CommandDto command(final String interactionId) {
+        CommandDto command = new CommandDto();
+        command.setMajorVersion("2");
+        command.setMinorVersion("0");
+        command.setInteractionId(interactionId);
+        command.setUsername("approval-user");
+        command.setTargets(targets("demo.Customer", "123"));
+
+        ActionDto action = new ActionDto();
+        action.setLogicalMemberIdentifier("demo.Customer#noop");
+        action.setInteractionType(InteractionType.ACTION_INVOCATION);
+        command.setMember(action);
+        return command;
+    }
+
     private static ActionDto actionWithAllDateTimeParams() {
         ActionDto action = new ActionDto();
         action.setLogicalMemberIdentifier("demo.Customer#allDateTimeTypes");
diff --git a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java
index 6661093eb53..61d7f25bae3 100644
--- a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java
+++ b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_toYaml_fromYaml_Test.java
@@ -28,6 +28,7 @@
 import org.assertj.core.api.Assertions;
 import org.junit.jupiter.api.Test;
 
+import org.apache.causeway.applib.services.bookmark.Bookmark;
 import org.apache.causeway.commons.io.DataSource;
 import org.apache.causeway.schema.cmd.v2.ActionDto;
 import org.apache.causeway.schema.cmd.v2.CommandDto;
@@ -40,6 +41,49 @@
 
 class CommandDtoUtils_toYaml_fromYaml_Test {
 
+    @Test
+    void bookmark_metadata_maps_returned_object_bookmark() {
+        CommandDtoUtils.BookmarkDto bookmarkDto = CommandDtoUtils.BookmarkDto.of(
+                Bookmark.forLogicalTypeNameAndIdentifier("demo.Invoice", "456"));
+
+        Assertions.assertThat(bookmarkDto.getLogicalTypeName()).isEqualTo("demo.Invoice");
+        Assertions.assertThat(bookmarkDto.getId()).isEqualTo("456");
+    }
+
+    @Test
+    void bookmark_metadata_is_absent_for_void_result() {
+        CommandDtoUtils.CommandExportDto exportDto = CommandDtoUtils.CommandExportDto.of(command("void-result"), null);
+
+        Assertions.assertThat(exportDto.getReturnedObject()).isNull();
+    }
+
+    @Test
+    void from_yaml_accepts_wrapped_export_shape_and_ignores_returned_object_metadata() {
+        CommandDto withResult = command("with-result");
+        String yaml = CommandDtoUtils.toYamlExport(List.of(
+                CommandDtoUtils.CommandExportDto.of(
+                        withResult,
+                        Bookmark.forLogicalTypeNameAndIdentifier("demo.Invoice", "456"))));
+
+        List<CommandDto> commandDtos = CommandDtoUtils.fromYaml(DataSource.ofStringUtf8(yaml));
+
+        Assertions.assertThat(commandDtos)
+                .singleElement()
+                .satisfies(command -> Assertions.assertThat(command.getInteractionId()).isEqualTo("with-result"));
+    }
+
+    @Test
+    void from_yaml_keeps_legacy_command_dto_shape() {
+        CommandDto legacy = command("legacy-command");
+        String yaml = CommandDtoUtils.toYaml(List.of(legacy));
+
+        List<CommandDto> commandDtos = CommandDtoUtils.fromYaml(DataSource.ofStringUtf8(yaml));
+
+        Assertions.assertThat(commandDtos)
+                .singleElement()
+                .satisfies(command -> Assertions.assertThat(command.getInteractionId()).isEqualTo("legacy-command"));
+    }
+
     @Test
     void localDate_roundtrips_as_date_only_without_timezone() throws Exception {
         TimeZone originalDefault = TimeZone.getDefault();
@@ -53,18 +97,7 @@ void localDate_roundtrips_as_date_only_without_timezone() throws Exception {
             XMLGregorianCalendar originalTime = datatypeFactory
                     .newXMLGregorianCalendar("10:15:30");
 
-            CommandDto command = new CommandDto();
-            command.setMajorVersion("2");
-            command.setMinorVersion("0");
-            command.setInteractionId("localdate-roundtrip-bug");
-            command.setUsername("sven");
-
-            OidDto oid = new OidDto();
-            oid.setType("demo.Customer");
-            oid.setId("123");
-            OidsDto targets = new OidsDto();
-            targets.getOid().add(oid);
-            command.setTargets(targets);
+            CommandDto command = command("localdate-roundtrip-bug");
 
             ParamDto localDateParam = new ParamDto();
             localDateParam.setName("Invoice Date");
@@ -129,4 +162,25 @@ void localDate_roundtrips_as_date_only_without_timezone() throws Exception {
             TimeZone.setDefault(originalDefault);
         }
     }
+
+    private static CommandDto command(final String interactionId) {
+        CommandDto command = new CommandDto();
+        command.setMajorVersion("2");
+        command.setMinorVersion("0");
+        command.setInteractionId(interactionId);
+        command.setUsername("sven");
+
+        OidDto oid = new OidDto();
+        oid.setType("demo.Customer");
+        oid.setId("123");
+        OidsDto targets = new OidsDto();
+        targets.getOid().add(oid);
+        command.setTargets(targets);
+
+        ActionDto action = new ActionDto();
+        action.setLogicalMemberIdentifier("demo.Customer#noop");
+        action.setInteractionType(InteractionType.ACTION_INVOCATION);
+        command.setMember(action);
+        return command;
+    }
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_exportSelected.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_exportSelected.java
index 923f353f212..d53fe106c07 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_exportSelected.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_exportSelected.java
@@ -51,9 +51,11 @@ public Clob act(
                 .sorted()
                 .collect(Collectors.toList());
 
-        var yaml = CommandDtoUtils.toYaml(
+        var yaml = CommandDtoUtils.toYamlExport(
                 selectedCommandLogEntries.stream()
-                        .map(CommandLogEntry::getCommandDto)
+                        .map(entry -> CommandDtoUtils.CommandExportDto.of(
+                                entry.getCommandDto(),
+                                entry.getResult()))
                         .collect(Collectors.toList()));
 
         final var replayableCommand = selected.get(0);  // validate ensures there is at least one command
diff --git a/openspec/changes/include-returned-object-in-command-export/tasks.md b/openspec/changes/include-returned-object-in-command-export/tasks.md
index 8aef413fb6d..2ea888e62fd 100644
--- a/openspec/changes/include-returned-object-in-command-export/tasks.md
+++ b/openspec/changes/include-returned-object-in-command-export/tasks.md
@@ -1,24 +1,24 @@
 ## 1. Export Data Shape
 
-- [ ] 1.1 Add an export-specific DTO or record that wraps the command DTO and optional returned object metadata.
-- [ ] 1.2 Add a bookmark metadata type with `logicalTypeName` and `id` fields derived from a `Bookmark`.
-- [ ] 1.3 Ensure returned object metadata is absent when `CommandLogEntry#getResult()` is null.
+- [x] 1.1 Add an export-specific DTO or record that wraps the command DTO and optional returned object metadata.
+- [x] 1.2 Add a bookmark metadata type with `logicalTypeName` and `id` fields derived from a `Bookmark`.
+- [x] 1.3 Ensure returned object metadata is absent when `CommandLogEntry#getResult()` is null.
 
 ## 2. YAML Export Integration
 
-- [ ] 2.1 Update `CommandExportManager_exportSelected` to serialize wrapped export entries instead of bare command DTOs.
-- [ ] 2.2 Preserve existing ordering, filename generation, YAML mime type, and replay state updates.
-- [ ] 2.3 Verify exported YAML includes returned object metadata for commands with results and omits it for void commands.
+- [x] 2.1 Update `CommandExportManager_exportSelected` to serialize wrapped export entries instead of bare command DTOs.
+- [x] 2.2 Preserve existing ordering, filename generation, YAML mime type, and replay state updates.
+- [x] 2.3 Verify exported YAML includes returned object metadata for commands with results and omits it for void commands.
 
 ## 3. Import Compatibility
 
-- [ ] 3.1 Update YAML import utilities or import action code to accept the new wrapped export shape.
-- [ ] 3.2 Keep legacy command DTO-only YAML import behavior unchanged.
-- [ ] 3.3 Ensure returned object metadata is treated as informational and is not required for replay execution.
+- [x] 3.1 Update YAML import utilities or import action code to accept the new wrapped export shape.
+- [x] 3.2 Keep legacy command DTO-only YAML import behavior unchanged.
+- [x] 3.3 Ensure returned object metadata is treated as informational and is not required for replay execution.
 
 ## 4. Tests
 
-- [ ] 4.1 Add unit tests for bookmark metadata mapping from returned object bookmarks.
-- [ ] 4.2 Add export tests covering commands with and without returned object bookmarks.
-- [ ] 4.3 Add import compatibility tests for legacy command DTO YAML and new wrapped YAML.
-- [ ] 4.4 Run the relevant commandlog applib test suite or targeted Maven tests.
+- [x] 4.1 Add unit tests for bookmark metadata mapping from returned object bookmarks.
+- [x] 4.2 Add export tests covering commands with and without returned object bookmarks.
+- [x] 4.3 Add import compatibility tests for legacy command DTO YAML and new wrapped YAML.
+- [x] 4.4 Run the relevant commandlog applib test suite or targeted Maven tests.


(causeway) 12/42: temporarily renames ${revision} -> 2.2.0-SNAPSHOT

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 0632e377b20cf903888136ebb4123cfe7a35ab48
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 13:04:04 2026 +0100

    temporarily renames ${revision} -> 2.2.0-SNAPSHOT
---
 api/applib/pom.xml                                 |  2 +-
 api/schema/pom.xml                                 |  2 +-
 bom/pom.xml                                        |  2 +-
 commons/pom.xml                                    |  2 +-
 core/codegen-bytebuddy/pom.xml                     |  2 +-
 core/config/pom.xml                                |  2 +-
 core/interaction/pom.xml                           |  2 +-
 core/internaltestsupport/pom.xml                   | 22 ++++++++---------
 core/metamodel/pom.xml                             | 10 ++++----
 core/pom.xml                                       |  2 +-
 core/runtime/pom.xml                               |  6 ++---
 core/runtimeservices/pom.xml                       | 12 +++++-----
 core/security/pom.xml                              |  8 +++----
 core/transaction/pom.xml                           |  4 ++--
 core/webapp/pom.xml                                | 24 +++++++++----------
 extensions/core/commandlog/applib/pom.xml          |  4 ++--
 .../commandlog/persistence-jdo-qclasses/pom.xml    |  2 +-
 extensions/core/commandlog/persistence-jdo/pom.xml |  2 +-
 extensions/core/commandlog/persistence-jpa/pom.xml |  2 +-
 extensions/core/commandlog/pom.xml                 |  2 +-
 extensions/core/docgen/help/pom.xml                |  2 +-
 extensions/core/docgen/pom.xml                     |  2 +-
 extensions/core/excel/applib/pom.xml               |  2 +-
 extensions/core/excel/fixture/pom.xml              |  2 +-
 extensions/core/excel/integtests/pom.xml           |  4 ++--
 extensions/core/excel/pom.xml                      |  2 +-
 extensions/core/excel/testing/pom.xml              |  2 +-
 extensions/core/executionlog/applib/pom.xml        |  2 +-
 .../executionlog/persistence-jdo-qclasses/pom.xml  |  2 +-
 .../core/executionlog/persistence-jdo/pom.xml      |  2 +-
 .../core/executionlog/persistence-jpa/pom.xml      |  2 +-
 extensions/core/executionlog/pom.xml               |  2 +-
 extensions/core/executionoutbox/applib/pom.xml     |  2 +-
 .../persistence-jdo-qclasses/pom.xml               |  2 +-
 .../core/executionoutbox/persistence-jdo/pom.xml   |  2 +-
 .../core/executionoutbox/persistence-jpa/pom.xml   |  2 +-
 extensions/core/executionoutbox/pom.xml            |  2 +-
 extensions/core/executionoutbox/restclient/pom.xml |  2 +-
 .../core/executionrepublisher/applib/pom.xml       |  2 +-
 extensions/core/executionrepublisher/pom.xml       |  2 +-
 extensions/core/flyway/impl/pom.xml                | 20 ++++++++--------
 extensions/core/flyway/pom.xml                     |  2 +-
 extensions/core/layoutloaders/github/pom.xml       |  2 +-
 extensions/core/layoutloaders/pom.xml              |  2 +-
 extensions/core/titlecache/applib/pom.xml          |  2 +-
 extensions/core/titlecache/caffeine/pom.xml        |  2 +-
 extensions/core/titlecache/pom.xml                 |  2 +-
 extensions/pom.xml                                 |  2 +-
 extensions/security/audittrail/applib/pom.xml      |  2 +-
 .../audittrail/persistence-jdo-qclasses/pom.xml    |  2 +-
 .../security/audittrail/persistence-jdo/pom.xml    |  2 +-
 .../security/audittrail/persistence-jpa/pom.xml    |  2 +-
 extensions/security/audittrail/pom.xml             |  2 +-
 extensions/security/secman/applib/pom.xml          |  2 +-
 extensions/security/secman/delegated-shiro/pom.xml |  2 +-
 .../security/secman/delegated-springoauth2/pom.xml |  2 +-
 .../security/secman/encryption-jbcrypt/pom.xml     |  2 +-
 .../security/secman/encryption-spring/pom.xml      |  2 +-
 extensions/security/secman/integration/pom.xml     |  2 +-
 .../secman/persistence-jdo-qclasses/pom.xml        |  2 +-
 extensions/security/secman/persistence-jdo/pom.xml |  2 +-
 extensions/security/secman/persistence-jpa/pom.xml |  2 +-
 extensions/security/secman/pom.xml                 |  2 +-
 extensions/security/sessionlog/applib/pom.xml      |  2 +-
 .../sessionlog/persistence-jdo-qclasses/pom.xml    |  2 +-
 .../security/sessionlog/persistence-jdo/pom.xml    |  2 +-
 .../security/sessionlog/persistence-jpa/pom.xml    |  2 +-
 extensions/security/sessionlog/pom.xml             |  2 +-
 extensions/security/spring-oauth2/pom.xml          |  2 +-
 extensions/vro/cors/impl/pom.xml                   | 22 ++++++++---------
 extensions/vro/cors/pom.xml                        |  2 +-
 extensions/vw/fullcalendar/applib/pom.xml          |  2 +-
 extensions/vw/fullcalendar/pom.xml                 |  2 +-
 .../vw/fullcalendar/wicket/integration/pom.xml     | 10 ++++----
 extensions/vw/fullcalendar/wicket/pom.xml          |  6 ++---
 extensions/vw/fullcalendar/wicket/ui/pom.xml       |  2 +-
 extensions/vw/pdfjs/applib/pom.xml                 |  4 ++--
 extensions/vw/pdfjs/fixtures/pom.xml               |  2 +-
 extensions/vw/pdfjs/metamodel/pom.xml              |  2 +-
 extensions/vw/pdfjs/pom.xml                        |  2 +-
 extensions/vw/pdfjs/wicket/integration/pom.xml     |  2 +-
 extensions/vw/pdfjs/wicket/pom.xml                 |  6 ++---
 extensions/vw/pdfjs/wicket/ui/pom.xml              |  2 +-
 extensions/vw/sse/applib/pom.xml                   | 20 ++++++++--------
 extensions/vw/sse/metamodel/pom.xml                | 20 ++++++++--------
 extensions/vw/sse/pom.xml                          |  2 +-
 extensions/vw/sse/wicket/pom.xml                   |  2 +-
 extensions/vw/tabular/applib/pom.xml               |  2 +-
 extensions/vw/tabular/excel/pom.xml                |  4 ++--
 extensions/vw/tabular/pom.xml                      |  2 +-
 mavendeps/pom.xml                                  |  2 +-
 mavendeps/webapp/pom.xml                           |  2 +-
 persistence/commons/pom.xml                        |  2 +-
 persistence/jdo/applib/pom.xml                     | 20 ++++++++--------
 persistence/jdo/datanucleus/pom.xml                | 22 ++++++++---------
 persistence/jdo/integration/pom.xml                |  2 +-
 persistence/jdo/metamodel/pom.xml                  |  2 +-
 persistence/jdo/pom.xml                            | 24 +++++++++----------
 persistence/jdo/provider/pom.xml                   | 24 +++++++++----------
 persistence/jdo/spring/pom.xml                     |  2 +-
 persistence/jpa/applib/pom.xml                     |  2 +-
 persistence/jpa/eclipselink/pom.xml                | 28 +++++++++++-----------
 persistence/jpa/integration/pom.xml                |  2 +-
 persistence/jpa/metamodel/pom.xml                  |  2 +-
 persistence/jpa/pom.xml                            | 20 ++++++++--------
 persistence/querydsl/applib/pom.xml                |  2 +-
 persistence/querydsl/integration/pom.xml           |  2 +-
 persistence/querydsl/jdo/pom.xml                   |  2 +-
 persistence/querydsl/jpa/pom.xml                   |  2 +-
 persistence/querydsl/metamodel/pom.xml             |  2 +-
 persistence/querydsl/pom.xml                       |  2 +-
 persistence/querydsl/testsupport/pom.xml           |  2 +-
 pom.xml                                            |  8 +++----
 regressiontests/base/pom.xml                       |  2 +-
 regressiontests/bootstrapping/pom.xml              |  2 +-
 regressiontests/cmdexecauditsess/generic/pom.xml   |  2 +-
 .../cmdexecauditsess/persistence-jdo/pom.xml       |  2 +-
 .../cmdexecauditsess/persistence-jpa/pom.xml       |  2 +-
 regressiontests/cmdexecauditsess/pom.xml           |  2 +-
 regressiontests/config/pom.xml                     |  8 +++----
 regressiontests/core-wrapperfactory/pom.xml        |  2 +-
 regressiontests/cucumber/pom.xml                   |  2 +-
 regressiontests/domainmodel/pom.xml                |  2 +-
 regressiontests/eventhandling/pom.xml              |  2 +-
 regressiontests/factory/pom.xml                    |  2 +-
 regressiontests/incubating/pom.xml                 |  2 +-
 regressiontests/interact/pom.xml                   |  2 +-
 regressiontests/layouts/pom.xml                    |  2 +-
 regressiontests/persistence-jdo/pom.xml            |  2 +-
 regressiontests/persistence-jpa/pom.xml            |  2 +-
 regressiontests/pom.xml                            |  2 +-
 regressiontests/publishing-jpa/pom.xml             |  2 +-
 regressiontests/rest/pom.xml                       |  2 +-
 regressiontests/value/pom.xml                      |  2 +-
 regressiontests/viewers-common/pom.xml             |  2 +-
 regressiontests/viewers-jdo/pom.xml                |  2 +-
 regressiontests/viewers-jpa/pom.xml                |  2 +-
 retired/extensions/core/commandreplay/pom.xml      |  2 +-
 .../extensions/core/commandreplay/primary/pom.xml  |  2 +-
 .../core/commandreplay/secondary/pom.xml           |  2 +-
 security/bypass/pom.xml                            |  8 +++----
 security/keycloak/pom.xml                          |  2 +-
 security/shiro/pom.xml                             |  2 +-
 security/simple/pom.xml                            | 12 +++++-----
 security/spring/pom.xml                            |  2 +-
 starters/pom.xml                                   |  2 +-
 testing/archtestsupport/applib/pom.xml             |  2 +-
 testing/archtestsupport/pom.xml                    |  2 +-
 testing/fakedata/applib/pom.xml                    |  2 +-
 testing/fakedata/fixtures/pom.xml                  |  2 +-
 testing/fakedata/integtests/pom.xml                |  8 +++----
 testing/fakedata/pom.xml                           |  2 +-
 testing/fixtures/applib/pom.xml                    |  2 +-
 testing/fixtures/pom.xml                           |  2 +-
 testing/h2console/pom.xml                          | 20 ++++++++--------
 testing/h2console/ui/pom.xml                       |  2 +-
 testing/hsqldbmgr/pom.xml                          | 20 ++++++++--------
 testing/hsqldbmgr/ui/pom.xml                       | 20 ++++++++--------
 testing/integtestsupport/applib/pom.xml            |  2 +-
 testing/integtestsupport/pom.xml                   | 20 ++++++++--------
 testing/pom.xml                                    |  2 +-
 testing/specsupport/applib/pom.xml                 | 20 ++++++++--------
 testing/specsupport/pom.xml                        | 20 ++++++++--------
 testing/unittestsupport/applib/pom.xml             |  2 +-
 testing/unittestsupport/pom.xml                    |  2 +-
 valuetypes/asciidoc/applib/pom.xml                 | 20 ++++++++--------
 valuetypes/asciidoc/builder/pom.xml                | 22 ++++++++---------
 valuetypes/asciidoc/metamodel/pom.xml              | 20 ++++++++--------
 valuetypes/asciidoc/persistence-jdo/pom.xml        |  2 +-
 valuetypes/asciidoc/persistence-jpa/pom.xml        |  2 +-
 valuetypes/asciidoc/pom.xml                        |  2 +-
 valuetypes/asciidoc/ui/pom.xml                     | 22 ++++++++---------
 valuetypes/asciidoc/ui/wicket/pom.xml              |  2 +-
 valuetypes/jodatime/applib/pom.xml                 | 20 ++++++++--------
 valuetypes/jodatime/integration/pom.xml            | 22 ++++++++---------
 valuetypes/jodatime/pom.xml                        | 20 ++++++++--------
 valuetypes/markdown/applib/pom.xml                 | 20 ++++++++--------
 valuetypes/markdown/metamodel/pom.xml              | 20 ++++++++--------
 valuetypes/markdown/persistence-jdo/pom.xml        |  2 +-
 valuetypes/markdown/persistence-jpa/pom.xml        |  2 +-
 valuetypes/markdown/pom.xml                        |  2 +-
 valuetypes/markdown/ui/pom.xml                     | 20 ++++++++--------
 valuetypes/markdown/ui/wicket/pom.xml              |  2 +-
 valuetypes/pom.xml                                 |  2 +-
 valuetypes/vega/applib/pom.xml                     | 20 ++++++++--------
 valuetypes/vega/metamodel/pom.xml                  | 20 ++++++++--------
 valuetypes/vega/persistence-jdo/pom.xml            |  2 +-
 valuetypes/vega/persistence-jpa/pom.xml            |  2 +-
 valuetypes/vega/pom.xml                            |  2 +-
 valuetypes/vega/ui/pom.xml                         | 22 ++++++++---------
 valuetypes/vega/ui/wicket/pom.xml                  |  2 +-
 viewers/commons/applib/pom.xml                     |  8 +++----
 viewers/commons/model/pom.xml                      | 10 ++++----
 viewers/commons/pom.xml                            | 10 ++++----
 viewers/commons/prism/pom.xml                      | 20 ++++++++--------
 viewers/commons/services/pom.xml                   |  2 +-
 viewers/graphql/applib/pom.xml                     |  2 +-
 viewers/graphql/model/pom.xml                      |  2 +-
 viewers/graphql/pom.xml                            |  2 +-
 viewers/graphql/test/pom.xml                       |  2 +-
 viewers/graphql/test2/pom.xml                      |  2 +-
 viewers/graphql/testsupport/pom.xml                |  2 +-
 viewers/graphql/viewer/pom.xml                     |  2 +-
 viewers/restfulobjects/applib/pom.xml              |  8 +++----
 viewers/restfulobjects/client/pom.xml              |  2 +-
 viewers/restfulobjects/jaxrs-resteasy/pom.xml      | 22 ++++++++---------
 viewers/restfulobjects/pom.xml                     |  2 +-
 viewers/restfulobjects/rendering/pom.xml           |  8 +++----
 viewers/restfulobjects/test/pom.xml                |  2 +-
 viewers/restfulobjects/testing/pom.xml             |  2 +-
 viewers/restfulobjects/viewer/pom.xml              |  2 +-
 viewers/wicket/applib/pom.xml                      |  2 +-
 viewers/wicket/model/pom.xml                       |  8 +++----
 viewers/wicket/pom.xml                             |  4 ++--
 viewers/wicket/ui-test/pom.xml                     |  2 +-
 viewers/wicket/ui/pom.xml                          |  2 +-
 viewers/wicket/viewer/pom.xml                      |  2 +-
 217 files changed, 597 insertions(+), 597 deletions(-)

diff --git a/api/applib/pom.xml b/api/applib/pom.xml
index 483863a6218..31e20bf4510 100644
--- a/api/applib/pom.xml
+++ b/api/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
diff --git a/api/schema/pom.xml b/api/schema/pom.xml
index 960c28c3b8b..877cf59588d 100644
--- a/api/schema/pom.xml
+++ b/api/schema/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../core/pom.xml</relativePath>
 	</parent>
 	<artifactId>causeway-schema</artifactId>
diff --git a/bom/pom.xml b/bom/pom.xml
index 95dccb94096..c5bb8df22d6 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -44,7 +44,7 @@ identified
     </parent>
     <groupId>org.apache.causeway</groupId>
     <artifactId>causeway-bom</artifactId>
-    <version>${revision}</version>
+    <version>2.2.0-SNAPSHOT</version>
 
     <packaging>pom</packaging>
 
diff --git a/commons/pom.xml b/commons/pom.xml
index 95750f1465a..29c5e83d23c 100644
--- a/commons/pom.xml
+++ b/commons/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/core/codegen-bytebuddy/pom.xml b/core/codegen-bytebuddy/pom.xml
index 24ae3b9513b..b0abccf6c7d 100644
--- a/core/codegen-bytebuddy/pom.xml
+++ b/core/codegen-bytebuddy/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-core-codegen-bytebuddy</artifactId>
diff --git a/core/config/pom.xml b/core/config/pom.xml
index 8cf663d8f57..57890622a3b 100644
--- a/core/config/pom.xml
+++ b/core/config/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-core-config</artifactId>
diff --git a/core/interaction/pom.xml b/core/interaction/pom.xml
index 61f5f2bb345..29f7e7fe8f1 100644
--- a/core/interaction/pom.xml
+++ b/core/interaction/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-core-interaction</artifactId>
diff --git a/core/internaltestsupport/pom.xml b/core/internaltestsupport/pom.xml
index 2cd52871d31..b60bdd19640 100644
--- a/core/internaltestsupport/pom.xml
+++ b/core/internaltestsupport/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-core-internaltestsupport</artifactId>
@@ -100,7 +100,7 @@
 					<artifactId>asm</artifactId>
 				</exclusion>
 				<exclusion>
-					<!-- when spring-boot release lags behind spring-core release explicitly 
+					<!-- when spring-boot release lags behind spring-core release explicitly
 						spring-test added below -->
 					<groupId>org.springframework</groupId>
 					<artifactId>spring-core</artifactId>
diff --git a/core/metamodel/pom.xml b/core/metamodel/pom.xml
index 93a561db677..0b659041368 100644
--- a/core/metamodel/pom.xml
+++ b/core/metamodel/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-core-metamodel</artifactId>
@@ -63,7 +63,7 @@
     </build>
 
     <dependencies>
-    
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-applib</artifactId>
@@ -110,7 +110,7 @@
         </dependency>
 
         <!-- TESTING -->
-        
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-internaltestsupport</artifactId>
diff --git a/core/pom.xml b/core/pom.xml
index fa3591ea044..e8299f88b69 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway</groupId>
 		<artifactId>causeway-bom</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../bom/pom.xml</relativePath>
 	</parent>
 
diff --git a/core/runtime/pom.xml b/core/runtime/pom.xml
index 08e4028ec69..45722ef0b60 100644
--- a/core/runtime/pom.xml
+++ b/core/runtime/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-core-runtime</artifactId>
@@ -69,7 +69,7 @@
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-metamodel</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-transaction</artifactId>
@@ -79,7 +79,7 @@
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-interaction</artifactId>
         </dependency>
-        
+
     	<dependency>
 			<groupId>org.apache.causeway.valuetypes</groupId>
 			<artifactId>causeway-valuetypes-jodatime-integration</artifactId>
diff --git a/core/runtimeservices/pom.xml b/core/runtimeservices/pom.xml
index f93853394a1..ca86017a783 100644
--- a/core/runtimeservices/pom.xml
+++ b/core/runtimeservices/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-core-runtimeservices</artifactId>
@@ -71,7 +71,7 @@
     </build>
 
     <dependencies>
-		
+
 		<dependency>
 		    <groupId>jakarta.mail</groupId>
 		    <artifactId>jakarta.mail-api</artifactId>
@@ -84,12 +84,12 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-context-support</artifactId>
         </dependency>
-	
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-runtime</artifactId>
         </dependency>
-      
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-codegen-bytebuddy</artifactId>
@@ -100,7 +100,7 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        
+
 		<!-- TESTING -->
 
         <dependency>
@@ -118,7 +118,7 @@
         </dependency>
 
     </dependencies>
- 
+
 
 
 </project>
diff --git a/core/security/pom.xml b/core/security/pom.xml
index bc771ac9ffe..4058dc6b682 100644
--- a/core/security/pom.xml
+++ b/core/security/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-core-security</artifactId>
@@ -45,7 +45,7 @@
         </dependency>
 
 		<!-- TESTING -->
-        
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-internaltestsupport</artifactId>
diff --git a/core/transaction/pom.xml b/core/transaction/pom.xml
index 19a4865617c..b49774a399b 100644
--- a/core/transaction/pom.xml
+++ b/core/transaction/pom.xml
@@ -23,13 +23,13 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-core-transaction</artifactId>
     <name>Apache Causeway Core - Transaction</name>
     <description>
-    	Provides transaction integration with Spring and also 
+    	Provides transaction integration with Spring and also
     	entity change tracking, with associated publishing and pre/post value events.
     </description>
 
diff --git a/core/webapp/pom.xml b/core/webapp/pom.xml
index 52480084988..c118cc102ff 100644
--- a/core/webapp/pom.xml
+++ b/core/webapp/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-core-webapp</artifactId>
@@ -57,7 +57,7 @@
 			<groupId>org.apache.causeway.core</groupId>
 			<artifactId>causeway-core-runtime</artifactId>
 		</dependency>
-		
+
 		<dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-transaction</artifactId>
@@ -77,7 +77,7 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-actuator</artifactId>
 		</dependency>
-		
+
 		<dependency>
 		    <groupId>javax.servlet</groupId>
 		    <artifactId>javax.servlet-api</artifactId>
diff --git a/extensions/core/commandlog/applib/pom.xml b/extensions/core/commandlog/applib/pom.xml
index 5fbf47564bb..4a8cda3e578 100644
--- a/extensions/core/commandlog/applib/pom.xml
+++ b/extensions/core/commandlog/applib/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-commandlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-commandlog-applib</artifactId>
@@ -85,7 +85,7 @@
 			<groupId>org.apache.causeway.valuetypes</groupId>
 			<artifactId>causeway-valuetypes-asciidoc-builder</artifactId>
 		</dependency>
-		
+
         <dependency>
             <groupId>org.quartz-scheduler</groupId>
             <artifactId>quartz</artifactId>
diff --git a/extensions/core/commandlog/persistence-jdo-qclasses/pom.xml b/extensions/core/commandlog/persistence-jdo-qclasses/pom.xml
index 9f898cd23ae..f26afd39e12 100644
--- a/extensions/core/commandlog/persistence-jdo-qclasses/pom.xml
+++ b/extensions/core/commandlog/persistence-jdo-qclasses/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-commandlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-commandlog-persistence-jdo-qclasses</artifactId>
diff --git a/extensions/core/commandlog/persistence-jdo/pom.xml b/extensions/core/commandlog/persistence-jdo/pom.xml
index 767475ff835..5f58552e801 100644
--- a/extensions/core/commandlog/persistence-jdo/pom.xml
+++ b/extensions/core/commandlog/persistence-jdo/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-commandlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-commandlog-persistence-jdo</artifactId>
diff --git a/extensions/core/commandlog/persistence-jpa/pom.xml b/extensions/core/commandlog/persistence-jpa/pom.xml
index b98b4fbd2f9..32c0c14472e 100644
--- a/extensions/core/commandlog/persistence-jpa/pom.xml
+++ b/extensions/core/commandlog/persistence-jpa/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-commandlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-commandlog-persistence-jpa</artifactId>
diff --git a/extensions/core/commandlog/pom.xml b/extensions/core/commandlog/pom.xml
index a527b936466..b1f351b9c7a 100644
--- a/extensions/core/commandlog/pom.xml
+++ b/extensions/core/commandlog/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/core/docgen/help/pom.xml b/extensions/core/docgen/help/pom.xml
index 4eb324539e2..6025aaebf9d 100644
--- a/extensions/core/docgen/help/pom.xml
+++ b/extensions/core/docgen/help/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-docgen</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-docgen-help</artifactId>
diff --git a/extensions/core/docgen/pom.xml b/extensions/core/docgen/pom.xml
index 19aa09180e4..e20e2a7e19a 100644
--- a/extensions/core/docgen/pom.xml
+++ b/extensions/core/docgen/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/core/excel/applib/pom.xml b/extensions/core/excel/applib/pom.xml
index ddb71a24818..d9a27005211 100644
--- a/extensions/core/excel/applib/pom.xml
+++ b/extensions/core/excel/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-excel</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-excel-applib</artifactId>
diff --git a/extensions/core/excel/fixture/pom.xml b/extensions/core/excel/fixture/pom.xml
index 51949a5101b..7cb547b5854 100644
--- a/extensions/core/excel/fixture/pom.xml
+++ b/extensions/core/excel/fixture/pom.xml
@@ -23,7 +23,7 @@ under the License.
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/core/excel/integtests/pom.xml b/extensions/core/excel/integtests/pom.xml
index 34af4d53b62..22597ddb807 100644
--- a/extensions/core/excel/integtests/pom.xml
+++ b/extensions/core/excel/integtests/pom.xml
@@ -24,7 +24,7 @@ under the License.
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../../pom.xml</relativePath>
     </parent>
 
@@ -106,7 +106,7 @@ under the License.
 			<artifactId>causeway-testing-fixtures-applib</artifactId>
 			<scope>test</scope>
 		</dependency>
-		
+
 		<!-- PERSISTENCE -->
 
         <dependency>
diff --git a/extensions/core/excel/pom.xml b/extensions/core/excel/pom.xml
index 4c36925e258..96eaee869eb 100644
--- a/extensions/core/excel/pom.xml
+++ b/extensions/core/excel/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/core/excel/testing/pom.xml b/extensions/core/excel/testing/pom.xml
index fdf8001c822..77a06476f69 100644
--- a/extensions/core/excel/testing/pom.xml
+++ b/extensions/core/excel/testing/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-excel</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-excel-testing</artifactId>
diff --git a/extensions/core/executionlog/applib/pom.xml b/extensions/core/executionlog/applib/pom.xml
index 1506bf21367..83a7248eff0 100644
--- a/extensions/core/executionlog/applib/pom.xml
+++ b/extensions/core/executionlog/applib/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionlog-applib</artifactId>
diff --git a/extensions/core/executionlog/persistence-jdo-qclasses/pom.xml b/extensions/core/executionlog/persistence-jdo-qclasses/pom.xml
index f5d506fb568..768e7046ef5 100644
--- a/extensions/core/executionlog/persistence-jdo-qclasses/pom.xml
+++ b/extensions/core/executionlog/persistence-jdo-qclasses/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionlog-persistence-jdo-qclasses</artifactId>
diff --git a/extensions/core/executionlog/persistence-jdo/pom.xml b/extensions/core/executionlog/persistence-jdo/pom.xml
index 181a8d777e8..c78f633bb1d 100644
--- a/extensions/core/executionlog/persistence-jdo/pom.xml
+++ b/extensions/core/executionlog/persistence-jdo/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionlog-persistence-jdo</artifactId>
diff --git a/extensions/core/executionlog/persistence-jpa/pom.xml b/extensions/core/executionlog/persistence-jpa/pom.xml
index cefa66c6bc9..7b06c65b9d9 100644
--- a/extensions/core/executionlog/persistence-jpa/pom.xml
+++ b/extensions/core/executionlog/persistence-jpa/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionlog-persistence-jpa</artifactId>
diff --git a/extensions/core/executionlog/pom.xml b/extensions/core/executionlog/pom.xml
index 1ea8ce32159..59040019a98 100644
--- a/extensions/core/executionlog/pom.xml
+++ b/extensions/core/executionlog/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/core/executionoutbox/applib/pom.xml b/extensions/core/executionoutbox/applib/pom.xml
index 58193b16163..8266579bb81 100644
--- a/extensions/core/executionoutbox/applib/pom.xml
+++ b/extensions/core/executionoutbox/applib/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionoutbox</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionoutbox-applib</artifactId>
diff --git a/extensions/core/executionoutbox/persistence-jdo-qclasses/pom.xml b/extensions/core/executionoutbox/persistence-jdo-qclasses/pom.xml
index a6706022fd3..04cc9e81d80 100644
--- a/extensions/core/executionoutbox/persistence-jdo-qclasses/pom.xml
+++ b/extensions/core/executionoutbox/persistence-jdo-qclasses/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionoutbox</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionoutbox-persistence-jdo-qclasses</artifactId>
diff --git a/extensions/core/executionoutbox/persistence-jdo/pom.xml b/extensions/core/executionoutbox/persistence-jdo/pom.xml
index 35fe180c0f2..33e552606a7 100644
--- a/extensions/core/executionoutbox/persistence-jdo/pom.xml
+++ b/extensions/core/executionoutbox/persistence-jdo/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionoutbox</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionoutbox-persistence-jdo</artifactId>
diff --git a/extensions/core/executionoutbox/persistence-jpa/pom.xml b/extensions/core/executionoutbox/persistence-jpa/pom.xml
index 19c56049a81..64e846a495f 100644
--- a/extensions/core/executionoutbox/persistence-jpa/pom.xml
+++ b/extensions/core/executionoutbox/persistence-jpa/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionoutbox</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionoutbox-persistence-jpa</artifactId>
diff --git a/extensions/core/executionoutbox/pom.xml b/extensions/core/executionoutbox/pom.xml
index 08d2eed5c0d..14f718144ee 100644
--- a/extensions/core/executionoutbox/pom.xml
+++ b/extensions/core/executionoutbox/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/core/executionoutbox/restclient/pom.xml b/extensions/core/executionoutbox/restclient/pom.xml
index aed9a50f9ee..2879c912d02 100644
--- a/extensions/core/executionoutbox/restclient/pom.xml
+++ b/extensions/core/executionoutbox/restclient/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionoutbox</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionoutbox-restclient</artifactId>
diff --git a/extensions/core/executionrepublisher/applib/pom.xml b/extensions/core/executionrepublisher/applib/pom.xml
index 5ead56db5d4..9768be7bbea 100644
--- a/extensions/core/executionrepublisher/applib/pom.xml
+++ b/extensions/core/executionrepublisher/applib/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-executionrepublisher</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-executionrepublisher-applib</artifactId>
diff --git a/extensions/core/executionrepublisher/pom.xml b/extensions/core/executionrepublisher/pom.xml
index 6558531571a..abd3d9e9f38 100644
--- a/extensions/core/executionrepublisher/pom.xml
+++ b/extensions/core/executionrepublisher/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/core/flyway/impl/pom.xml b/extensions/core/flyway/impl/pom.xml
index 6185c0fbc1f..5ad2f5ddaac 100644
--- a/extensions/core/flyway/impl/pom.xml
+++ b/extensions/core/flyway/impl/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-flyway</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-flyway-impl</artifactId>
diff --git a/extensions/core/flyway/pom.xml b/extensions/core/flyway/pom.xml
index 06dd9688260..af519f93ba0 100644
--- a/extensions/core/flyway/pom.xml
+++ b/extensions/core/flyway/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/core/layoutloaders/github/pom.xml b/extensions/core/layoutloaders/github/pom.xml
index acfb8e90d39..6db1f3e980f 100644
--- a/extensions/core/layoutloaders/github/pom.xml
+++ b/extensions/core/layoutloaders/github/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-layoutloaders</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
 
diff --git a/extensions/core/layoutloaders/pom.xml b/extensions/core/layoutloaders/pom.xml
index 49f10555f1f..c6726fa83e4 100644
--- a/extensions/core/layoutloaders/pom.xml
+++ b/extensions/core/layoutloaders/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/core/titlecache/applib/pom.xml b/extensions/core/titlecache/applib/pom.xml
index 4dcc25f836c..03d64439195 100644
--- a/extensions/core/titlecache/applib/pom.xml
+++ b/extensions/core/titlecache/applib/pom.xml
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-titlecache</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-titlecache-applib</artifactId>
diff --git a/extensions/core/titlecache/caffeine/pom.xml b/extensions/core/titlecache/caffeine/pom.xml
index 165a8cc4b85..83fc534e3bc 100644
--- a/extensions/core/titlecache/caffeine/pom.xml
+++ b/extensions/core/titlecache/caffeine/pom.xml
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-titlecache</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-titlecache-caffeine</artifactId>
diff --git a/extensions/core/titlecache/pom.xml b/extensions/core/titlecache/pom.xml
index 7d32127162c..eba35a71891 100644
--- a/extensions/core/titlecache/pom.xml
+++ b/extensions/core/titlecache/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 8e1045aa602..796838e5092 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/security/audittrail/applib/pom.xml b/extensions/security/audittrail/applib/pom.xml
index f231dc673f4..8b6246e67e2 100644
--- a/extensions/security/audittrail/applib/pom.xml
+++ b/extensions/security/audittrail/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-audittrail</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/audittrail/persistence-jdo-qclasses/pom.xml b/extensions/security/audittrail/persistence-jdo-qclasses/pom.xml
index 70ccd42336f..3fd57192be6 100644
--- a/extensions/security/audittrail/persistence-jdo-qclasses/pom.xml
+++ b/extensions/security/audittrail/persistence-jdo-qclasses/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-audittrail</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/audittrail/persistence-jdo/pom.xml b/extensions/security/audittrail/persistence-jdo/pom.xml
index 3dca7d7f2c5..92431fce66f 100644
--- a/extensions/security/audittrail/persistence-jdo/pom.xml
+++ b/extensions/security/audittrail/persistence-jdo/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-audittrail</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/audittrail/persistence-jpa/pom.xml b/extensions/security/audittrail/persistence-jpa/pom.xml
index 3a8f042b7d5..38eab49b51b 100644
--- a/extensions/security/audittrail/persistence-jpa/pom.xml
+++ b/extensions/security/audittrail/persistence-jpa/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-audittrail</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/audittrail/pom.xml b/extensions/security/audittrail/pom.xml
index d30c9ddbc6b..307fc4c1218 100644
--- a/extensions/security/audittrail/pom.xml
+++ b/extensions/security/audittrail/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/applib/pom.xml b/extensions/security/secman/applib/pom.xml
index 66371eb6b08..eb67fe479d0 100644
--- a/extensions/security/secman/applib/pom.xml
+++ b/extensions/security/secman/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/delegated-shiro/pom.xml b/extensions/security/secman/delegated-shiro/pom.xml
index 4e0e1e3fe90..36f4e2aa24d 100644
--- a/extensions/security/secman/delegated-shiro/pom.xml
+++ b/extensions/security/secman/delegated-shiro/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/delegated-springoauth2/pom.xml b/extensions/security/secman/delegated-springoauth2/pom.xml
index ad911752aa3..406819f9f21 100644
--- a/extensions/security/secman/delegated-springoauth2/pom.xml
+++ b/extensions/security/secman/delegated-springoauth2/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/encryption-jbcrypt/pom.xml b/extensions/security/secman/encryption-jbcrypt/pom.xml
index 92bf6720f88..ab2f06a6181 100644
--- a/extensions/security/secman/encryption-jbcrypt/pom.xml
+++ b/extensions/security/secman/encryption-jbcrypt/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/encryption-spring/pom.xml b/extensions/security/secman/encryption-spring/pom.xml
index c7cd9bd154e..6a5499f4cbd 100644
--- a/extensions/security/secman/encryption-spring/pom.xml
+++ b/extensions/security/secman/encryption-spring/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/integration/pom.xml b/extensions/security/secman/integration/pom.xml
index 7d3a26f8bfd..b3207bc629d 100644
--- a/extensions/security/secman/integration/pom.xml
+++ b/extensions/security/secman/integration/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/persistence-jdo-qclasses/pom.xml b/extensions/security/secman/persistence-jdo-qclasses/pom.xml
index b58922a8ecb..87adecdc9f2 100644
--- a/extensions/security/secman/persistence-jdo-qclasses/pom.xml
+++ b/extensions/security/secman/persistence-jdo-qclasses/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/persistence-jdo/pom.xml b/extensions/security/secman/persistence-jdo/pom.xml
index 37920f37e02..1e5e48945d4 100644
--- a/extensions/security/secman/persistence-jdo/pom.xml
+++ b/extensions/security/secman/persistence-jdo/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/persistence-jpa/pom.xml b/extensions/security/secman/persistence-jpa/pom.xml
index b7beb4af57e..f7e09281338 100644
--- a/extensions/security/secman/persistence-jpa/pom.xml
+++ b/extensions/security/secman/persistence-jpa/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-secman</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/secman/pom.xml b/extensions/security/secman/pom.xml
index 4955785cc43..a0eae4971e6 100644
--- a/extensions/security/secman/pom.xml
+++ b/extensions/security/secman/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/sessionlog/applib/pom.xml b/extensions/security/sessionlog/applib/pom.xml
index 6e27948ef20..7e4f33b642a 100644
--- a/extensions/security/sessionlog/applib/pom.xml
+++ b/extensions/security/sessionlog/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-sessionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/sessionlog/persistence-jdo-qclasses/pom.xml b/extensions/security/sessionlog/persistence-jdo-qclasses/pom.xml
index 0391257a793..d5207ef90aa 100644
--- a/extensions/security/sessionlog/persistence-jdo-qclasses/pom.xml
+++ b/extensions/security/sessionlog/persistence-jdo-qclasses/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-sessionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/sessionlog/persistence-jdo/pom.xml b/extensions/security/sessionlog/persistence-jdo/pom.xml
index 45199619099..341a2106223 100644
--- a/extensions/security/sessionlog/persistence-jdo/pom.xml
+++ b/extensions/security/sessionlog/persistence-jdo/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-sessionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/sessionlog/persistence-jpa/pom.xml b/extensions/security/sessionlog/persistence-jpa/pom.xml
index 054455a6d57..e106bb75586 100644
--- a/extensions/security/sessionlog/persistence-jpa/pom.xml
+++ b/extensions/security/sessionlog/persistence-jpa/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-sessionlog</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/sessionlog/pom.xml b/extensions/security/sessionlog/pom.xml
index a94a395e7ff..1afbc6168e3 100644
--- a/extensions/security/sessionlog/pom.xml
+++ b/extensions/security/sessionlog/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/security/spring-oauth2/pom.xml b/extensions/security/spring-oauth2/pom.xml
index df16b2a5c92..3c9cd5a2237 100644
--- a/extensions/security/spring-oauth2/pom.xml
+++ b/extensions/security/spring-oauth2/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/vro/cors/impl/pom.xml b/extensions/vro/cors/impl/pom.xml
index 7145113935d..2ff5621bf76 100644
--- a/extensions/vro/cors/impl/pom.xml
+++ b/extensions/vro/cors/impl/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-cors</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-cors-impl</artifactId>
@@ -47,7 +47,7 @@
 		</dependency>
 
         <!-- TESTING -->
-        
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-internaltestsupport</artifactId>
diff --git a/extensions/vro/cors/pom.xml b/extensions/vro/cors/pom.xml
index 6f31a344452..6556567187d 100644
--- a/extensions/vro/cors/pom.xml
+++ b/extensions/vro/cors/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/vw/fullcalendar/applib/pom.xml b/extensions/vw/fullcalendar/applib/pom.xml
index 6388922da8a..e1d74c021ab 100644
--- a/extensions/vw/fullcalendar/applib/pom.xml
+++ b/extensions/vw/fullcalendar/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-fullcalendar</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-fullcalendar-applib</artifactId>
diff --git a/extensions/vw/fullcalendar/pom.xml b/extensions/vw/fullcalendar/pom.xml
index 4db5b103cef..90a9075d0f1 100644
--- a/extensions/vw/fullcalendar/pom.xml
+++ b/extensions/vw/fullcalendar/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/vw/fullcalendar/wicket/integration/pom.xml b/extensions/vw/fullcalendar/wicket/integration/pom.xml
index 02255dc1358..5afe29bcb73 100644
--- a/extensions/vw/fullcalendar/wicket/integration/pom.xml
+++ b/extensions/vw/fullcalendar/wicket/integration/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-fullcalendar-wicket</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
 	<artifactId>causeway-extensions-fullcalendar-wicket-integration</artifactId>
@@ -46,20 +46,20 @@
             <groupId>org.apache.causeway.viewer</groupId>
             <artifactId>causeway-viewer-wicket-ui</artifactId>
         </dependency>
-        
+
         <dependency>
         	<groupId>com.fasterxml.jackson.datatype</groupId>
             <artifactId>jackson-datatype-jsr310</artifactId>
         </dependency>
-        
+
      	<dependency>
 		    <groupId>org.webjars</groupId>
 			<artifactId>fullcalendar</artifactId>
 			<!--  keep in sync with o.a.i.extensions.fullcalendar.wkt.fullcalendar.res.FullCalendar*Reference -->
 			<version>5.11.3</version>
 		</dependency>
-		
-<!-- these are sources only, cannot use -->		
+
+<!-- these are sources only, cannot use -->
 <!-- 		<dependency> -->
 <!-- 		    <groupId>org.webjars.bowergithub.fullcalendar</groupId> -->
 <!-- 		    <artifactId>fullcalendar</artifactId> -->
diff --git a/extensions/vw/fullcalendar/wicket/pom.xml b/extensions/vw/fullcalendar/wicket/pom.xml
index d575736814b..3dd222ae513 100644
--- a/extensions/vw/fullcalendar/wicket/pom.xml
+++ b/extensions/vw/fullcalendar/wicket/pom.xml
@@ -23,17 +23,17 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-fullcalendar</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-fullcalendar-wicket</artifactId>
     <name>Apache Causeway Ext - FullCalendar Wicket</name>
 
     <packaging>pom</packaging>
-    
+
     <modules>
     	<module>integration</module>
     	<module>ui</module>
     </modules>
-    
+
 </project>
diff --git a/extensions/vw/fullcalendar/wicket/ui/pom.xml b/extensions/vw/fullcalendar/wicket/ui/pom.xml
index 1e1222aa163..0a38d2b8ad9 100644
--- a/extensions/vw/fullcalendar/wicket/ui/pom.xml
+++ b/extensions/vw/fullcalendar/wicket/ui/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-fullcalendar-wicket</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
 	<artifactId>causeway-extensions-fullcalendar-wicket-ui</artifactId>
diff --git a/extensions/vw/pdfjs/applib/pom.xml b/extensions/vw/pdfjs/applib/pom.xml
index fcaa8569724..4acd26b5750 100644
--- a/extensions/vw/pdfjs/applib/pom.xml
+++ b/extensions/vw/pdfjs/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-pdfjs</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-pdfjs-applib</artifactId>
@@ -40,7 +40,7 @@
             <groupId>org.apache.causeway.commons</groupId>
             <artifactId>causeway-commons</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-applib</artifactId>
diff --git a/extensions/vw/pdfjs/fixtures/pom.xml b/extensions/vw/pdfjs/fixtures/pom.xml
index d85e2c7721d..c5f0cd6b83a 100644
--- a/extensions/vw/pdfjs/fixtures/pom.xml
+++ b/extensions/vw/pdfjs/fixtures/pom.xml
@@ -23,7 +23,7 @@ under the License.
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-pdfjs</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.causewayaddons.wicket.pdfjs</groupId>
diff --git a/extensions/vw/pdfjs/metamodel/pom.xml b/extensions/vw/pdfjs/metamodel/pom.xml
index 02d6785fe38..38f58cc11dc 100644
--- a/extensions/vw/pdfjs/metamodel/pom.xml
+++ b/extensions/vw/pdfjs/metamodel/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-pdfjs</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-pdfjs-metamodel</artifactId>
diff --git a/extensions/vw/pdfjs/pom.xml b/extensions/vw/pdfjs/pom.xml
index df345a4ba45..e37d9cbe3c5 100644
--- a/extensions/vw/pdfjs/pom.xml
+++ b/extensions/vw/pdfjs/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/extensions/vw/pdfjs/wicket/integration/pom.xml b/extensions/vw/pdfjs/wicket/integration/pom.xml
index b35c2bcecf5..12c67456baf 100644
--- a/extensions/vw/pdfjs/wicket/integration/pom.xml
+++ b/extensions/vw/pdfjs/wicket/integration/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-pdfjs-wicket</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-pdfjs-wicket-integration</artifactId>
diff --git a/extensions/vw/pdfjs/wicket/pom.xml b/extensions/vw/pdfjs/wicket/pom.xml
index 67b9b453c4a..3b7e2d48975 100644
--- a/extensions/vw/pdfjs/wicket/pom.xml
+++ b/extensions/vw/pdfjs/wicket/pom.xml
@@ -23,17 +23,17 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-pdfjs</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-pdfjs-wicket</artifactId>
     <name>Apache Causeway Ext - pdf.js Wicket</name>
 
     <packaging>pom</packaging>
-    
+
     <modules>
     	<module>integration</module>
     	<module>ui</module>
     </modules>
-    
+
 </project>
diff --git a/extensions/vw/pdfjs/wicket/ui/pom.xml b/extensions/vw/pdfjs/wicket/ui/pom.xml
index d7a70d34f94..92ff795639f 100644
--- a/extensions/vw/pdfjs/wicket/ui/pom.xml
+++ b/extensions/vw/pdfjs/wicket/ui/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-pdfjs-wicket</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-pdfjs-wicket-ui</artifactId>
diff --git a/extensions/vw/sse/applib/pom.xml b/extensions/vw/sse/applib/pom.xml
index 31424f2bfec..c47127973fa 100644
--- a/extensions/vw/sse/applib/pom.xml
+++ b/extensions/vw/sse/applib/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-sse</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-sse-applib</artifactId>
diff --git a/extensions/vw/sse/metamodel/pom.xml b/extensions/vw/sse/metamodel/pom.xml
index 20ad5c23a37..27d29257d41 100644
--- a/extensions/vw/sse/metamodel/pom.xml
+++ b/extensions/vw/sse/metamodel/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-sse</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-sse-metamodel</artifactId>
diff --git a/extensions/vw/sse/pom.xml b/extensions/vw/sse/pom.xml
index e900585ccee..afb667ef40f 100644
--- a/extensions/vw/sse/pom.xml
+++ b/extensions/vw/sse/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../pom.xml</relativePath>
 	</parent>
 
diff --git a/extensions/vw/sse/wicket/pom.xml b/extensions/vw/sse/wicket/pom.xml
index 238fdd6bc76..ce3f179945c 100644
--- a/extensions/vw/sse/wicket/pom.xml
+++ b/extensions/vw/sse/wicket/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.extensions</groupId>
 		<artifactId>causeway-extensions-sse</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-sse-wicket</artifactId>
diff --git a/extensions/vw/tabular/applib/pom.xml b/extensions/vw/tabular/applib/pom.xml
index 786fd348df3..a4d8a3e79b4 100644
--- a/extensions/vw/tabular/applib/pom.xml
+++ b/extensions/vw/tabular/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-tabular</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-tabular-applib</artifactId>
diff --git a/extensions/vw/tabular/excel/pom.xml b/extensions/vw/tabular/excel/pom.xml
index 08e58ae2435..e7e4a38cbbe 100644
--- a/extensions/vw/tabular/excel/pom.xml
+++ b/extensions/vw/tabular/excel/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions-tabular</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-tabular-excel</artifactId>
@@ -40,7 +40,7 @@
             <groupId>org.apache.causeway.extensions</groupId>
             <artifactId>causeway-extensions-tabular-applib</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.causeway.viewer</groupId>
             <artifactId>causeway-viewer-commons-applib</artifactId>
diff --git a/extensions/vw/tabular/pom.xml b/extensions/vw/tabular/pom.xml
index 2fd0d0f5537..fa965abe5ac 100644
--- a/extensions/vw/tabular/pom.xml
+++ b/extensions/vw/tabular/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.extensions</groupId>
         <artifactId>causeway-extensions</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/mavendeps/pom.xml b/mavendeps/pom.xml
index 58aed3c0cc1..07819dc68ea 100644
--- a/mavendeps/pom.xml
+++ b/mavendeps/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/mavendeps/webapp/pom.xml b/mavendeps/webapp/pom.xml
index 391805065b8..b6f0d6b92bf 100644
--- a/mavendeps/webapp/pom.xml
+++ b/mavendeps/webapp/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.mavendeps</groupId>
 		<artifactId>causeway-mavendeps</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-mavendeps-webapp</artifactId>
diff --git a/persistence/commons/pom.xml b/persistence/commons/pom.xml
index 6a4c91e57d8..7f69faa6074 100644
--- a/persistence/commons/pom.xml
+++ b/persistence/commons/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/persistence/jdo/applib/pom.xml b/persistence/jdo/applib/pom.xml
index 33f1c6c83bc..92d59fd92af 100644
--- a/persistence/jdo/applib/pom.xml
+++ b/persistence/jdo/applib/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -16,7 +16,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jdo</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jdo-applib</artifactId>
diff --git a/persistence/jdo/datanucleus/pom.xml b/persistence/jdo/datanucleus/pom.xml
index 66deb143739..262a3c66775 100644
--- a/persistence/jdo/datanucleus/pom.xml
+++ b/persistence/jdo/datanucleus/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jdo</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jdo-datanucleus</artifactId>
@@ -71,7 +71,7 @@
 		</dependency>
 
 
-		<!-- not required by the JDO integration modules, but enables 
+		<!-- not required by the JDO integration modules, but enables
 			Spring Boot DataSource Auto-configuration -->
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
diff --git a/persistence/jdo/integration/pom.xml b/persistence/jdo/integration/pom.xml
index fafb560881b..9ec44e0112f 100644
--- a/persistence/jdo/integration/pom.xml
+++ b/persistence/jdo/integration/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jdo</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jdo-integration</artifactId>
diff --git a/persistence/jdo/metamodel/pom.xml b/persistence/jdo/metamodel/pom.xml
index a0a4c5c691c..495048b47e9 100644
--- a/persistence/jdo/metamodel/pom.xml
+++ b/persistence/jdo/metamodel/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jdo</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jdo-metamodel</artifactId>
diff --git a/persistence/jdo/pom.xml b/persistence/jdo/pom.xml
index 417ec13ba38..8fd768dea26 100644
--- a/persistence/jdo/pom.xml
+++ b/persistence/jdo/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -16,7 +16,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../core/pom.xml</relativePath>
 	</parent>
 
@@ -32,13 +32,13 @@
 
 	<modules>
 		<module>applib</module>
-		
+
 		<module>integration</module>
 		<module>metamodel</module>
 		<module>spring</module>
 		<module>provider</module>
 		<module>datanucleus</module>
-		
+
 	</modules>
 
 </project>
\ No newline at end of file
diff --git a/persistence/jdo/provider/pom.xml b/persistence/jdo/provider/pom.xml
index f349993f41e..afb2c26ec98 100644
--- a/persistence/jdo/provider/pom.xml
+++ b/persistence/jdo/provider/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -16,7 +16,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jdo</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jdo-provider</artifactId>
@@ -37,12 +37,12 @@
 			<groupId>org.apache.causeway.persistence</groupId>
 			<artifactId>causeway-persistence-jdo-applib</artifactId>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.datanucleus</groupId>
 			<artifactId>datanucleus-rdbms</artifactId>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.apache.causeway.core</groupId>
 			<artifactId>causeway-core-metamodel</artifactId>
diff --git a/persistence/jdo/spring/pom.xml b/persistence/jdo/spring/pom.xml
index 8374d30c378..1fe72cc67f5 100644
--- a/persistence/jdo/spring/pom.xml
+++ b/persistence/jdo/spring/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jdo</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jdo-spring</artifactId>
diff --git a/persistence/jpa/applib/pom.xml b/persistence/jpa/applib/pom.xml
index a22eda0906b..7a4be8bd334 100644
--- a/persistence/jpa/applib/pom.xml
+++ b/persistence/jpa/applib/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jpa</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jpa-applib</artifactId>
diff --git a/persistence/jpa/eclipselink/pom.xml b/persistence/jpa/eclipselink/pom.xml
index 7ae6edfc759..f7a710d8068 100644
--- a/persistence/jpa/eclipselink/pom.xml
+++ b/persistence/jpa/eclipselink/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -16,7 +16,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jpa</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jpa-eclipselink</artifactId>
@@ -65,7 +65,7 @@
             </testResource>
         </testResources>
 	</build>
-	
+
 
 	<dependencies>
 
@@ -80,7 +80,7 @@
 				</exclusion>
 			</exclusions>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.eclipse.persistence</groupId>
 			<artifactId>org.eclipse.persistence.jpa</artifactId>
@@ -103,7 +103,7 @@
 			<artifactId>spring-boot-starter-data-jpa</artifactId>
 			<exclusions>
 				<exclusion>
-					<!-- outdated v2.0.1 transitively brought in by 
+					<!-- outdated v2.0.1 transitively brought in by
 						jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile -->
 					<groupId>jakarta.enterprise</groupId>
 					<artifactId>jakarta.enterprise.cdi-api</artifactId>
@@ -141,7 +141,7 @@
 		</dependency>
 
 		<!-- TESTING -->
-		
+
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-internaltestsupport</artifactId>
diff --git a/persistence/jpa/integration/pom.xml b/persistence/jpa/integration/pom.xml
index 24e7e4e2ecb..7cf5457ae54 100644
--- a/persistence/jpa/integration/pom.xml
+++ b/persistence/jpa/integration/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jpa</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jpa-integration</artifactId>
diff --git a/persistence/jpa/metamodel/pom.xml b/persistence/jpa/metamodel/pom.xml
index f50310fc420..54e40f32751 100644
--- a/persistence/jpa/metamodel/pom.xml
+++ b/persistence/jpa/metamodel/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-jpa</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-jpa-metamodel</artifactId>
diff --git a/persistence/jpa/pom.xml b/persistence/jpa/pom.xml
index b1a2c947e78..c262932bb8f 100644
--- a/persistence/jpa/pom.xml
+++ b/persistence/jpa/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -16,7 +16,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/persistence/querydsl/applib/pom.xml b/persistence/querydsl/applib/pom.xml
index e52c238a79d..7b2540b228f 100644
--- a/persistence/querydsl/applib/pom.xml
+++ b/persistence/querydsl/applib/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-querydsl</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-querydsl-applib</artifactId>
diff --git a/persistence/querydsl/integration/pom.xml b/persistence/querydsl/integration/pom.xml
index 48fb5e9d600..ee3ffe151a3 100644
--- a/persistence/querydsl/integration/pom.xml
+++ b/persistence/querydsl/integration/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-querydsl</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-querydsl-integration</artifactId>
diff --git a/persistence/querydsl/jdo/pom.xml b/persistence/querydsl/jdo/pom.xml
index b005a889d1f..beca57c4c86 100644
--- a/persistence/querydsl/jdo/pom.xml
+++ b/persistence/querydsl/jdo/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-querydsl</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-querydsl-jdo</artifactId>
diff --git a/persistence/querydsl/jpa/pom.xml b/persistence/querydsl/jpa/pom.xml
index 432f96c07f2..1307c642468 100644
--- a/persistence/querydsl/jpa/pom.xml
+++ b/persistence/querydsl/jpa/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-querydsl</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-querydsl-jpa</artifactId>
diff --git a/persistence/querydsl/metamodel/pom.xml b/persistence/querydsl/metamodel/pom.xml
index bf5200675f1..1165c6f867f 100644
--- a/persistence/querydsl/metamodel/pom.xml
+++ b/persistence/querydsl/metamodel/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-querydsl</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-querydsl-metamodel</artifactId>
diff --git a/persistence/querydsl/pom.xml b/persistence/querydsl/pom.xml
index dac13b865f1..e69b5495695 100644
--- a/persistence/querydsl/pom.xml
+++ b/persistence/querydsl/pom.xml
@@ -16,7 +16,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/persistence/querydsl/testsupport/pom.xml b/persistence/querydsl/testsupport/pom.xml
index 0bd3287d6cb..c4efcf7ba1a 100644
--- a/persistence/querydsl/testsupport/pom.xml
+++ b/persistence/querydsl/testsupport/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.causeway.persistence</groupId>
 		<artifactId>causeway-persistence-querydsl</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-persistence-querydsl-testsupport</artifactId>
diff --git a/pom.xml b/pom.xml
index 745b6f700ca..848fe793dfe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
 
 	<groupId>org.apache.causeway</groupId>
 	<artifactId>causeway-all</artifactId>
-	<version>${revision}</version>
+	<version>2.2.0-SNAPSHOT</version>
 
 	<packaging>pom</packaging>
 
@@ -38,7 +38,7 @@
     <properties>
         <revision>2.2.0-SNAPSHOT</revision> <!-- can be overidden like mvn
         -Drevision=2.7.8 -->
-    
+
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 	</properties>
 
@@ -215,10 +215,10 @@
                             <groupId>org.codehaus.mojo</groupId>
                             <artifactId>versions-maven-plugin</artifactId>
                             <version>2.20.1</version>
-                            <!-- usage: mvn versions:set -Drevision=2.2.0-SNAPSHOT 
+                            <!-- usage: mvn versions:set -Drevision=2.2.0-SNAPSHOT
                                 to be run before install or deploy -->
                             <configuration>
-                                <newVersion>${revision}</newVersion>
+                                <newVersion>2.2.0-SNAPSHOT</newVersion>
                                 <processAllModules>true</processAllModules>
                                 <generateBackupPoms>false</generateBackupPoms>
                             </configuration>
diff --git a/regressiontests/base/pom.xml b/regressiontests/base/pom.xml
index 8f809921488..448fb57a953 100644
--- a/regressiontests/base/pom.xml
+++ b/regressiontests/base/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/bootstrapping/pom.xml b/regressiontests/bootstrapping/pom.xml
index da65ab108d4..8d866bc1404 100644
--- a/regressiontests/bootstrapping/pom.xml
+++ b/regressiontests/bootstrapping/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/cmdexecauditsess/generic/pom.xml b/regressiontests/cmdexecauditsess/generic/pom.xml
index 724daaa5d5b..b98948bccba 100644
--- a/regressiontests/cmdexecauditsess/generic/pom.xml
+++ b/regressiontests/cmdexecauditsess/generic/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.regressiontests</groupId>
         <artifactId>causeway-regressiontests-cmdexecauditsess</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-regressiontests-cmdexecauditsess-generic</artifactId>
diff --git a/regressiontests/cmdexecauditsess/persistence-jdo/pom.xml b/regressiontests/cmdexecauditsess/persistence-jdo/pom.xml
index 2397558f2a3..dad43674186 100644
--- a/regressiontests/cmdexecauditsess/persistence-jdo/pom.xml
+++ b/regressiontests/cmdexecauditsess/persistence-jdo/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.regressiontests</groupId>
         <artifactId>causeway-regressiontests-cmdexecauditsess</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-regressiontests-cmdexecauditsess-persistence-jdo</artifactId>
diff --git a/regressiontests/cmdexecauditsess/persistence-jpa/pom.xml b/regressiontests/cmdexecauditsess/persistence-jpa/pom.xml
index d424c7a2dfa..353680a63c7 100644
--- a/regressiontests/cmdexecauditsess/persistence-jpa/pom.xml
+++ b/regressiontests/cmdexecauditsess/persistence-jpa/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.regressiontests</groupId>
         <artifactId>causeway-regressiontests-cmdexecauditsess</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-regressiontests-cmdexecauditsess-persistence-jpa</artifactId>
diff --git a/regressiontests/cmdexecauditsess/pom.xml b/regressiontests/cmdexecauditsess/pom.xml
index bea7af61e7c..ea1a8a94eb1 100644
--- a/regressiontests/cmdexecauditsess/pom.xml
+++ b/regressiontests/cmdexecauditsess/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.regressiontests</groupId>
         <artifactId>causeway-regressiontests</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/regressiontests/config/pom.xml b/regressiontests/config/pom.xml
index 3fdf6fa5419..8f167db6010 100644
--- a/regressiontests/config/pom.xml
+++ b/regressiontests/config/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
@@ -41,19 +41,19 @@
     </properties>
 
 	<dependencies>
-		
+
 		<dependency>
 			<groupId>org.apache.causeway.regressiontests</groupId>
 			<artifactId>causeway-regressiontests-base</artifactId>
 			<scope>test</scope>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.apache.causeway.core</groupId>
 			<artifactId>causeway-core-runtimeservices</artifactId>
 			<scope>test</scope>
 		</dependency>
-		
+
         <dependency>
             <groupId>com.icegreen</groupId>
             <artifactId>greenmail-junit5</artifactId>
diff --git a/regressiontests/core-wrapperfactory/pom.xml b/regressiontests/core-wrapperfactory/pom.xml
index b9feef5151a..b4c73f6e753 100644
--- a/regressiontests/core-wrapperfactory/pom.xml
+++ b/regressiontests/core-wrapperfactory/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.regressiontests</groupId>
         <artifactId>causeway-regressiontests</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-regressiontests-core-wrapperfactory</artifactId>
diff --git a/regressiontests/cucumber/pom.xml b/regressiontests/cucumber/pom.xml
index 4be8e2bc84a..d777513bf50 100644
--- a/regressiontests/cucumber/pom.xml
+++ b/regressiontests/cucumber/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/domainmodel/pom.xml b/regressiontests/domainmodel/pom.xml
index 892fbe88dca..273edef895e 100644
--- a/regressiontests/domainmodel/pom.xml
+++ b/regressiontests/domainmodel/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/eventhandling/pom.xml b/regressiontests/eventhandling/pom.xml
index 8e5a5716c14..8e074cbaac5 100644
--- a/regressiontests/eventhandling/pom.xml
+++ b/regressiontests/eventhandling/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/factory/pom.xml b/regressiontests/factory/pom.xml
index d0c79fe9d83..a4e87e15f50 100644
--- a/regressiontests/factory/pom.xml
+++ b/regressiontests/factory/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/incubating/pom.xml b/regressiontests/incubating/pom.xml
index ff67ed7ca51..195fe0c2ccc 100644
--- a/regressiontests/incubating/pom.xml
+++ b/regressiontests/incubating/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/interact/pom.xml b/regressiontests/interact/pom.xml
index cd86c5e017e..6436f8d3bd9 100644
--- a/regressiontests/interact/pom.xml
+++ b/regressiontests/interact/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/layouts/pom.xml b/regressiontests/layouts/pom.xml
index cc2e2a58b81..c0014e38d71 100644
--- a/regressiontests/layouts/pom.xml
+++ b/regressiontests/layouts/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.regressiontests</groupId>
         <artifactId>causeway-regressiontests</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-regressiontests-layouts</artifactId>
diff --git a/regressiontests/persistence-jdo/pom.xml b/regressiontests/persistence-jdo/pom.xml
index b335a4d4e29..5522c833601 100644
--- a/regressiontests/persistence-jdo/pom.xml
+++ b/regressiontests/persistence-jdo/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/persistence-jpa/pom.xml b/regressiontests/persistence-jpa/pom.xml
index c81130b8b83..9ef4883fe43 100644
--- a/regressiontests/persistence-jpa/pom.xml
+++ b/regressiontests/persistence-jpa/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.causeway.regressiontests</groupId>
         <artifactId>causeway-regressiontests</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/regressiontests/pom.xml b/regressiontests/pom.xml
index 03ab04efc0f..79305211324 100644
--- a/regressiontests/pom.xml
+++ b/regressiontests/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway</groupId>
 		<artifactId>causeway-bom</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../bom/pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/publishing-jpa/pom.xml b/regressiontests/publishing-jpa/pom.xml
index 39e6b548049..0d16bada4cd 100644
--- a/regressiontests/publishing-jpa/pom.xml
+++ b/regressiontests/publishing-jpa/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/rest/pom.xml b/regressiontests/rest/pom.xml
index 08611e09e19..4af234f3351 100644
--- a/regressiontests/rest/pom.xml
+++ b/regressiontests/rest/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/value/pom.xml b/regressiontests/value/pom.xml
index 50d30e48985..d29865f4af2 100644
--- a/regressiontests/value/pom.xml
+++ b/regressiontests/value/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/viewers-common/pom.xml b/regressiontests/viewers-common/pom.xml
index e3fa44a28b6..3ae15e57df0 100644
--- a/regressiontests/viewers-common/pom.xml
+++ b/regressiontests/viewers-common/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/viewers-jdo/pom.xml b/regressiontests/viewers-jdo/pom.xml
index 4aa497e8ddc..33d9a8281d4 100644
--- a/regressiontests/viewers-jdo/pom.xml
+++ b/regressiontests/viewers-jdo/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/regressiontests/viewers-jpa/pom.xml b/regressiontests/viewers-jpa/pom.xml
index 90e588893e2..42510326e3f 100644
--- a/regressiontests/viewers-jpa/pom.xml
+++ b/regressiontests/viewers-jpa/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.regressiontests</groupId>
 		<artifactId>causeway-regressiontests</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
diff --git a/retired/extensions/core/commandreplay/pom.xml b/retired/extensions/core/commandreplay/pom.xml
index b0aceda1937..ca5b39428e4 100644
--- a/retired/extensions/core/commandreplay/pom.xml
+++ b/retired/extensions/core/commandreplay/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.incubator</groupId>
 		<artifactId>causeway-incubator</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../../pom.xml</relativePath>
 	</parent>
 
diff --git a/retired/extensions/core/commandreplay/primary/pom.xml b/retired/extensions/core/commandreplay/primary/pom.xml
index b93976b3439..a58d92da753 100644
--- a/retired/extensions/core/commandreplay/primary/pom.xml
+++ b/retired/extensions/core/commandreplay/primary/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.incubator.extensions</groupId>
         <artifactId>causeway-extensions-commandreplay</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-extensions-commandreplay-primary</artifactId>
diff --git a/retired/extensions/core/commandreplay/secondary/pom.xml b/retired/extensions/core/commandreplay/secondary/pom.xml
index 643bf56c06e..4499cbceae3 100644
--- a/retired/extensions/core/commandreplay/secondary/pom.xml
+++ b/retired/extensions/core/commandreplay/secondary/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.incubator.extensions</groupId>
 		<artifactId>causeway-extensions-commandreplay</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-extensions-commandreplay-secondary</artifactId>
diff --git a/security/bypass/pom.xml b/security/bypass/pom.xml
index 1f9a7bc3c01..b4e1f66e031 100644
--- a/security/bypass/pom.xml
+++ b/security/bypass/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
@@ -42,7 +42,7 @@
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-runtimeservices</artifactId>
         </dependency>
-        
+
     </dependencies>
 
 
diff --git a/security/keycloak/pom.xml b/security/keycloak/pom.xml
index fe298147355..ae527dee6c3 100644
--- a/security/keycloak/pom.xml
+++ b/security/keycloak/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-    	<version>${revision}</version>
+    	<version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
diff --git a/security/shiro/pom.xml b/security/shiro/pom.xml
index 4d1eb4d71af..e4119c04e2f 100644
--- a/security/shiro/pom.xml
+++ b/security/shiro/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-    	<version>${revision}</version>
+    	<version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
diff --git a/security/simple/pom.xml b/security/simple/pom.xml
index 253d4deeed6..51d312eb6cd 100644
--- a/security/simple/pom.xml
+++ b/security/simple/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
@@ -42,12 +42,12 @@
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-runtimeservices</artifactId>
         </dependency>
-        
+
         <dependency>
 		    <groupId>org.springframework.security</groupId>
 		    <artifactId>spring-security-crypto</artifactId>
 		</dependency>
-		
+
 		<!-- TESTING -->
 
         <dependency>
@@ -55,7 +55,7 @@
             <artifactId>causeway-core-internaltestsupport</artifactId>
             <scope>test</scope>
         </dependency>
-        
+
     </dependencies>
 
 
diff --git a/security/spring/pom.xml b/security/spring/pom.xml
index 2513249fb5c..3200f90b416 100644
--- a/security/spring/pom.xml
+++ b/security/spring/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/starters/pom.xml b/starters/pom.xml
index bb3718bfd6d..a4e4ccdec9c 100644
--- a/starters/pom.xml
+++ b/starters/pom.xml
@@ -27,7 +27,7 @@
 		in build-artifacts.sh -->
 	<groupId>org.apache.causeway.app</groupId>
 	<artifactId>causeway-app-starter-parent</artifactId>
-	<version>${revision}</version>
+	<version>2.2.0-SNAPSHOT</version>
 	<packaging>pom</packaging>
 
 	<parent>
diff --git a/testing/archtestsupport/applib/pom.xml b/testing/archtestsupport/applib/pom.xml
index df94b227321..978f7ac8041 100644
--- a/testing/archtestsupport/applib/pom.xml
+++ b/testing/archtestsupport/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing-archtestsupport</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-archtestsupport-applib</artifactId>
diff --git a/testing/archtestsupport/pom.xml b/testing/archtestsupport/pom.xml
index ad57702e2b5..01fae149861 100644
--- a/testing/archtestsupport/pom.xml
+++ b/testing/archtestsupport/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-archtestsupport</artifactId>
diff --git a/testing/fakedata/applib/pom.xml b/testing/fakedata/applib/pom.xml
index 9502089777c..59358c4c5a4 100644
--- a/testing/fakedata/applib/pom.xml
+++ b/testing/fakedata/applib/pom.xml
@@ -23,7 +23,7 @@ under the License.
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing-fakedata</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-fakedata-applib</artifactId>
diff --git a/testing/fakedata/fixtures/pom.xml b/testing/fakedata/fixtures/pom.xml
index 77d2546b460..7657e0e6fda 100644
--- a/testing/fakedata/fixtures/pom.xml
+++ b/testing/fakedata/fixtures/pom.xml
@@ -23,7 +23,7 @@ under the License.
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing-fakedata</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-fakedata-fixtures</artifactId>
diff --git a/testing/fakedata/integtests/pom.xml b/testing/fakedata/integtests/pom.xml
index 2d665782df5..c15868e95dc 100644
--- a/testing/fakedata/integtests/pom.xml
+++ b/testing/fakedata/integtests/pom.xml
@@ -24,12 +24,12 @@ under the License.
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing-fakedata</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-fakedata-integtests</artifactId>
     <name>Apache Causeway Tst - FakeData (integ tests)</name>
-    
+
     <properties>
         <maven.install.skip>true</maven.install.skip>
         <maven.deploy.skip>true</maven.deploy.skip>
@@ -68,7 +68,7 @@ under the License.
     </build>
 
     <dependencies>
-    
+
    		<!-- PERSISTENCE -->
         <dependency>
             <groupId>org.apache.causeway.persistence</groupId>
@@ -93,7 +93,7 @@ under the License.
 			<artifactId>causeway-testing-integtestsupport-applib</artifactId>
 			<scope>test</scope>
 		</dependency>
-	
+
 		<dependency>
 			<groupId>org.apache.causeway.testing</groupId>
 			<artifactId>causeway-testing-fixtures-applib</artifactId>
diff --git a/testing/fakedata/pom.xml b/testing/fakedata/pom.xml
index 0eb3b4a656b..5138e8e7e6d 100644
--- a/testing/fakedata/pom.xml
+++ b/testing/fakedata/pom.xml
@@ -23,7 +23,7 @@ under the License.
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-fakedata</artifactId>
diff --git a/testing/fixtures/applib/pom.xml b/testing/fixtures/applib/pom.xml
index 2e2c063aa13..5ac292fa9e9 100644
--- a/testing/fixtures/applib/pom.xml
+++ b/testing/fixtures/applib/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing-fixtures</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-fixtures-applib</artifactId>
diff --git a/testing/fixtures/pom.xml b/testing/fixtures/pom.xml
index b8c9b1f3264..07cd4da68e7 100644
--- a/testing/fixtures/pom.xml
+++ b/testing/fixtures/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-fixtures</artifactId>
diff --git a/testing/h2console/pom.xml b/testing/h2console/pom.xml
index 4da7b8dd2ac..3076079661e 100644
--- a/testing/h2console/pom.xml
+++ b/testing/h2console/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-h2console</artifactId>
diff --git a/testing/h2console/ui/pom.xml b/testing/h2console/ui/pom.xml
index a0c34d05d43..f3cfc8d3e64 100644
--- a/testing/h2console/ui/pom.xml
+++ b/testing/h2console/ui/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing-h2console</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-h2console-ui</artifactId>
diff --git a/testing/hsqldbmgr/pom.xml b/testing/hsqldbmgr/pom.xml
index 67e4e515310..586893a8add 100644
--- a/testing/hsqldbmgr/pom.xml
+++ b/testing/hsqldbmgr/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-hsqldbmgr</artifactId>
diff --git a/testing/hsqldbmgr/ui/pom.xml b/testing/hsqldbmgr/ui/pom.xml
index 2fe3b33df0f..ce8f949a187 100644
--- a/testing/hsqldbmgr/ui/pom.xml
+++ b/testing/hsqldbmgr/ui/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing-hsqldbmgr</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-hsqldbmgr-ui</artifactId>
diff --git a/testing/integtestsupport/applib/pom.xml b/testing/integtestsupport/applib/pom.xml
index 4651c7d0075..6305158a852 100644
--- a/testing/integtestsupport/applib/pom.xml
+++ b/testing/integtestsupport/applib/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing-integtestsupport</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-integtestsupport-applib</artifactId>
diff --git a/testing/integtestsupport/pom.xml b/testing/integtestsupport/pom.xml
index 33af5386bd0..d43f5a60e25 100644
--- a/testing/integtestsupport/pom.xml
+++ b/testing/integtestsupport/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-integtestsupport</artifactId>
diff --git a/testing/pom.xml b/testing/pom.xml
index db795b24859..50250438ce7 100644
--- a/testing/pom.xml
+++ b/testing/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/testing/specsupport/applib/pom.xml b/testing/specsupport/applib/pom.xml
index 343615125dc..65ed2570e91 100644
--- a/testing/specsupport/applib/pom.xml
+++ b/testing/specsupport/applib/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing-specsupport</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-specsupport-applib</artifactId>
diff --git a/testing/specsupport/pom.xml b/testing/specsupport/pom.xml
index da889eb4b25..9274ca61482 100644
--- a/testing/specsupport/pom.xml
+++ b/testing/specsupport/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.testing</groupId>
 		<artifactId>causeway-testing</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-testing-specsupport</artifactId>
diff --git a/testing/unittestsupport/applib/pom.xml b/testing/unittestsupport/applib/pom.xml
index d5307032417..0fe4bbe2e04 100644
--- a/testing/unittestsupport/applib/pom.xml
+++ b/testing/unittestsupport/applib/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing-unittestsupport</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-unittestsupport-applib</artifactId>
diff --git a/testing/unittestsupport/pom.xml b/testing/unittestsupport/pom.xml
index f29dd109109..c3f1bfcec83 100644
--- a/testing/unittestsupport/pom.xml
+++ b/testing/unittestsupport/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.testing</groupId>
         <artifactId>causeway-testing</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-testing-unittestsupport</artifactId>
diff --git a/valuetypes/asciidoc/applib/pom.xml b/valuetypes/asciidoc/applib/pom.xml
index 44294175482..0145437f008 100644
--- a/valuetypes/asciidoc/applib/pom.xml
+++ b/valuetypes/asciidoc/applib/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-asciidoc</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc-applib</artifactId>
diff --git a/valuetypes/asciidoc/builder/pom.xml b/valuetypes/asciidoc/builder/pom.xml
index cfb4822a08d..9cd683ea788 100644
--- a/valuetypes/asciidoc/builder/pom.xml
+++ b/valuetypes/asciidoc/builder/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-asciidoc</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc-builder</artifactId>
@@ -33,7 +33,7 @@
 		help with transfer of source code, if any project (under the umbrella of the
 		AsciiDoc Working Group) is willing to take over.
     </description>
-    
+
 	<properties>
 		<jar-plugin.automaticModuleName>org.apache.causeway.valuetypes.asciidoc.builder</jar-plugin.automaticModuleName>
 		<git-plugin.propertiesDir>org/apache/causeway/valuetypes/asciidoc/builder</git-plugin.propertiesDir>
diff --git a/valuetypes/asciidoc/metamodel/pom.xml b/valuetypes/asciidoc/metamodel/pom.xml
index 31dd81b16f7..f2040197b7f 100644
--- a/valuetypes/asciidoc/metamodel/pom.xml
+++ b/valuetypes/asciidoc/metamodel/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-asciidoc</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc-metamodel</artifactId>
diff --git a/valuetypes/asciidoc/persistence-jdo/pom.xml b/valuetypes/asciidoc/persistence-jdo/pom.xml
index 4e4632017f6..0ebb2c39f7d 100644
--- a/valuetypes/asciidoc/persistence-jdo/pom.xml
+++ b/valuetypes/asciidoc/persistence-jdo/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-asciidoc</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc-persistence-jdo</artifactId>
diff --git a/valuetypes/asciidoc/persistence-jpa/pom.xml b/valuetypes/asciidoc/persistence-jpa/pom.xml
index 3c8e9faf37c..45ec1df3e37 100644
--- a/valuetypes/asciidoc/persistence-jpa/pom.xml
+++ b/valuetypes/asciidoc/persistence-jpa/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-asciidoc</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc-persistence-jpa</artifactId>
diff --git a/valuetypes/asciidoc/pom.xml b/valuetypes/asciidoc/pom.xml
index d8c16673dac..91167756988 100644
--- a/valuetypes/asciidoc/pom.xml
+++ b/valuetypes/asciidoc/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc</artifactId>
diff --git a/valuetypes/asciidoc/ui/pom.xml b/valuetypes/asciidoc/ui/pom.xml
index 8b0b3501595..50956eac55a 100644
--- a/valuetypes/asciidoc/ui/pom.xml
+++ b/valuetypes/asciidoc/ui/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-asciidoc</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc-ui</artifactId>
@@ -31,7 +31,7 @@
 	</properties>
 
 	<dependencies>
-	
+
 		<dependency>
 			<groupId>org.apache.causeway.valuetypes</groupId>
 			<artifactId>causeway-valuetypes-asciidoc-applib</artifactId>
diff --git a/valuetypes/asciidoc/ui/wicket/pom.xml b/valuetypes/asciidoc/ui/wicket/pom.xml
index e92efca76ad..6a4a7b3cc8e 100644
--- a/valuetypes/asciidoc/ui/wicket/pom.xml
+++ b/valuetypes/asciidoc/ui/wicket/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-asciidoc-ui</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-asciidoc-ui-wkt</artifactId>
diff --git a/valuetypes/jodatime/applib/pom.xml b/valuetypes/jodatime/applib/pom.xml
index 3f4567b6286..249291ab48d 100644
--- a/valuetypes/jodatime/applib/pom.xml
+++ b/valuetypes/jodatime/applib/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-jodatime</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-jodatime-applib</artifactId>
diff --git a/valuetypes/jodatime/integration/pom.xml b/valuetypes/jodatime/integration/pom.xml
index a40a5fde5aa..72e7bfb5e47 100644
--- a/valuetypes/jodatime/integration/pom.xml
+++ b/valuetypes/jodatime/integration/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-jodatime</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-jodatime-integration</artifactId>
@@ -46,7 +46,7 @@
             <artifactId>causeway-core-internaltestsupport</artifactId>
             <scope>test</scope>
         </dependency>
-		
+
 	</dependencies>
 
 </project>
diff --git a/valuetypes/jodatime/pom.xml b/valuetypes/jodatime/pom.xml
index 239af95f219..631a0a60b90 100644
--- a/valuetypes/jodatime/pom.xml
+++ b/valuetypes/jodatime/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-jodatime</artifactId>
diff --git a/valuetypes/markdown/applib/pom.xml b/valuetypes/markdown/applib/pom.xml
index 5811dcea8c5..cec05956568 100644
--- a/valuetypes/markdown/applib/pom.xml
+++ b/valuetypes/markdown/applib/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-markdown</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-markdown-applib</artifactId>
diff --git a/valuetypes/markdown/metamodel/pom.xml b/valuetypes/markdown/metamodel/pom.xml
index 904ce899159..a4e7af998de 100644
--- a/valuetypes/markdown/metamodel/pom.xml
+++ b/valuetypes/markdown/metamodel/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-markdown</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-markdown-metamodel</artifactId>
diff --git a/valuetypes/markdown/persistence-jdo/pom.xml b/valuetypes/markdown/persistence-jdo/pom.xml
index 97827802c07..d84ae0bf476 100644
--- a/valuetypes/markdown/persistence-jdo/pom.xml
+++ b/valuetypes/markdown/persistence-jdo/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-markdown</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-markdown-persistence-jdo</artifactId>
diff --git a/valuetypes/markdown/persistence-jpa/pom.xml b/valuetypes/markdown/persistence-jpa/pom.xml
index 536c9f7b59e..e5403c8c502 100644
--- a/valuetypes/markdown/persistence-jpa/pom.xml
+++ b/valuetypes/markdown/persistence-jpa/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-markdown</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-markdown-persistence-jpa</artifactId>
diff --git a/valuetypes/markdown/pom.xml b/valuetypes/markdown/pom.xml
index 1cd667a6672..7ce04373661 100644
--- a/valuetypes/markdown/pom.xml
+++ b/valuetypes/markdown/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-markdown</artifactId>
diff --git a/valuetypes/markdown/ui/pom.xml b/valuetypes/markdown/ui/pom.xml
index 688ad2ea179..3a79cf1e917 100644
--- a/valuetypes/markdown/ui/pom.xml
+++ b/valuetypes/markdown/ui/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-markdown</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-markdown-ui</artifactId>
diff --git a/valuetypes/markdown/ui/wicket/pom.xml b/valuetypes/markdown/ui/wicket/pom.xml
index b26424deabc..706675e5320 100644
--- a/valuetypes/markdown/ui/wicket/pom.xml
+++ b/valuetypes/markdown/ui/wicket/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-markdown-ui</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-markdown-ui-wkt</artifactId>
diff --git a/valuetypes/pom.xml b/valuetypes/pom.xml
index 1819dec036a..b790419c7fb 100644
--- a/valuetypes/pom.xml
+++ b/valuetypes/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/valuetypes/vega/applib/pom.xml b/valuetypes/vega/applib/pom.xml
index 4a9933b483d..b59dcf840d5 100644
--- a/valuetypes/vega/applib/pom.xml
+++ b/valuetypes/vega/applib/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-vega</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-vega-applib</artifactId>
diff --git a/valuetypes/vega/metamodel/pom.xml b/valuetypes/vega/metamodel/pom.xml
index 7045e3b7dd7..6dcf021cb96 100644
--- a/valuetypes/vega/metamodel/pom.xml
+++ b/valuetypes/vega/metamodel/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-vega</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-vega-metamodel</artifactId>
diff --git a/valuetypes/vega/persistence-jdo/pom.xml b/valuetypes/vega/persistence-jdo/pom.xml
index afb85dc6ddd..b571c888273 100644
--- a/valuetypes/vega/persistence-jdo/pom.xml
+++ b/valuetypes/vega/persistence-jdo/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-vega</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-vega-persistence-jdo</artifactId>
diff --git a/valuetypes/vega/persistence-jpa/pom.xml b/valuetypes/vega/persistence-jpa/pom.xml
index 5dfe2e930bd..25f1f1548d4 100644
--- a/valuetypes/vega/persistence-jpa/pom.xml
+++ b/valuetypes/vega/persistence-jpa/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-vega</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-vega-persistence-jpa</artifactId>
diff --git a/valuetypes/vega/pom.xml b/valuetypes/vega/pom.xml
index acc4737b755..ec52c86a59a 100644
--- a/valuetypes/vega/pom.xml
+++ b/valuetypes/vega/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-vega</artifactId>
diff --git a/valuetypes/vega/ui/pom.xml b/valuetypes/vega/ui/pom.xml
index 7e105ac70ed..ccde7bcb050 100644
--- a/valuetypes/vega/ui/pom.xml
+++ b/valuetypes/vega/ui/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-vega</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-vega-ui</artifactId>
@@ -31,7 +31,7 @@
 	</properties>
 
 	<dependencies>
-	
+
 		<dependency>
 			<groupId>org.apache.causeway.valuetypes</groupId>
 			<artifactId>causeway-valuetypes-vega-applib</artifactId>
diff --git a/valuetypes/vega/ui/wicket/pom.xml b/valuetypes/vega/ui/wicket/pom.xml
index 7509ac6c610..69152f25952 100644
--- a/valuetypes/vega/ui/wicket/pom.xml
+++ b/valuetypes/vega/ui/wicket/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.valuetypes</groupId>
 		<artifactId>causeway-valuetypes-vega-ui</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-valuetypes-vega-ui-wkt</artifactId>
diff --git a/viewers/commons/applib/pom.xml b/viewers/commons/applib/pom.xml
index 26abf7644c4..c20e49f6d76 100644
--- a/viewers/commons/applib/pom.xml
+++ b/viewers/commons/applib/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,7 +24,7 @@
     <parent>
     	<groupId>org.apache.causeway.viewer</groupId>
     	<artifactId>causeway-viewer-commons</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-commons-applib</artifactId>
@@ -36,7 +36,7 @@
     </properties>
 
     <dependencies>
-    
+
 		<dependency>
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-metamodel</artifactId>
diff --git a/viewers/commons/model/pom.xml b/viewers/commons/model/pom.xml
index 5439399aa15..dd1c238dcab 100644
--- a/viewers/commons/model/pom.xml
+++ b/viewers/commons/model/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,7 +24,7 @@
     <parent>
     	<groupId>org.apache.causeway.viewer</groupId>
     	<artifactId>causeway-viewer-commons</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-commons-model</artifactId>
@@ -36,7 +36,7 @@
     </properties>
 
     <dependencies>
-    
+
     	<dependency>
             <groupId>org.apache.causeway.viewer</groupId>
             <artifactId>causeway-viewer-commons-applib</artifactId>
@@ -46,7 +46,7 @@
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-runtime</artifactId>
         </dependency>
-        
+
 		<dependency>
 			<groupId>org.webjars</groupId>
 			<artifactId>font-awesome</artifactId>
diff --git a/viewers/commons/pom.xml b/viewers/commons/pom.xml
index 8dd4500a53d..6ec8f09cfe2 100644
--- a/viewers/commons/pom.xml
+++ b/viewers/commons/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,14 +24,14 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
     <groupId>org.apache.causeway.viewer</groupId>
     <artifactId>causeway-viewer-commons</artifactId>
     <name>Apache Causeway Viewer - Commons</name>
-    
+
     <packaging>pom</packaging>
 
     <properties>
@@ -39,7 +39,7 @@
 
     <dependencies>
     </dependencies>
-  
+
     <modules>
     	<module>applib</module>
     	<module>model</module>
diff --git a/viewers/commons/prism/pom.xml b/viewers/commons/prism/pom.xml
index 6c6544d5c7d..93fed1423b9 100644
--- a/viewers/commons/prism/pom.xml
+++ b/viewers/commons/prism/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
     	<artifactId>causeway-viewer-commons</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-commons-prism</artifactId>
diff --git a/viewers/commons/services/pom.xml b/viewers/commons/services/pom.xml
index 8c146627bf0..d923de82eee 100644
--- a/viewers/commons/services/pom.xml
+++ b/viewers/commons/services/pom.xml
@@ -24,7 +24,7 @@
     <parent>
     	<groupId>org.apache.causeway.viewer</groupId>
     	<artifactId>causeway-viewer-commons</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-commons-services</artifactId>
diff --git a/viewers/graphql/applib/pom.xml b/viewers/graphql/applib/pom.xml
index 809d97a754f..288caf9b8e0 100644
--- a/viewers/graphql/applib/pom.xml
+++ b/viewers/graphql/applib/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-graphql</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-graphql-applib</artifactId>
diff --git a/viewers/graphql/model/pom.xml b/viewers/graphql/model/pom.xml
index 88a3917e6c6..10f6c70d778 100644
--- a/viewers/graphql/model/pom.xml
+++ b/viewers/graphql/model/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-graphql</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-graphql-model</artifactId>
diff --git a/viewers/graphql/pom.xml b/viewers/graphql/pom.xml
index a293404d06b..0549d19343d 100644
--- a/viewers/graphql/pom.xml
+++ b/viewers/graphql/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.core</groupId>
 		<artifactId>causeway-core</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 		<relativePath>../../core/pom.xml</relativePath>
 	</parent>
 
diff --git a/viewers/graphql/test/pom.xml b/viewers/graphql/test/pom.xml
index 94a81acbeaa..46bdc7df0c6 100644
--- a/viewers/graphql/test/pom.xml
+++ b/viewers/graphql/test/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-graphql</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-graphql-test</artifactId>
diff --git a/viewers/graphql/test2/pom.xml b/viewers/graphql/test2/pom.xml
index 116a26e991b..163fc8c79b3 100644
--- a/viewers/graphql/test2/pom.xml
+++ b/viewers/graphql/test2/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-graphql</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-graphql-test2</artifactId>
diff --git a/viewers/graphql/testsupport/pom.xml b/viewers/graphql/testsupport/pom.xml
index 1cce68dca90..aef169f932a 100644
--- a/viewers/graphql/testsupport/pom.xml
+++ b/viewers/graphql/testsupport/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-graphql</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-graphql-testsupport</artifactId>
diff --git a/viewers/graphql/viewer/pom.xml b/viewers/graphql/viewer/pom.xml
index 15ab41bc557..807fdbde32c 100644
--- a/viewers/graphql/viewer/pom.xml
+++ b/viewers/graphql/viewer/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-graphql</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-graphql-viewer</artifactId>
diff --git a/viewers/restfulobjects/applib/pom.xml b/viewers/restfulobjects/applib/pom.xml
index 3c2572d04ee..438d67902a6 100644
--- a/viewers/restfulobjects/applib/pom.xml
+++ b/viewers/restfulobjects/applib/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-restfulobjects</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
 	<artifactId>causeway-viewer-restfulobjects-applib</artifactId>
@@ -40,7 +40,7 @@
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-applib</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.causeway.commons</groupId>
             <artifactId>causeway-commons</artifactId>
diff --git a/viewers/restfulobjects/client/pom.xml b/viewers/restfulobjects/client/pom.xml
index bcbe866e698..420326b390f 100644
--- a/viewers/restfulobjects/client/pom.xml
+++ b/viewers/restfulobjects/client/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-restfulobjects</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
 	<artifactId>causeway-viewer-restfulobjects-client</artifactId>
diff --git a/viewers/restfulobjects/jaxrs-resteasy/pom.xml b/viewers/restfulobjects/jaxrs-resteasy/pom.xml
index cd87b2bcbf0..d05d71ca933 100644
--- a/viewers/restfulobjects/jaxrs-resteasy/pom.xml
+++ b/viewers/restfulobjects/jaxrs-resteasy/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (the "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you under the Apache License, Version 2.0 (the "License"); you may not use
+	this file except in compliance with the License. You may obtain a copy of
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+	by applicable law or agreed to in writing, software distributed under the
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+	OF ANY KIND, either express or implied. See the License for the specific
 	language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-restfulobjects</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-restfulobjects-jaxrsresteasy</artifactId>
@@ -113,7 +113,7 @@
 		    	</exclusion>
 		    </exclusions>
 		</dependency>
-		
+
 		<!-- TESTING -->
 
 		<dependency>
diff --git a/viewers/restfulobjects/pom.xml b/viewers/restfulobjects/pom.xml
index 6745dff7bc2..70fddfbbad4 100644
--- a/viewers/restfulobjects/pom.xml
+++ b/viewers/restfulobjects/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
diff --git a/viewers/restfulobjects/rendering/pom.xml b/viewers/restfulobjects/rendering/pom.xml
index ed5ec04e135..4a9b8df3e34 100644
--- a/viewers/restfulobjects/rendering/pom.xml
+++ b/viewers/restfulobjects/rendering/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-restfulobjects</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-restfulobjects-rendering</artifactId>
@@ -45,7 +45,7 @@
             <groupId>org.apache.causeway.viewer</groupId>
             <artifactId>causeway-viewer-restfulobjects-applib</artifactId>
         </dependency>
-        
+
         <!-- TEST DEPENDENCIES -->
         <dependency>
             <groupId>org.apache.causeway.core</groupId>
diff --git a/viewers/restfulobjects/test/pom.xml b/viewers/restfulobjects/test/pom.xml
index ee4c1e0fce4..ffb3ef0a733 100644
--- a/viewers/restfulobjects/test/pom.xml
+++ b/viewers/restfulobjects/test/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-restfulobjects</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-restfulobjects-test</artifactId>
diff --git a/viewers/restfulobjects/testing/pom.xml b/viewers/restfulobjects/testing/pom.xml
index 4ed7b5bc080..ccafd67e058 100644
--- a/viewers/restfulobjects/testing/pom.xml
+++ b/viewers/restfulobjects/testing/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-restfulobjects</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-restfulobjects-testing</artifactId>
diff --git a/viewers/restfulobjects/viewer/pom.xml b/viewers/restfulobjects/viewer/pom.xml
index f8f46a45f8e..9190baffc9a 100644
--- a/viewers/restfulobjects/viewer/pom.xml
+++ b/viewers/restfulobjects/viewer/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-restfulobjects</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-restfulobjects-viewer</artifactId>
diff --git a/viewers/wicket/applib/pom.xml b/viewers/wicket/applib/pom.xml
index 3042629676d..0ef955344f7 100644
--- a/viewers/wicket/applib/pom.xml
+++ b/viewers/wicket/applib/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-wicket</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-wicket-applib</artifactId>
diff --git a/viewers/wicket/model/pom.xml b/viewers/wicket/model/pom.xml
index 37c32d14d32..d6fe7ef489d 100644
--- a/viewers/wicket/model/pom.xml
+++ b/viewers/wicket/model/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
          http://www.apache.org/licenses/LICENSE-2.0
-         
+
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-wicket</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>causeway-viewer-wicket-model</artifactId>
@@ -46,7 +46,7 @@
             <groupId>org.apache.causeway.core</groupId>
             <artifactId>causeway-core-webapp</artifactId>
         </dependency>
-        
+
         <dependency>
 			<groupId>org.apache.causeway.viewer</groupId>
 			<artifactId>causeway-viewer-commons-model</artifactId>
diff --git a/viewers/wicket/pom.xml b/viewers/wicket/pom.xml
index cef681fa91a..05633bfbb0d 100644
--- a/viewers/wicket/pom.xml
+++ b/viewers/wicket/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.core</groupId>
         <artifactId>causeway-core</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
         <relativePath>../../core/pom.xml</relativePath>
     </parent>
 
@@ -33,7 +33,7 @@
     <name>Apache Causeway Viewer - Wicket</name>
 
     <packaging>pom</packaging>
-    
+
     <dependencies>
 		<dependency>
 			<groupId>de.agilecoders.wicket</groupId>
diff --git a/viewers/wicket/ui-test/pom.xml b/viewers/wicket/ui-test/pom.xml
index b0e6e6800b5..08c39921762 100644
--- a/viewers/wicket/ui-test/pom.xml
+++ b/viewers/wicket/ui-test/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-wicket</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-wicket-ui-test</artifactId>
diff --git a/viewers/wicket/ui/pom.xml b/viewers/wicket/ui/pom.xml
index aed4ce823f7..45cea4ffd36 100644
--- a/viewers/wicket/ui/pom.xml
+++ b/viewers/wicket/ui/pom.xml
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.apache.causeway.viewer</groupId>
 		<artifactId>causeway-viewer-wicket</artifactId>
-		<version>${revision}</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>causeway-viewer-wicket-ui</artifactId>
diff --git a/viewers/wicket/viewer/pom.xml b/viewers/wicket/viewer/pom.xml
index bc1bea7c948..55df36480d6 100644
--- a/viewers/wicket/viewer/pom.xml
+++ b/viewers/wicket/viewer/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.causeway.viewer</groupId>
         <artifactId>causeway-viewer-wicket</artifactId>
-        <version>${revision}</version>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
 
     <name>Apache Causeway Viewer - Wicket (Viewer)</name>


(causeway) 33/42: CAUSEWAY-4010: fails replay on conflicting result mappings

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 8c508a40e475fcb1e222ac549370134375f33600
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 18:53:55 2026 +0100

    CAUSEWAY-4010: fails replay on conflicting result mappings
---
 .../applib/dom/replay/ReplayableCommand.java       | 30 ++++----
 .../spi/CommandReplayMappingListenerDefault.java   | 14 +++-
 .../dom/replay/ReplayableCommandMappingTest.java   | 90 ++++++++++++++++++++++
 .../CommandReplayMappingListenerDefaultTest.java   | 24 +++++-
 .../tasks.md                                       | 28 +++----
 5 files changed, 152 insertions(+), 34 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
index 4a20386bef9..aa0547fcaa6 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
@@ -483,19 +483,21 @@ private void copyBookmarkToOidDto(
 
     private Try<Bookmark> tryReplay(final CommandDto commandDto) {
         var tryResultBookmark = replayContext.transactionService()
-            .callTransactional(Propagation.REQUIRES_NEW, () -> replayContext.commandExecutorService()
-                .executeCommand(InteractionContextPolicy.SWITCH_USER_AND_TIME, commandDto)
-                // if we have a replay failure, this throws, which will roll back the surrounding transaction
-                .valueAsNullableElseFail());
-
-        replayContext.transactionService()
-            .runTransactional(Propagation.REQUIRES_NEW, () -> {
-                // handle the replay outcome
-                tryResultBookmark.accept(
-                        this::onReplayError,
-                        bookmarkOpt->onReplaySuccess(bookmarkOpt.orElse(null)));
+            .callTransactional(Propagation.REQUIRES_NEW, () -> {
+                final Bookmark actualResult = replayContext.commandExecutorService()
+                    .executeCommand(InteractionContextPolicy.SWITCH_USER_AND_TIME, commandDto)
+                    // if we have a replay failure, this throws, which will roll back the surrounding transaction
+                    .valueAsNullableElseFail();
+                onReplaySuccess(actualResult);
+                return actualResult;
             });
 
+        tryResultBookmark.ifFailure(ex -> replayContext.transactionService()
+            .callTransactional(Propagation.REQUIRES_NEW, () -> {
+                onReplayError(ex);
+                return null;
+            }));
+
         // in any outcome case (OK or FAILED) the ReplayState may have changed, hence invalidate local cache
         invalidateCachedRecord();
 
@@ -559,10 +561,6 @@ private void notifyReplayResultMapped(
             final Bookmark recordedResult,
             final Bookmark actualResult,
             final CommandLogEntry commandLogEntry) {
-        try {
-            listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
-        } catch (Exception ex) {
-            log.warn("Replay result mapping listener failed", ex);
-        }
+        listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
     }
 }
\ No newline at end of file
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
index 2512909ba88..b118d0b8e73 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
@@ -50,8 +50,20 @@ public void onReplayResultMapped(
             final Bookmark recordedResult,
             final Bookmark actualResult,
             final CommandLogEntry commandLogEntry) {
-        if(!recordedResult.equals(actualResult)) {
+        if(recordedResult.equals(actualResult)) {
+            return;
+        }
+        final Bookmark existingActualResult = actualBookmarkByRecordedBookmark.get(recordedResult);
+        if(existingActualResult == null) {
             actualBookmarkByRecordedBookmark.put(recordedResult, actualResult);
+            return;
+        }
+        if(!existingActualResult.equals(actualResult)) {
+            throw new IllegalStateException(String.format(
+                    "Recorded result bookmark '%s' was already mapped to actual bookmark '%s', cannot remap to '%s'",
+                    recordedResult,
+                    existingActualResult,
+                    actualResult));
         }
     }
 
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
index 4ade6116409..79b0f080698 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
@@ -21,6 +21,7 @@
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
@@ -217,6 +218,95 @@ void notifies_listener_when_recorded_and_actual_results_are_equal() {
         verify(listener).onReplayResultMapped(result, result, commandLogEntry);
     }
 
+    @Test
+    void notifies_listener_in_same_transaction_as_command_execution() throws Exception {
+        UUID interactionId = UUID.randomUUID();
+        CommandDto commandDto = new CommandDto();
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        when(commandLogEntry.getInteractionId()).thenReturn(interactionId);
+        when(commandLogEntry.getCommandDto()).thenReturn(commandDto);
+        when(commandLogEntry.getReplayState()).thenReturn(ReplayState.PENDING);
+
+        CommandLogEntryRepository commandLogEntryRepository = mock(CommandLogEntryRepository.class);
+        when(commandLogEntryRepository.findByInteractionId(interactionId)).thenReturn(Optional.of(commandLogEntry));
+
+        AtomicInteger transactionSequence = new AtomicInteger();
+        AtomicInteger currentTransaction = new AtomicInteger(-1);
+        AtomicInteger commandExecutionTransaction = new AtomicInteger(-1);
+        TransactionService transactionService = mock(TransactionService.class);
+        when(transactionService.callTransactional(any(Propagation.class), any(Callable.class)))
+                .thenAnswer(invocation -> {
+                    @SuppressWarnings("unchecked")
+                    Callable<Object> callable = invocation.getArgument(1);
+                    int transactionId = transactionSequence.incrementAndGet();
+                    currentTransaction.set(transactionId);
+                    Try<Object> result = Try.call(callable);
+                    currentTransaction.set(-1);
+                    return result;
+                });
+
+        CommandExecutorService commandExecutorService = mock(CommandExecutorService.class);
+        when(commandExecutorService.executeCommand(eq(InteractionContextPolicy.SWITCH_USER_AND_TIME), any(CommandDto.class)))
+                .thenAnswer(invocation -> {
+                    commandExecutionTransaction.set(currentTransaction.get());
+                    return Try.success(actualResult);
+                });
+
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+        org.mockito.Mockito.doAnswer(invocation -> {
+            assertThat(currentTransaction.get()).isEqualTo(commandExecutionTransaction.get());
+            return null;
+        }).when(listener).onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+        ReplayContext replayContext = new ReplayContext(
+                null, null, transactionService, commandLogEntryRepository, commandExecutorService, null, List.of(listener));
+
+        Try<ReplayableCommand> result = new ReplayableCommand(interactionId, replayContext).tryReplayOrRetry();
+
+        assertThat(result.isSuccess()).isTrue();
+        verify(listener).onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+    }
+
+    @Test
+    void listener_exception_causes_replay_failure() throws Exception {
+        UUID interactionId = UUID.randomUUID();
+        CommandDto commandDto = new CommandDto();
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        when(commandLogEntry.getInteractionId()).thenReturn(interactionId);
+        when(commandLogEntry.getCommandDto()).thenReturn(commandDto);
+        when(commandLogEntry.getReplayState()).thenReturn(ReplayState.PENDING);
+
+        CommandLogEntryRepository commandLogEntryRepository = mock(CommandLogEntryRepository.class);
+        when(commandLogEntryRepository.findByInteractionId(interactionId)).thenReturn(Optional.of(commandLogEntry));
+
+        TransactionService transactionService = mock(TransactionService.class);
+        when(transactionService.callTransactional(any(Propagation.class), any(Callable.class)))
+                .thenAnswer(invocation -> {
+                    @SuppressWarnings("unchecked")
+                    Callable<Object> callable = invocation.getArgument(1);
+                    return Try.call(callable);
+                });
+
+        CommandExecutorService commandExecutorService = mock(CommandExecutorService.class);
+        when(commandExecutorService.executeCommand(eq(InteractionContextPolicy.SWITCH_USER_AND_TIME), any(CommandDto.class)))
+                .thenReturn(Try.success(actualResult));
+
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+        doThrow(new IllegalStateException("conflicting result mapping"))
+                .when(listener).onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+        ReplayContext replayContext = new ReplayContext(
+                null, null, transactionService, commandLogEntryRepository, commandExecutorService, null, List.of(listener));
+
+        Try<ReplayableCommand> result = new ReplayableCommand(interactionId, replayContext).tryReplayOrRetry();
+
+        assertThat(result.isFailure()).isTrue();
+        verify(listener).onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+        verify(commandLogEntry).saveAnalysis("java.lang.IllegalStateException: conflicting result mapping");
+    }
+
     @Test
     void does_not_notify_listener_when_recorded_result_is_missing() {
         Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
index 862e0a47935..957d7c72693 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
@@ -19,6 +19,7 @@
 package org.apache.causeway.extensions.commandlog.applib.spi;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 
 import org.junit.jupiter.api.Test;
@@ -55,7 +56,20 @@ void equal_recorded_and_actual_bookmark_is_not_recorded() {
     }
 
     @Test
-    void repeated_recorded_bookmark_mapping_uses_latest_actual_bookmark() {
+    void repeated_recorded_bookmark_mapping_with_same_actual_bookmark_is_idempotent() {
+        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+
+        listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+        listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+
+        assertThat(listener.remap(commandLogEntry, recordedResult)).contains(actualResult);
+    }
+
+    @Test
+    void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_rejected() {
         CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
@@ -63,9 +77,13 @@ void repeated_recorded_bookmark_mapping_uses_latest_actual_bookmark() {
         Bookmark secondActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "3");
 
         listener.onReplayResultMapped(recordedResult, firstActualResult, commandLogEntry);
-        listener.onReplayResultMapped(recordedResult, secondActualResult, commandLogEntry);
 
-        assertThat(listener.remap(commandLogEntry, recordedResult)).contains(secondActualResult);
+        assertThatThrownBy(() -> listener.onReplayResultMapped(recordedResult, secondActualResult, commandLogEntry))
+                .isInstanceOf(IllegalStateException.class)
+                .hasMessageContaining("demoInvoice:1")
+                .hasMessageContaining("demoInvoice:2")
+                .hasMessageContaining("demoInvoice:3");
+        assertThat(listener.remap(commandLogEntry, recordedResult)).contains(firstActualResult);
     }
 
     @Test
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md b/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md
index dfc813d768a..025247df1f2 100644
--- a/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md
+++ b/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md
@@ -1,25 +1,25 @@
 ## 1. Default Listener Consistency
 
-- [ ] 1.1 Update `CommandReplayMappingListenerDefault#onReplayResultMapped(...)` to check for an existing non-identity mapping before writing.
-- [ ] 1.2 Throw an exception when a recorded result bookmark is already mapped to a different actual bookmark.
-- [ ] 1.3 Preserve idempotent behavior when a repeated notification uses the same actual bookmark.
-- [ ] 1.4 Preserve no-op behavior when recorded and actual bookmarks are equal.
+- [x] 1.1 Update `CommandReplayMappingListenerDefault#onReplayResultMapped(...)` to check for an existing non-identity mapping before writing.
+- [x] 1.2 Throw an exception when a recorded result bookmark is already mapped to a different actual bookmark.
+- [x] 1.3 Preserve idempotent behavior when a repeated notification uses the same actual bookmark.
+- [x] 1.4 Preserve no-op behavior when recorded and actual bookmarks are equal.
 
 ## 2. Replay Transaction Handling
 
-- [ ] 2.1 Refactor `ReplayableCommand#tryReplay(...)` so command execution and successful result-mapping notification happen inside the same `REQUIRES_NEW` transaction.
-- [ ] 2.2 Preserve separate failure-analysis persistence after the failed command transaction rolls back.
-- [ ] 2.3 Remove exception swallowing for result-mapping notification failures so listener exceptions propagate from the command transaction.
-- [ ] 2.4 Keep target and reference parameter remapping exception handling unchanged.
+- [x] 2.1 Refactor `ReplayableCommand#tryReplay(...)` so command execution and successful result-mapping notification happen inside the same `REQUIRES_NEW` transaction.
+- [x] 2.2 Preserve separate failure-analysis persistence after the failed command transaction rolls back.
+- [x] 2.3 Remove exception swallowing for result-mapping notification failures so listener exceptions propagate from the command transaction.
+- [x] 2.4 Keep target and reference parameter remapping exception handling unchanged.
 
 ## 3. Tests
 
-- [ ] 3.1 Update default listener tests to cover conflict rejection, idempotent duplicate notification, and unchanged mapping after conflict.
-- [ ] 3.2 Update replay mapping tests to verify result-mapping listener exceptions fail replay execution.
-- [ ] 3.3 Add or update transaction-service test stubbing to verify successful listener notification happens in the same transaction as command execution.
-- [ ] 3.4 Verify missing recorded or actual result bookmarks still skip result-mapping notification.
+- [x] 3.1 Update default listener tests to cover conflict rejection, idempotent duplicate notification, and unchanged mapping after conflict.
+- [x] 3.2 Update replay mapping tests to verify result-mapping listener exceptions fail replay execution.
+- [x] 3.3 Add or update transaction-service test stubbing to verify successful listener notification happens in the same transaction as command execution.
+- [x] 3.4 Verify missing recorded or actual result bookmarks still skip result-mapping notification.
 
 ## 4. Verification
 
-- [ ] 4.1 Run the command log applib tests that cover `CommandReplayMappingListenerDefaultTest` and `ReplayableCommandMappingTest`.
-- [ ] 4.2 Run `openspec validate fail-replay-on-conflicting-result-mapping --type change --strict`.
+- [x] 4.1 Run the command log applib tests that cover `CommandReplayMappingListenerDefaultTest` and `ReplayableCommandMappingTest`.
+- [x] 4.2 Run `openspec validate fail-replay-on-conflicting-result-mapping --type change --strict`.


(causeway) 21/42: CAUSEWAY-4010: ensures that the CommandLogEntry's result ...

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 23751efd5e3cd4651068dd26e1eda847efd467de
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 16:41:29 2026 +0100

    CAUSEWAY-4010: ensures that the CommandLogEntry's result ...
    
    ... isn't overwritten during init or sync.  Also minor refactoring
---
 .../extensions/commandlog/applib/dom/CommandLogEntry.java     | 11 ++++++++---
 .../commandlog/applib/dom/replay/ReplayableCommand.java       |  5 +++--
 .../applib/dom/replay/ReplayableCommandMappingTest.java       | 10 +++++-----
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
index f217f514b3f..39b4778ac0a 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntry.java
@@ -174,8 +174,12 @@ public void sync(final Command command) {
         setStartedAt(command.getStartedAt());
         setCompletedAt(command.getCompletedAt());
 
-        setResult(command.getResult());
-        setException(command.getException());
+        if (getReplayState().isPendingOrFailed()) {
+            // we DON'T overwrite the result if we're replaying.
+        } else {
+            setResult(command.getResult());
+            setException(command.getException());
+        }
     }
 
 
@@ -209,7 +213,8 @@ protected void init(
                 setCompletedAt(JavaSqlXMLGregorianCalendarMarshalling.toTimestamp(timings.getCompletedAt()));
             });
 
-        copyOver(commandDto, UserDataKeys.RESULT, value -> this.setResult(Bookmark.parse(value).orElse(null)));
+
+        copyOver(commandDto, UserDataKeys.RESULT, value -> Bookmark.parse(value).ifPresent(this::setResult));
         copyOver(commandDto, UserDataKeys.EXCEPTION, this::setException);
 
         setReplayState(replayState);
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
index d5fbd16481c..5bd2dc772d6 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
@@ -369,7 +369,8 @@ Try<ReplayableCommand> tryReplayOrRetry() {
             return Try.success(null); // guard against disallowed invocation
         return commandLogEntry()
             .filter(ReplayableCommand::canReplayOrRetryOrMarkForExclusion)
-            .map(commandLogEntry->tryReplay(commandDtoForReplay(commandLogEntry))
+                .map(this::commandDtoPossiblyRemappedForReplay)
+            .map(commandDto->tryReplay(commandDto)
                 .mapSuccessAsNullable(__ -> this))
             // if nothing to do, return with an 'empty success'
             .orElseGet(()->Try.success(null));
@@ -390,7 +391,7 @@ String disableReplayOrRetry() {
      * Replays given command in its own transaction and handles {@link ReplayState} transition to
      * either {@link ReplayState#OK} or {@link ReplayState#FAILED}.
      */
-    CommandDto commandDtoForReplay(final CommandLogEntry commandLogEntry) {
+    CommandDto commandDtoPossiblyRemappedForReplay(final CommandLogEntry commandLogEntry) {
         final CommandDto commandDto = copyCommandDto(commandLogEntry.getCommandDto());
         remapTargets(commandLogEntry, commandDto);
         remapReferenceParameters(commandLogEntry, commandDto);
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
index 1e50da971e7..4608640af59 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
@@ -67,7 +67,7 @@ void target_remapping_changes_replay_command_dto() {
                 Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "1")))
                 .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "2")));
 
-        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoPossiblyRemappedForReplay(commandLogEntry);
 
         assertThat(replayCommandDto.getTargets().getOid().get(0).getType()).isEqualTo("simple.SimpleObject");
         assertThat(replayCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("2");
@@ -80,7 +80,7 @@ void missing_target_remapping_leaves_replay_command_dto_unchanged() {
         CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
         CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
 
-        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoPossiblyRemappedForReplay(commandLogEntry);
 
         assertThat(replayCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("1");
         assertThat(recordedCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("1");
@@ -98,7 +98,7 @@ void reference_parameter_remapping_changes_replay_command_dto() {
                 Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "3")))
                 .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "4")));
 
-        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoPossiblyRemappedForReplay(commandLogEntry);
         ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
         ParamDto recordedParameter = ((ActionDto) recordedCommandDto.getMember()).getParameters().getParameter().get(0);
 
@@ -113,7 +113,7 @@ void missing_reference_parameter_remapping_leaves_replay_command_dto_unchanged()
         CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
         CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
 
-        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoPossiblyRemappedForReplay(commandLogEntry);
         ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
         ParamDto recordedParameter = ((ActionDto) recordedCommandDto.getMember()).getParameters().getParameter().get(0);
 
@@ -131,7 +131,7 @@ void non_reference_parameter_is_not_remapped_by_reference_flow() {
         CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
         CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
 
-        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoPossiblyRemappedForReplay(commandLogEntry);
         ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
 
         assertThat(replayParameter.getString()).isEqualTo("unchanged");


(causeway) 05/42: CAUSEWAY-4011: cosmetic fixes

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 54ec82d26fce3e8d0f8b072a297523a93757df4a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jun 3 20:27:03 2026 +0100

    CAUSEWAY-4011: cosmetic fixes
---
 .../replay/CommandExportManager.layout.fallback.xml | 21 ++++++++++++---------
 .../dom/replay/CommandExportManager_nextPage.java   |  4 ++--
 .../replay/CommandExportManager_previousPage.java   |  6 +++---
 .../dom/replay/CommandExportManager_toggleMode.java |  1 +
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
index 07394fd488f..fe52c33b98a 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.layout.fallback.xml
@@ -5,15 +5,18 @@
         </bs:col>
         <bs:col span="3">
             <cpt:fieldSet name=" " id="baseline">
-                <cpt:action id="previousHour"/>
-                <cpt:action id="changeBaseline"/>
-                <cpt:action id="nextHour"/>
-                <cpt:property id="baseline"/>
-            </cpt:fieldSet>
-            <cpt:fieldSet name=" " id="limit">
-                <cpt:action id="previousPage"/>
-                <cpt:action id="nextPage"/>
-                <cpt:property id="limit"/>
+                <cpt:property id="baseline">
+                    <cpt:action id="previousHour"/>
+                    <cpt:action id="changeBaseline"/>
+                    <cpt:action id="nextHour"/>
+                </cpt:property>
+                <cpt:property id="limit">
+                    <cpt:action id="previousPage"/>
+                    <cpt:action id="nextPage"/>
+                </cpt:property>
+                <cpt:property id="mode">
+                    <cpt:action id="ToggleMode"/>
+                </cpt:property>
             </cpt:fieldSet>
         </bs:col>
         <bs:col span="3">
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
index 8a7a1369f10..84021cd3466 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_nextPage.java
@@ -13,9 +13,9 @@
         executionPublishing = Publishing.DISABLED
 )
 @ActionLayout(
-        associateWith = "baseline", sequence = "4",
+        associateWith = "limit", sequence = "2",
         named = "Next Page",
-        position = ActionLayout.Position.PANEL,
+        position = ActionLayout.Position.BELOW,
         describedAs = "Move forward to next page of commands"
 )
 @RequiredArgsConstructor
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
index 67374bae292..4b4a59638b0 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_previousPage.java
@@ -13,9 +13,9 @@
         executionPublishing = Publishing.DISABLED
 )
 @ActionLayout(
-        associateWith = "baseline", sequence = "4",
-        named = "Next Page",
-        position = ActionLayout.Position.PANEL,
+        associateWith = "limit", sequence = "1",
+        named = "Previous",
+        position = ActionLayout.Position.BELOW,
         describedAs = "Move backwards to previous page of commands"
 )
 @RequiredArgsConstructor
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
index c1941bfeec0..83c931da0ff 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager_toggleMode.java
@@ -14,6 +14,7 @@
 )
 @ActionLayout(
         sequence = "1.1",
+        named = "Toggle",
         cssClass = "btn-secondary",
         describedAs = "Toggle between exporting and un-exporting."
 )


(causeway) 16/42: CAUSEWAY-4011: improves paging, cosmetics.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 546677e60f4dbd7995707f433a70fc388a7e013c
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 14:32:55 2026 +0100

    CAUSEWAY-4011: improves paging, cosmetics.
---
 .../extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
index dae0c747ea6..42277774bd1 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
@@ -39,6 +39,7 @@
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_nextPage;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_previousPage;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_toggleMode;
+import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager_replayOrRetryNext;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.HasBaseline_changeBaseline;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_exportSelected;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_makeSelectedExportable;
@@ -101,6 +102,7 @@
         CommandExportManager_toggleMode.class,
         CommandExportManager_changeLimit.class,
         CommandReplayManager_importCommands.class,
+        CommandReplayManager_replayOrRetryNext.class,
         CommandReplayManager_replayOrRetrySelected.class,
         CommandReplayManager_excludeSelectedFromReplay.class,
         CommandReplayManager_deleteSelectedSucceededOrExcluded.class,


(causeway) 40/42: CAUSEWAY-4010: refines persistent replay mapping listener

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit f9297f27f8f49792531b19bc537845528c2d4320
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 23:44:57 2026 +0100

    CAUSEWAY-4010: refines persistent replay mapping listener
---
 .../applib/CausewayModuleExtCommandLogApplib.java  |  4 +-
 ...andReplayResultMapping.columnOrder.fallback.txt |  2 +
 .../applib/dom/CommandReplayResultMapping.java     | 89 +++++++++-------------
 .../CommandReplayResultMapping.layout.fallback.xml | 72 +++++++++++++++++
 .../dom/CommandReplayResultMapping.layout.xml      | 41 ----------
 ...mmandReplayResultMappingRepositoryAbstract.java |  3 +-
 ...a => CommandReplayMappingListenerInMemory.java} | 10 +--
 ... CommandReplayMappingListenerInMemoryTest.java} | 24 +++---
 ...CommandReplayMappingListenerPersistentTest.java | 42 +++-------
 .../jdo/dom/CommandReplayResultMapping.java        | 34 ++++-----
 .../jpa/dom/CommandReplayResultMapping.java        | 37 ++++-----
 .../design.md                                      | 10 +--
 .../proposal.md                                    |  2 +-
 .../spec.md                                        |  8 +-
 .../tasks.md                                       |  2 +-
 15 files changed, 180 insertions(+), 200 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
index cfcb63e8040..ce59b080a05 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
@@ -63,7 +63,7 @@
 import org.apache.causeway.extensions.commandlog.applib.job.BackgroundCommandsJobControl;
 import org.apache.causeway.extensions.commandlog.applib.job.RunBackgroundCommandsJob;
 import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListener;
-import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListenerDefault;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListenerInMemory;
 import org.apache.causeway.extensions.commandlog.applib.spi.RunBackgroundCommandsJobListener;
 import org.apache.causeway.extensions.commandlog.applib.subscriber.CommandSubscriberForCommandLog;
 import org.springframework.context.annotation.Bean;
@@ -113,7 +113,7 @@
         // @Component's
         RunBackgroundCommandsJob.class,
         RunBackgroundCommandsJobListener.Noop.class,
-        CommandReplayMappingListenerDefault.BeanFactory.class,
+        CommandReplayMappingListenerInMemory.BeanFactory.class,
 
         // @Service's
         CommandSubscriberForCommandLog.class,
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.columnOrder.fallback.txt b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.columnOrder.fallback.txt
new file mode 100644
index 00000000000..d040508db7f
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.columnOrder.fallback.txt
@@ -0,0 +1,2 @@
+recordedBookmark
+actualBookmark
\ No newline at end of file
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.java
index d13ef46c2d3..6b057606d15 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.java
@@ -18,15 +18,21 @@
  */
 package org.apache.causeway.extensions.commandlog.applib.dom;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
 import javax.inject.Named;
 
 import org.apache.causeway.applib.annotation.DomainObject;
 import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Editing;
+import org.apache.causeway.applib.annotation.ObjectSupport;
 import org.apache.causeway.applib.annotation.Programmatic;
 import org.apache.causeway.applib.annotation.Property;
 import org.apache.causeway.applib.annotation.Publishing;
 import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.applib.util.TitleBuffer;
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 
 import lombok.NoArgsConstructor;
@@ -38,6 +44,7 @@
         entityChangePublishing = Publishing.DISABLED
 )
 @DomainObjectLayout(
+        cssClassFa = "fa-solid fa-arrow-right-from-bracket",
         titleUiEvent = CommandReplayResultMapping.TitleUiEvent.class,
         iconUiEvent = CommandReplayResultMapping.IconUiEvent.class,
         cssClassUiEvent = CommandReplayResultMapping.CssClassUiEvent.class,
@@ -61,70 +68,48 @@ public static class Nq {
         public static final String FIND_BY_RECORDED_BOOKMARK = LOGICAL_TYPE_NAME + ".findByRecordedBookmark";
     }
 
-    @Programmatic
-    public void init(final Bookmark recordedBookmark, final Bookmark actualBookmark) {
-        setRecordedLogicalTypeName(recordedBookmark.getLogicalTypeName());
-        setRecordedIdentifier(recordedBookmark.getIdentifier());
-        setActualLogicalTypeName(actualBookmark.getLogicalTypeName());
-        setActualIdentifier(actualBookmark.getIdentifier());
-    }
-
-    @Programmatic
-    public Bookmark getRecordedBookmark() {
-        return Bookmark.forLogicalTypeNameAndIdentifier(getRecordedLogicalTypeName(), getRecordedIdentifier());
+    @ObjectSupport public String title() {
+        return new TitleBuffer()
+                .append(getRecordedBookmark())
+                .append(" → ")
+                .append(getActualBookmark())
+                .toString();
     }
 
     @Programmatic
-    public Bookmark getActualBookmark() {
-        return Bookmark.forLogicalTypeNameAndIdentifier(getActualLogicalTypeName(), getActualIdentifier());
-    }
-
-    @Property
-    @RecordedLogicalTypeName
-    public abstract String getRecordedLogicalTypeName();
-    public abstract void setRecordedLogicalTypeName(String recordedLogicalTypeName);
-
-    @Property
-    @RecordedIdentifier
-    public abstract String getRecordedIdentifier();
-    public abstract void setRecordedIdentifier(String recordedIdentifier);
-
-    @Property
-    @ActualLogicalTypeName
-    public abstract String getActualLogicalTypeName();
-    public abstract void setActualLogicalTypeName(String actualLogicalTypeName);
-
-    @Property
-    @ActualIdentifier
-    public abstract String getActualIdentifier();
-    public abstract void setActualIdentifier(String actualIdentifier);
-
-    public @interface RecordedLogicalTypeName {
-        String NAME = "recordedLogicalTypeName";
-        int MAX_LENGTH = 255;
-        boolean NULLABLE = false;
-        String ALLOWS_NULL = "false";
+    public void init(final Bookmark recordedBookmark, final Bookmark actualBookmark) {
+        setRecordedBookmark(recordedBookmark);
+        setActualBookmark(actualBookmark);
     }
 
-    public @interface RecordedIdentifier {
-        String NAME = "recordedIdentifier";
+    @Property(
+            domainEvent = RecordedBookmark.DomainEvent.class
+    )
+    @java.lang.annotation.Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface RecordedBookmark {
+        class DomainEvent extends CausewayModuleExtCommandLogApplib.PropertyDomainEvent<CommandReplayResultMapping, Bookmark> {}
         int MAX_LENGTH = 2000;
         boolean NULLABLE = false;
         String ALLOWS_NULL = "false";
     }
-
-    public @interface ActualLogicalTypeName {
-        String NAME = "actualLogicalTypeName";
-        int MAX_LENGTH = 255;
-        boolean NULLABLE = false;
-        String ALLOWS_NULL = "false";
-    }
-
-    public @interface ActualIdentifier {
-        String NAME = "actualIdentifier";
+    @RecordedBookmark
+    public abstract Bookmark getRecordedBookmark();
+    public abstract void setRecordedBookmark(Bookmark recordedBookmark);
+
+    @Property(
+            domainEvent = ActualBookmark.DomainEvent.class
+    )
+    @java.lang.annotation.Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface ActualBookmark {
+        class DomainEvent extends CausewayModuleExtCommandLogApplib.PropertyDomainEvent<CommandReplayResultMapping, Bookmark> {}
         int MAX_LENGTH = 2000;
         boolean NULLABLE = false;
         String ALLOWS_NULL = "false";
     }
+    @ActualBookmark
+    public abstract Bookmark getActualBookmark();
+    public abstract void setActualBookmark(Bookmark actualBookmark);
 
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.fallback.xml b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.fallback.xml
new file mode 100644
index 00000000000..56df2c7c863
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.fallback.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~        http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+<bs:grid xsi:schemaLocation="https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd https://causeway.apache.org/applib/layout/links https://causeway.apache.org/applib/layout/links/links.xsd https://causeway.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+         xmlns:bs="https://causeway.apache.org/applib/layout/grid/bootstrap3"
+         xmlns:cpt="https://causeway.apache.org/applib/layout/component"
+         xmlns:lnk="https://causeway.apache.org/applib/layout/links"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <bs:row>
+        <bs:col span="7" unreferencedActions="true">
+            <cpt:domainObject/>
+        </bs:col>
+        <bs:col span="5">
+            <bs:tabGroup>
+                <bs:tab name="Identity">
+                    <bs:row>
+                        <bs:col span="12">
+                            <cpt:fieldSet name="Identity" id="identity"/>
+                        </bs:col>
+                    </bs:row>
+                </bs:tab>
+                <bs:tab name="Other">
+                    <bs:row>
+                        <bs:col span="12">
+                            <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+                        </bs:col>
+                    </bs:row>
+                </bs:tab>
+                <bs:tab name="Metadata">
+                    <bs:row>
+                        <bs:col span="12">
+                            <cpt:fieldSet name="Metadata" id="metadata"/>
+                        </bs:col>
+                    </bs:row>
+                </bs:tab>
+            </bs:tabGroup>
+        </bs:col>
+    </bs:row>
+    <bs:row>
+        <bs:col span="6">
+            <cpt:fieldSet name="Recorded Bookmark" id="recorded">
+                <cpt:property id="recordedBookmark"/>
+            </cpt:fieldSet>
+        </bs:col>
+        <bs:col span="6">
+            <cpt:fieldSet name="Actual Bookmark" id="actual">
+                <cpt:property id="actualBookmark"/>
+            </cpt:fieldSet>
+        </bs:col>
+    </bs:row>
+    <bs:row>
+        <bs:col span="12">
+            <bs:tabGroup unreferencedCollections="true"/>
+        </bs:col>
+    </bs:row>
+</bs:grid>
\ No newline at end of file
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.xml b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.xml
deleted file mode 100644
index e6d1718bc2b..00000000000
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
-  ~  Licensed to the Apache Software Foundation (ASF) under one
-  ~  or more contributor license agreements.  See the NOTICE file
-  ~  distributed with this work for additional information
-  ~  regarding copyright ownership.  The ASF licenses this file
-  ~  to you under the Apache License, Version 2.0 (the
-  ~  "License"); you may not use this file except in compliance
-  ~  with the License.  You may obtain a copy of the License at
-  ~
-  ~        http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~  Unless required by applicable law or agreed to in writing,
-  ~  software distributed under the License is distributed on an
-  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  KIND, either express or implied.  See the License for the
-  ~  specific language governing permissions and limitations
-  ~  under the License.
-  -->
-<bs:grid xsi:schemaLocation="https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd https://causeway.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns:c="https://causeway.apache.org/applib/layout/component" xmlns:bs="https://causeway.apache.org/applib/layout/grid/bootstrap3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-    <bs:row>
-        <bs:col span="12" unreferencedActions="true">
-            <c:domainObject bookmarking="AS_ROOT"/>
-        </bs:col>
-    </bs:row>
-    <bs:row>
-        <bs:col span="6">
-            <c:fieldSet name="Recorded Bookmark" id="recorded">
-                <c:property id="recordedLogicalTypeName"/>
-                <c:property id="recordedIdentifier"/>
-            </c:fieldSet>
-        </bs:col>
-        <bs:col span="6">
-            <c:fieldSet name="Actual Bookmark" id="actual">
-                <c:property id="actualLogicalTypeName"/>
-                <c:property id="actualIdentifier"/>
-            </c:fieldSet>
-        </bs:col>
-    </bs:row>
-</bs:grid>
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepositoryAbstract.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepositoryAbstract.java
index 5e32fcb3482..f3753e063c8 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepositoryAbstract.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepositoryAbstract.java
@@ -51,8 +51,7 @@ protected CommandReplayResultMappingRepositoryAbstract(final Class<C> entityClas
     public Optional<CommandReplayResultMapping> findByRecordedBookmark(final Bookmark recordedBookmark) {
         return _Casts.uncheckedCast(repositoryService().firstMatch(
                 Query.named(entityClass, CommandReplayResultMapping.Nq.FIND_BY_RECORDED_BOOKMARK)
-                        .withParameter("recordedLogicalTypeName", recordedBookmark.getLogicalTypeName())
-                        .withParameter("recordedIdentifier", recordedBookmark.getIdentifier())));
+                        .withParameter("recordedBookmark", recordedBookmark)));
     }
 
     @Override
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerInMemory.java
similarity index 92%
rename from extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
rename to extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerInMemory.java
index 47045684b84..600e31242b1 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerInMemory.java
@@ -40,16 +40,16 @@
  * @since 2.1 {@index}
  */
 @Log4j2
-public class CommandReplayMappingListenerDefault implements CommandReplayMappingListener {
+public class CommandReplayMappingListenerInMemory implements CommandReplayMappingListener {
 
     private final Map<Bookmark, Bookmark> actualBookmarkByRecordedBookmark = new HashMap<>();
     private final OnConflictPolicy onConflictPolicy;
 
-    public CommandReplayMappingListenerDefault() {
+    public CommandReplayMappingListenerInMemory() {
         this(OnConflictPolicy.THROW_EXCEPTION);
     }
 
-    CommandReplayMappingListenerDefault(final OnConflictPolicy onConflictPolicy) {
+    CommandReplayMappingListenerInMemory(final OnConflictPolicy onConflictPolicy) {
         this.onConflictPolicy = onConflictPolicy;
     }
 
@@ -97,9 +97,9 @@ public static class BeanFactory {
                 name = "storage-strategy",
                 havingValue = "IN_MEMORY",
                 matchIfMissing = true)
-        CommandReplayMappingListener commandReplayMappingListenerDefault(
+        CommandReplayMappingListener commandReplayMappingListenerInMemory(
                 final CausewayConfiguration causewayConfiguration) {
-            return new CommandReplayMappingListenerDefault(causewayConfiguration
+            return new CommandReplayMappingListenerInMemory(causewayConfiguration
                     .getExtensions()
                     .getCommandLog()
                     .getReplayResultMapping()
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerInMemoryTest.java
similarity index 89%
rename from extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
rename to extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerInMemoryTest.java
index 3cc3dee61e3..1de7aacc521 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerInMemoryTest.java
@@ -37,11 +37,11 @@
 import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping.OnConflictPolicy;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 
-class CommandReplayMappingListenerDefaultTest {
+class CommandReplayMappingListenerInMemoryTest {
 
     @Test
     void records_result_mapping_and_returns_it_from_remap() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandReplayMappingListenerInMemory listener = new CommandReplayMappingListenerInMemory();
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -53,7 +53,7 @@ void records_result_mapping_and_returns_it_from_remap() {
 
     @Test
     void equal_recorded_and_actual_bookmark_is_not_recorded() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandReplayMappingListenerInMemory listener = new CommandReplayMappingListenerInMemory();
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
 
@@ -64,7 +64,7 @@ void equal_recorded_and_actual_bookmark_is_not_recorded() {
 
     @Test
     void repeated_recorded_bookmark_mapping_with_same_actual_bookmark_is_idempotent() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandReplayMappingListenerInMemory listener = new CommandReplayMappingListenerInMemory();
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -77,7 +77,7 @@ void repeated_recorded_bookmark_mapping_with_same_actual_bookmark_is_idempotent(
 
     @Test
     void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_rejected_by_default() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandReplayMappingListenerInMemory listener = new CommandReplayMappingListenerInMemory();
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -95,7 +95,7 @@ void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_reject
 
     @Test
     void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_logged_and_ignored_when_configured() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault(OnConflictPolicy.LOG_AND_CONTINUE);
+        CommandReplayMappingListenerInMemory listener = new CommandReplayMappingListenerInMemory(OnConflictPolicy.LOG_AND_CONTINUE);
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -109,7 +109,7 @@ void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_logged
 
     @Test
     void unmapped_bookmark_returns_no_replacement() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        CommandReplayMappingListenerInMemory listener = new CommandReplayMappingListenerInMemory();
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedBookmark = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
 
@@ -120,10 +120,10 @@ void unmapped_bookmark_returns_no_replacement() {
     void autoconfiguration_creates_default_listener_when_missing() {
         try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
                 CausewayConfigurationForTest.class,
-                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+                CommandReplayMappingListenerInMemory.BeanFactory.class)) {
 
             assertThat(context.getBean(CommandReplayMappingListener.class))
-                    .isInstanceOf(CommandReplayMappingListenerDefault.class);
+                    .isInstanceOf(CommandReplayMappingListenerInMemory.class);
         }
     }
 
@@ -132,7 +132,7 @@ void autoconfiguration_backs_off_when_custom_listener_exists() {
         try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
                 CausewayConfigurationForTest.class,
                 CustomListenerConfiguration.class,
-                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+                CommandReplayMappingListenerInMemory.BeanFactory.class)) {
 
             assertThat(context.getBeansOfType(CommandReplayMappingListener.class))
                     .hasSize(1)
@@ -147,7 +147,7 @@ void autoconfiguration_does_not_create_in_memory_listener_when_persistent_storag
         try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
             context.getEnvironment().getPropertySources().addFirst(new MapPropertySource("test", Map.of(
                     "causeway.extensions.command-log.replay-result-mapping.storage-strategy", "PERSISTENT")));
-            context.register(CausewayConfigurationForTest.class, CommandReplayMappingListenerDefault.BeanFactory.class);
+            context.register(CausewayConfigurationForTest.class, CommandReplayMappingListenerInMemory.BeanFactory.class);
             context.refresh();
 
             assertThat(context.getBeansOfType(CommandReplayMappingListener.class)).isEmpty();
@@ -158,7 +158,7 @@ void autoconfiguration_does_not_create_in_memory_listener_when_persistent_storag
     void autoconfiguration_uses_configured_conflict_policy() {
         try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
                 LogAndContinueCausewayConfigurationForTest.class,
-                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+                CommandReplayMappingListenerInMemory.BeanFactory.class)) {
             CommandReplayMappingListener listener = context.getBean(CommandReplayMappingListener.class);
             CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
             Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistentTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistentTest.java
index 95d614d84d0..67d9556f955 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistentTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistentTest.java
@@ -232,49 +232,27 @@ public CommandReplayResultMapping createAndPersist(final Bookmark recordedBookma
 
     static class FakeMapping extends CommandReplayResultMapping {
 
-        private String recordedLogicalTypeName;
-        private String recordedIdentifier;
-        private String actualLogicalTypeName;
-        private String actualIdentifier;
+        private Bookmark recordedBookmark;
+        private Bookmark actualBookmark;
 
         @Override
-        public String getRecordedLogicalTypeName() {
-            return recordedLogicalTypeName;
+        public Bookmark getRecordedBookmark() {
+            return recordedBookmark;
         }
 
         @Override
-        public void setRecordedLogicalTypeName(final String recordedLogicalTypeName) {
-            this.recordedLogicalTypeName = recordedLogicalTypeName;
+        public void setRecordedBookmark(final Bookmark recordedBookmark) {
+            this.recordedBookmark = recordedBookmark;
         }
 
         @Override
-        public String getRecordedIdentifier() {
-            return recordedIdentifier;
+        public Bookmark getActualBookmark() {
+            return actualBookmark;
         }
 
         @Override
-        public void setRecordedIdentifier(final String recordedIdentifier) {
-            this.recordedIdentifier = recordedIdentifier;
-        }
-
-        @Override
-        public String getActualLogicalTypeName() {
-            return actualLogicalTypeName;
-        }
-
-        @Override
-        public void setActualLogicalTypeName(final String actualLogicalTypeName) {
-            this.actualLogicalTypeName = actualLogicalTypeName;
-        }
-
-        @Override
-        public String getActualIdentifier() {
-            return actualIdentifier;
-        }
-
-        @Override
-        public void setActualIdentifier(final String actualIdentifier) {
-            this.actualIdentifier = actualIdentifier;
+        public void setActualBookmark(final Bookmark actualBookmark) {
+            this.actualBookmark = actualBookmark;
         }
     }
 }
diff --git a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMapping.java b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMapping.java
index 42ac70f9c9a..872e5b3798f 100644
--- a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMapping.java
+++ b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMapping.java
@@ -24,6 +24,7 @@
 import javax.jdo.annotations.Index;
 import javax.jdo.annotations.Indices;
 import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.Persistent;
 import javax.jdo.annotations.Queries;
 import javax.jdo.annotations.Query;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -32,6 +33,7 @@
 import org.apache.causeway.applib.annotation.Editing;
 import org.apache.causeway.applib.annotation.Publishing;
 import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
+import org.apache.causeway.applib.services.bookmark.Bookmark;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.Nq;
 
 import lombok.Getter;
@@ -43,20 +45,18 @@
         schema = CommandReplayResultMapping.SCHEMA,
         table = CommandReplayResultMapping.TABLE)
 @Indices({
-        @Index(name = "CommandReplayResultMapping__recorded__IDX", members = { "recordedLogicalTypeName", "recordedIdentifier" }, unique = "true"),
+        @Index(name = "CommandReplayResultMapping__recordedBookmark__IDX", members = { "recordedBookmark" }, unique = "true"),
 })
 @Queries({
     @Query(
             name = Nq.FIND,
             value = "SELECT "
-                  + "  FROM " + CommandReplayResultMapping.FQCN + " "
-                  + " ORDER BY recordedLogicalTypeName ASC, recordedIdentifier ASC"),
+                  + "  FROM " + CommandReplayResultMapping.FQCN),
     @Query(
             name = Nq.FIND_BY_RECORDED_BOOKMARK,
             value = "SELECT "
                   + "  FROM " + CommandReplayResultMapping.FQCN + " "
-                  + " WHERE recordedLogicalTypeName == :recordedLogicalTypeName "
-                  + "    && recordedIdentifier == :recordedIdentifier")
+                  + " WHERE recordedBookmark == :recordedBookmark")
 })
 @Named(org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.LOGICAL_TYPE_NAME)
 @DomainObject(
@@ -70,24 +70,16 @@ public class CommandReplayResultMapping
 
     public static final String FQCN = "org.apache.causeway.extensions.commandlog.jdo.dom.CommandReplayResultMapping";
 
-    @Column(allowsNull = RecordedLogicalTypeName.ALLOWS_NULL, length = RecordedLogicalTypeName.MAX_LENGTH)
-    @RecordedLogicalTypeName
-    @Getter @Setter
-    private String recordedLogicalTypeName;
-
-    @Column(allowsNull = RecordedIdentifier.ALLOWS_NULL, length = RecordedIdentifier.MAX_LENGTH)
-    @RecordedIdentifier
-    @Getter @Setter
-    private String recordedIdentifier;
-
-    @Column(allowsNull = ActualLogicalTypeName.ALLOWS_NULL, length = ActualLogicalTypeName.MAX_LENGTH)
-    @ActualLogicalTypeName
+    @Persistent
+    @Column(allowsNull = RecordedBookmark.ALLOWS_NULL, length = RecordedBookmark.MAX_LENGTH)
+    @RecordedBookmark
     @Getter @Setter
-    private String actualLogicalTypeName;
+    private Bookmark recordedBookmark;
 
-    @Column(allowsNull = ActualIdentifier.ALLOWS_NULL, length = ActualIdentifier.MAX_LENGTH)
-    @ActualIdentifier
+    @Persistent
+    @Column(allowsNull = ActualBookmark.ALLOWS_NULL, length = ActualBookmark.MAX_LENGTH)
+    @ActualBookmark
     @Getter @Setter
-    private String actualIdentifier;
+    private Bookmark actualBookmark;
 
 }
diff --git a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMapping.java b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMapping.java
index 857361881c9..0193640c4cd 100644
--- a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMapping.java
+++ b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMapping.java
@@ -20,6 +20,7 @@
 
 import javax.inject.Named;
 import javax.persistence.Column;
+import javax.persistence.Convert;
 import javax.persistence.Entity;
 import javax.persistence.EntityListeners;
 import javax.persistence.GeneratedValue;
@@ -35,8 +36,10 @@
 import org.apache.causeway.applib.annotation.Editing;
 import org.apache.causeway.applib.annotation.Publishing;
 import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
+import org.apache.causeway.applib.services.bookmark.Bookmark;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.Nq;
 import org.apache.causeway.persistence.jpa.applib.integration.CausewayEntityListener;
+import org.apache.causeway.persistence.jpa.integration.typeconverters.applib.CausewayBookmarkConverter;
 
 import lombok.Getter;
 import lombok.NoArgsConstructor;
@@ -47,24 +50,22 @@
         schema = CommandReplayResultMapping.SCHEMA,
         name = CommandReplayResultMapping.TABLE,
         indexes = {
-                @Index(name = "CommandReplayResultMapping__recorded__IDX", columnList = "recordedLogicalTypeName, recordedIdentifier")
+                @Index(name = "CommandReplayResultMapping__recordedBookmark__IDX", columnList = "recordedBookmark")
         },
         uniqueConstraints = {
-                @UniqueConstraint(name = "CommandReplayResultMapping__recorded__UNQ", columnNames = { "recordedLogicalTypeName", "recordedIdentifier" })
+                @UniqueConstraint(name = "CommandReplayResultMapping__recordedBookmark__UNQ", columnNames = { "recordedBookmark" })
         }
 )
 @NamedQueries({
     @NamedQuery(
             name = Nq.FIND,
             query = "SELECT m "
-                  + "  FROM CommandReplayResultMapping m "
-                  + " ORDER BY m.recordedLogicalTypeName ASC, m.recordedIdentifier ASC"),
+                  + "  FROM CommandReplayResultMapping m"),
     @NamedQuery(
             name = Nq.FIND_BY_RECORDED_BOOKMARK,
             query = "SELECT m "
                   + "  FROM CommandReplayResultMapping m "
-                  + " WHERE m.recordedLogicalTypeName = :recordedLogicalTypeName "
-                  + "   AND m.recordedIdentifier = :recordedIdentifier")
+                  + " WHERE m.recordedBookmark = :recordedBookmark")
 })
 @Named(org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.LOGICAL_TYPE_NAME)
 @DomainObject(
@@ -82,24 +83,16 @@ public class CommandReplayResultMapping
     @Getter @Setter
     private Long id;
 
-    @Column(nullable = RecordedLogicalTypeName.NULLABLE, length = RecordedLogicalTypeName.MAX_LENGTH)
-    @RecordedLogicalTypeName
-    @Getter @Setter
-    private String recordedLogicalTypeName;
-
-    @Column(nullable = RecordedIdentifier.NULLABLE, length = RecordedIdentifier.MAX_LENGTH)
-    @RecordedIdentifier
-    @Getter @Setter
-    private String recordedIdentifier;
-
-    @Column(nullable = ActualLogicalTypeName.NULLABLE, length = ActualLogicalTypeName.MAX_LENGTH)
-    @ActualLogicalTypeName
+    @Convert(converter = CausewayBookmarkConverter.class)
+    @Column(nullable = RecordedBookmark.NULLABLE, length = RecordedBookmark.MAX_LENGTH)
+    @RecordedBookmark
     @Getter @Setter
-    private String actualLogicalTypeName;
+    private Bookmark recordedBookmark;
 
-    @Column(nullable = ActualIdentifier.NULLABLE, length = ActualIdentifier.MAX_LENGTH)
-    @ActualIdentifier
+    @Convert(converter = CausewayBookmarkConverter.class)
+    @Column(nullable = ActualBookmark.NULLABLE, length = ActualBookmark.MAX_LENGTH)
+    @ActualBookmark
     @Getter @Setter
-    private String actualIdentifier;
+    private Bookmark actualBookmark;
 
 }
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/design.md b/openspec/changes/persistent-command-replay-mapping-listener/design.md
index 8ef7e095794..e06dd7526d8 100644
--- a/openspec/changes/persistent-command-replay-mapping-listener/design.md
+++ b/openspec/changes/persistent-command-replay-mapping-listener/design.md
@@ -1,6 +1,6 @@
 ## Context
 
-The command log applib currently provides a built-in `CommandReplayMappingListenerDefault` that remembers non-identity replay result mappings in an in-memory `HashMap`.
+The command log applib currently provides a built-in `CommandReplayMappingListenerInMemory` that remembers non-identity replay result mappings in an in-memory `HashMap`.
 The listener also remaps later replay inputs by looking up recorded bookmarks in that map.
 A recently added conflict policy controls whether conflicting mappings throw an exception or are logged and ignored.
 
@@ -15,7 +15,7 @@ A persistent implementation needs to follow the existing command log persistence
 - Preserve the current in-memory listener as the default storage strategy.
 - Use a configuration property to choose between in-memory and persistent built-in storage.
 - Keep custom `CommandReplayMappingListener` beans authoritative over both built-in implementations.
-- Persist recorded and actual bookmarks as logical type plus identifier columns.
+- Persist recorded and actual bookmarks as `Bookmark` value type properties.
 - Provide abstract applib entity and repository types plus concrete JDO and JPA implementations.
 - Provide menu access and fallback layout metadata for the persisted mappings.
 - Reuse the existing conflict policy semantics for both built-in listener implementations.
@@ -38,8 +38,8 @@ A persistent implementation needs to follow the existing command log persistence
   Its bean factory should be guarded by no custom `CommandReplayMappingListener` and by storage strategy `IN_MEMORY`.
   The persistent listener should use the same no-custom-listener guard and a storage strategy `PERSISTENT` guard.
 
-- Introduce an abstract applib entity, for example `CommandReplayResultMapping`, with fields for recorded logical type, recorded identifier, actual logical type, and actual identifier.
-  Store the bookmark components separately rather than serializing a whole bookmark string so queries and uniqueness constraints can target recorded bookmark identity directly.
+- Introduce an abstract applib entity, for example `CommandReplayResultMapping`, with `Bookmark` fields for the recorded and actual bookmarks.
+  Reuse the existing `Bookmark` value type persistence support, as `CommandLogEntry` does for target and result bookmarks.
 
 - Introduce an abstract applib repository, for example `CommandReplayResultMappingRepository`, with operations to find by recorded bookmark, list all mappings, and create or retrieve mappings.
   Concrete JDO and JPA repositories should follow the `CommandLogEntryRepository` pattern and live in the matching persistence modules.
@@ -53,7 +53,7 @@ A persistent implementation needs to follow the existing command log persistence
   Concrete persistence modules provide the entity implementations that make the returned objects renderable.
 
 - Add a `.fallback.layout.xml` for the abstract applib mapping entity or for each concrete entity following existing command log layout conventions.
-  The layout should expose recorded and actual bookmark components and hide technical persistence details where appropriate.
+  The layout should expose recorded and actual bookmark properties and hide technical persistence details where appropriate.
 
 ## Risks / Trade-offs
 
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/proposal.md b/openspec/changes/persistent-command-replay-mapping-listener/proposal.md
index 01579f9e1a6..95f4e9ab423 100644
--- a/openspec/changes/persistent-command-replay-mapping-listener/proposal.md
+++ b/openspec/changes/persistent-command-replay-mapping-listener/proposal.md
@@ -6,7 +6,7 @@ Replay workflows that span JVM restarts, multiple operators, or long-running imp
 ## What Changes
 
 - Add a persistent `CommandReplayMappingListener` implementation backed by command log persistence entities.
-- Store recorded bookmark logical type and identifier together with actual bookmark logical type and identifier, matching the structure used by the in-memory map but persisted in the datastore.
+- Store recorded and actual bookmarks as `Bookmark` value types, matching the command log entry result/target mapping style but persisted in the datastore.
 - Add abstract applib domain and repository types for replay result mappings, plus concrete JDO and JPA implementations following the `CommandLogEntry` pattern.
 - Add configuration to select the built-in listener storage strategy, with `IN_MEMORY` preserving the current default and `PERSISTENT` enabling the new persistent implementation.
 - Rework the current default in-memory listener so it is conditionally enabled only when the storage strategy is `IN_MEMORY` and no custom listener exists.
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md b/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
index 49ad8c327d4..189ef0b2f8a 100644
--- a/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
+++ b/openspec/changes/persistent-command-replay-mapping-listener/specs/persistent-command-replay-mapping-listener/spec.md
@@ -2,7 +2,7 @@
 
 ### Requirement: Persistent replay mapping listener records result mappings
 The system SHALL provide a persistent command replay mapping listener that records non-identity replay result mappings by recorded result bookmark.
-The persisted mapping SHALL store the recorded bookmark logical type, recorded bookmark identifier, actual bookmark logical type, and actual bookmark identifier.
+The persisted mapping SHALL store the recorded bookmark and actual bookmark as bookmark value type properties.
 When replay notifies the persistent listener with equal recorded and actual result bookmarks, the listener MUST NOT persist a mapping for that notification.
 When no mapping exists for a recorded result bookmark, the persistent listener SHALL create a mapping to the actual result bookmark.
 When the same recorded bookmark is notified more than once with the same actual bookmark, the persistent listener SHALL treat the notification as idempotent.
@@ -10,7 +10,7 @@ When the same recorded bookmark is notified more than once with a different actu
 
 #### Scenario: Persistent mapping is recorded
 - **WHEN** command replay notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
-- **THEN** the system persists a mapping with recorded logical type `demoInvoice`, recorded identifier `1`, actual logical type `demoInvoice`, and actual identifier `2`
+- **THEN** the system persists a mapping with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:2`
 
 #### Scenario: Equal result mapping is not persisted
 - **WHEN** command replay notifies the persistent listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:1`
@@ -53,7 +53,7 @@ The persistent listener SHALL perform remapping without resolving recorded or ac
 - **THEN** the persistent listener returns no replacement
 
 ### Requirement: Persistent replay mappings are represented by applib and persistence-specific types
-The system SHALL define an abstract applib replay result mapping entity that exposes recorded and actual bookmark components.
+The system SHALL define an abstract applib replay result mapping entity that exposes recorded and actual bookmark properties.
 The system SHALL define an abstract applib repository for finding, listing, and creating replay result mappings.
 The JDO command log persistence module SHALL provide a concrete replay result mapping entity and repository.
 The JPA command log persistence module SHALL provide a concrete replay result mapping entity and repository.
@@ -95,4 +95,4 @@ The list action SHALL return persisted mappings using the abstract applib reposi
 #### Scenario: User lists persisted replay mappings
 - **WHEN** a user invokes the command log menu action for replay result mappings
 - **THEN** the system returns the persisted replay result mappings
-- **AND** each mapping displays its recorded and actual bookmark components
+- **AND** each mapping displays its recorded and actual bookmarks
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/tasks.md b/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
index 0855f0e232b..5f9613ccb42 100644
--- a/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
+++ b/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
@@ -7,7 +7,7 @@
 
 ## 2. Applib Persistent Mapping Model
 
-- [x] 2.1 Add an abstract applib replay result mapping entity with recorded and actual bookmark logical type and identifier properties.
+- [x] 2.1 Add an abstract applib replay result mapping entity with recorded and actual bookmark properties.
 - [x] 2.2 Add bookmark conversion helpers on the applib entity for recorded and actual bookmarks.
 - [x] 2.3 Add an abstract applib replay result mapping repository contract for lookup by recorded bookmark, listing all mappings, and creating mappings.
 - [x] 2.4 Add a fallback layout XML for the replay result mapping entity.


(causeway) 20/42: CAUSEWAY-4010: adds command replay input remapping

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 8d681115069c2acb86e68193368533975c3167a4
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 15:35:18 2026 +0100

    CAUSEWAY-4010: adds command replay input remapping
---
 .../applib/CausewayModuleExtCommandLogApplib.java  |   6 +-
 .../applib/dom/replay/ReplayContext.java           |   4 +-
 .../applib/dom/replay/ReplayableCommand.java       | 111 ++++++-
 ...ener.java => CommandReplayMappingListener.java} |  36 ++-
 .../dom/replay/ReplayableCommandMappingTest.java   | 323 +++++++++++++++++++++
 .../replay/ReplayableCommandResultMappingTest.java | 136 ---------
 .../changes/remap-command-replay-inputs/tasks.md   |  36 +--
 7 files changed, 487 insertions(+), 165 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
index ccb07791605..e4f03388583 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/CausewayModuleExtCommandLogApplib.java
@@ -62,7 +62,7 @@
 import org.apache.causeway.extensions.commandlog.applib.fakescheduler.FakeScheduler;
 import org.apache.causeway.extensions.commandlog.applib.job.BackgroundCommandsJobControl;
 import org.apache.causeway.extensions.commandlog.applib.job.RunBackgroundCommandsJob;
-import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListener;
 import org.apache.causeway.extensions.commandlog.applib.spi.RunBackgroundCommandsJobListener;
 import org.apache.causeway.extensions.commandlog.applib.subscriber.CommandSubscriberForCommandLog;
 import org.springframework.context.annotation.Bean;
@@ -173,11 +173,11 @@ public static void honorSystemEnvironment() {
             final CommandLogEntryRepository commandLogEntryRepository,
             final CommandExecutorService commandExecutorService,
             final ClockService clockService,
-            final java.util.List<ReplayResultMappingListener> replayResultMappingListeners) {
+            final java.util.List<CommandReplayMappingListener> commandReplayMappingListeners) {
         return new ReplayContext(
                 repositoryService, interactionService, transactionService,
                 commandLogEntryRepository, commandExecutorService, clockService,
-                replayResultMappingListeners);
+                commandReplayMappingListeners);
     }
 
 }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java
index 840de39b665..3d7b2b20adb 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayContext.java
@@ -29,7 +29,7 @@
 import org.apache.causeway.applib.services.xactn.TransactionService;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
-import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListener;
 import org.springframework.lang.Nullable;
 
 import lombok.Value;
@@ -46,7 +46,7 @@ public final class ReplayContext {
         CommandLogEntryRepository commandLogEntryRepository;
         CommandExecutorService commandExecutorService;
         ClockService clockService;
-        List<ReplayResultMappingListener> replayResultMappingListeners;
+        List<CommandReplayMappingListener> commandReplayMappingListeners;
         
     public Optional<CommandLogEntry> lookupCommandLogEntry(final @Nullable UUID interactionId) {
     	return interactionId!=null
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
index fed88caf419..d5fbd16481c 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommand.java
@@ -46,6 +46,7 @@
 import org.apache.causeway.applib.services.bookmark.Bookmark;
 import org.apache.causeway.applib.services.bookmark.BookmarkService;
 import org.apache.causeway.applib.services.command.CommandExecutorService.InteractionContextPolicy;
+import org.apache.causeway.applib.util.schema.CommandDtoUtils;
 import org.apache.causeway.commons.functional.Try;
 import org.apache.causeway.commons.internal.base._NullSafe;
 import org.apache.causeway.commons.internal.base._Refs.ObjectReference;
@@ -56,10 +57,13 @@
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
-import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListener;
+import org.apache.causeway.schema.cmd.v2.ActionDto;
 import org.apache.causeway.schema.cmd.v2.CommandDto;
 import org.apache.causeway.schema.cmd.v2.MemberDto;
+import org.apache.causeway.schema.cmd.v2.ParamDto;
 import org.apache.causeway.schema.common.v2.OidDto;
+import org.apache.causeway.schema.common.v2.ValueType;
 import org.apache.causeway.valuetypes.asciidoc.applib.value.AsciiDoc;
 import org.apache.causeway.valuetypes.asciidoc.builder.AsciiDocBuilder;
 import org.apache.causeway.valuetypes.asciidoc.builder.AsciiDocFactory;
@@ -365,7 +369,7 @@ Try<ReplayableCommand> tryReplayOrRetry() {
             return Try.success(null); // guard against disallowed invocation
         return commandLogEntry()
             .filter(ReplayableCommand::canReplayOrRetryOrMarkForExclusion)
-            .map(commandLogEntry->tryReplay(commandLogEntry.getCommandDto())
+            .map(commandLogEntry->tryReplay(commandDtoForReplay(commandLogEntry))
                 .mapSuccessAsNullable(__ -> this))
             // if nothing to do, return with an 'empty success'
             .orElseGet(()->Try.success(null));
@@ -386,6 +390,105 @@ String disableReplayOrRetry() {
      * Replays given command in its own transaction and handles {@link ReplayState} transition to
      * either {@link ReplayState#OK} or {@link ReplayState#FAILED}.
      */
+    CommandDto commandDtoForReplay(final CommandLogEntry commandLogEntry) {
+        final CommandDto commandDto = copyCommandDto(commandLogEntry.getCommandDto());
+        remapTargets(commandLogEntry, commandDto);
+        remapReferenceParameters(commandLogEntry, commandDto);
+        return commandDto;
+    }
+
+    private CommandDto copyCommandDto(final CommandDto commandDto) {
+        return Try.call(() -> CommandDtoUtils.dtoMapper().read(CommandDtoUtils.dtoMapper().toString(commandDto)))
+                .ifFailureFail()
+                .getValue()
+                .orElse(commandDto);
+    }
+
+    private void remapTargets(
+            final CommandLogEntry commandLogEntry,
+            final CommandDto commandDto) {
+        Optional.ofNullable(commandDto.getTargets())
+            .stream()
+            .flatMap(targets -> targets.getOid().stream())
+            .forEach(target -> remapTarget(commandLogEntry, target));
+    }
+
+    private void remapTarget(
+            final CommandLogEntry commandLogEntry,
+            final OidDto target) {
+        final Bookmark recordedTarget = Bookmark.forOidDto(target);
+        _NullSafe.stream(replayContext.commandReplayMappingListeners())
+            .forEach(listener -> remapTarget(listener, commandLogEntry, target, recordedTarget));
+    }
+
+    private void remapTarget(
+            final CommandReplayMappingListener listener,
+            final CommandLogEntry commandLogEntry,
+            final OidDto target,
+            final Bookmark recordedTarget) {
+        try {
+            Optional.ofNullable(listener.remapTarget(commandLogEntry, recordedTarget))
+                .orElseGet(Optional::empty)
+                .ifPresent(replacement -> copyBookmarkToOidDto(replacement, target));
+        } catch (Exception ex) {
+            log.warn("Command replay target remapping listener failed", ex);
+        }
+    }
+
+    private void remapReferenceParameters(
+            final CommandLogEntry commandLogEntry,
+            final CommandDto commandDto) {
+        if (!(commandDto.getMember() instanceof ActionDto)) {
+            return;
+        }
+        Optional.ofNullable(((ActionDto) commandDto.getMember()).getParameters())
+            .stream()
+            .flatMap(parameters -> parameters.getParameter().stream())
+            .forEach(new java.util.function.Consumer<ParamDto>() {
+                private int parameterIndex = 0;
+                @Override
+                public void accept(final ParamDto parameter) {
+                    remapReferenceParameter(commandLogEntry, parameter, parameterIndex++);
+                }
+            });
+    }
+
+    private void remapReferenceParameter(
+            final CommandLogEntry commandLogEntry,
+            final ParamDto parameter,
+            final int parameterIndex) {
+        if (parameter.getType() != ValueType.REFERENCE || parameter.getReference() == null) {
+            return;
+        }
+        final Bookmark recordedReference = Bookmark.forOidDto(parameter.getReference());
+        _NullSafe.stream(replayContext.commandReplayMappingListeners())
+            .forEach(listener -> remapReferenceParameter(
+                    listener, commandLogEntry, parameter, parameterIndex, recordedReference));
+    }
+
+    private void remapReferenceParameter(
+            final CommandReplayMappingListener listener,
+            final CommandLogEntry commandLogEntry,
+            final ParamDto parameter,
+            final int parameterIndex,
+            final Bookmark recordedReference) {
+        try {
+            Optional.ofNullable(listener.remapReferenceParameter(
+                    commandLogEntry, parameter.getName(), parameterIndex, recordedReference))
+                .orElseGet(Optional::empty)
+                .ifPresent(replacement -> copyBookmarkToOidDto(replacement, parameter.getReference()));
+        } catch (Exception ex) {
+            log.warn("Command replay reference parameter remapping listener failed", ex);
+        }
+    }
+
+    private void copyBookmarkToOidDto(
+            final Bookmark bookmark,
+            final OidDto oidDto) {
+        oidDto.setType(bookmark.getLogicalTypeName());
+        oidDto.setId(bookmark.getIdentifier());
+    }
+
     private Try<Bookmark> tryReplay(final CommandDto commandDto) {
         var tryResultBookmark = replayContext.transactionService()
             .callTransactional(Propagation.REQUIRES_NEW, () -> replayContext.commandExecutorService()
@@ -455,12 +558,12 @@ void notifyReplayResultMapped(
         if (recordedResult == null || actualResult == null) {
             return;
         }
-        _NullSafe.stream(replayContext.replayResultMappingListeners())
+        _NullSafe.stream(replayContext.commandReplayMappingListeners())
             .forEach(listener -> notifyReplayResultMapped(listener, recordedResult, actualResult, commandLogEntry));
     }
 
     private void notifyReplayResultMapped(
-            final ReplayResultMappingListener listener,
+            final CommandReplayMappingListener listener,
             final Bookmark recordedResult,
             final Bookmark actualResult,
             final CommandLogEntry commandLogEntry) {
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/ReplayResultMappingListener.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListener.java
similarity index 51%
rename from extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/ReplayResultMappingListener.java
rename to extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListener.java
index 691aee0c776..8305cfa5573 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/ReplayResultMappingListener.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListener.java
@@ -18,15 +18,47 @@
  */
 package org.apache.causeway.extensions.commandlog.applib.spi;
 
+import java.util.Optional;
+
 import org.apache.causeway.applib.services.bookmark.Bookmark;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 
 /**
- * Listens for mappings from imported replay result bookmarks to actual replay result bookmarks.
+ * Maps replay command inputs before execution and listens for mappings from imported replay result bookmarks to actual replay result bookmarks.
  *
  * @since 2.1 {@index}
  */
-public interface ReplayResultMappingListener {
+public interface CommandReplayMappingListener {
+
+    /**
+     * Optionally remaps a command target bookmark before replay execution.
+     *
+     * @param commandLogEntry the command log entry being replayed
+     * @param recordedTarget the target bookmark recorded in the imported command DTO
+     * @return replacement target bookmark, or empty to keep the recorded target
+     */
+    default Optional<Bookmark> remapTarget(
+            final CommandLogEntry commandLogEntry,
+            final Bookmark recordedTarget) {
+        return Optional.empty();
+    }
+
+    /**
+     * Optionally remaps a reference-valued action parameter before replay execution.
+     *
+     * @param commandLogEntry the command log entry being replayed
+     * @param parameterName the parameter name from the command DTO
+     * @param parameterIndex the zero-based parameter index from the command DTO
+     * @param recordedReference the reference bookmark recorded for the parameter
+     * @return replacement reference bookmark, or empty to keep the recorded reference
+     */
+    default Optional<Bookmark> remapReferenceParameter(
+            final CommandLogEntry commandLogEntry,
+            final String parameterName,
+            final int parameterIndex,
+            final Bookmark recordedReference) {
+        return Optional.empty();
+    }
 
     /**
      * Notifies that replay produced an actual result bookmark for a command whose imported command log entry had a recorded result bookmark.
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
new file mode 100644
index 00000000000..1e50da971e7
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandMappingTest.java
@@ -0,0 +1,323 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.dom.replay;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.transaction.annotation.Propagation;
+
+import org.mockito.ArgumentCaptor;
+
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.applib.services.command.CommandExecutorService;
+import org.apache.causeway.applib.services.command.CommandExecutorService.InteractionContextPolicy;
+import org.apache.causeway.applib.services.xactn.TransactionService;
+import org.apache.causeway.commons.functional.Try;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListener;
+import org.apache.causeway.schema.cmd.v2.ActionDto;
+import org.apache.causeway.schema.cmd.v2.ParamDto;
+import org.apache.causeway.schema.cmd.v2.ParamsDto;
+import org.apache.causeway.schema.common.v2.InteractionType;
+import org.apache.causeway.schema.common.v2.OidDto;
+import org.apache.causeway.schema.common.v2.OidsDto;
+import org.apache.causeway.schema.common.v2.ValueType;
+import org.apache.causeway.schema.cmd.v2.CommandDto;
+
+class ReplayableCommandMappingTest {
+
+    @Test
+    void target_remapping_changes_replay_command_dto() {
+        CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter("simple.SimpleObject", "1", "simple.SimpleObject", "3");
+        CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+        when(listener.remapTarget(
+                commandLogEntry,
+                Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "1")))
+                .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "2")));
+
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+
+        assertThat(replayCommandDto.getTargets().getOid().get(0).getType()).isEqualTo("simple.SimpleObject");
+        assertThat(replayCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("2");
+        assertThat(recordedCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("1");
+    }
+
+    @Test
+    void missing_target_remapping_leaves_replay_command_dto_unchanged() {
+        CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter("simple.SimpleObject", "1", "simple.SimpleObject", "3");
+        CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+
+        assertThat(replayCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("1");
+        assertThat(recordedCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("1");
+    }
+
+    @Test
+    void reference_parameter_remapping_changes_replay_command_dto() {
+        CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter("simple.SimpleObject", "1", "simple.SimpleObject", "3");
+        CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+        when(listener.remapReferenceParameter(
+                commandLogEntry,
+                "simpleObject",
+                0,
+                Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "3")))
+                .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "4")));
+
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
+        ParamDto recordedParameter = ((ActionDto) recordedCommandDto.getMember()).getParameters().getParameter().get(0);
+
+        assertThat(replayParameter.getReference().getType()).isEqualTo("simple.SimpleObject");
+        assertThat(replayParameter.getReference().getId()).isEqualTo("4");
+        assertThat(recordedParameter.getReference().getId()).isEqualTo("3");
+    }
+
+    @Test
+    void missing_reference_parameter_remapping_leaves_replay_command_dto_unchanged() {
+        CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter("simple.SimpleObject", "1", "simple.SimpleObject", "3");
+        CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
+        ParamDto recordedParameter = ((ActionDto) recordedCommandDto.getMember()).getParameters().getParameter().get(0);
+
+        assertThat(replayParameter.getReference().getId()).isEqualTo("3");
+        assertThat(recordedParameter.getReference().getId()).isEqualTo("3");
+    }
+
+    @Test
+    void non_reference_parameter_is_not_remapped_by_reference_flow() {
+        CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter("simple.SimpleObject", "1", "simple.SimpleObject", "3");
+        ParamDto parameter = ((ActionDto) recordedCommandDto.getMember()).getParameters().getParameter().get(0);
+        parameter.setType(ValueType.STRING);
+        parameter.setReference(null);
+        parameter.setString("unchanged");
+        CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+
+        CommandDto replayCommandDto = replayableCommand(listener).commandDtoForReplay(commandLogEntry);
+        ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
+
+        assertThat(replayParameter.getString()).isEqualTo("unchanged");
+        verify(listener, never()).remapReferenceParameter(any(), any(), any(Integer.class), any());
+    }
+
+    @Test
+    void replay_execution_receives_remapped_command_dto() throws Exception {
+        UUID interactionId = UUID.randomUUID();
+        CommandDto recordedCommandDto = commandWithTargetAndReferenceParameter(
+                "simple.SimpleObject", "1", "simple.SimpleObject", "3");
+        CommandLogEntry commandLogEntry = commandLogEntryWithCommandDto(recordedCommandDto);
+        when(commandLogEntry.getInteractionId()).thenReturn(interactionId);
+        when(commandLogEntry.getReplayState()).thenReturn(ReplayState.PENDING);
+
+        CommandLogEntryRepository commandLogEntryRepository = mock(CommandLogEntryRepository.class);
+        when(commandLogEntryRepository.findByInteractionId(interactionId)).thenReturn(Optional.of(commandLogEntry));
+
+        TransactionService transactionService = mock(TransactionService.class);
+        when(transactionService.callTransactional(any(Propagation.class), any(Callable.class)))
+                .thenAnswer(invocation -> {
+                    @SuppressWarnings("unchecked")
+                    Callable<Object> callable = invocation.getArgument(1);
+                    return Try.call(callable);
+                });
+
+        CommandExecutorService commandExecutorService = mock(CommandExecutorService.class);
+        when(commandExecutorService.executeCommand(eq(InteractionContextPolicy.SWITCH_USER_AND_TIME), any(CommandDto.class)))
+                .thenReturn(Try.success(null));
+
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+        when(listener.remapTarget(
+                commandLogEntry,
+                Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "1")))
+                .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "2")));
+        when(listener.remapReferenceParameter(
+                commandLogEntry,
+                "simpleObject",
+                0,
+                Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "3")))
+                .thenReturn(Optional.of(Bookmark.forLogicalTypeNameAndIdentifier("simple.SimpleObject", "4")));
+        ReplayContext replayContext = new ReplayContext(
+                null, null, transactionService, commandLogEntryRepository, commandExecutorService, null, List.of(listener));
+
+        new ReplayableCommand(interactionId, replayContext).tryReplayOrRetry();
+
+        ArgumentCaptor<CommandDto> commandDtoCaptor = ArgumentCaptor.forClass(CommandDto.class);
+        verify(commandExecutorService).executeCommand(
+                eq(InteractionContextPolicy.SWITCH_USER_AND_TIME), commandDtoCaptor.capture());
+        CommandDto replayCommandDto = commandDtoCaptor.getValue();
+        ParamDto replayParameter = ((ActionDto) replayCommandDto.getMember()).getParameters().getParameter().get(0);
+        ParamDto recordedParameter = ((ActionDto) recordedCommandDto.getMember()).getParameters().getParameter().get(0);
+
+        assertThat(replayCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("2");
+        assertThat(replayParameter.getReference().getId()).isEqualTo("4");
+        assertThat(recordedCommandDto.getTargets().getOid().get(0).getId()).isEqualTo("1");
+        assertThat(recordedParameter.getReference().getId()).isEqualTo("3");
+    }
+
+    @Test
+    void notifies_listener_when_recorded_and_actual_results_differ() {
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, actualResult);
+
+        verify(listener).onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
+    }
+
+    @Test
+    void notifies_listener_when_recorded_and_actual_results_are_equal() {
+        Bookmark result = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(result);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, result);
+
+        verify(listener).onReplayResultMapped(result, result, commandLogEntry);
+    }
+
+    @Test
+    void does_not_notify_listener_when_recorded_result_is_missing() {
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(null);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, actualResult);
+
+        verify(listener, never()).onReplayResultMapped(any(), any(), any());
+    }
+
+    @Test
+    void does_not_notify_listener_when_actual_result_is_missing() {
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+
+        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, null);
+
+        verify(listener, never()).onReplayResultMapped(any(), any(), any());
+    }
+
+    @Test
+    void does_not_notify_listener_when_replay_fails() throws Exception {
+        UUID interactionId = UUID.randomUUID();
+        CommandDto commandDto = new CommandDto();
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
+        when(commandLogEntry.getInteractionId()).thenReturn(interactionId);
+        when(commandLogEntry.getCommandDto()).thenReturn(commandDto);
+        when(commandLogEntry.getReplayState()).thenReturn(ReplayState.PENDING);
+
+        CommandLogEntryRepository commandLogEntryRepository = mock(CommandLogEntryRepository.class);
+        when(commandLogEntryRepository.findByInteractionId(interactionId)).thenReturn(Optional.of(commandLogEntry));
+
+        TransactionService transactionService = mock(TransactionService.class);
+        AtomicInteger transactionCall = new AtomicInteger();
+        when(transactionService.callTransactional(any(Propagation.class), any(Callable.class)))
+                .thenAnswer(invocation -> {
+                    @SuppressWarnings("unchecked")
+                    Callable<Object> callable = invocation.getArgument(1);
+                    if (transactionCall.getAndIncrement() == 0) {
+                        return Try.failure(new RuntimeException("replay failed"));
+                    }
+                    return Try.call(callable);
+                });
+
+        CommandReplayMappingListener listener = mock(CommandReplayMappingListener.class);
+        ReplayContext replayContext = new ReplayContext(
+                null, null, transactionService, commandLogEntryRepository, null, null, List.of(listener));
+
+        new ReplayableCommand(interactionId, replayContext).tryReplayOrRetry();
+
+        verify(listener, never()).onReplayResultMapped(any(), any(), any());
+    }
+
+    private static ReplayableCommand replayableCommand(final CommandReplayMappingListener listener) {
+        ReplayContext replayContext = new ReplayContext(null, null, null, null, null, null, List.of(listener));
+        return new ReplayableCommand(UUID.randomUUID(), replayContext);
+    }
+
+    private static CommandLogEntry commandLogEntryWithCommandDto(final CommandDto commandDto) {
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        when(commandLogEntry.getCommandDto()).thenReturn(commandDto);
+        return commandLogEntry;
+    }
+
+    private static CommandDto commandWithTargetAndReferenceParameter(
+            final String targetType,
+            final String targetId,
+            final String parameterType,
+            final String parameterId) {
+        CommandDto commandDto = new CommandDto();
+        commandDto.setMajorVersion("2");
+        commandDto.setMinorVersion("0");
+        commandDto.setInteractionId(UUID.randomUUID().toString());
+
+        OidDto target = new OidDto();
+        target.setType(targetType);
+        target.setId(targetId);
+        OidsDto targets = new OidsDto();
+        targets.getOid().add(target);
+        commandDto.setTargets(targets);
+
+        OidDto reference = new OidDto();
+        reference.setType(parameterType);
+        reference.setId(parameterId);
+        ParamDto parameter = new ParamDto();
+        parameter.setName("simpleObject");
+        parameter.setType(ValueType.REFERENCE);
+        parameter.setReference(reference);
+        ParamsDto parameters = new ParamsDto();
+        parameters.getParameter().add(parameter);
+        ActionDto action = new ActionDto();
+        action.setLogicalMemberIdentifier("simple.SimpleObject#sameAs");
+        action.setInteractionType(InteractionType.ACTION_INVOCATION);
+        action.setParameters(parameters);
+        commandDto.setMember(action);
+        return commandDto;
+    }
+
+    private static CommandLogEntry commandLogEntryWithRecordedResult(final Bookmark recordedResult) {
+        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
+        when(commandLogEntry.getResult()).thenReturn(recordedResult);
+        return commandLogEntry;
+    }
+}
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandResultMappingTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandResultMappingTest.java
deleted file mode 100644
index bc9620074e7..00000000000
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/ReplayableCommandResultMappingTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.causeway.extensions.commandlog.applib.dom.replay;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.util.List;
-import java.util.Optional;
-import java.util.UUID;
-import java.util.concurrent.Callable;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.transaction.annotation.Propagation;
-
-import org.apache.causeway.applib.services.bookmark.Bookmark;
-import org.apache.causeway.applib.services.xactn.TransactionService;
-import org.apache.causeway.commons.functional.Try;
-import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
-import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
-import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
-import org.apache.causeway.extensions.commandlog.applib.spi.ReplayResultMappingListener;
-import org.apache.causeway.schema.cmd.v2.CommandDto;
-
-class ReplayableCommandResultMappingTest {
-
-    @Test
-    void notifies_listener_when_recorded_and_actual_results_differ() {
-        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
-        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
-        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
-        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
-
-        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, actualResult);
-
-        verify(listener).onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
-    }
-
-    @Test
-    void notifies_listener_when_recorded_and_actual_results_are_equal() {
-        Bookmark result = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
-        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(result);
-        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
-
-        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, result);
-
-        verify(listener).onReplayResultMapped(result, result, commandLogEntry);
-    }
-
-    @Test
-    void does_not_notify_listener_when_recorded_result_is_missing() {
-        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
-        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(null);
-        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
-
-        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, actualResult);
-
-        verify(listener, never()).onReplayResultMapped(any(), any(), any());
-    }
-
-    @Test
-    void does_not_notify_listener_when_actual_result_is_missing() {
-        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
-        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
-        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
-
-        replayableCommand(listener).notifyReplayResultMapped(commandLogEntry, null);
-
-        verify(listener, never()).onReplayResultMapped(any(), any(), any());
-    }
-
-    @Test
-    void does_not_notify_listener_when_replay_fails() throws Exception {
-        UUID interactionId = UUID.randomUUID();
-        CommandDto commandDto = new CommandDto();
-        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
-        CommandLogEntry commandLogEntry = commandLogEntryWithRecordedResult(recordedResult);
-        when(commandLogEntry.getInteractionId()).thenReturn(interactionId);
-        when(commandLogEntry.getCommandDto()).thenReturn(commandDto);
-        when(commandLogEntry.getReplayState()).thenReturn(ReplayState.PENDING);
-
-        CommandLogEntryRepository commandLogEntryRepository = mock(CommandLogEntryRepository.class);
-        when(commandLogEntryRepository.findByInteractionId(interactionId)).thenReturn(Optional.of(commandLogEntry));
-
-        TransactionService transactionService = mock(TransactionService.class);
-        AtomicInteger transactionCall = new AtomicInteger();
-        when(transactionService.callTransactional(any(Propagation.class), any(Callable.class)))
-                .thenAnswer(invocation -> {
-                    @SuppressWarnings("unchecked")
-                    Callable<Object> callable = invocation.getArgument(1);
-                    if (transactionCall.getAndIncrement() == 0) {
-                        return Try.failure(new RuntimeException("replay failed"));
-                    }
-                    return Try.call(callable);
-                });
-
-        ReplayResultMappingListener listener = mock(ReplayResultMappingListener.class);
-        ReplayContext replayContext = new ReplayContext(
-                null, null, transactionService, commandLogEntryRepository, null, null, List.of(listener));
-
-        new ReplayableCommand(interactionId, replayContext).tryReplayOrRetry();
-
-        verify(listener, never()).onReplayResultMapped(any(), any(), any());
-    }
-
-    private static ReplayableCommand replayableCommand(final ReplayResultMappingListener listener) {
-        ReplayContext replayContext = new ReplayContext(null, null, null, null, null, null, List.of(listener));
-        return new ReplayableCommand(UUID.randomUUID(), replayContext);
-    }
-
-    private static CommandLogEntry commandLogEntryWithRecordedResult(final Bookmark recordedResult) {
-        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
-        when(commandLogEntry.getResult()).thenReturn(recordedResult);
-        return commandLogEntry;
-    }
-}
diff --git a/openspec/changes/remap-command-replay-inputs/tasks.md b/openspec/changes/remap-command-replay-inputs/tasks.md
index 025969b2a56..7ab22572f2b 100644
--- a/openspec/changes/remap-command-replay-inputs/tasks.md
+++ b/openspec/changes/remap-command-replay-inputs/tasks.md
@@ -1,26 +1,26 @@
 ## 1. SPI Refactor
 
-- [ ] 1.1 Rename `ReplayResultMappingListener` to a broader command replay mapping SPI name.
-- [ ] 1.2 Preserve the existing recorded-to-actual result mapping notification method under the renamed SPI.
-- [ ] 1.3 Add a target remapping method that receives the replay command context and recorded target bookmark, and returns an optional replacement target bookmark.
-- [ ] 1.4 Add a reference action parameter remapping method that receives the replay command context, parameter context, and current reference bookmark, and returns an optional replacement reference bookmark.
-- [ ] 1.5 Update module wiring and replay context references to use the renamed SPI.
+- [x] 1.1 Rename `ReplayResultMappingListener` to a broader command replay mapping SPI name.
+- [x] 1.2 Preserve the existing recorded-to-actual result mapping notification method under the renamed SPI.
+- [x] 1.3 Add a target remapping method that receives the replay command context and recorded target bookmark, and returns an optional replacement target bookmark.
+- [x] 1.4 Add a reference action parameter remapping method that receives the replay command context, parameter context, and current reference bookmark, and returns an optional replacement reference bookmark.
+- [x] 1.5 Update module wiring and replay context references to use the renamed SPI.
 
 ## 2. Replay Input Remapping
 
-- [ ] 2.1 Add a utility or method to create a replay-time copy of the imported `CommandDto` before applying remaps.
-- [ ] 2.2 Apply target bookmark remapping to the replay-time command DTO copy before execution.
-- [ ] 2.3 Apply reference action parameter remapping to `ParamDto.reference` values on the replay-time command DTO copy before execution.
-- [ ] 2.4 Pass the remapped command DTO copy to `CommandExecutorService#executeCommand(...)`.
-- [ ] 2.5 Preserve the stored imported command DTO unchanged after remapping.
-- [ ] 2.6 Keep existing result mapping notification behavior after successful replay.
+- [x] 2.1 Add a utility or method to create a replay-time copy of the imported `CommandDto` before applying remaps.
+- [x] 2.2 Apply target bookmark remapping to the replay-time command DTO copy before execution.
+- [x] 2.3 Apply reference action parameter remapping to `ParamDto.reference` values on the replay-time command DTO copy before execution.
+- [x] 2.4 Pass the remapped command DTO copy to `CommandExecutorService#executeCommand(...)`.
+- [x] 2.5 Preserve the stored imported command DTO unchanged after remapping.
+- [x] 2.6 Keep existing result mapping notification behavior after successful replay.
 
 ## 3. Tests
 
-- [ ] 3.1 Add tests that target bookmark remapping changes the command DTO supplied to replay execution.
-- [ ] 3.2 Add tests that missing target remapping leaves replay execution unchanged.
-- [ ] 3.3 Add tests that reference action parameter remapping changes the command DTO supplied to replay execution using a `type: "reference"` parameter with `reference.type` and `reference.id`.
-- [ ] 3.4 Add tests that missing reference action parameter remapping leaves replay execution unchanged.
-- [ ] 3.5 Add tests that remapping does not mutate the command DTO stored on the imported command log entry.
-- [ ] 3.6 Update existing result mapping tests for the renamed SPI.
-- [ ] 3.7 Run focused command replay tests.
+- [x] 3.1 Add tests that target bookmark remapping changes the command DTO supplied to replay execution.
+- [x] 3.2 Add tests that missing target remapping leaves replay execution unchanged.
+- [x] 3.3 Add tests that reference action parameter remapping changes the command DTO supplied to replay execution using a `type: "reference"` parameter with `reference.type` and `reference.id`.
+- [x] 3.4 Add tests that missing reference action parameter remapping leaves replay execution unchanged.
+- [x] 3.5 Add tests that remapping does not mutate the command DTO stored on the imported command log entry.
+- [x] 3.6 Update existing result mapping tests for the renamed SPI.
+- [x] 3.7 Run focused command replay tests.


(causeway) 22/42: CAUSEWAY-4010: archives command replay input remapping

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 40374aecae2ebb509625e15a48b9c967d014eee0
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 16:43:01 2026 +0100

    CAUSEWAY-4010: archives command replay input remapping
---
 .../.openspec.yaml                                 |  0
 .../design.md                                      |  0
 .../proposal.md                                    |  0
 .../specs/command-replay-result-mapping/spec.md    |  0
 .../tasks.md                                       |  0
 .../specs/command-replay-result-mapping/spec.md    | 70 ++++++++++++++++++----
 6 files changed, 60 insertions(+), 10 deletions(-)

diff --git a/openspec/changes/remap-command-replay-inputs/.openspec.yaml b/openspec/changes/archive/2026-06-04-remap-command-replay-inputs/.openspec.yaml
similarity index 100%
rename from openspec/changes/remap-command-replay-inputs/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-remap-command-replay-inputs/.openspec.yaml
diff --git a/openspec/changes/remap-command-replay-inputs/design.md b/openspec/changes/archive/2026-06-04-remap-command-replay-inputs/design.md
similarity index 100%
rename from openspec/changes/remap-command-replay-inputs/design.md
rename to openspec/changes/archive/2026-06-04-remap-command-replay-inputs/design.md
diff --git a/openspec/changes/remap-command-replay-inputs/proposal.md b/openspec/changes/archive/2026-06-04-remap-command-replay-inputs/proposal.md
similarity index 100%
rename from openspec/changes/remap-command-replay-inputs/proposal.md
rename to openspec/changes/archive/2026-06-04-remap-command-replay-inputs/proposal.md
diff --git a/openspec/changes/remap-command-replay-inputs/specs/command-replay-result-mapping/spec.md b/openspec/changes/archive/2026-06-04-remap-command-replay-inputs/specs/command-replay-result-mapping/spec.md
similarity index 100%
rename from openspec/changes/remap-command-replay-inputs/specs/command-replay-result-mapping/spec.md
rename to openspec/changes/archive/2026-06-04-remap-command-replay-inputs/specs/command-replay-result-mapping/spec.md
diff --git a/openspec/changes/remap-command-replay-inputs/tasks.md b/openspec/changes/archive/2026-06-04-remap-command-replay-inputs/tasks.md
similarity index 100%
rename from openspec/changes/remap-command-replay-inputs/tasks.md
rename to openspec/changes/archive/2026-06-04-remap-command-replay-inputs/tasks.md
diff --git a/openspec/specs/command-replay-result-mapping/spec.md b/openspec/specs/command-replay-result-mapping/spec.md
index f37807e1e2e..7dec98ca00d 100644
--- a/openspec/specs/command-replay-result-mapping/spec.md
+++ b/openspec/specs/command-replay-result-mapping/spec.md
@@ -1,43 +1,93 @@
 ## Purpose
 
-Define the replay result mapping SPI that lets applications observe mappings from recorded returned object bookmarks to actual replay result bookmarks.
+Define the command replay mapping SPI that lets applications remap replay inputs and observe mappings from recorded returned object bookmarks to actual replay result bookmarks.
 
 ## Requirements
 
+### Requirement: Replay mapping SPI can remap command targets before execution
+The system SHALL ask the command replay mapping SPI whether each replayed command target bookmark should be remapped before command execution.
+When the SPI provides a replacement target bookmark, the system SHALL execute the replayed command using the replacement target identifier.
+When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded target identifier.
+
+#### Scenario: Target bookmark is remapped
+- **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
+- **AND** the command replay mapping SPI returns replacement target bookmark `demoCustomer:2`
+- **THEN** the system executes the replayed command against target bookmark `demoCustomer:2`
+
+#### Scenario: Target bookmark is not remapped
+- **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
+- **AND** no command replay mapping SPI provides a replacement target bookmark
+- **THEN** the system executes the replayed command against target bookmark `demoCustomer:1`
+
+### Requirement: Replay mapping SPI can remap reference action parameters before execution
+The system SHALL ask the command replay mapping SPI whether each replayed action parameter represented as `type: "reference"` with a populated `reference` OID should be remapped before command execution.
+When the SPI provides a replacement reference bookmark, the system SHALL execute the replayed command using the replacement parameter reference.
+When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded parameter reference.
+The system MUST leave non-reference action parameters unchanged by this reference remapping flow.
+
+#### Scenario: Reference action parameter is remapped
+- **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+- **AND** the command replay mapping SPI returns replacement reference bookmark `simple.SimpleObject:2`
+- **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "2"`
+
+#### Scenario: Reference action parameter is not remapped
+- **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+- **AND** no command replay mapping SPI provides a replacement reference bookmark
+- **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
+
+#### Scenario: Non-reference action parameter is not remapped by reference flow
+- **WHEN** command replay is about to execute an action command with a parameter that is not represented as `type: "reference"`
+- **THEN** the system does not ask the reference parameter remapping flow to replace that parameter
+
+### Requirement: Replay input remapping does not mutate recorded command data
+The system SHALL preserve the imported command log entry's recorded command DTO when applying replay-time target or reference parameter remapping.
+Replay input remapping SHALL affect the command DTO supplied to replay execution, not the recorded command DTO retained for audit and inspection.
+
+#### Scenario: Remapped replay preserves recorded command
+- **WHEN** command replay remaps recorded target bookmark `demoCustomer:1` to actual target bookmark `demoCustomer:2`
+- **THEN** the replay execution receives target bookmark `demoCustomer:2`
+- **AND** the imported command log entry still records target bookmark `demoCustomer:1`
+
 ### Requirement: Replay result mapping SPI is notified after successful replay
-The system SHALL provide an SPI that applications can implement to receive replay result bookmark mappings.
+The system SHALL provide a command replay mapping SPI that applications can implement to receive replay result bookmark mappings and provide replay input remappings.
 After a command replay succeeds, the system SHALL notify the SPI when the imported command log entry has a recorded returned object bookmark and replay execution returns an actual result bookmark.
 The notification SHALL include the recorded returned object bookmark and the actual replay result bookmark.
 
 #### Scenario: Successful replay produces a different result bookmark
 - **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
 - **AND** replay execution returns actual result bookmark `demoInvoice:2`
-- **THEN** the system notifies the replay result mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:2`
+- **THEN** the system notifies the command replay mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:2`
 
 #### Scenario: Successful replay produces the same result bookmark
 - **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
 - **AND** replay execution returns actual result bookmark `demoInvoice:1`
-- **THEN** the system notifies the replay result mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
+- **THEN** the system notifies the command replay mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
 
 ### Requirement: Replay result mapping SPI is not notified when mapping data is unavailable
-The system MUST NOT notify the replay result mapping SPI unless replay succeeds and both recorded and actual result bookmarks are available.
+The system MUST NOT notify the command replay mapping SPI of result mappings unless replay succeeds and both recorded and actual result bookmarks are available.
+Replay input remapping methods MAY still be called before execution even if result mapping data is unavailable.
 
 #### Scenario: Replay fails
 - **WHEN** command replay fails for an imported command whose recorded result bookmark is available
-- **THEN** the system does not notify the replay result mapping SPI
+- **THEN** the system does not notify the command replay mapping SPI of a result mapping
 
 #### Scenario: Recorded result is absent
 - **WHEN** command replay succeeds for an imported command whose recorded result bookmark is absent
-- **THEN** the system does not notify the replay result mapping SPI
+- **THEN** the system does not notify the command replay mapping SPI of a result mapping
 
 #### Scenario: Actual result is absent
 - **WHEN** command replay succeeds for an imported command whose recorded result bookmark is available
 - **AND** replay execution does not return an actual result bookmark
-- **THEN** the system does not notify the replay result mapping SPI
+- **THEN** the system does not notify the command replay mapping SPI of a result mapping
 
 ### Requirement: Replay result mapping SPI uses bookmarks without resolving objects
-The system SHALL pass recorded and actual result bookmarks to the replay result mapping SPI without requiring those bookmarks to resolve to live domain objects.
+The system SHALL pass recorded and actual result bookmarks to the command replay mapping SPI without requiring those bookmarks to resolve to live domain objects.
+The system SHALL pass target bookmarks to the command replay mapping SPI without requiring those bookmarks to resolve to live domain objects.
 
 #### Scenario: Recorded object is not resolvable
 - **WHEN** command replay succeeds and the recorded result bookmark does not resolve to a local domain object
-- **THEN** the system can still notify the replay result mapping SPI with the recorded bookmark and actual bookmark
+- **THEN** the system can still notify the command replay mapping SPI with the recorded bookmark and actual bookmark
+
+#### Scenario: Target object is not resolvable before remapping
+- **WHEN** command replay is about to execute a command whose recorded target bookmark does not resolve to a local domain object
+- **THEN** the system can still ask the command replay mapping SPI for a replacement target bookmark


(causeway) 34/42: CAUSEWAY-4010: archives replay conflict failure handling

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit cdfe0dbd4ef166b5cec100bdd0e293f7394d116a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 18:54:29 2026 +0100

    CAUSEWAY-4010: archives replay conflict failure handling
---
 .../.openspec.yaml                                    |  0
 .../design.md                                         |  0
 .../proposal.md                                       |  0
 .../specs/command-replay-result-mapping/spec.md       |  0
 .../default-command-replay-mapping-listener/spec.md   |  0
 .../tasks.md                                          |  0
 openspec/specs/command-replay-result-mapping/spec.md  |  9 +++++++++
 .../default-command-replay-mapping-listener/spec.md   | 19 +++++++++++++------
 8 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/.openspec.yaml b/openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/.openspec.yaml
similarity index 100%
rename from openspec/changes/fail-replay-on-conflicting-result-mapping/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/.openspec.yaml
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/design.md b/openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/design.md
similarity index 100%
rename from openspec/changes/fail-replay-on-conflicting-result-mapping/design.md
rename to openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/design.md
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/proposal.md b/openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/proposal.md
similarity index 100%
rename from openspec/changes/fail-replay-on-conflicting-result-mapping/proposal.md
rename to openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/proposal.md
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/command-replay-result-mapping/spec.md b/openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/specs/command-replay-result-mapping/spec.md
similarity index 100%
rename from openspec/changes/fail-replay-on-conflicting-result-mapping/specs/command-replay-result-mapping/spec.md
rename to openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/specs/command-replay-result-mapping/spec.md
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/specs/default-command-replay-mapping-listener/spec.md
similarity index 100%
rename from openspec/changes/fail-replay-on-conflicting-result-mapping/specs/default-command-replay-mapping-listener/spec.md
rename to openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/specs/default-command-replay-mapping-listener/spec.md
diff --git a/openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md b/openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/tasks.md
similarity index 100%
rename from openspec/changes/fail-replay-on-conflicting-result-mapping/tasks.md
rename to openspec/changes/archive/2026-06-04-fail-replay-on-conflicting-result-mapping/tasks.md
diff --git a/openspec/specs/command-replay-result-mapping/spec.md b/openspec/specs/command-replay-result-mapping/spec.md
index a145815ca99..f23b6cd024d 100644
--- a/openspec/specs/command-replay-result-mapping/spec.md
+++ b/openspec/specs/command-replay-result-mapping/spec.md
@@ -52,6 +52,8 @@ Replay input remapping SHALL affect the command DTO supplied to replay execution
 The system SHALL provide a command replay mapping SPI that applications can implement to receive replay result bookmark mappings and provide replay input remappings.
 After a command replay succeeds, the system SHALL notify the SPI when the imported command log entry has a recorded returned object bookmark and replay execution returns an actual result bookmark.
 The notification SHALL include the recorded returned object bookmark and the actual replay result bookmark.
+The system SHALL notify the SPI in the same transaction as replay command execution.
+The system SHALL propagate result-mapping notification exceptions so the replayed command execution fails and rolls back.
 
 #### Scenario: Successful replay produces a different result bookmark
 - **WHEN** command replay succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
@@ -63,6 +65,13 @@ The notification SHALL include the recorded returned object bookmark and the act
 - **AND** replay execution returns actual result bookmark `demoInvoice:1`
 - **THEN** the system notifies the command replay mapping SPI with recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
 
+#### Scenario: Result mapping listener rejects the replay result
+- **WHEN** command replay execution succeeds for an imported command whose recorded result bookmark is `demoInvoice:1`
+- **AND** replay execution returns actual result bookmark `demoInvoice:2`
+- **AND** a command replay mapping SPI throws while handling the result mapping notification
+- **THEN** the replayed command execution fails
+- **AND** the replayed command transaction rolls back
+
 ### Requirement: Replay result mapping SPI is not notified when mapping data is unavailable
 The system MUST NOT notify the command replay mapping SPI of result mappings unless replay succeeds and both recorded and actual result bookmarks are available.
 Replay input remapping methods MAY still be called before execution even if result mapping data is unavailable.
diff --git a/openspec/specs/default-command-replay-mapping-listener/spec.md b/openspec/specs/default-command-replay-mapping-listener/spec.md
index d6776751278..262f0b76895 100644
--- a/openspec/specs/default-command-replay-mapping-listener/spec.md
+++ b/openspec/specs/default-command-replay-mapping-listener/spec.md
@@ -1,14 +1,13 @@
 ## Purpose
 
 Provide an out-of-the-box replay mapping listener that remembers non-identity replay result mappings and remaps later replay inputs from those mappings.
-
 ## Requirements
-
 ### Requirement: Default replay mapping listener records result mappings
 The system SHALL provide a default command replay mapping listener that records each replay result mapping by recorded result bookmark.
-When replay notifies the listener with a recorded result bookmark and a different actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark.
+When replay notifies the listener with a recorded result bookmark and a different actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark if no mapping already exists.
 When replay notifies the listener with equal recorded and actual result bookmarks, the listener MUST NOT remember a mapping for that notification.
-When the same recorded bookmark is notified more than once with different actual result bookmarks, the listener SHALL use the most recent actual bookmark for later remapping.
+When the same recorded bookmark is notified more than once with the same actual result bookmark, the listener SHALL treat the notification as idempotent.
+When the same recorded bookmark is notified more than once with different actual result bookmarks, the listener SHALL throw an exception and MUST NOT replace the remembered actual bookmark.
 
 #### Scenario: Different result mapping is recorded
 - **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
@@ -18,10 +17,17 @@ When the same recorded bookmark is notified more than once with different actual
 - **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:1`
 - **THEN** the default listener records no mapping for `demoInvoice:1`
 
-#### Scenario: Result mapping is replaced
+#### Scenario: Result mapping is repeated with the same actual bookmark
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+- **AND** no exception is thrown
+
+#### Scenario: Result mapping conflict is rejected
 - **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
 - **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
-- **THEN** the default listener records `demoInvoice:3` as the actual bookmark for `demoInvoice:1`
+- **THEN** the default listener throws an exception
+- **AND** the default listener keeps `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
 
 ### Requirement: Default replay mapping listener remaps from recorded results
 The default command replay mapping listener SHALL return a remembered actual bookmark when replay asks it to remap a recorded bookmark that was previously stored from a replay result mapping.
@@ -46,3 +52,4 @@ The system SHALL NOT require the default listener to persist mappings across JVM
 - **WHEN** the default listener records that `demoInvoice:1` mapped to actual bookmark `demoInvoice:2`
 - **AND** a new default listener instance is created
 - **THEN** the new listener instance has no required remembered mapping for `demoInvoice:1`
+


(causeway) 25/42: CAUSEWAY-4010: archives listener SPI remap simplification

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 6733cc1abbe2ff99e66a2f97690861ee56e6b564
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 17:10:33 2026 +0100

    CAUSEWAY-4010: archives listener SPI remap simplification
---
 .../.openspec.yaml                                    |  0
 .../design.md                                         |  0
 .../proposal.md                                       |  0
 .../specs/command-replay-result-mapping/spec.md       |  0
 .../tasks.md                                          |  0
 openspec/specs/command-replay-result-mapping/spec.md  | 19 ++++++++++---------
 6 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/openspec/changes/simplify-listener-spi-remap-method/.openspec.yaml b/openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/.openspec.yaml
similarity index 100%
rename from openspec/changes/simplify-listener-spi-remap-method/.openspec.yaml
rename to openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/.openspec.yaml
diff --git a/openspec/changes/simplify-listener-spi-remap-method/design.md b/openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/design.md
similarity index 100%
rename from openspec/changes/simplify-listener-spi-remap-method/design.md
rename to openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/design.md
diff --git a/openspec/changes/simplify-listener-spi-remap-method/proposal.md b/openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/proposal.md
similarity index 100%
rename from openspec/changes/simplify-listener-spi-remap-method/proposal.md
rename to openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/proposal.md
diff --git a/openspec/changes/simplify-listener-spi-remap-method/specs/command-replay-result-mapping/spec.md b/openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/specs/command-replay-result-mapping/spec.md
similarity index 100%
rename from openspec/changes/simplify-listener-spi-remap-method/specs/command-replay-result-mapping/spec.md
rename to openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/specs/command-replay-result-mapping/spec.md
diff --git a/openspec/changes/simplify-listener-spi-remap-method/tasks.md b/openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/tasks.md
similarity index 100%
rename from openspec/changes/simplify-listener-spi-remap-method/tasks.md
rename to openspec/changes/archive/2026-06-04-simplify-listener-spi-remap-method/tasks.md
diff --git a/openspec/specs/command-replay-result-mapping/spec.md b/openspec/specs/command-replay-result-mapping/spec.md
index 7dec98ca00d..f554554fcba 100644
--- a/openspec/specs/command-replay-result-mapping/spec.md
+++ b/openspec/specs/command-replay-result-mapping/spec.md
@@ -1,43 +1,43 @@
 ## Purpose
 
 Define the command replay mapping SPI that lets applications remap replay inputs and observe mappings from recorded returned object bookmarks to actual replay result bookmarks.
-
 ## Requirements
-
 ### Requirement: Replay mapping SPI can remap command targets before execution
-The system SHALL ask the command replay mapping SPI whether each replayed command target bookmark should be remapped before command execution.
+The system SHALL ask the command replay mapping SPI's common remap method whether each replayed command target bookmark should be remapped before command execution.
 When the SPI provides a replacement target bookmark, the system SHALL execute the replayed command using the replacement target identifier.
 When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded target identifier.
+The system SHALL use the same remap method for command targets and reference action parameters.
 
 #### Scenario: Target bookmark is remapped
 - **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
-- **AND** the command replay mapping SPI returns replacement target bookmark `demoCustomer:2`
+- **AND** the command replay mapping SPI returns replacement bookmark `demoCustomer:2` from its common remap method
 - **THEN** the system executes the replayed command against target bookmark `demoCustomer:2`
 
 #### Scenario: Target bookmark is not remapped
 - **WHEN** command replay is about to execute a command whose recorded target bookmark is `demoCustomer:1`
-- **AND** no command replay mapping SPI provides a replacement target bookmark
+- **AND** no command replay mapping SPI provides a replacement bookmark from its common remap method
 - **THEN** the system executes the replayed command against target bookmark `demoCustomer:1`
 
 ### Requirement: Replay mapping SPI can remap reference action parameters before execution
-The system SHALL ask the command replay mapping SPI whether each replayed action parameter represented as `type: "reference"` with a populated `reference` OID should be remapped before command execution.
+The system SHALL ask the command replay mapping SPI's common remap method whether each replayed action parameter represented as `type: "reference"` with a populated `reference` OID should be remapped before command execution.
 When the SPI provides a replacement reference bookmark, the system SHALL execute the replayed command using the replacement parameter reference.
 When no SPI implementation exists or no replacement is provided, the system SHALL execute the replayed command using the recorded parameter reference.
 The system MUST leave non-reference action parameters unchanged by this reference remapping flow.
+The system MUST NOT require the SPI to receive parameter name or parameter index metadata to remap a reference action parameter.
 
 #### Scenario: Reference action parameter is remapped
 - **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
-- **AND** the command replay mapping SPI returns replacement reference bookmark `simple.SimpleObject:2`
+- **AND** the command replay mapping SPI returns replacement bookmark `simple.SimpleObject:2` from its common remap method
 - **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "2"`
 
 #### Scenario: Reference action parameter is not remapped
 - **WHEN** command replay is about to execute an action command with parameter `simpleObject` recorded as `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
-- **AND** no command replay mapping SPI provides a replacement reference bookmark
+- **AND** no command replay mapping SPI provides a replacement bookmark from its common remap method
 - **THEN** the system executes the replayed command with parameter `simpleObject` set to `reference.type: "simple.SimpleObject"` and `reference.id: "1"`
 
 #### Scenario: Non-reference action parameter is not remapped by reference flow
 - **WHEN** command replay is about to execute an action command with a parameter that is not represented as `type: "reference"`
-- **THEN** the system does not ask the reference parameter remapping flow to replace that parameter
+- **THEN** the system does not ask the command replay mapping SPI's common remap method to replace that parameter
 
 ### Requirement: Replay input remapping does not mutate recorded command data
 The system SHALL preserve the imported command log entry's recorded command DTO when applying replay-time target or reference parameter remapping.
@@ -91,3 +91,4 @@ The system SHALL pass target bookmarks to the command replay mapping SPI without
 #### Scenario: Target object is not resolvable before remapping
 - **WHEN** command replay is about to execute a command whose recorded target bookmark does not resolve to a local domain object
 - **THEN** the system can still ask the command replay mapping SPI for a replacement target bookmark
+


(causeway) 04/42: CAUSEWAY-4011: changes delimiter for view model

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 31eabda528c42a910d6d6e9bc1b98ec414366c7c
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jun 3 18:34:36 2026 +0100

    CAUSEWAY-4011: changes delimiter for view model
---
 .../applib/dom/replay/CommandExportManager.java       |  6 ++++--
 .../dom/replay/CommandExportManagerStateTest.java     | 19 +++++++++++++++----
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
index 63166f844dc..493b84b32fb 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManager.java
@@ -232,6 +232,8 @@ private CommandLogEntryRepository commandLogEntryRepository() {
 
     @Data
     public static class State {
+        private static final String DELIMITER = "--";
+
         private final Timestamp timestamp;
         private final int limit;
         private final Mode mode;
@@ -241,7 +243,7 @@ public static State parseMemento(String memento, State fallback) {
                 return fallback;
             }
             try {
-                final String[] parts = memento.split("\\|", -1);
+                String[] parts = memento.split(DELIMITER, -1);
                 if(parts.length != 3) {
                     return fallback;
                 }
@@ -263,7 +265,7 @@ public static State parseMemento(String memento, State fallback) {
         }
 
         public String toMemento() {
-            return TimestampMarshallUtil.toString(timestamp) + "|" + limit + "|" + mode;
+            return TimestampMarshallUtil.toString(timestamp) + DELIMITER + limit + DELIMITER + mode;
         }
     }
 
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManagerStateTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManagerStateTest.java
index 248eeed2c0d..8a1c5b1465d 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManagerStateTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/dom/replay/CommandExportManagerStateTest.java
@@ -37,6 +37,7 @@ void roundtrip_toMemento_and_parseMemento() {
         final String memento = state.toMemento();
         final State parsed = State.parseMemento(memento, null);
 
+        assertThat(memento).contains("--");
         assertThat(parsed).isNotNull();
         assertThat(parsed.getTimestamp()).isEqualTo(timestamp);
         assertThat(parsed.getLimit()).isEqualTo(25);
@@ -74,7 +75,7 @@ void parseMemento_invalid_part_count_returns_fallback() {
     void parseMemento_blank_limit_and_mode_uses_fallback_values() {
         final State fallback = fallbackState();
         final Timestamp timestamp = Timestamp.from(Instant.parse("2026-06-01T00:00:00.000Z"));
-        final String memento = TimestampMarshallUtil.toString(timestamp) + "||";
+        final String memento = TimestampMarshallUtil.toString(timestamp) + "----";
 
         final State parsed = State.parseMemento(memento, fallback);
 
@@ -87,7 +88,7 @@ void parseMemento_blank_limit_and_mode_uses_fallback_values() {
     @Test
     void parseMemento_invalid_limit_returns_fallback() {
         final State fallback = fallbackState();
-        final String memento = TimestampMarshallUtil.toString(fallback.getTimestamp()) + "|abc|EXPORT";
+        final String memento = TimestampMarshallUtil.toString(fallback.getTimestamp()) + "--abc--EXPORT";
 
         final State parsed = State.parseMemento(memento, fallback);
 
@@ -97,7 +98,7 @@ void parseMemento_invalid_limit_returns_fallback() {
     @Test
     void parseMemento_invalid_mode_returns_fallback() {
         final State fallback = fallbackState();
-        final String memento = TimestampMarshallUtil.toString(fallback.getTimestamp()) + "|10|UNKNOWN";
+        final String memento = TimestampMarshallUtil.toString(fallback.getTimestamp()) + "--10--UNKNOWN";
 
         final State parsed = State.parseMemento(memento, fallback);
 
@@ -108,7 +109,7 @@ void parseMemento_invalid_mode_returns_fallback() {
     void parseMemento_invalid_timestamp_uses_fallback_timestamp() {
         final State fallback = fallbackState();
 
-        final State parsed = State.parseMemento("not-a-timestamp|10|UNEXPORT", fallback);
+        final State parsed = State.parseMemento("not-a-timestamp--10--UNEXPORT", fallback);
 
         assertThat(parsed).isNotNull();
         assertThat(parsed.getTimestamp()).isEqualTo(fallback.getTimestamp());
@@ -116,6 +117,16 @@ void parseMemento_invalid_timestamp_uses_fallback_timestamp() {
         assertThat(parsed.getMode()).isEqualTo(Mode.UNEXPORT);
     }
 
+    @Test
+    void parseMemento_legacy_delimiter_returns_fallback() {
+        final State fallback = fallbackState();
+        final String memento = TimestampMarshallUtil.toString(fallback.getTimestamp()) + "|10|UNEXPORT";
+
+        final State parsed = State.parseMemento(memento, fallback);
+
+        assertThat(parsed).isSameAs(fallback);
+    }
+
     @Test
     void parseMemento_invalid_and_null_fallback_returns_null() {
         final State parsed = State.parseMemento("not-three-parts", null);


(causeway) 41/42: CAUSEWAY-4010: updates persistent replay mapping proposal docs

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 71e19a88e3b8897f8bae102681fb897580ab98e1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 23:45:14 2026 +0100

    CAUSEWAY-4010: updates persistent replay mapping proposal docs
---
 openspec/changes/persistent-command-replay-mapping-listener/design.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openspec/changes/persistent-command-replay-mapping-listener/design.md b/openspec/changes/persistent-command-replay-mapping-listener/design.md
index e06dd7526d8..dfdca535693 100644
--- a/openspec/changes/persistent-command-replay-mapping-listener/design.md
+++ b/openspec/changes/persistent-command-replay-mapping-listener/design.md
@@ -52,7 +52,7 @@ A persistent implementation needs to follow the existing command log persistence
   The action should delegate to the abstract repository and return all persisted mappings.
   Concrete persistence modules provide the entity implementations that make the returned objects renderable.
 
-- Add a `.fallback.layout.xml` for the abstract applib mapping entity or for each concrete entity following existing command log layout conventions.
+- Add a `layout.fallback.xml` for the abstract applib mapping entity following existing command log layout conventions.
   The layout should expose recorded and actual bookmark properties and hide technical persistence details where appropriate.
 
 ## Risks / Trade-offs


(causeway) 39/42: CAUSEWAY-4010: adds persistent replay mapping listener

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit d9f918630ed69c21c1b6fad9e9dbf40babb8ee2f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 23:11:46 2026 +0100

    CAUSEWAY-4010: adds persistent replay mapping listener
---
 .../core/config/CausewayConfiguration.java         |  28 +++-
 .../commandlog/applib/app/CommandLogMenu.java      |  27 ++++
 .../applib/dom/CommandReplayResultMapping.java     | 130 ++++++++++++++++
 .../dom/CommandReplayResultMapping.layout.xml      |  41 ++++++
 .../dom/CommandReplayResultMappingRepository.java  |  39 +++++
 ...mmandReplayResultMappingRepositoryAbstract.java |  76 ++++++++++
 .../spi/CommandReplayMappingListenerDefault.java   |   6 +
 ...=> CommandReplayMappingListenerPersistent.java} |  52 ++++---
 .../integtest/CommandLog_IntegTestAbstract.java    |  35 +++++
 .../CommandReplayMappingListenerDefaultTest.java   |  14 ++
 ...ommandReplayMappingListenerPersistentTest.java} | 164 ++++++++++++++++-----
 .../CausewayModuleExtCommandLogPersistenceJdo.java |   9 +-
 .../jdo/dom/CommandReplayResultMapping.java        |  93 ++++++++++++
 .../dom/CommandReplayResultMappingRepository.java  |  47 ++++++
 .../CausewayModuleExtCommandLogPersistenceJpa.java |  12 +-
 .../jpa/dom/CommandReplayResultMapping.java        | 105 +++++++++++++
 .../dom/CommandReplayResultMappingRepository.java  |  47 ++++++
 .../tasks.md                                       |  56 +++----
 18 files changed, 888 insertions(+), 93 deletions(-)

diff --git a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
index 350ffe943d4..7dcc74cac90 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
@@ -3984,7 +3984,26 @@ public enum PersistPolicy {
             public static class ReplayResultMapping {
 
                 /**
-                 * How the default command replay mapping listener handles a conflicting replay result mapping.
+                 * Which built-in command replay mapping listener storage strategy to use.
+                 *
+                 * <p>
+                 *     External property: {@code causeway.extensions.command-log.replay-result-mapping.storage-strategy}.
+                 *     Accepted values are {@code IN_MEMORY} and {@code PERSISTENT}.
+                 * </p>
+                 */
+                public enum StorageStrategy {
+                    /**
+                     * Store replay result mappings in the default listener instance only.
+                     */
+                    IN_MEMORY,
+                    /**
+                     * Store replay result mappings in the configured command log persistence store.
+                     */
+                    PERSISTENT;
+                }
+
+                /**
+                 * How the built-in command replay mapping listener handles a conflicting replay result mapping.
                  *
                  * <p>
                  *     External property: {@code causeway.extensions.command-log.replay-result-mapping.on-conflict-policy}.
@@ -4007,7 +4026,12 @@ public enum OnConflictPolicy {
                 }
 
                 /**
-                 * If replay result mapping conflicts, what should the default listener do?
+                 * Which built-in replay mapping listener storage strategy should be used?
+                 */
+                private StorageStrategy storageStrategy = StorageStrategy.IN_MEMORY;
+
+                /**
+                 * If replay result mapping conflicts, what should the built-in listener do?
                  */
                 private OnConflictPolicy onConflictPolicy = OnConflictPolicy.THROW_EXCEPTION;
             }
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
index 34172393184..3e4ccd62564 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/app/CommandLogMenu.java
@@ -46,6 +46,8 @@
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMappingRepository;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandExportManager_changeLimit;
 import org.apache.causeway.extensions.commandlog.applib.dom.replay.CommandReplayManager;
@@ -80,6 +82,7 @@ public static abstract class ActionDomainEvent<T>
 
 
     final CommandLogEntryRepository commandLogEntryRepository;
+    final Optional<CommandReplayResultMappingRepository> commandReplayResultMappingRepository;
     final ClockService clockService;
     final ReplayContext replayContext;
 
@@ -166,6 +169,30 @@ public DomainEvent() { }
         }
     }
 
+    @Action(
+            commandPublishing = Publishing.DISABLED,
+            domainEvent = findReplayResultMappings.DomainEvent.class,
+            executionPublishing = Publishing.DISABLED,
+            semantics = SemanticsOf.SAFE,
+            typeOf = CommandReplayResultMapping.class
+    )
+    @ActionLayout(cssClassFa = "fa-search", sequence="45")
+    public class findReplayResultMappings {
+        public class DomainEvent extends ActionDomainEvent<findReplayResultMappings> {
+            public DomainEvent() { }
+        }
+
+        @MemberSupport public List<? extends CommandReplayResultMapping> act() {
+            return commandReplayResultMappingRepository
+                    .map(CommandReplayResultMappingRepository::findAll)
+                    .orElseGet(List::of);
+        }
+
+        @MemberSupport public boolean hideAct() {
+            return commandReplayResultMappingRepository.isEmpty();
+        }
+    }
+
     @Action(
             commandPublishing = Publishing.DISABLED,
             domainEvent = exportManager.DomainEvent.class,
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.java
new file mode 100644
index 00000000000..d13ef46c2d3
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.java
@@ -0,0 +1,130 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.dom;
+
+import javax.inject.Named;
+
+import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.DomainObjectLayout;
+import org.apache.causeway.applib.annotation.Editing;
+import org.apache.causeway.applib.annotation.Programmatic;
+import org.apache.causeway.applib.annotation.Property;
+import org.apache.causeway.applib.annotation.Publishing;
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
+
+import lombok.NoArgsConstructor;
+import lombok.experimental.UtilityClass;
+
+@Named(CommandReplayResultMapping.LOGICAL_TYPE_NAME)
+@DomainObject(
+        editing = Editing.DISABLED,
+        entityChangePublishing = Publishing.DISABLED
+)
+@DomainObjectLayout(
+        titleUiEvent = CommandReplayResultMapping.TitleUiEvent.class,
+        iconUiEvent = CommandReplayResultMapping.IconUiEvent.class,
+        cssClassUiEvent = CommandReplayResultMapping.CssClassUiEvent.class,
+        layoutUiEvent = CommandReplayResultMapping.LayoutUiEvent.class
+)
+@NoArgsConstructor
+public abstract class CommandReplayResultMapping {
+
+    public static final String LOGICAL_TYPE_NAME = CausewayModuleExtCommandLogApplib.NAMESPACE + ".CommandReplayResultMapping";
+    public static final String SCHEMA = CausewayModuleExtCommandLogApplib.SCHEMA;
+    public static final String TABLE = "CommandReplayResultMapping";
+
+    public static class TitleUiEvent extends CausewayModuleExtCommandLogApplib.TitleUiEvent<CommandReplayResultMapping> { }
+    public static class IconUiEvent extends CausewayModuleExtCommandLogApplib.IconUiEvent<CommandReplayResultMapping> { }
+    public static class CssClassUiEvent extends CausewayModuleExtCommandLogApplib.CssClassUiEvent<CommandReplayResultMapping> { }
+    public static class LayoutUiEvent extends CausewayModuleExtCommandLogApplib.LayoutUiEvent<CommandReplayResultMapping> { }
+
+    @UtilityClass
+    public static class Nq {
+        public static final String FIND = LOGICAL_TYPE_NAME + ".find";
+        public static final String FIND_BY_RECORDED_BOOKMARK = LOGICAL_TYPE_NAME + ".findByRecordedBookmark";
+    }
+
+    @Programmatic
+    public void init(final Bookmark recordedBookmark, final Bookmark actualBookmark) {
+        setRecordedLogicalTypeName(recordedBookmark.getLogicalTypeName());
+        setRecordedIdentifier(recordedBookmark.getIdentifier());
+        setActualLogicalTypeName(actualBookmark.getLogicalTypeName());
+        setActualIdentifier(actualBookmark.getIdentifier());
+    }
+
+    @Programmatic
+    public Bookmark getRecordedBookmark() {
+        return Bookmark.forLogicalTypeNameAndIdentifier(getRecordedLogicalTypeName(), getRecordedIdentifier());
+    }
+
+    @Programmatic
+    public Bookmark getActualBookmark() {
+        return Bookmark.forLogicalTypeNameAndIdentifier(getActualLogicalTypeName(), getActualIdentifier());
+    }
+
+    @Property
+    @RecordedLogicalTypeName
+    public abstract String getRecordedLogicalTypeName();
+    public abstract void setRecordedLogicalTypeName(String recordedLogicalTypeName);
+
+    @Property
+    @RecordedIdentifier
+    public abstract String getRecordedIdentifier();
+    public abstract void setRecordedIdentifier(String recordedIdentifier);
+
+    @Property
+    @ActualLogicalTypeName
+    public abstract String getActualLogicalTypeName();
+    public abstract void setActualLogicalTypeName(String actualLogicalTypeName);
+
+    @Property
+    @ActualIdentifier
+    public abstract String getActualIdentifier();
+    public abstract void setActualIdentifier(String actualIdentifier);
+
+    public @interface RecordedLogicalTypeName {
+        String NAME = "recordedLogicalTypeName";
+        int MAX_LENGTH = 255;
+        boolean NULLABLE = false;
+        String ALLOWS_NULL = "false";
+    }
+
+    public @interface RecordedIdentifier {
+        String NAME = "recordedIdentifier";
+        int MAX_LENGTH = 2000;
+        boolean NULLABLE = false;
+        String ALLOWS_NULL = "false";
+    }
+
+    public @interface ActualLogicalTypeName {
+        String NAME = "actualLogicalTypeName";
+        int MAX_LENGTH = 255;
+        boolean NULLABLE = false;
+        String ALLOWS_NULL = "false";
+    }
+
+    public @interface ActualIdentifier {
+        String NAME = "actualIdentifier";
+        int MAX_LENGTH = 2000;
+        boolean NULLABLE = false;
+        String ALLOWS_NULL = "false";
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.xml b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.xml
new file mode 100644
index 00000000000..e6d1718bc2b
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMapping.layout.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~        http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+<bs:grid xsi:schemaLocation="https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd https://causeway.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns:c="https://causeway.apache.org/applib/layout/component" xmlns:bs="https://causeway.apache.org/applib/layout/grid/bootstrap3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <bs:row>
+        <bs:col span="12" unreferencedActions="true">
+            <c:domainObject bookmarking="AS_ROOT"/>
+        </bs:col>
+    </bs:row>
+    <bs:row>
+        <bs:col span="6">
+            <c:fieldSet name="Recorded Bookmark" id="recorded">
+                <c:property id="recordedLogicalTypeName"/>
+                <c:property id="recordedIdentifier"/>
+            </c:fieldSet>
+        </bs:col>
+        <bs:col span="6">
+            <c:fieldSet name="Actual Bookmark" id="actual">
+                <c:property id="actualLogicalTypeName"/>
+                <c:property id="actualIdentifier"/>
+            </c:fieldSet>
+        </bs:col>
+    </bs:row>
+</bs:grid>
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepository.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepository.java
new file mode 100644
index 00000000000..bf72c63dc24
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepository.java
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.dom;
+
+import java.util.List;
+import java.util.Optional;
+
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+
+/**
+ * Provides supporting functionality for querying and persisting replay result mappings.
+ *
+ * @since 2.1 {@index}
+ */
+public interface CommandReplayResultMappingRepository {
+
+    Optional<CommandReplayResultMapping> findByRecordedBookmark(final Bookmark recordedBookmark);
+
+    List<? extends CommandReplayResultMapping> findAll();
+
+    CommandReplayResultMapping createAndPersist(final Bookmark recordedBookmark, final Bookmark actualBookmark);
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepositoryAbstract.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepositoryAbstract.java
new file mode 100644
index 00000000000..5e32fcb3482
--- /dev/null
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandReplayResultMappingRepositoryAbstract.java
@@ -0,0 +1,76 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.applib.dom;
+
+import java.util.List;
+import java.util.Optional;
+
+import javax.inject.Inject;
+import javax.inject.Provider;
+
+import org.apache.causeway.applib.query.Query;
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.applib.services.factory.FactoryService;
+import org.apache.causeway.applib.services.repository.RepositoryService;
+import org.apache.causeway.commons.internal.base._Casts;
+
+/**
+ * Provides supporting functionality for querying and persisting replay result mapping entities.
+ *
+ * @since 2.1 {@index}
+ */
+public abstract class CommandReplayResultMappingRepositoryAbstract<C extends CommandReplayResultMapping>
+implements CommandReplayResultMappingRepository {
+
+    @Inject Provider<RepositoryService> repositoryServiceProvider;
+    @Inject FactoryService factoryService;
+
+    private final Class<C> entityClass;
+
+    protected CommandReplayResultMappingRepositoryAbstract(final Class<C> entityClass) {
+        this.entityClass = entityClass;
+    }
+
+    @Override
+    public Optional<CommandReplayResultMapping> findByRecordedBookmark(final Bookmark recordedBookmark) {
+        return _Casts.uncheckedCast(repositoryService().firstMatch(
+                Query.named(entityClass, CommandReplayResultMapping.Nq.FIND_BY_RECORDED_BOOKMARK)
+                        .withParameter("recordedLogicalTypeName", recordedBookmark.getLogicalTypeName())
+                        .withParameter("recordedIdentifier", recordedBookmark.getIdentifier())));
+    }
+
+    @Override
+    public List<? extends CommandReplayResultMapping> findAll() {
+        return _Casts.uncheckedCast(repositoryService().allMatches(
+                Query.named(entityClass, CommandReplayResultMapping.Nq.FIND)));
+    }
+
+    @Override
+    public CommandReplayResultMapping createAndPersist(final Bookmark recordedBookmark, final Bookmark actualBookmark) {
+        C mapping = factoryService.detachedEntity(entityClass);
+        mapping.init(recordedBookmark, actualBookmark);
+        repositoryService().persistAndFlush(mapping);
+        return mapping;
+    }
+
+    private RepositoryService repositoryService() {
+        return repositoryServiceProvider.get();
+    }
+
+}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
index 39a58bdce6d..47045684b84 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
@@ -23,6 +23,7 @@
 import java.util.Optional;
 
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
@@ -91,6 +92,11 @@ public static class BeanFactory {
 
         @Bean
         @ConditionalOnMissingBean(CommandReplayMappingListener.class)
+        @ConditionalOnProperty(
+                prefix = "causeway.extensions.command-log.replay-result-mapping",
+                name = "storage-strategy",
+                havingValue = "IN_MEMORY",
+                matchIfMissing = true)
         CommandReplayMappingListener commandReplayMappingListenerDefault(
                 final CausewayConfiguration causewayConfiguration) {
             return new CommandReplayMappingListenerDefault(causewayConfiguration
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistent.java
similarity index 57%
copy from extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
copy to extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistent.java
index 39a58bdce6d..77ee5c94f48 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefault.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistent.java
@@ -18,11 +18,11 @@
  */
 package org.apache.causeway.extensions.commandlog.applib.spi;
 
-import java.util.HashMap;
-import java.util.Map;
 import java.util.Optional;
 
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
@@ -30,25 +30,26 @@
 import org.apache.causeway.core.config.CausewayConfiguration;
 import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping.OnConflictPolicy;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMappingRepository;
 
 import lombok.extern.log4j.Log4j2;
 
 /**
- * Default in-memory implementation of {@link CommandReplayMappingListener}.
+ * Persistent implementation of {@link CommandReplayMappingListener}.
  *
  * @since 2.1 {@index}
  */
 @Log4j2
-public class CommandReplayMappingListenerDefault implements CommandReplayMappingListener {
+public class CommandReplayMappingListenerPersistent implements CommandReplayMappingListener {
 
-    private final Map<Bookmark, Bookmark> actualBookmarkByRecordedBookmark = new HashMap<>();
+    private final CommandReplayResultMappingRepository commandReplayResultMappingRepository;
     private final OnConflictPolicy onConflictPolicy;
 
-    public CommandReplayMappingListenerDefault() {
-        this(OnConflictPolicy.THROW_EXCEPTION);
-    }
-
-    CommandReplayMappingListenerDefault(final OnConflictPolicy onConflictPolicy) {
+    public CommandReplayMappingListenerPersistent(
+            final CommandReplayResultMappingRepository commandReplayResultMappingRepository,
+            final OnConflictPolicy onConflictPolicy) {
+        this.commandReplayResultMappingRepository = commandReplayResultMappingRepository;
         this.onConflictPolicy = onConflictPolicy;
     }
 
@@ -56,7 +57,8 @@ public CommandReplayMappingListenerDefault() {
     public Optional<Bookmark> remap(
             final CommandLogEntry commandLogEntry,
             final Bookmark recordedBookmark) {
-        return Optional.ofNullable(actualBookmarkByRecordedBookmark.get(recordedBookmark));
+        return commandReplayResultMappingRepository.findByRecordedBookmark(recordedBookmark)
+                .map(CommandReplayResultMapping::getActualBookmark);
     }
 
     @Override
@@ -67,11 +69,13 @@ public void onReplayResultMapped(
         if(recordedResult.equals(actualResult)) {
             return;
         }
-        final Bookmark existingActualResult = actualBookmarkByRecordedBookmark.get(recordedResult);
-        if(existingActualResult == null) {
-            actualBookmarkByRecordedBookmark.put(recordedResult, actualResult);
+        final Optional<CommandReplayResultMapping> existingMappingIfAny =
+                commandReplayResultMappingRepository.findByRecordedBookmark(recordedResult);
+        if(existingMappingIfAny.isEmpty()) {
+            commandReplayResultMappingRepository.createAndPersist(recordedResult, actualResult);
             return;
         }
+        final Bookmark existingActualResult = existingMappingIfAny.get().getActualBookmark();
         if(!existingActualResult.equals(actualResult)) {
             final String message = String.format(
                     "Recorded result bookmark '%s' was already mapped to actual bookmark '%s', cannot remap to '%s'",
@@ -90,14 +94,22 @@ public void onReplayResultMapped(
     public static class BeanFactory {
 
         @Bean
+        @ConditionalOnBean(CommandReplayResultMappingRepository.class)
         @ConditionalOnMissingBean(CommandReplayMappingListener.class)
-        CommandReplayMappingListener commandReplayMappingListenerDefault(
+        @ConditionalOnProperty(
+                prefix = "causeway.extensions.command-log.replay-result-mapping",
+                name = "storage-strategy",
+                havingValue = "PERSISTENT")
+        CommandReplayMappingListener commandReplayMappingListenerPersistent(
+                final CommandReplayResultMappingRepository commandReplayResultMappingRepository,
                 final CausewayConfiguration causewayConfiguration) {
-            return new CommandReplayMappingListenerDefault(causewayConfiguration
-                    .getExtensions()
-                    .getCommandLog()
-                    .getReplayResultMapping()
-                    .getOnConflictPolicy());
+            return new CommandReplayMappingListenerPersistent(
+                    commandReplayResultMappingRepository,
+                    causewayConfiguration
+                            .getExtensions()
+                            .getCommandLog()
+                            .getReplayResultMapping()
+                            .getOnConflictPolicy());
         }
 
     }
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java
index 25f08554460..ed271259221 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java
@@ -41,7 +41,10 @@
 import org.apache.causeway.core.config.presets.CausewayPresets;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMappingRepository;
 import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListenerPersistent;
+import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping.OnConflictPolicy;
 import org.apache.causeway.extensions.commandlog.applib.integtest.model.Counter;
 import org.apache.causeway.extensions.commandlog.applib.integtest.model.CounterRepository;
 import org.apache.causeway.extensions.commandlog.applib.integtest.model.Counter_bumpUsingMixin;
@@ -89,6 +92,37 @@ void beforeEach() {
     protected abstract Counter newCounter(String name);
 
 
+    @Test
+    void replay_result_mapping_repository_and_persistent_listener() {
+        String suffix = UUID.randomUUID().toString();
+        Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "recorded-" + suffix);
+        Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "actual-" + suffix);
+        Bookmark conflictingActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "conflicting-" + suffix);
+
+        CommandReplayMappingListenerPersistent listener = new CommandReplayMappingListenerPersistent(
+                commandReplayResultMappingRepository, OnConflictPolicy.THROW_EXCEPTION);
+
+        listener.onReplayResultMapped(recordedResult, actualResult, null);
+        listener.onReplayResultMapped(recordedResult, actualResult, null);
+
+        assertThat(commandReplayResultMappingRepository.findByRecordedBookmark(recordedResult))
+                .isPresent()
+                .get()
+                .extracting("actualBookmark")
+                .isEqualTo(actualResult);
+        assertThat(commandReplayResultMappingRepository.findAll())
+                .anySatisfy(mapping -> assertThat(mapping.getRecordedBookmark()).isEqualTo(recordedResult));
+        assertThat(listener.remap(null, recordedResult)).contains(actualResult);
+
+        Assertions.assertThatThrownBy(() -> listener.onReplayResultMapped(recordedResult, conflictingActualResult, null))
+                .isInstanceOf(IllegalStateException.class);
+        assertThat(commandReplayResultMappingRepository.findByRecordedBookmark(recordedResult))
+                .isPresent()
+                .get()
+                .extracting("actualBookmark")
+                .isEqualTo(actualResult);
+    }
+
     @Test
     void invoke_mixin() {
 
@@ -477,6 +511,7 @@ void test_all_the_repository_methods() {
     }
 
     @Inject CommandLogEntryRepository commandLogEntryRepository;
+    @Inject CommandReplayResultMappingRepository commandReplayResultMappingRepository;
     @Inject SudoService sudoService;
     @Inject ClockService clockService;
     @Inject InteractionService interactionService;
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
index 4cd09e11d6d..3cc3dee61e3 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
@@ -22,12 +22,14 @@
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 
+import java.util.Map;
 import java.util.Optional;
 
 import org.junit.jupiter.api.Test;
 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.MapPropertySource;
 import org.springframework.core.env.StandardEnvironment;
 
 import org.apache.causeway.applib.services.bookmark.Bookmark;
@@ -140,6 +142,18 @@ void autoconfiguration_backs_off_when_custom_listener_exists() {
         }
     }
 
+    @Test
+    void autoconfiguration_does_not_create_in_memory_listener_when_persistent_storage_is_configured() {
+        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
+            context.getEnvironment().getPropertySources().addFirst(new MapPropertySource("test", Map.of(
+                    "causeway.extensions.command-log.replay-result-mapping.storage-strategy", "PERSISTENT")));
+            context.register(CausewayConfigurationForTest.class, CommandReplayMappingListenerDefault.BeanFactory.class);
+            context.refresh();
+
+            assertThat(context.getBeansOfType(CommandReplayMappingListener.class)).isEmpty();
+        }
+    }
+
     @Test
     void autoconfiguration_uses_configured_conflict_policy() {
         try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistentTest.java
similarity index 53%
copy from extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
copy to extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistentTest.java
index 4cd09e11d6d..95d614d84d0 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerDefaultTest.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/spi/CommandReplayMappingListenerPersistentTest.java
@@ -22,24 +22,33 @@
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 
 import org.junit.jupiter.api.Test;
 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.MapPropertySource;
 import org.springframework.core.env.StandardEnvironment;
 
 import org.apache.causeway.applib.services.bookmark.Bookmark;
 import org.apache.causeway.core.config.CausewayConfiguration;
 import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping.OnConflictPolicy;
 import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMappingRepository;
 
-class CommandReplayMappingListenerDefaultTest {
+class CommandReplayMappingListenerPersistentTest {
 
     @Test
     void records_result_mapping_and_returns_it_from_remap() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        FakeRepository repository = new FakeRepository();
+        CommandReplayMappingListenerPersistent listener = new CommandReplayMappingListenerPersistent(
+                repository, OnConflictPolicy.THROW_EXCEPTION);
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -47,22 +56,28 @@ void records_result_mapping_and_returns_it_from_remap() {
         listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
 
         assertThat(listener.remap(commandLogEntry, recordedResult)).contains(actualResult);
+        assertThat(repository.findAll()).hasSize(1);
     }
 
     @Test
     void equal_recorded_and_actual_bookmark_is_not_recorded() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        FakeRepository repository = new FakeRepository();
+        CommandReplayMappingListenerPersistent listener = new CommandReplayMappingListenerPersistent(
+                repository, OnConflictPolicy.THROW_EXCEPTION);
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
 
         listener.onReplayResultMapped(recordedResult, recordedResult, commandLogEntry);
 
         assertThat(listener.remap(commandLogEntry, recordedResult)).isEmpty();
+        assertThat(repository.findAll()).isEmpty();
     }
 
     @Test
     void repeated_recorded_bookmark_mapping_with_same_actual_bookmark_is_idempotent() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        FakeRepository repository = new FakeRepository();
+        CommandReplayMappingListenerPersistent listener = new CommandReplayMappingListenerPersistent(
+                repository, OnConflictPolicy.THROW_EXCEPTION);
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark actualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -71,11 +86,14 @@ void repeated_recorded_bookmark_mapping_with_same_actual_bookmark_is_idempotent(
         listener.onReplayResultMapped(recordedResult, actualResult, commandLogEntry);
 
         assertThat(listener.remap(commandLogEntry, recordedResult)).contains(actualResult);
+        assertThat(repository.findAll()).hasSize(1);
     }
 
     @Test
     void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_rejected_by_default() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
+        FakeRepository repository = new FakeRepository();
+        CommandReplayMappingListenerPersistent listener = new CommandReplayMappingListenerPersistent(
+                repository, OnConflictPolicy.THROW_EXCEPTION);
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -93,7 +111,9 @@ void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_reject
 
     @Test
     void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_logged_and_ignored_when_configured() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault(OnConflictPolicy.LOG_AND_CONTINUE);
+        FakeRepository repository = new FakeRepository();
+        CommandReplayMappingListenerPersistent listener = new CommandReplayMappingListenerPersistent(
+                repository, OnConflictPolicy.LOG_AND_CONTINUE);
         CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
         Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
         Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
@@ -103,34 +123,38 @@ void repeated_recorded_bookmark_mapping_with_different_actual_bookmark_is_logged
         listener.onReplayResultMapped(recordedResult, secondActualResult, commandLogEntry);
 
         assertThat(listener.remap(commandLogEntry, recordedResult)).contains(firstActualResult);
+        assertThat(repository.findAll()).hasSize(1);
     }
 
     @Test
-    void unmapped_bookmark_returns_no_replacement() {
-        CommandReplayMappingListenerDefault listener = new CommandReplayMappingListenerDefault();
-        CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
-        Bookmark recordedBookmark = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
+    void autoconfiguration_creates_persistent_listener_when_configured() {
+        try (AnnotationConfigApplicationContext context = contextWithPersistentStorage(
+                CausewayConfigurationForTest.class,
+                RepositoryConfiguration.class,
+                CommandReplayMappingListenerPersistent.BeanFactory.class)) {
 
-        assertThat(listener.remap(commandLogEntry, recordedBookmark)).isEmpty();
+            assertThat(context.getBean(CommandReplayMappingListener.class))
+                    .isInstanceOf(CommandReplayMappingListenerPersistent.class);
+        }
     }
 
     @Test
-    void autoconfiguration_creates_default_listener_when_missing() {
-        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+    void autoconfiguration_does_not_create_persistent_listener_without_repository() {
+        try (AnnotationConfigApplicationContext context = contextWithPersistentStorage(
                 CausewayConfigurationForTest.class,
-                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+                CommandReplayMappingListenerPersistent.BeanFactory.class)) {
 
-            assertThat(context.getBean(CommandReplayMappingListener.class))
-                    .isInstanceOf(CommandReplayMappingListenerDefault.class);
+            assertThat(context.getBeansOfType(CommandReplayMappingListener.class)).isEmpty();
         }
     }
 
     @Test
     void autoconfiguration_backs_off_when_custom_listener_exists() {
-        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
+        try (AnnotationConfigApplicationContext context = contextWithPersistentStorage(
                 CausewayConfigurationForTest.class,
+                RepositoryConfiguration.class,
                 CustomListenerConfiguration.class,
-                CommandReplayMappingListenerDefault.BeanFactory.class)) {
+                CommandReplayMappingListenerPersistent.BeanFactory.class)) {
 
             assertThat(context.getBeansOfType(CommandReplayMappingListener.class))
                     .hasSize(1)
@@ -140,22 +164,13 @@ void autoconfiguration_backs_off_when_custom_listener_exists() {
         }
     }
 
-    @Test
-    void autoconfiguration_uses_configured_conflict_policy() {
-        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
-                LogAndContinueCausewayConfigurationForTest.class,
-                CommandReplayMappingListenerDefault.BeanFactory.class)) {
-            CommandReplayMappingListener listener = context.getBean(CommandReplayMappingListener.class);
-            CommandLogEntry commandLogEntry = mock(CommandLogEntry.class);
-            Bookmark recordedResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "1");
-            Bookmark firstActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "2");
-            Bookmark secondActualResult = Bookmark.forLogicalTypeNameAndIdentifier("demoInvoice", "3");
-
-            listener.onReplayResultMapped(recordedResult, firstActualResult, commandLogEntry);
-            listener.onReplayResultMapped(recordedResult, secondActualResult, commandLogEntry);
-
-            assertThat(listener.remap(commandLogEntry, recordedResult)).contains(firstActualResult);
-        }
+    private static AnnotationConfigApplicationContext contextWithPersistentStorage(final Class<?>... configClasses) {
+        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
+        context.getEnvironment().getPropertySources().addFirst(new MapPropertySource("test", Map.of(
+                "causeway.extensions.command-log.replay-result-mapping.storage-strategy", "PERSISTENT")));
+        context.register(configClasses);
+        context.refresh();
+        return context;
     }
 
     @Configuration(proxyBeanMethods = false)
@@ -169,14 +184,13 @@ CausewayConfiguration causewayConfiguration() {
     }
 
     @Configuration(proxyBeanMethods = false)
-    static class LogAndContinueCausewayConfigurationForTest {
+    static class RepositoryConfiguration {
+
+        static final FakeRepository REPOSITORY = new FakeRepository();
 
         @Bean
-        CausewayConfiguration causewayConfiguration() {
-            CausewayConfiguration causewayConfiguration = new CausewayConfiguration(new StandardEnvironment(), Optional.empty());
-            causewayConfiguration.getExtensions().getCommandLog().getReplayResultMapping()
-                    .setOnConflictPolicy(OnConflictPolicy.LOG_AND_CONTINUE);
-            return causewayConfiguration;
+        CommandReplayResultMappingRepository commandReplayResultMappingRepository() {
+            return REPOSITORY;
         }
 
     }
@@ -193,4 +207,74 @@ CommandReplayMappingListener customCommandReplayMappingListener() {
 
     }
 
+    static class FakeRepository implements CommandReplayResultMappingRepository {
+
+        private final Map<Bookmark, CommandReplayResultMapping> mappings = new LinkedHashMap<>();
+
+        @Override
+        public Optional<CommandReplayResultMapping> findByRecordedBookmark(final Bookmark recordedBookmark) {
+            return Optional.ofNullable(mappings.get(recordedBookmark));
+        }
+
+        @Override
+        public List<? extends CommandReplayResultMapping> findAll() {
+            return new ArrayList<>(mappings.values());
+        }
+
+        @Override
+        public CommandReplayResultMapping createAndPersist(final Bookmark recordedBookmark, final Bookmark actualBookmark) {
+            FakeMapping mapping = new FakeMapping();
+            mapping.init(recordedBookmark, actualBookmark);
+            mappings.put(recordedBookmark, mapping);
+            return mapping;
+        }
+    }
+
+    static class FakeMapping extends CommandReplayResultMapping {
+
+        private String recordedLogicalTypeName;
+        private String recordedIdentifier;
+        private String actualLogicalTypeName;
+        private String actualIdentifier;
+
+        @Override
+        public String getRecordedLogicalTypeName() {
+            return recordedLogicalTypeName;
+        }
+
+        @Override
+        public void setRecordedLogicalTypeName(final String recordedLogicalTypeName) {
+            this.recordedLogicalTypeName = recordedLogicalTypeName;
+        }
+
+        @Override
+        public String getRecordedIdentifier() {
+            return recordedIdentifier;
+        }
+
+        @Override
+        public void setRecordedIdentifier(final String recordedIdentifier) {
+            this.recordedIdentifier = recordedIdentifier;
+        }
+
+        @Override
+        public String getActualLogicalTypeName() {
+            return actualLogicalTypeName;
+        }
+
+        @Override
+        public void setActualLogicalTypeName(final String actualLogicalTypeName) {
+            this.actualLogicalTypeName = actualLogicalTypeName;
+        }
+
+        @Override
+        public String getActualIdentifier() {
+            return actualIdentifier;
+        }
+
+        @Override
+        public void setActualIdentifier(final String actualIdentifier) {
+            this.actualIdentifier = actualIdentifier;
+        }
+    }
 }
diff --git a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/CausewayModuleExtCommandLogPersistenceJdo.java b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/CausewayModuleExtCommandLogPersistenceJdo.java
index 5d0ce7f1fd2..7d18f2a7d2b 100644
--- a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/CausewayModuleExtCommandLogPersistenceJdo.java
+++ b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/CausewayModuleExtCommandLogPersistenceJdo.java
@@ -22,8 +22,11 @@
 import org.springframework.context.annotation.Import;
 
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListenerPersistent;
 import org.apache.causeway.extensions.commandlog.jdo.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.jdo.dom.CommandLogEntryRepository;
+import org.apache.causeway.extensions.commandlog.jdo.dom.CommandReplayResultMapping;
+import org.apache.causeway.extensions.commandlog.jdo.dom.CommandReplayResultMappingRepository;
 import org.apache.causeway.persistence.jdo.datanucleus.CausewayModulePersistenceJdoDatanucleus;
 import org.apache.causeway.testing.fixtures.applib.fixturescripts.FixtureScript;
 import org.apache.causeway.testing.fixtures.applib.modules.ModuleWithFixtures;
@@ -40,9 +43,12 @@
 
         // @Service's
         CommandLogEntryRepository.class,
+        CommandReplayResultMappingRepository.class,
+        CommandReplayMappingListenerPersistent.BeanFactory.class,
 
         // entities
-        CommandLogEntry.class
+        CommandLogEntry.class,
+        CommandReplayResultMapping.class
 })
 public class CausewayModuleExtCommandLogPersistenceJdo {
 
@@ -57,6 +63,7 @@ public FixtureScript teardownFixture() {
         return new TeardownFixtureJdoAbstract() {
             @Override
             protected void execute(final ExecutionContext executionContext) {
+                deleteFrom(CommandReplayResultMapping.class);
                 deleteFrom(CommandLogEntry.class);
             }
         };
diff --git a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMapping.java b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMapping.java
new file mode 100644
index 00000000000..42ac70f9c9a
--- /dev/null
+++ b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMapping.java
@@ -0,0 +1,93 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.jdo.dom;
+
+import javax.inject.Named;
+import javax.jdo.annotations.Column;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.Index;
+import javax.jdo.annotations.Indices;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.Queries;
+import javax.jdo.annotations.Query;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.Editing;
+import org.apache.causeway.applib.annotation.Publishing;
+import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.Nq;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@PersistenceCapable(
+        identityType = IdentityType.DATASTORE,
+        schema = CommandReplayResultMapping.SCHEMA,
+        table = CommandReplayResultMapping.TABLE)
+@Indices({
+        @Index(name = "CommandReplayResultMapping__recorded__IDX", members = { "recordedLogicalTypeName", "recordedIdentifier" }, unique = "true"),
+})
+@Queries({
+    @Query(
+            name = Nq.FIND,
+            value = "SELECT "
+                  + "  FROM " + CommandReplayResultMapping.FQCN + " "
+                  + " ORDER BY recordedLogicalTypeName ASC, recordedIdentifier ASC"),
+    @Query(
+            name = Nq.FIND_BY_RECORDED_BOOKMARK,
+            value = "SELECT "
+                  + "  FROM " + CommandReplayResultMapping.FQCN + " "
+                  + " WHERE recordedLogicalTypeName == :recordedLogicalTypeName "
+                  + "    && recordedIdentifier == :recordedIdentifier")
+})
+@Named(org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.LOGICAL_TYPE_NAME)
+@DomainObject(
+        editing = Editing.DISABLED,
+        entityChangePublishing = Publishing.DISABLED
+)
+@XmlJavaTypeAdapter(PersistentEntityAdapter.class)
+@NoArgsConstructor
+public class CommandReplayResultMapping
+extends org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping {
+
+    public static final String FQCN = "org.apache.causeway.extensions.commandlog.jdo.dom.CommandReplayResultMapping";
+
+    @Column(allowsNull = RecordedLogicalTypeName.ALLOWS_NULL, length = RecordedLogicalTypeName.MAX_LENGTH)
+    @RecordedLogicalTypeName
+    @Getter @Setter
+    private String recordedLogicalTypeName;
+
+    @Column(allowsNull = RecordedIdentifier.ALLOWS_NULL, length = RecordedIdentifier.MAX_LENGTH)
+    @RecordedIdentifier
+    @Getter @Setter
+    private String recordedIdentifier;
+
+    @Column(allowsNull = ActualLogicalTypeName.ALLOWS_NULL, length = ActualLogicalTypeName.MAX_LENGTH)
+    @ActualLogicalTypeName
+    @Getter @Setter
+    private String actualLogicalTypeName;
+
+    @Column(allowsNull = ActualIdentifier.ALLOWS_NULL, length = ActualIdentifier.MAX_LENGTH)
+    @ActualIdentifier
+    @Getter @Setter
+    private String actualIdentifier;
+
+}
diff --git a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMappingRepository.java b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMappingRepository.java
new file mode 100644
index 00000000000..5484d3dd9e8
--- /dev/null
+++ b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/causeway/extensions/commandlog/jdo/dom/CommandReplayResultMappingRepository.java
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.jdo.dom;
+
+import javax.inject.Named;
+
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+import org.apache.causeway.applib.annotation.PriorityPrecedence;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMappingRepositoryAbstract;
+import org.apache.causeway.extensions.commandlog.jdo.CausewayModuleExtCommandLogPersistenceJdo;
+
+/**
+ * Provides supporting functionality for querying and persisting replay result mappings.
+ */
+@Service
+@Named(CommandReplayResultMappingRepository.LOGICAL_TYPE_NAME)
+@javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
+@Qualifier("Jdo")
+public class CommandReplayResultMappingRepository
+extends CommandReplayResultMappingRepositoryAbstract<CommandReplayResultMapping> {
+
+    public static final String LOGICAL_TYPE_NAME =
+            CausewayModuleExtCommandLogPersistenceJdo.NAMESPACE + ".CommandReplayResultMappingRepository";
+
+    public CommandReplayResultMappingRepository() {
+        super(CommandReplayResultMapping.class);
+    }
+
+}
diff --git a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/CausewayModuleExtCommandLogPersistenceJpa.java b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/CausewayModuleExtCommandLogPersistenceJpa.java
index 681c811a2f7..cc7c60cd1f0 100644
--- a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/CausewayModuleExtCommandLogPersistenceJpa.java
+++ b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/CausewayModuleExtCommandLogPersistenceJpa.java
@@ -23,9 +23,12 @@
 import org.springframework.context.annotation.Import;
 
 import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
+import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListenerPersistent;
 import org.apache.causeway.extensions.commandlog.jpa.dom.CommandLogEntry;
 import org.apache.causeway.extensions.commandlog.jpa.dom.CommandLogEntryPK;
 import org.apache.causeway.extensions.commandlog.jpa.dom.CommandLogEntryRepository;
+import org.apache.causeway.extensions.commandlog.jpa.dom.CommandReplayResultMapping;
+import org.apache.causeway.extensions.commandlog.jpa.dom.CommandReplayResultMappingRepository;
 import org.apache.causeway.persistence.jpa.eclipselink.CausewayModulePersistenceJpaEclipselink;
 import org.apache.causeway.testing.fixtures.applib.CausewayModuleTestingFixturesApplib;
 import org.apache.causeway.testing.fixtures.applib.fixturescripts.FixtureScript;
@@ -45,12 +48,16 @@
         // @Service's
         CommandLogEntryRepository.class,
         CommandLogEntryPK.Semantics.class,
+        CommandReplayResultMappingRepository.class,
+        CommandReplayMappingListenerPersistent.BeanFactory.class,
 
         // entities
-        CommandLogEntry.class
+        CommandLogEntry.class,
+        CommandReplayResultMapping.class
 })
 @EntityScan(basePackageClasses = {
-    CommandLogEntry.class
+    CommandLogEntry.class,
+    CommandReplayResultMapping.class
 })
 public class CausewayModuleExtCommandLogPersistenceJpa {
 
@@ -65,6 +72,7 @@ public FixtureScript teardownFixture() {
         return new TeardownFixtureJpaAbstract() {
             @Override
             protected void execute(final ExecutionContext executionContext) {
+                deleteFrom(CommandReplayResultMapping.class);
                 deleteFrom(CommandLogEntry.class);
             }
         };
diff --git a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMapping.java b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMapping.java
new file mode 100644
index 00000000000..857361881c9
--- /dev/null
+++ b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMapping.java
@@ -0,0 +1,105 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.jpa.dom;
+
+import javax.inject.Named;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityListeners;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.Editing;
+import org.apache.causeway.applib.annotation.Publishing;
+import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.Nq;
+import org.apache.causeway.persistence.jpa.applib.integration.CausewayEntityListener;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Entity
+@Table(
+        schema = CommandReplayResultMapping.SCHEMA,
+        name = CommandReplayResultMapping.TABLE,
+        indexes = {
+                @Index(name = "CommandReplayResultMapping__recorded__IDX", columnList = "recordedLogicalTypeName, recordedIdentifier")
+        },
+        uniqueConstraints = {
+                @UniqueConstraint(name = "CommandReplayResultMapping__recorded__UNQ", columnNames = { "recordedLogicalTypeName", "recordedIdentifier" })
+        }
+)
+@NamedQueries({
+    @NamedQuery(
+            name = Nq.FIND,
+            query = "SELECT m "
+                  + "  FROM CommandReplayResultMapping m "
+                  + " ORDER BY m.recordedLogicalTypeName ASC, m.recordedIdentifier ASC"),
+    @NamedQuery(
+            name = Nq.FIND_BY_RECORDED_BOOKMARK,
+            query = "SELECT m "
+                  + "  FROM CommandReplayResultMapping m "
+                  + " WHERE m.recordedLogicalTypeName = :recordedLogicalTypeName "
+                  + "   AND m.recordedIdentifier = :recordedIdentifier")
+})
+@Named(org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping.LOGICAL_TYPE_NAME)
+@DomainObject(
+        editing = Editing.DISABLED,
+        entityChangePublishing = Publishing.DISABLED
+)
+@XmlJavaTypeAdapter(PersistentEntityAdapter.class)
+@EntityListeners(CausewayEntityListener.class)
+@NoArgsConstructor
+public class CommandReplayResultMapping
+extends org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMapping {
+
+    @Id
+    @GeneratedValue
+    @Getter @Setter
+    private Long id;
+
+    @Column(nullable = RecordedLogicalTypeName.NULLABLE, length = RecordedLogicalTypeName.MAX_LENGTH)
+    @RecordedLogicalTypeName
+    @Getter @Setter
+    private String recordedLogicalTypeName;
+
+    @Column(nullable = RecordedIdentifier.NULLABLE, length = RecordedIdentifier.MAX_LENGTH)
+    @RecordedIdentifier
+    @Getter @Setter
+    private String recordedIdentifier;
+
+    @Column(nullable = ActualLogicalTypeName.NULLABLE, length = ActualLogicalTypeName.MAX_LENGTH)
+    @ActualLogicalTypeName
+    @Getter @Setter
+    private String actualLogicalTypeName;
+
+    @Column(nullable = ActualIdentifier.NULLABLE, length = ActualIdentifier.MAX_LENGTH)
+    @ActualIdentifier
+    @Getter @Setter
+    private String actualIdentifier;
+
+}
diff --git a/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMappingRepository.java b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMappingRepository.java
new file mode 100644
index 00000000000..8e69e512f54
--- /dev/null
+++ b/extensions/core/commandlog/persistence-jpa/src/main/java/org/apache/causeway/extensions/commandlog/jpa/dom/CommandReplayResultMappingRepository.java
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.causeway.extensions.commandlog.jpa.dom;
+
+import javax.inject.Named;
+
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+import org.apache.causeway.applib.annotation.PriorityPrecedence;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMappingRepositoryAbstract;
+import org.apache.causeway.extensions.commandlog.jpa.CausewayModuleExtCommandLogPersistenceJpa;
+
+/**
+ * Provides supporting functionality for querying and persisting replay result mappings.
+ */
+@Service
+@Named(CommandReplayResultMappingRepository.LOGICAL_TYPE_NAME)
+@javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
+@Qualifier("Jpa")
+public class CommandReplayResultMappingRepository
+extends CommandReplayResultMappingRepositoryAbstract<CommandReplayResultMapping> {
+
+    public static final String LOGICAL_TYPE_NAME =
+            CausewayModuleExtCommandLogPersistenceJpa.NAMESPACE + ".CommandReplayResultMappingRepository";
+
+    public CommandReplayResultMappingRepository() {
+        super(CommandReplayResultMapping.class);
+    }
+
+}
diff --git a/openspec/changes/persistent-command-replay-mapping-listener/tasks.md b/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
index e6b3852fb73..0855f0e232b 100644
--- a/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
+++ b/openspec/changes/persistent-command-replay-mapping-listener/tasks.md
@@ -1,45 +1,45 @@
 ## 1. Configuration and Conditional Beans
 
-- [ ] 1.1 Add a built-in replay mapping listener storage strategy enum with `IN_MEMORY` and `PERSISTENT` values.
-- [ ] 1.2 Add the storage strategy property to `CausewayConfiguration` with `IN_MEMORY` as the default.
-- [ ] 1.3 Update the existing in-memory listener bean factory so it is created only for `IN_MEMORY`, only when no custom listener exists, and still receives the conflict policy.
-- [ ] 1.4 Add tests for in-memory listener autoconfiguration, persistent-storage back-off, and custom listener back-off.
+- [x] 1.1 Add a built-in replay mapping listener storage strategy enum with `IN_MEMORY` and `PERSISTENT` values.
+- [x] 1.2 Add the storage strategy property to `CausewayConfiguration` with `IN_MEMORY` as the default.
+- [x] 1.3 Update the existing in-memory listener bean factory so it is created only for `IN_MEMORY`, only when no custom listener exists, and still receives the conflict policy.
+- [x] 1.4 Add tests for in-memory listener autoconfiguration, persistent-storage back-off, and custom listener back-off.
 
 ## 2. Applib Persistent Mapping Model
 
-- [ ] 2.1 Add an abstract applib replay result mapping entity with recorded and actual bookmark logical type and identifier properties.
-- [ ] 2.2 Add bookmark conversion helpers on the applib entity for recorded and actual bookmarks.
-- [ ] 2.3 Add an abstract applib replay result mapping repository contract for lookup by recorded bookmark, listing all mappings, and creating mappings.
-- [ ] 2.4 Add a fallback layout XML for the replay result mapping entity.
-- [ ] 2.5 Add a command log menu action that lists persisted replay result mappings through the applib repository.
+- [x] 2.1 Add an abstract applib replay result mapping entity with recorded and actual bookmark logical type and identifier properties.
+- [x] 2.2 Add bookmark conversion helpers on the applib entity for recorded and actual bookmarks.
+- [x] 2.3 Add an abstract applib replay result mapping repository contract for lookup by recorded bookmark, listing all mappings, and creating mappings.
+- [x] 2.4 Add a fallback layout XML for the replay result mapping entity.
+- [x] 2.5 Add a command log menu action that lists persisted replay result mappings through the applib repository.
 
 ## 3. Persistent Listener Implementation
 
-- [ ] 3.1 Add a persistent `CommandReplayMappingListener` implementation that depends on the applib repository and conflict policy.
-- [ ] 3.2 Implement remapping from persisted recorded bookmark mappings without resolving domain objects.
-- [ ] 3.3 Implement result mapping persistence for first non-identity mappings.
-- [ ] 3.4 Implement idempotent repeated mapping handling.
-- [ ] 3.5 Implement conflict handling that throws or logs-and-continues according to the existing conflict policy.
-- [ ] 3.6 Add conditional bean creation for the persistent listener when storage strategy is `PERSISTENT`, no custom listener exists, and a repository is available.
-- [ ] 3.7 Add tests for persistent listener remapping, recording, idempotency, strict conflicts, lenient conflicts, and conditional bean creation.
+- [x] 3.1 Add a persistent `CommandReplayMappingListener` implementation that depends on the applib repository and conflict policy.
+- [x] 3.2 Implement remapping from persisted recorded bookmark mappings without resolving domain objects.
+- [x] 3.3 Implement result mapping persistence for first non-identity mappings.
+- [x] 3.4 Implement idempotent repeated mapping handling.
+- [x] 3.5 Implement conflict handling that throws or logs-and-continues according to the existing conflict policy.
+- [x] 3.6 Add conditional bean creation for the persistent listener when storage strategy is `PERSISTENT`, no custom listener exists, and a repository is available.
+- [x] 3.7 Add tests for persistent listener remapping, recording, idempotency, strict conflicts, lenient conflicts, and conditional bean creation.
 
 ## 4. JDO Persistence Implementation
 
-- [ ] 4.1 Add a concrete JDO replay result mapping entity following the command log persistence JDO conventions.
-- [ ] 4.2 Add a concrete JDO replay result mapping repository implementing the applib repository contract.
-- [ ] 4.3 Register the JDO entity and repository with the command log JDO persistence module.
-- [ ] 4.4 Add JDO tests for create, find by recorded bookmark, list all, idempotent repeated mapping, and conflict preservation.
+- [x] 4.1 Add a concrete JDO replay result mapping entity following the command log persistence JDO conventions.
+- [x] 4.2 Add a concrete JDO replay result mapping repository implementing the applib repository contract.
+- [x] 4.3 Register the JDO entity and repository with the command log JDO persistence module.
+- [x] 4.4 Add JDO tests for create, find by recorded bookmark, list all, idempotent repeated mapping, and conflict preservation.
 
 ## 5. JPA Persistence Implementation
 
-- [ ] 5.1 Add a concrete JPA replay result mapping entity following the command log persistence JPA conventions.
-- [ ] 5.2 Add a concrete JPA replay result mapping repository implementing the applib repository contract.
-- [ ] 5.3 Register the JPA entity and repository with the command log JPA persistence module.
-- [ ] 5.4 Add JPA tests for create, find by recorded bookmark, list all, idempotent repeated mapping, and conflict preservation.
+- [x] 5.1 Add a concrete JPA replay result mapping entity following the command log persistence JPA conventions.
+- [x] 5.2 Add a concrete JPA replay result mapping repository implementing the applib repository contract.
+- [x] 5.3 Register the JPA entity and repository with the command log JPA persistence module.
+- [x] 5.4 Add JPA tests for create, find by recorded bookmark, list all, idempotent repeated mapping, and conflict preservation.
 
 ## 6. Validation
 
-- [ ] 6.1 Run targeted command log applib tests covering both built-in listener implementations and menu action behavior.
-- [ ] 6.2 Run targeted command log JDO persistence tests for the new replay result mapping entity and repository.
-- [ ] 6.3 Run targeted command log JPA persistence tests for the new replay result mapping entity and repository.
-- [ ] 6.4 Run `openspec validate persistent-command-replay-mapping-listener --type change --strict`.
+- [x] 6.1 Run targeted command log applib tests covering both built-in listener implementations and menu action behavior.
+- [x] 6.2 Run targeted command log JDO persistence tests for the new replay result mapping entity and repository.
+- [x] 6.3 Run targeted command log JPA persistence tests for the new replay result mapping entity and repository.
+- [x] 6.4 Run `openspec validate persistent-command-replay-mapping-listener --type change --strict`.


(causeway) 28/42: CAUSEWAY-4010: proposes default command replay mapping listener

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-4010
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit f473ad54214ba81c0ffed65cc96494bc25c3ac60
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 4 17:37:17 2026 +0100

    CAUSEWAY-4010: proposes default command replay mapping listener
---
 .../.openspec.yaml                                 |  2 +
 .../design.md                                      | 46 ++++++++++++++++++++++
 .../proposal.md                                    | 27 +++++++++++++
 .../specs/command-replay-result-mapping/spec.md    | 18 +++++++++
 .../spec.md                                        | 39 ++++++++++++++++++
 .../tasks.md                                       | 24 +++++++++++
 6 files changed, 156 insertions(+)

diff --git a/openspec/changes/default-command-replay-mapping-listener/.openspec.yaml b/openspec/changes/default-command-replay-mapping-listener/.openspec.yaml
new file mode 100644
index 00000000000..f617bd1867a
--- /dev/null
+++ b/openspec/changes/default-command-replay-mapping-listener/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-04
diff --git a/openspec/changes/default-command-replay-mapping-listener/design.md b/openspec/changes/default-command-replay-mapping-listener/design.md
new file mode 100644
index 00000000000..62be40e473c
--- /dev/null
+++ b/openspec/changes/default-command-replay-mapping-listener/design.md
@@ -0,0 +1,46 @@
+## Context
+
+The command replay mapping SPI already lets applications remap replay targets and reference parameters, and it notifies listeners after a successful replay maps a recorded result bookmark to an actual result bookmark.
+The common replay workflow needs those result mappings to be remembered so that later commands can remap inputs that refer to objects created or otherwise mapped by earlier replayed commands.
+Today the SPI provides the hooks, but applications must supply their own listener before replay input remapping can use mappings observed earlier in the same replay session.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Provide a default `CommandReplayMappingListener` implementation that stores recorded-to-actual replay result mappings in memory.
+- Make the default implementation available through autoconfiguration only when an application has not defined another listener bean.
+- Keep the listener behavior simple, deterministic, and aligned with the existing SPI methods.
+- Preserve custom application listeners as the extension point for persistent, distributed, or domain-specific mapping behavior.
+
+**Non-Goals:**
+
+- Persist replay mappings across JVM restarts or application nodes.
+- Change the `CommandReplayMappingListener` SPI method signatures.
+- Replace user-defined listener beans or combine multiple default mapping stores.
+- Resolve bookmarks to live domain objects before storing or remapping them.
+
+## Decisions
+
+- Implement the default listener as a command log extension class that implements `CommandReplayMappingListener` directly.
+  This keeps the behavior close to the SPI and avoids adding a new service abstraction for simple map-backed state.
+  An alternative was to add a separate mapping store service, but that would add indirection without current persistence or distribution requirements.
+
+- Use a simple in-memory `HashMap<Bookmark, Bookmark>` keyed by the recorded bookmark and valued by the actual replay bookmark.
+  `onReplayResultMapped(...)` will update the map, and `remap(...)` will return the mapped actual bookmark when present.
+  An alternative was to use a concurrent map, but command replay is expected to use this listener in a straightforward replay flow and the requested implementation explicitly calls for a simple hashmap.
+
+- Register the default listener with Spring Boot autoconfiguration guarded by `@ConditionalOnMissingBean(CommandReplayMappingListener.class)`.
+  This lets applications override the default by declaring their own listener bean while giving simpler applications out-of-the-box remapping behavior.
+  An alternative was unconditional registration, but that would interfere with custom listener implementations and could create multiple mapping listeners with overlapping behavior.
+
+- Keep the default map lifecycle bound to the Spring bean lifecycle.
+  This matches the requirement for a simple default implementation and avoids adding clearing, scoping, or persistence semantics in this change.
+  Applications that need different lifecycle semantics can provide their own listener bean.
+
+## Risks / Trade-offs
+
+- In-memory mappings are lost on restart or bean recreation → Document the default as an in-memory convenience and leave durable behavior to custom listener beans.
+- A singleton map can retain mappings longer than a replay batch → Keep the implementation simple for this change and rely on custom listeners where tighter scoping is required.
+- Multiple replay batches in the same JVM could observe previous mappings → Use recorded bookmark keys so repeated mappings overwrite previous values, and avoid claiming batch isolation for the default implementation.
+- `HashMap` is not thread-safe → Treat the default as suitable for simple replay use and allow applications with concurrent replay requirements to replace it with their own bean.
diff --git a/openspec/changes/default-command-replay-mapping-listener/proposal.md b/openspec/changes/default-command-replay-mapping-listener/proposal.md
new file mode 100644
index 00000000000..85575dc94b9
--- /dev/null
+++ b/openspec/changes/default-command-replay-mapping-listener/proposal.md
@@ -0,0 +1,27 @@
+## Why
+
+Applications that replay imported commands need a ready-to-use mapping listener for the common case where replay result mappings should feed later input remapping.
+Without a default implementation, each application must repeat the same simple in-memory bookkeeping before command replay input remapping works out of the box.
+
+## What Changes
+
+- Add a default command replay mapping listener implementation backed by a simple in-memory `HashMap` from recorded bookmarks to actual replay result bookmarks.
+- Record mappings when replay reports `onReplayResultMapped(...)` and consult the recorded-to-actual map from `remap(...)` before command execution.
+- Register the default listener through Spring Boot autoconfiguration only when no other `CommandReplayMappingListener` bean is present.
+- Leave existing custom listener implementations in control by ensuring the default bean is conditional on missing bean.
+
+## Capabilities
+
+### New Capabilities
+
+- `default-command-replay-mapping-listener`: Provides an out-of-the-box replay mapping listener that remembers replay result mappings and remaps later replay inputs from those mappings.
+
+### Modified Capabilities
+
+- `command-replay-result-mapping`: The replay mapping SPI gains a default autoconfigured implementation when applications do not provide their own listener.
+
+## Impact
+
+- Affects the command log extension applib/autoconfiguration modules that expose and wire `CommandReplayMappingListener`.
+- Adds a default Spring bean, guarded by `@ConditionalOnMissingBean`, without changing the SPI method signatures.
+- Uses in-memory state, so mappings are scoped to the lifecycle of the default listener bean and are not persisted.
diff --git a/openspec/changes/default-command-replay-mapping-listener/specs/command-replay-result-mapping/spec.md b/openspec/changes/default-command-replay-mapping-listener/specs/command-replay-result-mapping/spec.md
new file mode 100644
index 00000000000..c75309fe0f1
--- /dev/null
+++ b/openspec/changes/default-command-replay-mapping-listener/specs/command-replay-result-mapping/spec.md
@@ -0,0 +1,18 @@
+## ADDED Requirements
+
+### Requirement: Replay mapping SPI has a conditional default listener
+The system SHALL autoconfigure a default `CommandReplayMappingListener` bean when no application-defined `CommandReplayMappingListener` bean is present.
+The system MUST NOT instantiate the default listener bean when another `CommandReplayMappingListener` bean is already defined.
+The conditional default listener SHALL participate in the same replay mapping listener collection used for replay input remapping and replay result mapping notifications.
+
+#### Scenario: Default listener is autoconfigured when missing
+- **WHEN** the application context contains no `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration provides the default `CommandReplayMappingListener` bean
+
+#### Scenario: Default listener backs off for custom listener
+- **WHEN** the application context already contains a custom `CommandReplayMappingListener` bean
+- **THEN** the command log autoconfiguration does not provide the default `CommandReplayMappingListener` bean
+
+#### Scenario: Autoconfigured listener participates in replay
+- **WHEN** the command log autoconfiguration provides the default `CommandReplayMappingListener` bean
+- **THEN** command replay includes that listener when requesting input remaps and sending result mapping notifications
diff --git a/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
new file mode 100644
index 00000000000..1110bea6bb6
--- /dev/null
+++ b/openspec/changes/default-command-replay-mapping-listener/specs/default-command-replay-mapping-listener/spec.md
@@ -0,0 +1,39 @@
+## ADDED Requirements
+
+### Requirement: Default replay mapping listener records result mappings
+The system SHALL provide a default command replay mapping listener that records each replay result mapping by recorded result bookmark.
+When replay notifies the listener with a recorded result bookmark and an actual result bookmark, the listener SHALL remember the actual bookmark for the recorded bookmark.
+When the same recorded bookmark is notified more than once, the listener SHALL use the most recent actual bookmark for later remapping.
+
+#### Scenario: Result mapping is recorded
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **THEN** the default listener records `demoInvoice:2` as the actual bookmark for `demoInvoice:1`
+
+#### Scenario: Result mapping is replaced
+- **WHEN** command replay notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:2`
+- **AND** command replay later notifies the default listener that recorded result bookmark `demoInvoice:1` mapped to actual result bookmark `demoInvoice:3`
+- **THEN** the default listener records `demoInvoice:3` as the actual bookmark for `demoInvoice:1`
+
+### Requirement: Default replay mapping listener remaps from recorded results
+The default command replay mapping listener SHALL return a remembered actual bookmark when replay asks it to remap a recorded bookmark that was previously stored from a replay result mapping.
+When no mapping is remembered for the recorded bookmark, the listener SHALL return no replacement.
+The listener SHALL perform remapping without resolving recorded or actual bookmarks to live domain objects.
+
+#### Scenario: Recorded bookmark is remapped from stored mapping
+- **WHEN** the default listener has recorded that `demoInvoice:1` mapped to actual bookmark `demoInvoice:2`
+- **AND** command replay asks the listener to remap recorded bookmark `demoInvoice:1`
+- **THEN** the default listener returns replacement bookmark `demoInvoice:2`
+
+#### Scenario: Unmapped recorded bookmark is not replaced
+- **WHEN** the default listener has no recorded mapping for bookmark `demoInvoice:1`
+- **AND** command replay asks the listener to remap recorded bookmark `demoInvoice:1`
+- **THEN** the default listener returns no replacement
+
+### Requirement: Default replay mapping listener uses in-memory state
+The default command replay mapping listener SHALL store mappings in memory only.
+The system SHALL NOT require the default listener to persist mappings across JVM restarts, application nodes, or Spring bean lifecycle recreation.
+
+#### Scenario: Mapping state is scoped to listener instance
+- **WHEN** the default listener records that `demoInvoice:1` mapped to actual bookmark `demoInvoice:2`
+- **AND** a new default listener instance is created
+- **THEN** the new listener instance has no required remembered mapping for `demoInvoice:1`
diff --git a/openspec/changes/default-command-replay-mapping-listener/tasks.md b/openspec/changes/default-command-replay-mapping-listener/tasks.md
new file mode 100644
index 00000000000..423344459d8
--- /dev/null
+++ b/openspec/changes/default-command-replay-mapping-listener/tasks.md
@@ -0,0 +1,24 @@
+## 1. Default Listener Implementation
+
+- [ ] 1.1 Add a default `CommandReplayMappingListener` implementation in the command log applib that stores recorded-to-actual mappings in a `HashMap<Bookmark, Bookmark>`.
+- [ ] 1.2 Implement `onReplayResultMapped(...)` to store or replace the actual bookmark for the recorded result bookmark.
+- [ ] 1.3 Implement `remap(...)` to return the remembered actual bookmark for a recorded bookmark, or `Optional.empty()` when none exists.
+- [ ] 1.4 Keep the implementation bookmark-based and avoid resolving recorded or actual bookmarks to domain objects.
+
+## 2. Autoconfiguration
+
+- [ ] 2.1 Register the default listener as a Spring bean from the command log applib module configuration.
+- [ ] 2.2 Guard the bean with `@ConditionalOnMissingBean(CommandReplayMappingListener.class)` so custom listener beans replace the default.
+- [ ] 2.3 Ensure the autoconfigured listener is available to the existing replay listener collection used by `ReplayContext`.
+
+## 3. Tests
+
+- [ ] 3.1 Add unit tests proving the default listener records result mappings and returns them from `remap(...)`.
+- [ ] 3.2 Add a unit test proving a repeated recorded bookmark mapping uses the latest actual bookmark.
+- [ ] 3.3 Add a unit test proving an unmapped bookmark returns no replacement.
+- [ ] 3.4 Add Spring context tests proving the default listener bean is created when missing and backs off when a custom listener bean exists.
+
+## 4. Verification
+
+- [ ] 4.1 Run the command log applib test suite for the new listener and autoconfiguration coverage.
+- [ ] 4.2 Run `openspec validate --change default-command-replay-mapping-listener --strict`.