Skip to content

Define execution-state storage schema #28

Description

@alexeygrigorev

Goal

Define the production execution-state schema for DataOps V1 so runtime work can move from the current undeployed work-engine prototype into SAM-managed DynamoDB tables without locking us into DynamoDB forever.

Process knowledge, SOPs, task templates, and other durable operating documents stay Git-backed. This issue is only for mutable execution state: what tasks exist, who owns them, what reminders are due, what workflow bundle they belong to, and what runtime metadata is needed to operate the portal.

Decision Inputs

Scope

  • Define the logical entity model for V1 execution state.
  • Decide which data is DynamoDB runtime state versus Git-backed process knowledge.
  • Define table names, keys, GSIs, retention, and ownership in SAM/CloudFormation.
  • Refactor or specify work-engine table access so production table names come from environment variables.
  • Define relationship fields in a portable way so records can later migrate to Postgres.
  • Document backup requirements for every durable table.
  • Ensure the schema feeds the portable export registry in Add portable execution-data export and DynamoDB backup safety #48.

Entities In Scope

  • Users or operator identities.
  • Tasks and task status transitions.
  • Workflow bundles/projects.
  • Task templates and instantiated template metadata.
  • Recurring task configurations.
  • File metadata, not file binaries.
  • Notifications and reminders.
  • Sessions only where the portal needs server-side session state.
  • Later-compatible slots for artifacts, assistant jobs, and audit events.

Acceptance Criteria

  • A schema document or ADR describes each execution entity, required fields, optional fields, ownership, retention expectation, and whether it is user-editable.
  • Every entity has a stable application-level ID that is not only a DynamoDB key expression.
  • Relationships are represented with explicit IDs suitable for a future relational migration, for example task_id, bundle_id, template_id, assignee_id, and parent_task_id.
  • DynamoDB table resources or a precise implementation spec define partition keys, sort keys where used, GSIs, billing mode, tags, PITR, and deletion/retain policy.
  • The schema includes access patterns needed by V1: today’s tasks, overdue tasks, tasks by owner/status, tasks by bundle/workflow, recurring schedules due soon, notifications due, and task-linked files/artifacts.
  • Production table lifecycle is owned by SAM/CloudFormation; production handlers do not create tables on cold start.
  • work-engine table names are configured through environment variables with local-development defaults only.
  • The schema explicitly distinguishes Git-backed templates/process docs from DynamoDB runtime template instances.
  • The portable export work in Add portable execution-data export and DynamoDB backup safety #48 can enumerate every durable entity from this schema.
  • Tests or validation scripts cover table-name configuration, schema serialization assumptions, and at least one representative query path per core entity.

Out Of Scope

Dependencies

Test Expectations

  • Unit tests for schema helpers or repository methods.
  • Local DynamoDB/dynalite or mocked integration tests for key query paths.
  • Infrastructure validation through SAM/CloudFormation template checks.
  • A small fixture that can later become the seed for Add portable execution-data export and DynamoDB backup safety #48 export validation.

Notes

Current deployed V1 does not use DynamoDB yet. lambda-functions/template.full.yaml defines the public full app Lambda and secrets resources, but no execution tables. This issue is where that changes in a controlled way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must havebackendBackend/APIdataData model, migration, storagework-engineDataTasks task execution engine

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions