Skip to main content

AEROSIM-TS-66

Project task

Implement transactional progress persistence and retrieval

The API transactionally stores governed progress for the active pilot and returns that same pilot's canonical latest state in a later session.

AEROSIM-TS-66Canonical ID TASK-0066
Verified flow state
Done
Owner
AeroSim Architecture and Delivery
Component
API Service — Progress service, Fastify HTTP boundary, and Prisma data adapter
Repository
corp-v1-aerosim/corp-v1-aerosim

Delivery scope

Implement validated progress write and read contracts in the Progress service, derive pilot ownership from authenticated context, enforce payload and activity-version compatibility, order canonical updates deterministically, preserve resumable context, and map invalid or stale writes to stable errors. Concrete artifacts are prisma/schema.prisma and tests/integration/progress-persistence.test.ts; ownership is limited to the listed artifacts and their focused verification.

Implementation contract

Implementation artifacts

  • prisma/schema.prisma
  • prisma/migrations/implement-transactional-progress-persistence-and-retri/migration.sql
  • tests/integration/progress-persistence.test.ts

Inputs

  • Authenticated pilot context and validated progress write contract
  • Governed activity definition and supported state-payload version
  • Existing canonical updates used for deterministic latest-state selection

Outputs

  • The API transactionally stores governed progress for the active pilot and returns that same pilot's canonical latest state in a later session.

Failure boundaries

  • Reject malformed, stale, unsupported-version, wrong-activity, or wrong-pilot writes without changing canonical progress
  • An interrupted transaction or duplicate idempotent retry must not create a partial or second canonical checkpoint

Excluded scope

  • Accepting browser timestamps as the sole ordering authority
  • Persisting continuous flight telemetry or non-governed simulation state

Verification steps

  • Run tests/integration/progress-persistence.test.ts against the exact implementation revision and retain the complete passing result.
  • Exercise the positive contract with authenticated pilot context and validated progress write contract, then assert: The API transactionally stores governed progress for the active pilot and returns that same pilot's canonical latest state in a later session.
  • Exercise every negative boundary: Reject malformed, stale, unsupported-version, wrong-activity, or wrong-pilot writes without changing canonical progress; An interrupted transaction or duplicate idempotent retry must not create a partial or second canonical checkpoint

Traceability

Requirements

Dependencies

UI/UX applicability

non_visual

This Task owns technical or behavioral acceptance and does not claim direct visual conformance to the approved UI/UX package.

Acceptance evidence

Verified delivery: application PR #100 reviewed head 5165681b6e4435b3abbd1e9cd510315d225086cb passed all seven exact-head required jobs in tasks 3033, 3034, 3035, 3036, 3037, 3038, and 3039 after the test-first cross-schema DDL-race repair, merged as 00d2582bb561802e5ec2c15f668fb2d50a1ca798, and exact integration/publication tasks 3040, 3041, 3042, and 3044 succeeded. The reviewed implementation provides transactional pilot-owned progress persistence, deterministic latest-state retrieval, immutable idempotency receipts, stale/version/activity validation, rollback, concurrency, isolation, and legacy-upgrade coverage. Release completion verified on product 1.0.0.0 at GitOps revision 5d3712d89dfbf7dacd993348e55f497d126c7bf9 with Argo Synced/Healthy, exact image digests, authenticated API/database access, and three-world configured-flight acceptance.

Current evidence boundary

No current implementation, acceptance, release, or deployment evidence is claimed for this planned Task. Any prior implementation may be used only as prototype and discovery evidence.