# Phase 11 Sprint Task Breakdown (App-Level Task IDs)

**Date:** 2026-03-26  
**Phase:** 11 - Core Rails and Lifecycle Completion  
**Source Checklist:** docs/phase-11-execution-checklist.md

---

## 1. Planning Assumptions

- Sprint length: 2 weeks
- Phase length: 3 sprints (A, B, C)
- Status values: `not-started`, `in-progress`, `blocked`, `done`
- Priority values: `P0` (critical path), `P1` (important), `P2` (optimization)
- Each task must include test evidence and audit/telemetry evidence where applicable.

---

## 2. Task ID Scheme

Format:
- `P11-SA-<track><nn>` for Sprint A
- `P11-SB-<track><nn>` for Sprint B
- `P11-SC-<track><nn>` for Sprint C

Track letters:
- `A` Funding rails and cash-in
- `B` Wallet lifecycle and AFEX sync
- `C` Virtual IBAN and P2A
- `D` PIN and authorization
- `E` Phone/QR transfer identity
- `F` Cross-cutting quality/compliance/ops

---

## 3. Sprint A Tasks (Foundation and First Integrations)

## Track A - Funding Rails

### P11-SA-A01
- Title: Funding adapter contract normalization
- Apps: wallet_integrations, wallet_api_contracts
- Priority: P0
- Owner: Integrations Team + Architecture Team
- Dependencies: none
- Acceptance criteria:
  - Unified contract for `initiate`, `status`, `cancel`, `refund` for Lean/Checkout/AANI/AFEX card funding.
  - Request/response schemas versioned and published.
  - Error mapping follows ADR 0005 envelope.
- Evidence:
  - Contract document: `docs/funding-adapter-contract.md`
  - Contract schema tests: 27 tests, 0 failures
- Status: done

### P11-SA-A02
- Title: Lean adapter MVP implementation
- Apps: wallet_integrations
- Priority: P0
- Owner: Integrations Team
- Dependencies: P11-SA-A01
- Acceptance criteria:
  - Lean adapter supports initiate/status/cancel in sandbox mode.
  - Callback signature verification and replay dedup implemented.
  - Adapter contract tests pass.
- Evidence:
  - 26 adapter tests, 0 failures
  - Sandbox scenarios: success, insufficient_funds, card_declined, timeout, 3DS
  - HMAC-SHA256 signature verification with timing-safe compare
  - InboxStore.claim/3 replay deduplication (5-scenario batch test)
  - 173 total wallet_integrations tests, 0 regressions
- Status: done

### P11-SA-A03
- Title: Checkout adapter MVP implementation
- Apps: wallet_integrations
- Priority: P0
- Owner: Integrations Team
- Dependencies: P11-SA-A01
- Acceptance criteria:
  - Checkout adapter supports initiate/status/cancel in sandbox mode.
  - Failure states mapped to standardized integration exceptions.
  - Contract tests pass.
- Evidence:
  - Checkout adapter implementation: `apps/wallet_integrations/lib/wallet_integrations/adapters/checkout_adapter.ex`
  - Checkout adapter test suite: 35 tests, 0 failures
  - Exception mapping matrix coverage (timeout, unknown_outcome, duplicate_charge, mismatch)
  - Callback signature verification coverage (valid/invalid/missing/tampered/wrong-secret)
- Status: done

## Track B - Wallet Lifecycle and AFEX Sync

### P11-SA-B01
- Title: Wallet lifecycle state model expansion
- Apps: wallet_accounts, wallet_database
- Priority: P0
- Owner: Wallet Accounts Team
- Dependencies: none
- Acceptance criteria:
  - States include pending/active/suspended/frozen/closed.
  - Transition rules are explicit and tested.
  - Migration/scripts for persistence model updated.
- Evidence:
  - State model implemented in wallet_accounts with pending/active/suspended/frozen/closed lifecycle and transition guards.
  - wallet_database account schema and write-through persistence aligned to pending/suspended lifecycle state and suspension metadata.
  - Migration added to expand account status constraint and add suspend metadata columns.
  - Validation: wallet_accounts lifecycle test batch 39 tests, 0 failures.
