---
id: ATS-CRM-ACT-011
scope: CAP-CRM-ACT-011
product_area: crm
module: activities-tasks
revision: 3
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
  rhythm-v2-docs: 18a49edf30ee6bda18b159b65a2b91e093ea713d
scenarios:
- id: ATS-CRM-ACT-011-01
  title: Evaluate ordinary task status transitions
  level: unit
  proves:
  - BR-CAP-CRM-ACT-011-01
  preconditions: All task statuses are available to the lifecycle decision.
  steps: Evaluate each possible ordinary edit transition.
  expected: Open-to-open transitions succeed and closed-boundary transitions fail.
  negative: true
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to move
    to any of the three open statuses
  - services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#decides every operation from
    every status, so no move is left unanswered
  - services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#moves
    a task between open statuses
  - TST-CRM-ACT-032
  - TST-CRM-ACT-025
  provenance: test
  source: services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to
    move to any of the three open statuses
  category: transition
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-02
  title: Require explicit closing actions
  level: api
  proves:
  - BR-CAP-CRM-ACT-011-02
  preconditions: An open task is saved.
  steps: Replace its status with Completed or Cancelled.
  expected: The service refuses and names the appropriate action.
  negative: true
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update that would
    complete the task, naming the operation that would have worked
  - services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update that would
    cancel the task the same way
  - services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#refuses
    a replacement that would complete the task, naming the operation that would
  - TST-CRM-ACT-032
  - TST-CRM-ACT-025
  provenance: test
  source: services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update that
    would complete the task, naming the operation that would have worked
  category: validation
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-03
  title: Attribute closing and clear stamps on reopen
  level: api
  proves:
  - BR-CAP-CRM-ACT-011-03
  preconditions: An open task can be completed and cancelled.
  steps: Complete, reopen and cancel it.
  expected: Closing stamps identify actor and time, and reopening clears prior stamps.
  negative: false
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#completes the task, stamping who finished it
    and when
  - services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#cancels it afterwards, stamping who decided
    that and when
  - services-crm:modules/tasks/tests/integration/db/tasks.table.integration.spec.js#refuses a completed
    task with no stamps
  - services-crm:modules/tasks/tests/integration/db/tasks.table.integration.spec.js#refuses a completion
    stamp on a task that is not completed, so a reopen leaves no trace
  - TST-CRM-ACT-015
  - TST-CRM-ACT-017
  provenance: test
  source: services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#completes the task, stamping who finished
    it and when
  category: invariant
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-04
  title: Require reopening between closed statuses
  level: unit
  proves:
  - BR-CAP-CRM-ACT-011-04
  preconditions: Completed and Cancelled tasks are available.
  steps: Cancel the completed task and complete the cancelled task.
  expected: Both refuse with reopening guidance.
  negative: true
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a cancelled task, asking
    for the reopen that would make it possible
  - services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a completed task, asking
    for the reopen that would make it possible
  - services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#refuses
    cancelling a completed task, asking for the reopen first
  - TST-CRM-ACT-032
  - TST-CRM-ACT-025
  provenance: test
  source: services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a cancelled task,
    asking for the reopen that would make it possible
  category: transition
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-05
  title: Reject repeated user completion
  level: api
  proves:
  - BR-CAP-CRM-ACT-011-05
  preconditions: The task is already completed.
  steps: Complete it again as a person.
  expected: The action returns Conflict.
  negative: true
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to completing a task that is already
    completed
  - services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#refuses
    completing a task that is already completed
  - TST-CRM-ACT-015
  - TST-CRM-ACT-025
  provenance: test
  source: services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to completing a task that
    is already completed
  category: edge
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-06
  title: Restore Open and remove completion attribution
  level: api
  proves:
  - BR-CAP-CRM-ACT-011-06
  preconditions: A deferred task was completed.
  steps: Reopen it and separately try reopening an already open task.
  expected: The closed task returns to Open without closing stamps; the other request fails.
  negative: true
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#reopens
    it as open, whatever status it was in before it closed
  - services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#clears
    the completion stamps on the reopen, so nothing says it is done
  - services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to reopening a task that is not
    closed
  - 'services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a deferred task too:
    deferred is still a task somebody will do'
  - TST-CRM-ACT-025
  - TST-CRM-ACT-015
  - TST-CRM-ACT-032
  provenance: test
  source: services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#reopens
    it as open, whatever status it was in before it closed
  category: transition
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-07
  title: Prevent ordinary edits to closed work
  level: api
  proves:
  - BR-CAP-CRM-ACT-011-07
  preconditions: A task is cancelled.
  steps: Submit its general replacement.
  expected: The response conflicts and requires reopening.
  negative: true
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to replacing a cancelled task,
    which is reopened first
  - services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update of a completed
    task even where the status is left alone
  - react-console:acceptance/crm/playwright/journeys/cross-application/CRM-ACC-0708.spec.ts#CRM-ACC-0708
  - TST-CRM-ACT-015
  - TST-CRM-ACT-032
  - TST-CRM-ACT-052
  provenance: test
  source: services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to replacing a cancelled
    task, which is reopened first
  category: failure
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-08
  title: Guard lifecycle actions with the read version
  level: api
  proves:
  - BR-CAP-CRM-ACT-011-08
  preconditions: A task was completed after an earlier read.
  steps: Reopen with the earlier version and send closing actions without a version.
  expected: The stale action conflicts, missing versions fail validation and the saved status remains.
  negative: true
  data_needs: Each run creates and isolates the records it needs.
  bound_to:
  - services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to the reopen sent at the version
    the completion moved on from
  - services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 400 naming sys_version to a reopen,
    a cancel and a complete that name no version
  - services-crm:modules/tasks/tests/unit/api/task-api-mapper.spec.js#refuses a body that names no version,
    as ObjectInvalid naming sys_version
  - react-console:acceptance/crm/playwright/journeys/cross-application/CRM-ACC-0693.spec.ts#CRM-ACC-0693
  - TST-CRM-ACT-015
  - TST-CRM-ACT-030
  - TST-CRM-ACT-037
  provenance: test
  source: services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to the reopen sent at the
    version the completion moved on from
  category: concurrency
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
- id: ATS-CRM-ACT-011-09
  title: Workflow closure resolves overdue work and differs from a person retry
  category: interaction
  level: api
  proves:
  - BR-CAP-CRM-ACT-011-05
  - BR-CAP-CRM-ACT-015-04
  - BR-CAP-CRM-ACT-017-04
  preconditions: Publishing is enabled and an overdue task is open.
  steps: Complete as a registered service, repeat that command, then attempt a person completion with
    the current version.
  expected: The item resolves, the service repeat leaves the version unchanged, and the person repeat
    conflicts.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to completing a task that
    is already completed; services-crm:modules/tasks/tests/integration/services/persistence/task-attention-items.integration.spec.js#resolves
    the item completed when the overdue task is completed; services-crm:modules/tasks/tests/integration/services/persistence/tasks.workflow-actions.integration.spec.js#answers
    a completed task as it is, writing nothing, when asked again idempotently
  exercises:
  - CAP-CRM-ACT-011
  - CAP-CRM-ACT-015
  - CAP-CRM-ACT-017
  related:
  - CAP-CRM-ACT-015
  - CAP-CRM-ACT-017
