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/07 14:49:07 UTC
(causeway) 16/50: CAUSEWAY-4014: proposes recording all replay results
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-4014
in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 76bd6240c22633976284419ac2f2aa77b0708b49
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Jun 7 07:22:47 2026 +0100
CAUSEWAY-4014: proposes recording all replay results
---
.../record-all-replay-results/.openspec.yaml | 2 +
.../changes/record-all-replay-results/design.md | 51 ++++++++++++++
.../changes/record-all-replay-results/proposal.md | 29 ++++++++
.../specs/command-replay-result-mapping/spec.md | 79 ++++++++++++++++++++++
.../spec.md | 58 ++++++++++++++++
.../spec.md | 75 ++++++++++++++++++++
.../changes/record-all-replay-results/tasks.md | 23 +++++++
7 files changed, 317 insertions(+)
diff --git a/openspec/changes/record-all-replay-results/.openspec.yaml b/openspec/changes/record-all-replay-results/.openspec.yaml
new file mode 100644
index 00000000000..11967fcb6a7
--- /dev/null
+++ b/openspec/changes/record-all-replay-results/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-07
diff --git a/openspec/changes/record-all-replay-results/design.md b/openspec/changes/record-all-replay-results/design.md
new file mode 100644
index 00000000000..395324c4896
--- /dev/null
+++ b/openspec/changes/record-all-replay-results/design.md
@@ -0,0 +1,51 @@
+## Context
+
+`CommandReplayMappingListener` currently combines two related replay responsibilities.
+Before replay execution, `remap(CommandLogEntry, Bookmark)` lets a listener return a replacement bookmark for a recorded command target or reference-valued parameter.
+After successful replay, `onReplayResultMapped(Bookmark, Bookmark, CommandLogEntry)` tells the listener about the recorded and actual result bookmarks.
+
+The replay execution path already notifies the SPI when both recorded and actual result bookmarks are available, including identity results.
+The in-memory and persistent built-in listeners currently discard identity result notifications before storing anything.
+That made sense when the store represented only non-identity remappings, but the next UI goal needs the stored data to represent every object encountered as a replay result.
+
+## Goals / Non-Goals
+
+**Goals:**
+- Rename the SPI methods to `lookup(...)` and `onReplayResult(...)` so their names match their broadened responsibilities.
+- Store or persist identity result notifications as first-class replay result records.
+- Keep existing lookup behavior so later replay inputs can still be replaced by the actual bookmark associated with a recorded bookmark.
+- Keep existing conflict policy behavior for repeated notifications with different actual bookmarks.
+- Update tests and call sites to use the renamed SPI methods.
+
+**Non-Goals:**
+- Do not add the ReplayableCommand UI changes in this proposal.
+- Do not change command export format or imported command DTO semantics.
+- Do not add new tables, entities, or repository contracts beyond changing what the existing replay result mapping repository stores.
+- Do not introduce compatibility bridge methods for the old SPI method names unless implementation constraints require a short transitional step.
+
+## Decisions
+
+- Treat replay result records as observations rather than only remappings.
+ This means `onReplayResult(...)` stores the first observed actual bookmark for a recorded result bookmark even when both bookmarks are equal.
+ The alternative was to add a separate observation listener or repository, but that would duplicate the existing recorded-to-actual shape and delay the UI work.
+
+- Rename `remap(...)` to `lookup(...)` rather than introducing a second method.
+ The method returns the actual bookmark already associated with a recorded bookmark, so `lookup` describes both identity and non-identity records without implying that a value must differ.
+ The alternative was `resolve(...)`, but that can imply object resolution and this SPI deliberately works with bookmarks without resolving objects.
+
+- Rename `onReplayResultMapped(...)` to `onReplayResult(...)` and update call sites directly.
+ The new name avoids suggesting that a mapping only exists when bookmarks differ.
+ This is a breaking SPI change, but the proposal already changes method semantics and custom implementors need to review their implementations.
+
+- Preserve conflict handling unchanged after the first stored observation.
+ A repeated notification with the same actual bookmark remains idempotent.
+ A repeated notification with a different actual bookmark still follows the configured conflict policy and keeps the original actual bookmark.
+
+## Risks / Trade-offs
+
+- [Risk] Custom `CommandReplayMappingListener` implementations will fail to compile after the rename.
+ → Mitigation: Mark the proposal as breaking and update all repository implementations and tests in the same change.
+- [Risk] Persisting identity results increases the number of rows shown by replay result mapping list actions.
+ → Mitigation: This is intentional for the upcoming UI requirement, and no schema change is required.
+- [Risk] Code or docs may still use mapping terminology after the rename.
+ → Mitigation: Search for old method names and update comments, tests, and relevant specs during implementation.
diff --git a/openspec/changes/record-all-replay-results/proposal.md b/openspec/changes/record-all-replay-results/proposal.md
new file mode 100644
index 00000000000..4e79ec43ecc
--- /dev/null
+++ b/openspec/changes/record-all-replay-results/proposal.md
@@ -0,0 +1,29 @@
+## Why
+
+The replay mapping SPI currently names its responsibilities around remapping and mapped results, even though replay must now surface every encountered result bookmark for downstream UI and persistence workflows.
+Recording only non-identity result mappings hides replayed objects whose recorded and actual bookmarks are the same, which prevents the ReplayableCommand UI from showing the complete set of involved objects.
+
+## What Changes
+
+- **BREAKING**: Rename `CommandReplayMappingListener#remap(...)` to `lookup(...)` to reflect that listeners look up a previously observed bookmark rather than necessarily remapping it.
+- **BREAKING**: Rename `CommandReplayMappingListener#onReplayResultMapped(...)` to `onReplayResult(...)` to reflect that listeners are notified for every available replay result bookmark pair, including identity results.
+- Update the in-memory replay mapping listener to record every replay result notification keyed by recorded result bookmark, including equal recorded and actual bookmarks.
+- Update the persistent replay mapping listener to persist every replay result notification keyed by recorded result bookmark, including equal recorded and actual bookmarks.
+- Preserve existing conflict handling when a recorded result bookmark is later associated with a different actual result bookmark.
+- Update replay execution and tests to call the renamed SPI methods.
+
+## Capabilities
+
+### New Capabilities
+
+### Modified Capabilities
+- `command-replay-result-mapping`: Rename the SPI methods and clarify that result notifications represent all replay results rather than only non-identity mappings.
+- `default-command-replay-mapping-listener`: Change the built-in in-memory listener so identity replay results are stored and can be looked up later.
+- `persistent-command-replay-mapping-listener`: Change the persistent listener so identity replay results are persisted and can be listed or looked up later.
+
+## Impact
+
+- Affects the command log applib SPI `CommandReplayMappingListener` and all implementations.
+- Affects replay execution code in `ReplayableCommand` that consults listeners before execution and notifies them after successful replay.
+- Affects in-memory and persistent replay mapping listener tests, replay mapping tests, and any downstream custom listener implementations because the SPI method names change.
+- Does not introduce new dependencies or storage tables, but changes persistent listener semantics so identity mappings are saved in the existing replay result mapping repository.
diff --git a/openspec/changes/record-all-replay-results/specs/command-replay-result-mapping/spec.md b/openspec/changes/record-all-replay-results/specs/command-replay-result-mapping/spec.md
new file mode 100644
index 00000000000..348bd325e8b
--- /dev/null
+++ b/openspec/changes/record-all-replay-results/specs/command-replay-result-mapping/spec.md
@@ -0,0 +1,79 @@
+## MODIFIED Requirements
+
+### Requirement: Replay mapping SPI can remap command targets before execution
+The system SHALL ask the command replay mapping SPI's common lookup method whether each replayed command target bookmark has a replacement 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 lookup 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 lookup 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 lookup 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 lookup method whether each replayed action parameter represented as `type: "reference"` with a populated `reference` OID has a replacement 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 lookup 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 lookup 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 lookup method to replace that parameter
+
+### 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 observations and provide replay input bookmark lookups.
+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 even when the recorded returned object bookmark and actual replay result bookmark are equal.
+The system SHALL notify the SPI in the same transaction as replay command execution.
+The system SHALL propagate result 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 notification
+- **THEN** the replayed command execution fails
+- **AND** the replayed command transaction rolls back
+
+### Requirement: Safe action result mappings can remap later replay inputs
+The system SHALL make replay result observations produced by logged safe action commands available to the same replay input lookup flow used by other replayed commands.
+When a later replayed command target or reference parameter uses a recorded bookmark that was observed by an earlier safe action replay, the system SHALL allow the command replay mapping SPI to replace that recorded bookmark with the actual replay bookmark.
+
+#### Scenario: Later replay command target is remapped from safe action result
+- **GIVEN** replay of a safe action command mapped recorded bookmark `demoCustomer:1` to actual bookmark `demoCustomer:2`
+- **WHEN** replay is about to execute a later command whose recorded target bookmark is `demoCustomer:1`
+- **AND** the command replay mapping SPI returns replacement bookmark `demoCustomer:2`
+- **THEN** the system executes the later replayed command against target bookmark `demoCustomer:2`
+
+#### Scenario: Later replay command reference parameter is remapped from safe action result
+- **GIVEN** replay of a safe action command mapped recorded bookmark `demoCustomer:1` to actual bookmark `demoCustomer:2`
+- **WHEN** replay is about to execute a later command whose reference parameter bookmark is `demoCustomer:1`
+- **AND** the command replay mapping SPI returns replacement bookmark `demoCustomer:2`
+- **THEN** the system executes the later replayed command with reference parameter bookmark `demoCustomer:2`
diff --git a/openspec/changes/record-all-replay-results/specs/default-command-replay-mapping-listener/spec.md b/openspec/changes/record-all-replay-results/specs/default-command-replay-mapping-listener/spec.md
new file mode 100644
index 00000000000..4db28ffa4ba
--- /dev/null
+++ b/openspec/changes/record-all-replay-results/specs/default-command-replay-mapping-listener/spec.md
@@ -0,0 +1,58 @@
+## 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 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 SHALL remember the actual bookmark for the recorded bookmark if no mapping already exists.
+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 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 `demoInvoice:1` as the actual bookmark 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`
+
+### 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 look up a recorded bookmark that was previously stored from a replay result notification.
+When no mapping is remembered for the recorded bookmark, the listener SHALL return no replacement.
+The listener SHALL perform lookup 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 look up recorded bookmark `demoInvoice:1`
+- **THEN** the default listener returns replacement bookmark `demoInvoice:2`
+
+#### Scenario: Identity recorded bookmark is looked up from stored mapping
+- **WHEN** the default listener has recorded that `demoInvoice:1` mapped to actual bookmark `demoInvoice:1`
+- **AND** command replay asks the listener to look up recorded bookmark `demoInvoice:1`
+- **THEN** the default listener returns replacement bookmark `demoInvoice:1`
+
+#### 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 look up recorded bookmark `demoInvoice:1`
+- **THEN** the default listener returns no replacement
diff --git a/openspec/changes/record-all-replay-results/specs/persistent-command-replay-mapping-listener/spec.md b/openspec/changes/record-all-replay-results/specs/persistent-command-replay-mapping-listener/spec.md
new file mode 100644
index 00000000000..6570aa94aa7
--- /dev/null
+++ b/openspec/changes/record-all-replay-results/specs/persistent-command-replay-mapping-listener/spec.md
@@ -0,0 +1,75 @@
+## MODIFIED Requirements
+
+### Requirement: Persistent replay mapping listener records result mappings
+The system SHALL provide a persistent command replay mapping listener that records replay results by recorded result bookmark.
+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 SHALL persist a mapping for that notification if no mapping already exists.
+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 bookmark `demoInvoice:1` and actual bookmark `demoInvoice:2`
+
+#### Scenario: Equal result mapping is 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 a mapping with recorded bookmark `demoInvoice:1` and actual bookmark `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 look up 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 lookup 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 look up recorded bookmark `demoInvoice:1`
+- **THEN** the persistent listener returns replacement bookmark `demoInvoice:2`
+
+#### Scenario: Identity recorded bookmark is looked up from persisted mapping
+- **WHEN** the persistent listener has stored that `demoInvoice:1` mapped to actual bookmark `demoInvoice:1`
+- **AND** command replay asks the listener to look up recorded bookmark `demoInvoice:1`
+- **THEN** the persistent listener returns replacement bookmark `demoInvoice:1`
+
+#### 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 look up recorded bookmark `demoInvoice:1`
+- **THEN** the persistent listener returns no replacement
+
+### 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.
+The listed replay result mappings SHALL include identity replay results where the recorded and actual bookmarks are equal.
+
+#### 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 bookmarks
+
+#### Scenario: User lists persisted identity replay mappings
+- **WHEN** a persisted replay result mapping has recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
+- **AND** a user invokes the command log menu action for replay result mappings
+- **THEN** the system returns the persisted identity replay result mapping
+- **AND** the mapping displays recorded bookmark `demoInvoice:1` and actual bookmark `demoInvoice:1`
diff --git a/openspec/changes/record-all-replay-results/tasks.md b/openspec/changes/record-all-replay-results/tasks.md
new file mode 100644
index 00000000000..604f176db36
--- /dev/null
+++ b/openspec/changes/record-all-replay-results/tasks.md
@@ -0,0 +1,23 @@
+## 1. Rename the CommandReplayMappingListener SPI
+
+- [ ] 1.1 Rename `CommandReplayMappingListener#remap(CommandLogEntry, Bookmark)` to `lookup(CommandLogEntry, Bookmark)` and update its JavaDoc to describe bookmark lookup rather than remapping.
+- [ ] 1.2 Rename `CommandReplayMappingListener#onReplayResultMapped(Bookmark, Bookmark, CommandLogEntry)` to `onReplayResult(Bookmark, Bookmark, CommandLogEntry)` and update its JavaDoc to describe replay result observation.
+- [ ] 1.3 Update all replay execution call sites in `ReplayableCommand` to call `lookup(...)` before execution and `onReplayResult(...)` after successful replay.
+
+## 2. Store every replay result notification
+
+- [ ] 2.1 Update `CommandReplayMappingListenerInMemory` so `onReplayResult(...)` stores the first actual bookmark for a recorded result bookmark even when the recorded and actual bookmarks are equal.
+- [ ] 2.2 Update `CommandReplayMappingListenerPersistent` so `onReplayResult(...)` persists the first actual bookmark for a recorded result bookmark even when the recorded and actual bookmarks are equal.
+- [ ] 2.3 Preserve idempotent repeated notifications and configured conflict handling when an existing recorded bookmark is later notified with a different actual bookmark.
+
+## 3. Update tests and documentation references
+
+- [ ] 3.1 Update `ReplayableCommandMappingTest` mocks and verifications to use `lookup(...)` and `onReplayResult(...)`.
+- [ ] 3.2 Update in-memory listener tests to expect identity replay results to be stored and returned by `lookup(...)`.
+- [ ] 3.3 Update persistent listener tests to expect identity replay results to be persisted and returned by `lookup(...)`.
+- [ ] 3.4 Search the command log extension for old method names and update comments, JavaDocs, and test names that refer to `remap(...)` or `onReplayResultMapped(...)`.
+
+## 4. Validate
+
+- [ ] 4.1 Run the command log applib tests covering `ReplayableCommandMappingTest`, `CommandReplayMappingListenerInMemoryTest`, and `CommandReplayMappingListenerPersistentTest`.
+- [ ] 4.2 Run OpenSpec validation for `record-all-replay-results` and fix any spec or task issues.