- Status: done

### P11-SA-B02
- Title: Lifecycle commands and events v1
- Apps: wallet_accounts, wallet_events
- Priority: P0
- Owner: Wallet Accounts Team
- Dependencies: P11-SA-B01
- Acceptance criteria:
  - Commands for suspend, resume, close implemented.
  - Versioned events emitted with correlation IDs.
  - Audit events emitted for privileged actions.
- Evidence:
  - Commands implemented: ActivateAccount, SuspendAccount, ResumeAccount, CloseAccount.
  - Versioned events implemented: AccountActivated.v1, AccountSuspended.v1, AccountResumed.v1, AccountClosed.v1.
  - Command modules emit audit events and include correlation_id propagation in event payloads.
  - Lifecycle command and account tests aligned with pending-first lifecycle.
  - Validation: wallet_database schema/write-through tests 45 tests, 0 failures.
- Status: done

## Track D - PIN and Authorization

### P11-SA-D01
- Title: Wallet PIN policy baseline and threat checks
- Apps: wallet_auth
- Priority: P0
- Owner: Security Team + Product Team
- Dependencies: none
- Acceptance criteria:
  - Policy defines format, retry, lockout, reset/recovery, and support unlock controls.
  - Threat scenarios documented for brute force and recovery abuse.
  - Security sign-off recorded.
- Evidence:
  - Policy document
  - Threat checklist
- Status: not-started

### P11-SA-D02
- Title: PIN command primitives (create/verify/change)
- Apps: wallet_auth
- Priority: P0
- Owner: Security Team
- Dependencies: P11-SA-D01
- Acceptance criteria:
  - PIN create/verify/change commands implemented.
  - Storage uses secure hash strategy; no plaintext storage.
  - Abuse-path tests pass.
- Evidence:
  - Command tests
  - Security review note
- Status: not-started

## Track F - Cross-Cutting

### P11-SA-F01
- Title: Phase 11 API contract conformance baseline
- Apps: wallet_api_contracts, wallet_web
- Priority: P1
- Owner: Platform Team
- Dependencies: P11-SA-A01
- Acceptance criteria:
  - New endpoint contracts registered.
  - Validation tests for envelope, idempotency keys, and error codes pass.
- Evidence:
  - Conformance report
- Status: not-started

---

## 4. Sprint B Tasks (Core Completion and Reconciliation)

## Track A - Funding Rails

### P11-SB-A01
- Title: AANI and AFEX funding adapters
- Apps: wallet_integrations
- Priority: P0
- Owner: Integrations Team
- Dependencies: P11-SA-A01
- Acceptance criteria:
  - AANI and AFEX adapters implement initiate/status/cancel with standardized exceptions.
  - Provider-specific callback verification active.
  - Contract tests pass for all four rails.
- Evidence:
  - Adapter test suite report
- Status: not-started

### P11-SB-A02
- Title: Branch cash-in orchestration path
- Apps: wallet_integrations, wallet_journey, wallet_ledger, wallet_web
- Priority: P0
- Owner: Financial Domain Team + Operations Team
- Dependencies: P11-SA-A02, P11-SA-A03
- Acceptance criteria:
  - Branch operator can initiate cash-in with policy-gated admin action.
  - Successful callback posts atomic credit to ledger.
  - Duplicate callback cannot double-credit.
- Evidence:
  - End-to-end scenario tests
  - Duplicate replay test
- Status: not-started

## Track B - Wallet Lifecycle and AFEX Sync

### P11-SB-B01
- Title: AFEX profile synchronization ingestion
- Apps: wallet_integrations, wallet_accounts, wallet_database
- Priority: P0
- Owner: Integrations Team + Wallet Accounts Team
- Dependencies: P11-SA-B01
- Acceptance criteria:
  - AFEX profile upsert flow implemented with deterministic merge rules.
  - Sync events and conflict tags emitted.
  - Audit trail for profile updates is queryable.