- id: ATS-CRM-ACT-011-10
  title: Persist task from Open to Waiting for someone else
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Open standing. The task is unfinished, updates are unlocked and the
    read version matches.
  steps: An ordinary edit selects another unfinished-work status. Read the resulting record and affected
    projections after commit.
  expected: The resulting task has Waiting for someone else standing. Enabled attention refreshes an overdue
    item within the task transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to
    move to any of the three open statuses
  state_model: STATE-CRM-ACT-002
  transition:
    from: open
    to: waiting_for_someone_else
    trigger: An ordinary edit selects another unfinished-work status.
- id: ATS-CRM-ACT-011-11
  title: Persist task from Waiting for someone else to Deferred
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Waiting for someone else standing. The task is unfinished, updates
    are unlocked and the read version matches.
  steps: An ordinary edit selects another unfinished-work status. Read the resulting record and affected
    projections after commit.
  expected: The resulting task has Deferred standing. Enabled attention refreshes an overdue item within
    the task transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to
    move to any of the three open statuses
  state_model: STATE-CRM-ACT-002
  transition:
    from: waiting_for_someone_else
    to: deferred
    trigger: An ordinary edit selects another unfinished-work status.
- id: ATS-CRM-ACT-011-12
  title: Persist task from Deferred to Open
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Deferred standing. The task is unfinished, updates are unlocked and
    the read version matches.
  steps: An ordinary edit selects another unfinished-work status. Read the resulting record and affected
    projections after commit.
  expected: The resulting task has Open standing. Enabled attention refreshes an overdue item within the
    task transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to
    move to any of the three open statuses
  state_model: STATE-CRM-ACT-002
  transition:
    from: deferred
    to: open
    trigger: An ordinary edit selects another unfinished-work status.
