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:24 UTC
(causeway) 33/50: CAUSEWAY-4014: proposes replayable command participant argument rename
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 3d03042149a8cf38c790c0b293429bc772f5e879
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Jun 7 12:49:52 2026 +0100
CAUSEWAY-4014: proposes replayable command participant argument rename
---
.../.openspec.yaml | 2 +
.../design.md | 35 ++++++
.../proposal.md | 29 +++++
.../specs/replayable-command-remappings/spec.md | 137 +++++++++++++++++++++
.../tasks.md | 16 +++
5 files changed, 219 insertions(+)
diff --git a/openspec/changes/rename-replayable-command-participant-parameter/.openspec.yaml b/openspec/changes/rename-replayable-command-participant-parameter/.openspec.yaml
new file mode 100644
index 00000000000..11967fcb6a7
--- /dev/null
+++ b/openspec/changes/rename-replayable-command-participant-parameter/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-07
diff --git a/openspec/changes/rename-replayable-command-participant-parameter/design.md b/openspec/changes/rename-replayable-command-participant-parameter/design.md
new file mode 100644
index 00000000000..de0e0947bb2
--- /dev/null
+++ b/openspec/changes/rename-replayable-command-participant-parameter/design.md
@@ -0,0 +1,35 @@
+## Context
+
+`ReplayableCommandParticipant` currently models participant rows for target, reference parameter, and result bookmarks.
+The row already has a `parameterName` property that identifies the recorded command parameter.
+It also exposes a `parameter` object-valued property for the resolved actual reference parameter object.
+Using both `parameterName` and `parameter` makes the UI and API terminology less clear because one is metadata and the other is the resolved replay argument.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Rename the object-valued participant property from `parameter` to `argument`.
+- Preserve `parameterName` exactly as the recorded command parameter label.
+- Keep participant derivation, bookmark mapping, and object resolution behaviour unchanged.
+- Update fallback layout metadata and tests to use the new property name.
+
+**Non-Goals:**
+
+- Do not rename the participant role `PARAMETER`.
+- Do not rename `parameterName`.
+- Do not change command DTO parsing, replay mapping SPI signatures, or persistence schema.
+- Do not introduce compatibility aliases unless implementation constraints require them.
+
+## Decisions
+
+- Use `argument` as the object-valued property name because it describes the runtime value supplied to the replayed command while avoiding collision with `parameterName`.
+- Keep the participant role and recorded parameter metadata unchanged because they describe the command signature and existing replay semantics.
+- Update layout and column-order metadata in the same change so UI rendering and fallback table ordering stay aligned with the renamed property.
+- Treat this as a source/API-breaking rename for consumers of `ReplayableCommandParticipant#parameter`, rather than adding a deprecated duplicate property, because the command log applib participant type is newly introduced and the requested refinement is terminology cleanup.
+
+## Risks / Trade-offs
+
+- Existing custom code or layouts referencing `parameter` will fail until updated → Mark the change as breaking in the proposal and update all in-repository references.
+- Display labels may still mention reference parameters through `parameterName` and role `PARAMETER` → Preserve that wording intentionally because it identifies the command parameter, not the resolved argument object.
+- Tests could miss layout metadata regressions → Update focused participant tests to assert the new `argument` property and column ordering.
diff --git a/openspec/changes/rename-replayable-command-participant-parameter/proposal.md b/openspec/changes/rename-replayable-command-participant-parameter/proposal.md
new file mode 100644
index 00000000000..3652094acf6
--- /dev/null
+++ b/openspec/changes/rename-replayable-command-participant-parameter/proposal.md
@@ -0,0 +1,29 @@
+## Why
+
+The replayable command participants UI currently exposes a reference parameter object through a property named `parameter`, which is easy to confuse with the existing `parameterName` metadata.
+Renaming the object-valued property to `argument` makes the row model clearer while preserving `parameterName` as the recorded command parameter label.
+
+## What Changes
+
+- Rename the `ReplayableCommandParticipant` object-valued `parameter` property to `argument`.
+- Update participant layout and column-order metadata so target, argument, and result object columns appear in the intended order.
+- Update tests and any references that expect the old `parameter` property name.
+- Preserve the `parameterName` property and its behaviour unchanged.
+- **BREAKING**: Consumers using the `ReplayableCommandParticipant#parameter` property must switch to `argument`.
+
+## Capabilities
+
+### New Capabilities
+
+- None.
+
+### Modified Capabilities
+
+- `replayable-command-remappings`: Rename the reference parameter object property exposed by replayable command participants from `parameter` to `argument` while preserving `parameterName`.
+
+## Impact
+
+- Affects the command log applib replay view model `ReplayableCommandParticipant`.
+- Affects fallback layout and column-order metadata for replayable command participants.
+- Affects focused tests that assert participant property names and layout order.
+- Does not affect replay mapping SPI signatures or persistence schema.
diff --git a/openspec/changes/rename-replayable-command-participant-parameter/specs/replayable-command-remappings/spec.md b/openspec/changes/rename-replayable-command-participant-parameter/specs/replayable-command-remappings/spec.md
new file mode 100644
index 00000000000..6f1b3439054
--- /dev/null
+++ b/openspec/changes/rename-replayable-command-participant-parameter/specs/replayable-command-remappings/spec.md
@@ -0,0 +1,137 @@
+## MODIFIED Requirements
+
+### Requirement: Replayable command displays command participants
+The system SHALL expose a participants collection on each replayable command.
+The participants collection SHALL contain rows represented by `ReplayableCommandParticipant` view models.
+Each participant SHALL expose the role, parameter name, recorded bookmark, target object, argument object, result object, and actual bookmark in that order.
+The system SHALL include target participants when the command DTO has recorded target bookmarks.
+The system SHALL include reference parameter participants when the command DTO has recorded reference parameter bookmarks.
+The system MUST NOT include non-reference parameters as bookmark participants.
+The system SHALL include a result participant when the recorded command has a recorded result bookmark.
+Each included participant SHALL expose its recorded bookmark.
+Target participants SHALL expose an actual bookmark whenever replay mapping lookup provides a mapped bookmark.
+Reference parameter participants SHALL expose an actual bookmark whenever replay mapping lookup provides a mapped bookmark.
+Target and reference parameter participants SHALL leave actual bookmarks empty before successful replay when replay mapping lookup provides no mapped bookmark.
+Target and reference parameter participants SHALL use their recorded bookmark as the actual bookmark after successful replay when replay mapping lookup provides no mapped bookmark.
+Result participants SHALL expose actual bookmarks only after the replayable command has successfully replayed.
+When a successful replay has no explicit replacement bookmark for a result participant, the participant SHALL use its recorded bookmark as the actual bookmark.
+
+#### Scenario: Target participant appears in replayable command details
+- **WHEN** a replayable command has recorded target bookmark `demoCustomer:1`
+- **THEN** the replayable command participants collection contains a participant with role `TARGET`
+- **AND** the participant has recorded bookmark `demoCustomer:1`
+
+#### Scenario: Reference parameter participant appears in replayable command details
+- **WHEN** a replayable command has reference parameter `customer` recorded as bookmark `demoCustomer:1`
+- **THEN** the replayable command participants collection contains a participant with role `PARAMETER`
+- **AND** the participant has parameter name `customer`
+- **AND** the participant has recorded bookmark `demoCustomer:1`
+
+#### Scenario: Non-reference parameter is omitted
+- **WHEN** a replayable command has parameter `name` recorded as a string value
+- **THEN** the replayable command participants collection does not contain a participant for parameter `name`
+
+#### Scenario: Pending command populates mapped target actual bookmark
+- **WHEN** a replayable command has replay state `PENDING`
+- **AND** the replayable command has recorded target bookmark `demoCustomer:1`
+- **AND** replay mapping lookup provides actual bookmark `demoCustomer:2`
+- **THEN** the target participant has actual bookmark `demoCustomer:2`
+
+#### Scenario: Pending command populates mapped parameter actual bookmark
+- **WHEN** a replayable command has replay state `PENDING`
+- **AND** the replayable command has reference parameter `customer` recorded as bookmark `demoCustomer:1`
+- **AND** replay mapping lookup provides actual bookmark `demoCustomer:2`
+- **THEN** the parameter participant has actual bookmark `demoCustomer:2`
+
+#### Scenario: Pending command leaves unmapped target actual bookmark empty
+- **WHEN** a replayable command has replay state `PENDING`
+- **AND** the replayable command has recorded target bookmark `demoCustomer:1`
+- **AND** replay mapping lookup provides no actual bookmark
+- **THEN** the target participant has no actual bookmark
+
+#### Scenario: Pending command leaves unmapped parameter actual bookmark empty
+- **WHEN** a replayable command has replay state `PENDING`
+- **AND** the replayable command has reference parameter `customer` recorded as bookmark `demoCustomer:1`
+- **AND** replay mapping lookup provides no actual bookmark
+- **THEN** the parameter participant has no actual bookmark
+
+#### Scenario: Successful replay populates mapped target actual bookmark
+- **WHEN** a replayable command has replay state `OK`
+- **AND** the replayable command has recorded target bookmark `demoCustomer:1`
+- **AND** replay mapping lookup provides actual bookmark `demoCustomer:2`
+- **THEN** the target participant has actual bookmark `demoCustomer:2`
+
+#### Scenario: Successful replay keeps unchanged target actual bookmark populated
+- **WHEN** a replayable command has replay state `OK`
+- **AND** the replayable command has recorded target bookmark `demoCustomer:1`
+- **AND** replay mapping lookup provides no actual bookmark
+- **THEN** the target participant has actual bookmark `demoCustomer:1`
+
+#### Scenario: Successful replay keeps unchanged parameter actual bookmark populated
+- **WHEN** a replayable command has replay state `OK`
+- **AND** the replayable command has reference parameter `customer` recorded as bookmark `demoCustomer:1`
+- **AND** replay mapping lookup provides no actual bookmark
+- **THEN** the parameter participant has actual bookmark `demoCustomer:1`
+
+### Requirement: Replayable command participant resolves target, parameter, and result objects best-effort
+The `ReplayableCommandParticipant` view model SHALL expose a target object for target participants when the actual bookmark resolves locally.
+The `ReplayableCommandParticipant` view model SHALL expose an argument object for parameter participants when the actual bookmark resolves locally.
+The `ReplayableCommandParticipant` view model SHALL expose a result object for result participants when the actual bookmark resolves locally.
+The `ReplayableCommandParticipant` view model SHALL still expose recorded and actual bookmark values when the actual bookmark cannot be resolved locally.
+The system MUST NOT require recorded bookmarks to resolve locally in order to display a participant.
+
+#### Scenario: Target participant resolves actual object
+- **WHEN** a target participant has actual bookmark `demoCustomer:2`
+- **AND** bookmark lookup resolves `demoCustomer:2` to a local domain object
+- **THEN** the participant target property exposes that local domain object
+- **AND** the participant still displays recorded bookmark `demoCustomer:1`
+- **AND** the participant still displays actual bookmark `demoCustomer:2`
+
+#### Scenario: Parameter participant resolves actual object
+- **WHEN** a parameter participant has actual bookmark `demoCustomer:2`
+- **AND** bookmark lookup resolves `demoCustomer:2` to a local domain object
+- **THEN** the participant argument property exposes that local domain object
+- **AND** the participant still displays recorded bookmark `demoCustomer:1`
+- **AND** the participant still displays actual bookmark `demoCustomer:2`
+
+#### Scenario: Parameter participant keeps unresolved bookmark values
+- **WHEN** a reference parameter participant has actual bookmark `external.Customer:2`
+- **AND** bookmark lookup cannot resolve `external.Customer:2` to a local domain object
+- **THEN** the participant argument property is empty
+- **AND** the participant still displays recorded bookmark `external.Customer:1`
+- **AND** the participant still displays actual bookmark `external.Customer:2`
+
+### Requirement: Replayable participant layouts expose participant data
+The system SHALL provide fallback layout metadata for `ReplayableCommandParticipant`.
+The participant layout SHALL expose role, parameter name, recorded bookmark, target, argument, result, and actual bookmark in that order.
+The `ReplayableCommand` fallback layout SHALL include the participants collection as a table named `Participants` before the control field set.
+The `ReplayableCommand` object view MUST NOT expose separate target summary properties for target type or target identifier.
+The `ReplayableCommand` object view SHALL expose an `openTarget` action associated with the participants collection.
+The `openTarget` action SHALL have layout sequence `1`.
+The `openTarget` action SHALL open the actual target object when a target participant has an actual target available.
+The `openTarget` action SHALL be disabled when no actual target object is available.
+Target inspection and navigation SHALL be available through target rows in the participants collection.
+
+#### Scenario: User views participants table on a replayable command
+- **WHEN** a user views a replayable command using fallback layout metadata
+- **THEN** the layout includes the participants collection as a table named `Participants`
+- **AND** the participants table appears before the control field set
+
+#### Scenario: User views participant fields
+- **WHEN** a user views a replayable command participant using fallback layout metadata
+- **THEN** the layout displays the participant role, parameter name, recorded bookmark, target, argument, result, and actual bookmark in order
+
+#### Scenario: User inspects target through participants
+- **WHEN** a user views a replayable command using fallback layout metadata
+- **THEN** the layout does not display separate `targetType` or `targetId` properties
+- **AND** target information is available through the participants table
+
+#### Scenario: User opens actual target from participants action
+- **WHEN** a replayable command target participant has an actual target object available
+- **THEN** the replayable command exposes an `openTarget` action associated with the participants collection
+- **AND** the `openTarget` action has layout sequence `1`
+- **AND** invoking the action opens the actual target object
+
+#### Scenario: User cannot open target without actual target
+- **WHEN** a replayable command has no target participant actual target object available
+- **THEN** the `openTarget` action is disabled
diff --git a/openspec/changes/rename-replayable-command-participant-parameter/tasks.md b/openspec/changes/rename-replayable-command-participant-parameter/tasks.md
new file mode 100644
index 00000000000..51a7075801f
--- /dev/null
+++ b/openspec/changes/rename-replayable-command-participant-parameter/tasks.md
@@ -0,0 +1,16 @@
+## 1. Participant API Rename
+
+- [ ] 1.1 Rename the `ReplayableCommandParticipant` object-valued `parameter` property to `argument` while leaving `parameterName` unchanged.
+- [ ] 1.2 Update participant construction and object lookup code so parameter participants expose resolved objects through `argument`.
+- [ ] 1.3 Remove or update in-repository references to the old `parameter` property name.
+
+## 2. Layout Metadata
+
+- [ ] 2.1 Update fallback column order metadata to use `argument` between `target` and `result`.
+- [ ] 2.2 Update any fallback layout metadata or property names that reference `parameter` as the object-valued participant property.
+
+## 3. Tests and Validation
+
+- [ ] 3.1 Update focused replayable command participant tests to assert `argument` and preserve `parameterName`.
+- [ ] 3.2 Run the command log applib focused test suite for replayable command mapping.
+- [ ] 3.3 Run OpenSpec validation for the change.