- Evidence:
  - Sync integration tests
  - Conflict-handling report
- Status: not-started

### P11-SB-B02
- Title: Profile reconciliation scheduled job
- Apps: wallet_settlement, wallet_accounts
- Priority: P1
- Owner: Settlement/Reconciliation Team
- Dependencies: P11-SB-B01
- Acceptance criteria:
  - Scheduled compare-and-correct job available.
  - Reconciliation summary includes mismatch counts and corrected records.
  - Alerting threshold defined and tested.
- Evidence:
  - Job run report
  - Alert test evidence
- Status: not-started

## Track C - Virtual IBAN and P2A

### P11-SB-C01
- Title: Virtual IBAN policy and schema rollout
- Apps: wallet_accounts, wallet_database, wallet_compliance
- Priority: P0
- Owner: Financial Domain Team + Compliance Team
- Dependencies: none
- Acceptance criteria:
  - IBAN uniqueness/check validation rules documented and implemented.
  - Schema stores assignment and lifecycle metadata.
  - Compliance retention labels applied.
- Evidence:
  - Policy document
  - Migration + schema tests
- Status: not-started

### P11-SB-C02
- Title: Virtual IBAN issuance commands
- Apps: wallet_accounts
- Priority: P0
- Owner: Wallet Accounts Team
- Dependencies: P11-SB-C01
- Acceptance criteria:
  - Command to assign/reassign/deactivate virtual IBAN implemented.
  - Assignment events emitted.
  - Command tests pass for edge cases.
- Evidence:
  - Command tests
- Status: not-started

### P11-SB-C03
- Title: Inbound IBAN routing skeleton
- Apps: wallet_integrations, wallet_ledger, wallet_accounts
- Priority: P1
- Owner: Integrations Team + Ledger Team
- Dependencies: P11-SB-C02
- Acceptance criteria:
  - Inbound credit event maps to wallet account via virtual IBAN.
  - Routing failures create traceable exceptions.
  - No orphan inbound event without terminal status.
- Evidence:
  - Simulated inbound test report
- Status: not-started

## Track D - PIN and Authorization

### P11-SB-D01
- Title: PIN reset/recover with OTP
- Apps: wallet_auth
- Priority: P0
- Owner: Security Team
- Dependencies: P11-SA-D02
- Acceptance criteria:
  - Reset and recover commands require OTP challenge proof.
  - Recovery abuse limits and cooldown enforced.
  - Tests cover wrong OTP, expired OTP, retry exhaustion.
- Evidence:
  - Command tests
  - Abuse-flow test report
- Status: not-started

### P11-SB-D02
- Title: PIN retry and lockout enforcement
- Apps: wallet_auth, wallet_observability
- Priority: P0
- Owner: Security Team
- Dependencies: P11-SA-D02
- Acceptance criteria:
  - Retry counters and lockout state transitions implemented.
  - Lockout telemetry emitted with actor and correlation metadata.
  - Unlock/recovery path verified.
- Evidence:
  - Lockout tests
  - Telemetry sample report
- Status: not-started

## Track F - Cross-Cutting

### P11-SB-F01
- Title: Data governance controls for new entities
- Apps: wallet_database, wallet_compliance
- Priority: P1
- Owner: Compliance Team + Database Team
- Dependencies: P11-SB-B01, P11-SB-C01, P11-SB-D01
- Acceptance criteria:
  - PII tagging for new tables/fields complete.
  - Retention/access policies defined and enforced.
  - Governance review approved.
- Evidence:
  - Governance checklist
  - Approval note
- Status: not-started

---

## 5. Sprint C Tasks (End-to-End Completion and Sign-Off)

## Track C - Virtual IBAN and P2A

### P11-SC-C01
- Title: Wallet-to-bank transfer baseline (P2A)
- Apps: wallet_transfers, wallet_integrations, wallet_ledger
- Priority: P0
- Owner: Transfers Team + Integrations Team
- Dependencies: P11-SB-C03
- Acceptance criteria:
  - P2A initiate/status/fail/compensate lifecycle complete.
  - Idempotency and failure compensation tests pass.
  - Ledger integrity remains invariant under retries.