- id: ATS-CRM-ACT-011-13
  title: Persist task from Open to Completed
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Open standing. Updates are unlocked and the task is unfinished; the
    public action also requires the current read version.
  steps: The dedicated completion action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Completed standing. The completion actor and instant are recorded while
    routing is retained. Enabled attention resolves an overdue item as completed in the same transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#completes the task, stamping who finished
    it and when
  state_model: STATE-CRM-ACT-002
  transition:
    from: open
    to: completed
    trigger: The dedicated completion action is invoked.
- id: ATS-CRM-ACT-011-14
  title: Persist task from Open to Cancelled
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Open standing. Updates are unlocked and the task is unfinished; the
    public action also requires the current read version.
  steps: The dedicated cancellation action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Cancelled standing. The cancellation actor and instant are recorded
    while routing is retained. Enabled attention resolves an overdue item as cancelled in the same transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/persistence/tasks.ts:closeTask
  state_model: STATE-CRM-ACT-002
  transition:
    from: open
    to: cancelled
    trigger: The dedicated cancellation action is invoked.
- id: ATS-CRM-ACT-011-15
  title: Persist task from Waiting for someone else to Completed
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Waiting for someone else standing. Updates are unlocked and the task
    is unfinished; the public action also requires the current read version.
  steps: The dedicated completion action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Completed standing. The completion actor and instant are recorded while
    routing is retained. Enabled attention resolves an overdue item as completed in the same transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
  state_model: STATE-CRM-ACT-002
  transition:
    from: waiting_for_someone_else
    to: completed
    trigger: The dedicated completion action is invoked.
- id: ATS-CRM-ACT-011-16
  title: Persist task from Deferred to Cancelled
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Deferred standing. Updates are unlocked and the task is unfinished;
    the public action also requires the current read version.
  steps: The dedicated cancellation action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Cancelled standing. The cancellation actor and instant are recorded
    while routing is retained. Enabled attention resolves an overdue item as cancelled in the same transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
  state_model: STATE-CRM-ACT-002
  transition:
    from: deferred
    to: cancelled
    trigger: The dedicated cancellation action is invoked.
- id: ATS-CRM-ACT-011-17
  title: Persist task from Completed to Open
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Completed standing. The task is closed, updates are unlocked and the
    required read version matches.
  steps: The dedicated reopening action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Open standing. Both closing stamp pairs are cleared and the status
    becomes Open regardless of the earlier unfinished status. Enabled attention publishes again if the
    reopened work is overdue.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#reopens
    it as open, whatever status it was in before it closed
  state_model: STATE-CRM-ACT-002
  transition:
    from: completed
    to: open
    trigger: The dedicated reopening action is invoked.
