You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Status: ready for engineering
Tags: enhancement, work-engine, backend, data, process-docs, assistant, testing, P0
Depends on: #5 (closed document registry), #6 (closed task-to-process-doc links), #28 (execution-state storage schema), #48 (closed portable export/data safety)
Blocks: #8, #9, #29, #30, first workflow UI/runtime slices that need a stable workflow contract
Scope
Define the first V1 workflow data model as the reusable contract that turns DataOps from a docs-first portal into a workflow-first operations workspace.
This issue is not the Podcast workflow itself. It defines the shared model that a Podcast, Newsletter, Tax Report, or other workflow can use.
The implementation should:
Add or update a concise workflow data model document, preferably near the existing V1 schema docs, that names the canonical entities, their required fields, enum values, relationships, and ownership boundary.
Align work-engine/src/types.ts with that model for workflow definitions/templates, task definitions, runtime workflow bundles, task instances, reminders/follow-ups, proof requirements, docs-in-context fields, artifact references, assistant job references, and audit/history events.
Keep canonical workflow definitions and reviewed task templates Git-backed under content/; keep mutable workflow runs, tasks, reminders, file/artifact metadata, assistant job metadata, and audit/history state in DynamoDB as described by Define execution-state storage schema #28.
Add or update focused tests/fixtures that prove one representative workflow definition can instantiate a runtime bundle with tasks, proof requirements, doc context, follow-up fields, artifact/assistant references, stable IDs, and exportable relationship fields.
Acceptance Criteria
A V1 workflow data model document exists and clearly distinguishes:
external/S3 artifact binaries versus DynamoDB artifact metadata;
export/migration records using stable business IDs.
The model covers workflow definitions with phases/stages, task definitions, offsets from an anchor date, required bundle links, references, default assignee, trigger metadata, and source document IDs.
The model covers runtime workflow bundles with bundle_id, template_id, title, anchor date, stage, status, references, required bundle links, tags, created/updated timestamps, and stable relationships to tasks/artifacts/assistant jobs/audit events.
The model covers task instances with task_id, bundle_id, template_id or template_task_ref, assignee, due date, status, waiting/follow-up fields, completion actor/timestamp, proof fields, doc-context fields, comments, tags, and timestamps.
Task proof semantics are explicit: a task may require a URL, file/artifact metadata, comment, or external status, and a done state must not be valid when required proof is missing.
Reminder semantics are explicit for due, overdue, follow-up, missing-evidence, recurring, stage-change, and automation-failure notifications, reusing the existing notification/export type names where possible.
Audit/history is modeled as append-only events with actor, entity type, entity ID, action, before/after metadata or summary, and timestamp, even if full event emission is deferred.
All durable entities have stable application-level IDs and explicit relationship fields suitable for portable export and a future Postgres migration; DynamoDB PK/SK values are not the only relationship source.
work-engine/src/types.ts, route validation, template instantiation, and export/validation fixtures are consistent with the documented model without regressing existing task/doc-link/export behavior.
Tests cover the representative workflow fixture, template-to-bundle/task instantiation, waiting/follow-up validation, required proof validation, doc-context propagation, and portable export validation for the model fields touched by this issue.
Given a workflow definition with phases, required bundle links, source docs, task offsets, proof requirements, and doc-context fields
When a bundle is created from the workflow definition using an anchor date
Then the runtime bundle has stable IDs and required link placeholders, and each task has the expected due date, template task ref, bundle ID, proof requirement, doc context, assignee, tags, and status.
Scenario: Completion requires proof
Given a task generated from the workflow model requires a link or file/artifact proof
When the task is marked done without that proof
Then validation rejects the update with a clear missing-proof error and does not record completedAt or completedBy.
Scenario: Waiting work creates follow-up state without closing the task
Given a workflow task is blocked on an external person
When the task is moved to waiting with waitingFor and followUpAt
Then the task remains active, is exportable with waiting fields, and can drive a follow-up-due reminder when the follow-up date arrives.
Scenario: Docs stay contextual
Given a task definition includes instructionDocId, optional instructionStepId, phase, systems, and validation
When the template is saved and instantiated
Then those fields persist and copy to the task, while legacy instructionsUrl remains supported as a fallback only.
Scenario: Portable export remains migration-safe
Given the representative workflow has a bundle, tasks, proof metadata, reminders, and optional artifact/assistant/audit references
When the portable export validator runs
Then exported records use snake_case stable IDs and explicit relationship fields, the manifest marks not-yet-implemented entities explicitly, and no relationship depends only on DynamoDB keys.
Define the first workflow data model
Status: ready for engineering
Tags:
enhancement,work-engine,backend,data,process-docs,assistant,testing,P0Depends on: #5 (closed document registry), #6 (closed task-to-process-doc links), #28 (execution-state storage schema), #48 (closed portable export/data safety)
Blocks: #8, #9, #29, #30, first workflow UI/runtime slices that need a stable workflow contract
Scope
Define the first V1 workflow data model as the reusable contract that turns DataOps from a docs-first portal into a workflow-first operations workspace.
This issue is not the Podcast workflow itself. It defines the shared model that a Podcast, Newsletter, Tax Report, or other workflow can use.
The implementation should:
work-engine/src/types.tswith that model for workflow definitions/templates, task definitions, runtime workflow bundles, task instances, reminders/follow-ups, proof requirements, docs-in-context fields, artifact references, assistant job references, and audit/history events.content/; keep mutable workflow runs, tasks, reminders, file/artifact metadata, assistant job metadata, and audit/history state in DynamoDB as described by Define execution-state storage schema #28.sourceDocIds,instructionDocId,instructionStepId,phase,systems, andvalidationfields rather than inventing another doc-link mechanism.Acceptance Criteria
bundle_id,template_id, title, anchor date, stage, status, references, required bundle links, tags, created/updated timestamps, and stable relationships to tasks/artifacts/assistant jobs/audit events.task_id,bundle_id,template_idortemplate_task_ref, assignee, due date, status, waiting/follow-up fields, completion actor/timestamp, proof fields, doc-context fields, comments, tags, and timestamps.donestate must not be valid when required proof is missing.instructionsUrl; no new parallel document registry is introduced.PK/SKvalues are not the only relationship source.work-engine/src/types.ts, route validation, template instantiation, and export/validation fixtures are consistent with the documented model without regressing existing task/doc-link/export behavior.Test Scenarios
Scenario: Representative workflow definition instantiates cleanly
Given a workflow definition with phases, required bundle links, source docs, task offsets, proof requirements, and doc-context fields
When a bundle is created from the workflow definition using an anchor date
Then the runtime bundle has stable IDs and required link placeholders, and each task has the expected due date, template task ref, bundle ID, proof requirement, doc context, assignee, tags, and status.
Scenario: Completion requires proof
Given a task generated from the workflow model requires a link or file/artifact proof
When the task is marked
donewithout that proofThen validation rejects the update with a clear missing-proof error and does not record
completedAtorcompletedBy.Scenario: Waiting work creates follow-up state without closing the task
Given a workflow task is blocked on an external person
When the task is moved to
waitingwithwaitingForandfollowUpAtThen the task remains active, is exportable with waiting fields, and can drive a
follow-up-duereminder when the follow-up date arrives.Scenario: Docs stay contextual
Given a task definition includes
instructionDocId, optionalinstructionStepId,phase,systems, andvalidationWhen the template is saved and instantiated
Then those fields persist and copy to the task, while legacy
instructionsUrlremains supported as a fallback only.Scenario: Portable export remains migration-safe
Given the representative workflow has a bundle, tasks, proof metadata, reminders, and optional artifact/assistant/audit references
When the portable export validator runs
Then exported records use snake_case stable IDs and explicit relationship fields, the manifest marks not-yet-implemented entities explicitly, and no relationship depends only on DynamoDB keys.
Out of Scope
Dependencies