- Evidence:
  - 26 tests, 0 failures — `p2a_transfer_test.exs`
  - Lifecycle: :initiated → :submitted → :completed | :failed → :compensated
  - Compensation, idempotency, and DI failure-path tests included
- Status: done (2026-03-28)

## Track D - PIN and Authorization

### P11-SC-D01
- Title: Onboarding PIN setup journey
- Apps: wallet_web, wallet_auth
- Priority: P0
- Owner: Wallet Web Team + Security Team
- Dependencies: P11-SB-D01
- Acceptance criteria:
  - Onboarding flow includes required PIN setup step.
  - UX handles success/failure/lockout/recovery guidance.
  - Feature flag for controlled rollout in place.
- Evidence:
  - 9 tests, 0 failures — `onboarding_live_test.exs`
  - :pin_setup step between :review and :done; feature flag `pin_setup_enabled`
  - Covers: success, mismatch, weak, format_error, already_exists, skip_blocked, flag_disabled
- Status: done (2026-03-28)

### P11-SC-D02
- Title: PIN-gated transaction authorization
- Apps: wallet_web, wallet_auth, wallet_transfers
- Priority: P0
- Owner: Wallet Web Team + Security Team
- Dependencies: P11-SB-D02
- Acceptance criteria:
  - Sensitive transfer actions require valid PIN proof.
  - Step-up behavior aligns with policy matrix.
  - Negative-path tests pass.
- Evidence:
  - 5 PIN challenge tests, 0 failures — `transfer_live_test.exs`
  - :pin_challenge step added; VerifyPin called before execute_transfer
  - Negative paths: locked, invalid, not_set guidance, format_error, back navigation
- Status: done (2026-03-28)

## Track E - Phone/QR Transfer Identity

### P11-SC-E01
- Title: Phone receiver lookup integration
- Apps: wallet_transfers, wallet_integrations
- Priority: P0
- Owner: Transfers Team + Integrations Team
- Dependencies: P11-SB-B01
- Acceptance criteria:
  - Receiver can be resolved by normalized phone number.
  - Enumeration protections (masking/rate limit) enforced.
  - Contract tests pass.
- Evidence:
  - 26 tests, 0 failures — `phone_receiver_lookup_test.exs`
  - E.164 normalisation, PII masking (first-6/first-2/last-4), rate limit 5/60s
  - PhoneReceiver, PhoneLookupRateLimiter, LookupPhoneReceiver command
- Status: done (2026-03-28)

### P11-SC-E02
- Title: QR identity schema and parser integration
- Apps: wallet_transfers, wallet_web
- Priority: P0
- Owner: Wallet Web Team + Transfers Team
- Dependencies: none
- Acceptance criteria:
  - QR payload schema validated with checksum/version fields.
  - Invalid payload handling returns deterministic error contract.
  - Parse and validation tests pass.
- Evidence:
  - 26 tests, 0 failures — `qr_identity_test.exs`
  - WAL|v1|account|currency|amount_kobo|label|checksum wire format
  - Error atoms: malformed_qr / invalid_version / missing_account_id / checksum_mismatch
- Status: done (2026-03-28)

### P11-SC-E03
- Title: Phone/QR transfer initiation end-to-end
- Apps: wallet_web, wallet_transfers, wallet_auth, wallet_observability
- Priority: P0
- Owner: Transfers Team + Wallet Web Team
- Dependencies: P11-SC-E01, P11-SC-E02, P11-SC-D02
- Acceptance criteria:
  - Customer can initiate transfer using phone or QR target.
  - Policy checks, risk hooks, and audit events are emitted.
  - E2E tests pass for success/failure/unauthorized paths.
- Evidence:
  - 13 tests — `resolve_transfer_target_test.exs` (wallet_transfers)
  - 10 tests — phone/QR mode tests in `transfer_live_test.exs` (wallet_web)
  - ResolvedTarget struct, ResolveTransferTarget command, TransferLive 3-mode target selector
  - DI: phone_account_resolver via Application.get_env for test injection