- id: ATS-CRM-ACT-011-18
  title: Persist task from Cancelled to Open
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Cancelled standing. The task is closed, updates are unlocked and the
    required read version matches.
  steps: The dedicated reopening action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Open standing. Both closing stamp pairs are cleared and the status
    becomes Open regardless of the earlier unfinished status. Enabled attention publishes again if the
    reopened work is overdue.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/persistence/tasks.ts:reopenTask
  state_model: STATE-CRM-ACT-002
  transition:
    from: cancelled
    to: open
    trigger: The dedicated reopening action is invoked.
- id: ATS-CRM-ACT-011-19
  title: Persist task from Open to Deferred
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Open standing. The task is unfinished, updates are unlocked and the
    read version matches.
  steps: An ordinary edit selects another unfinished-work status. Read the resulting record and affected
    projections after commit.
  expected: The resulting task has Deferred standing. Enabled attention refreshes an overdue item within
    the task transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
  state_model: STATE-CRM-ACT-002
  transition:
    from: open
    to: deferred
    trigger: An ordinary edit selects another unfinished-work status.
- id: ATS-CRM-ACT-011-20
  title: Persist task from Waiting for someone else to Open
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Waiting for someone else standing. The task is unfinished, updates
    are unlocked and the read version matches.
  steps: An ordinary edit selects another unfinished-work status. Read the resulting record and affected
    projections after commit.
  expected: The resulting task has Open standing. Enabled attention refreshes an overdue item within the
    task transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
  state_model: STATE-CRM-ACT-002
  transition:
    from: waiting_for_someone_else
    to: open
    trigger: An ordinary edit selects another unfinished-work status.
- id: ATS-CRM-ACT-011-21
  title: Persist task from Deferred to Waiting for someone else
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Deferred standing. The task is unfinished, updates are unlocked and
    the read version matches.
  steps: An ordinary edit selects another unfinished-work status. Read the resulting record and affected
    projections after commit.
  expected: The resulting task has Waiting for someone else standing. Enabled attention refreshes an overdue
    item within the task transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
  state_model: STATE-CRM-ACT-002
  transition:
    from: deferred
    to: waiting_for_someone_else
    trigger: An ordinary edit selects another unfinished-work status.
- id: ATS-CRM-ACT-011-22
  title: Persist task from Waiting for someone else to Cancelled
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Waiting for someone else standing. Updates are unlocked and the task
    is unfinished; the public action also requires the current read version.
  steps: The dedicated cancellation action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Cancelled standing. The cancellation actor and instant are recorded
    while routing is retained. Enabled attention resolves an overdue item as cancelled in the same transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
  state_model: STATE-CRM-ACT-002
  transition:
    from: waiting_for_someone_else
    to: cancelled
    trigger: The dedicated cancellation action is invoked.
- id: ATS-CRM-ACT-011-23
  title: Persist task from Deferred to Completed
  category: transition
  level: api
  proves:
  - INV-DOM-CRM-ACT-003-02
  - INV-DOM-CRM-ACT-003-10
  - INV-DOM-CRM-ACT-003-12
  preconditions: Run-owned task has Deferred standing. Updates are unlocked and the task is unfinished;
    the public action also requires the current read version.
  steps: The dedicated completion action is invoked. Read the resulting record and affected projections
    after commit.
  expected: The resulting task has Completed standing. The completion actor and instant are recorded while
    routing is retained. Enabled attention resolves an overdue item as completed in the same transaction.
  negative: false
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to: []
  provenance: proposed
  source: services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
  state_model: STATE-CRM-ACT-002
  transition:
    from: deferred
    to: completed
    trigger: The dedicated completion action is invoked.
