Skip to content

ATS-PFM-OPS-010Preserve a shared record-activity trail: Capability Test Specification

Markdown

ATS-PFM-OPS-010

Preserve a shared record-activity trail: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-PFM-OPS-010

Design

Executed by
TST-PFM-OPS-057, TST-PFM-OPS-058, TST-PFM-OPS-120

KindAcceptance test setProduct areaPlatformModuleOperational RecordsRevision2

Read atservices-platform ad3f6a65macroservice-libraries 54536a44react-console baf6dae3

Coverage

  • Rule covered
  • Transition covered
  • Validation covered
  • Permission covered
  • Edge gap: FND-PFM-OPS-062
  • Failure gap: FND-PFM-OPS-062
  • Boundary covered
  • Concurrency gap: FND-PFM-OPS-062
  • Invariant covered
  • Interaction covered

Test Scenarios

13 scenarios proving CAP-PFM-OPS-010; 8 bound to an existing test.

01 Enforce the event vocabularyvalidationapinegativetest
Proves
BR-CAP-PFM-OPS-010-01
Preconditions
An inserted row uses an undeclared event type.
Steps
Write it through the application database role.
Expected
The event-type constraint refuses the row.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses an event type the store does not hold, by audit_events_event_type_check
02 Keep metadata specific and boundedboundaryapinegativetest
Proves
BR-CAP-PFM-OPS-010-02
Preconditions
A merge uses a view key and an intervention embeds its explanation.
Steps
Insert both rows.
Expected
The event-specific metadata checks reject them.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses an intervention that carries its reason inline: the reason lives in Commerce’s intervention_log row
03 Prevent application rewriting of historyinvariantapinegativetest
Proves
BR-CAP-PFM-OPS-010-03 INV-DOM-PFM-OPS-002-01
Preconditions
An activity entry already exists.
Steps
Attempt update and delete with application authority.
Expected
Both operations fail and the stored entry remains intact.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses an UPDATE of the event by the application role, so a trail cannot be rewritten
04 Enforce workspace boundariesboundaryapinegativetest
Proves
BR-CAP-PFM-OPS-010-04 INV-DOM-PFM-OPS-002-02
Preconditions
Events exist in separate workspaces.
Steps
Read across the boundary and attempt a foreign-workspace insert.
Expected
Foreign rows remain invisible and the insert is refused.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses a row written for another tenant from this tenant’s session, by the policy’s WITH CHECK
05 Keep deterministic ordering and timestamp precisionboundaryapinegativetest
Proves
BR-CAP-PFM-OPS-010-05
Preconditions
Time-based generated identities and timestamp checks are enabled.
Steps
Inspect ordering behavior and insert a submillisecond timestamp.
Expected
Timestamp and identity provide a total order and excessive precision is refused.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses an instant finer than a millisecond, by audit_events_occurred_at_precision_check
06 Join event writing to the business transactionruleapiproposed
Proves
BR-CAP-PFM-OPS-010-06
Preconditions
An owning mutation and eligibility event share a transaction.
Steps
Commit a valid mutation and roll back a failing one.
Expected
Only the committed mutation retains its attributed event.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Source
services-platform:modules/audit/services/persistence/audit-events.ts:recordEligibilityChange
07 Record merge participants without repeat entriesruleapitest
Proves
BR-CAP-PFM-OPS-010-07
Preconditions
A survivor absorbs two contact records.
Steps
Apply the merge twice.
Expected
Each participant has one event and repetition adds none.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:tests/integration/db/merge-participant.integration.spec.ts#writes one row for the survivor and one for each record merged away
08 Restrict event removal to retirementtransitionapinegativetest
Proves
BR-CAP-PFM-OPS-010-08
Preconditions
One workspace is deleting and another is not.
Steps
Invoke the batched event purge for each.
Expected
The deleting workspace empties by batches and the other is refused.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/audit/tests/integration/services/persistence/audit-events.integration.spec.js#is refused by the database, so the purger is never a delete-by-tenant tool
09 Limit the query role to readingpermissionapinegativetest
Proves
BR-CAP-PFM-OPS-010-09 INV-DOM-PFM-OPS-002-09
Preconditions
The configured query-reader role is active in a workspace.
Steps
Read activity and attempt insertion.
Expected
Local reads succeed and writes are refused.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses an INSERT by that role, because the grant is SELECT and nothing else
10 Write a visit into the protected activity trailinteractionapiproposed
Proves
BR-CAP-PFM-OPS-008-04 BR-CAP-PFM-OPS-010-03
Preconditions
A person opens a readable record using verified execution context.
Steps
Report the visit, attempt to rewrite its stored activity with ordinary application privileges, and read the retained event.
Expected
The retained event identifies the original visit and caller despite the refused rewrite.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
services-platform:modules/audit/tests/unit/aws/api/audit-api-mapper.spec.ts#refuses a body naming the actor, which is how a trail would be written in somebody else’s name; services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses an UPDATE of the event by the application role, so a trail cannot be rewritten; CAP-PFM-OPS-008; WF-PFM-OPS-008; WF-PFM-OPS-009
11 Retain history after its target disappearsinteractionapiproposed
Proves
BR-CAP-PFM-OPS-009-02 BR-CAP-PFM-OPS-010-03
Preconditions
A person has a stored visit and the target record is subsequently removed.
Steps
Read that person’s raw history and compare it with currently resolvable recent records.
Expected
The visit remains in raw history even when the target cannot appear in a current record list.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
services-platform:modules/audit/tests/integration/services/record-views/view-history.integration.spec.js#still holds the view after the contact is gone, because a trail is not a list of records; services-platform:modules/audit/tests/integration/db/audit-events.table.integration.spec.js#refuses an UPDATE of the event by the application role, so a trail cannot be rewritten; CAP-PFM-OPS-009; WF-PFM-OPS-008; WF-PFM-OPS-009
12 Relate a change to its security historyinteractionapiproposed
Proves
BR-CAP-PFM-OPS-010-06
Preconditions
Staff make a reasoned change and later security-history insertion can fail.
Steps
Complete one change and repeat with failure injected after the decision commits.
Expected
The successful flow has attributable history; the later failure leaves the committed decision visible for investigation.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
services-platform:modules/audit/services/persistence/audit-events.ts:recordEligibilityChange; CAP-PFM-SEC-011; WF-PFM-OPS-008; WF-PFM-OPS-009
13 Expose partial purge without claiming activity removalinteractionapinegativeproposed
Proves
BR-CAP-PFM-OPS-010-08
Preconditions
An operational purge reaches the protected activity stage with a workspace that is not deleting.
Steps
Attempt that stage, record its refusal and inspect participant inventories independently.
Expected
Activity remains intact after the refusal; progress in another participant does not imply successful activity removal.
Data
Isolated workspace and run-owned lifecycle records, with a second linked workspace where shared company evidence is checked.
Source
services-platform:modules/jobs/services/persistence/tenant-purges.ts:JOB_PURGE_RESOURCES; services-platform:modules/audit/tests/integration/services/persistence/audit-events.integration.spec.js#is refused by the database, so the purger is never a delete-by-tenant tool; services-platform:modules/licensing/services/maintenance/tenant-participant.ts:licensingParticipant

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.