- Status: done (2026-03-28)

## Track F - Cross-Cutting Sign-Off

### P11-SC-F01
- Title: Observability and audit traceability closure
- Apps: wallet_observability, wallet_web, wallet_integrations, wallet_auth
- Priority: P0
- Owner: Observability Team + Security Team
- Dependencies: all P11-SC P0 tasks
- Acceptance criteria:
  - Correlation continuity validated across all critical Phase 11 flows.
  - Audit timeline available for PIN/funding/P2A/phone-QR actions.
  - Traceability report approved.
- Evidence:
  - 10 tests, 0 failures — `audit_traceability_test.exs`
  - AuditEvent.build emits [:wallet_observability, :audit_event, :emitted] telemetry
  - AuditCapture test utility (start/stop/drain/correlation_ids/filter_by_action)
  - Correlation_id threading validated: single corr_id propagates through all events
  - Event structure validates ADR-0007 required fields
- Status: done (2026-03-28)

### P11-SC-F02
- Title: Operational runbooks and tabletop execution
- Apps: docs, wallet_production
- Priority: P1
- Owner: Operations Team + SRE Team
- Dependencies: P11-SC-C01, P11-SC-D02, P11-SC-E03
- Acceptance criteria:
  - Runbooks published for funding, sync, lockout, and P2A incidents.
  - One tabletop exercise executed with findings logged.
  - Action items assigned with owners and due dates.
- Evidence:
  - Runbook set
  - Tabletop report
- Status: deferred to Phase 12 (P1 carryover per Sprint C tolerance policy)

### P11-SC-F03
- Title: Phase 11 sign-off package
- Apps: docs
- Priority: P0
- Owner: Program Management + Track Leads
- Dependencies: P11-SC-F01, P11-SC-F02
- Acceptance criteria:
  - Evidence checklist in phase checklist is complete.
  - Open critical defects count is zero.
  - Sign-off from Architecture, Security, Compliance, Operations captured.
- Evidence:
  - `docs/phase-11-sprint-c-signoff.md` — signed sign-off package
- Status: done (2026-03-28)

---

## 6. Critical Path

1. P11-SA-A01 -> P11-SA-A02/P11-SA-A03 -> P11-SB-A01 -> P11-SB-A02
2. P11-SA-B01 -> P11-SA-B02 -> P11-SB-B01 -> P11-SB-B02
3. P11-SB-C01 -> P11-SB-C02 -> P11-SB-C03 -> P11-SC-C01
4. P11-SA-D01 -> P11-SA-D02 -> P11-SB-D01/P11-SB-D02 -> P11-SC-D01/P11-SC-D02
5. P11-SC-E01 + P11-SC-E02 + P11-SC-D02 -> P11-SC-E03
6. P11-SC-E03 + P11-SC-C01 + P11-SC-D02 -> P11-SC-F01 -> P11-SC-F03

---

## 7. Completion Gates Per Sprint

Sprint A gate:
- Must-complete tasks: P11-SA-A01, P11-SA-A02, P11-SA-A03, P11-SA-B01, P11-SA-D01, P11-SA-D02
- Tolerance: maximum 1 P1 task carryover

Sprint B gate:
- Must-complete tasks: P11-SB-A01, P11-SB-A02, P11-SB-B01, P11-SB-C01, P11-SB-C02, P11-SB-D01, P11-SB-D02
- Tolerance: no P0 carryover

Sprint C gate:
- Must-complete tasks: P11-SC-C01, P11-SC-D02, P11-SC-E03, P11-SC-F01, P11-SC-F03
- Tolerance: no open critical defects

---

## 8. Definition of Done (Phase 11)

A Phase 11 task is done only when:
- Code/config changes are merged and tests pass in CI.
- Required policy and security checks are validated.
- Audit and telemetry evidence is captured for sensitive actions.
- Operational documentation is updated where relevant.
- Task status, owner, and evidence link are recorded in tracker artifacts.