- id: ATS-CRM-ACT-011-24
  title: Map lifecycle refusal codes through the public error boundary
  category: failure
  level: unit
  proves:
  - BR-CAP-CRM-ACT-011-10
  - BR-CAP-CRM-ACT-017-05
  preconditions: Refusals represent incompatible closure, update locking and ineligible role claiming.
  steps: Map each refusal through the shared error response.
  expected: The response retains the specific problem code alongside status and explanation.
  negative: true
  data_needs: Run-owned records in an isolated workspace; fixed clock for calendar checks.
  bound_to:
  - services-crm:modules/tasks/tests/unit/services/tasks/task-refusals.spec.js
  - TST-CRM-ACT-033
  provenance: test
  source: services-crm:modules/tasks/tests/unit/services/tasks/task-refusals.spec.js
  binding_scope: Each registered suite contributes the assertions named by the retained file bindings;
    a compound scenario can require several suites. Conformance remains unverified.
evidence:
- 'services-crm at a8d1364f1dd44b723bb5f9acba12f983e9ec8d69: scenario sources, executable assertions and
  local dependency boundaries are inspected.'
- 'react-console at baf6dae382d6f41dce976c7f848667ccc37e076f: scoped component tests and browser journey
  assertions are inspected.'
coverage:
  rule: 'gap: FND-CRM-ACT-057'
  transition: covered
  validation: covered
  permission: 'gap: FND-CRM-ACT-057'
  edge: covered
  failure: covered
  boundary: 'gap: FND-CRM-ACT-057'
  concurrency: covered
  invariant: covered
  interaction: covered
coverage_obligations:
  finding: FND-CRM-ACT-057
  unproved_rules:
  - BR-CAP-CRM-ACT-011-11
  permission_matrix:
    keys:
    - crm.tasks.update
    remaining: Complete allow/refuse combinations, including each console guard and each API operation.
  execution_note: Covered means a scenario is specified; it does not mean that scenario has executed or
    every variant has an executable binding.
related_coverage:
- capability: CAP-CRM-ACT-015
  scenarios:
  - ATS-CRM-ACT-011-09
  finding: FND-CRM-ACT-057
- capability: CAP-CRM-ACT-017
  scenarios:
  - ATS-CRM-ACT-011-09
  finding: FND-CRM-ACT-057
permission_coverage:
- key: crm.tasks.update
  finding: FND-CRM-ACT-057
  note: The finding covers unproved operation and surface combinations; a permission-category scenario
    is not a complete permission matrix.
---

# Complete, cancel and reopen work with clear attribution: Capability Test Specification

## Coverage

Category coverage counts specified proof. Unbound cases remain proposed; registered assertions do not establish a passing run.

| Rule | Proof Scenario Or Finding |
|---|---|
| `BR-CAP-CRM-ACT-011-01` | `ATS-CRM-ACT-011-01` |
| `BR-CAP-CRM-ACT-011-02` | `ATS-CRM-ACT-011-02` |
| `BR-CAP-CRM-ACT-011-03` | `ATS-CRM-ACT-011-03` |
| `BR-CAP-CRM-ACT-011-04` | `ATS-CRM-ACT-011-04` |
| `BR-CAP-CRM-ACT-011-05` | `ATS-CRM-ACT-011-05`, `ATS-CRM-ACT-011-09` |
| `BR-CAP-CRM-ACT-011-06` | `ATS-CRM-ACT-011-06` |
| `BR-CAP-CRM-ACT-011-07` | `ATS-CRM-ACT-011-07` |
| `BR-CAP-CRM-ACT-011-08` | `ATS-CRM-ACT-011-08` |
| `BR-CAP-CRM-ACT-011-10` | `ATS-CRM-ACT-011-24` |
| `BR-CAP-CRM-ACT-011-11` | `FND-CRM-ACT-057` |

## Interactions With Related Capabilities

Publishing is enabled and an overdue task is open. Complete as a registered service, repeat that command, then attempt a person completion with the current version.

The interaction scenario names the capabilities and rules it exercises. The coverage finding retains incomplete permission combinations and failure variants.
