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
Add portable execution-data export and DynamoDB backup safety
Status: in progress
Tags: backend, data, infra, testing, P0
Depends on: #28 (execution-state schema, resolved)
Blocks: —
Scope
Complete the remaining data-safety gaps for portable execution-data export.
The export command, JSONL format, manifest, validator, redaction rules, and
PITR-enabled tables already exist. This issue adds:
A dry-run import path that validates an export and reports what would be
written without mutating any data.
A scheduled export endpoint that triggers a portable export and writes it
to an output location (local dir or S3 URI), callable as an admin job.
A restore drill document covering PITR recovery and portable-export
validation, with the minimum smoke-check list.
Acceptance Criteria
A dry-run import command reads an export directory, runs full
validation, and reports insert/update/skip/invalid counts per entity
without writing to any database.
Dry-run import exits non-zero when validation fails, zero when valid.
Dry-run import reports the total record count it would write.
A scheduled export route (POST /api/cron/export) triggers a
portable export and writes it to EXPORT_OUTPUT_DIR (or S3 when
configured).
The export route returns the manifest summary (entity counts, output
location) on success.
Waiting/follow-up fields (waitingFor, followUpAt) are preserved
and validated in export/import records.
Notification type values including follow-up-due are preserved
and validated.
A restore drill document explains PITR recovery, on-demand backup,
portable export, validation, dry-run import, and the smoke-check list.
Tests cover dry-run import reporting (valid and invalid exports) and
the scheduled export route.
Test Scenarios
Scenario: Dry-run import of a valid export
Given: a portable export created by writePortableExport
When: dry-run import runs against the export directory
Then: reports the same entity counts as the manifest, exits zero, writes
nothing.
Scenario: Dry-run import of a broken export
Given: an export with a broken task reference and a tampered checksum
When: dry-run import runs against the export directory
Then: reports validation errors, exits non-zero, writes nothing.
Scenario: Scheduled export produces a valid archive
Given: a DynamoDB with seeded execution data
When: POST /api/cron/export runs with EXPORT_OUTPUT_DIR set
Then: returns manifest summary with entity counts, files exist on disk,
and validatePortableExport passes.
Out of Scope
Real S3 upload implementation (route writes to local dir; S3 URI support
documented as a follow-up).
Admin auth/access control for the export endpoint (V1 uses the existing
cron auth path).
Multi-table transactional snapshot guarantee (current scan is sequential).
File body backup (metadata-only export, as documented).
Add portable execution-data export and DynamoDB backup safety
Status: in progress
Tags:
backend,data,infra,testing,P0Depends on: #28 (execution-state schema, resolved)
Blocks: —
Scope
Complete the remaining data-safety gaps for portable execution-data export.
The export command, JSONL format, manifest, validator, redaction rules, and
PITR-enabled tables already exist. This issue adds:
written without mutating any data.
to an output location (local dir or S3 URI), callable as an admin job.
validation, with the minimum smoke-check list.
Acceptance Criteria
validation, and reports insert/update/skip/invalid counts per entity
without writing to any database.
POST /api/cron/export) triggers aportable export and writes it to
EXPORT_OUTPUT_DIR(or S3 whenconfigured).
location) on success.
waitingFor,followUpAt) are preservedand validated in export/import records.
typevalues includingfollow-up-dueare preservedand validated.
portable export, validation, dry-run import, and the smoke-check list.
the scheduled export route.
Test Scenarios
Scenario: Dry-run import of a valid export
Given: a portable export created by
writePortableExportWhen: dry-run import runs against the export directory
Then: reports the same entity counts as the manifest, exits zero, writes
nothing.
Scenario: Dry-run import of a broken export
Given: an export with a broken task reference and a tampered checksum
When: dry-run import runs against the export directory
Then: reports validation errors, exits non-zero, writes nothing.
Scenario: Scheduled export produces a valid archive
Given: a DynamoDB with seeded execution data
When:
POST /api/cron/exportruns withEXPORT_OUTPUT_DIRsetThen: returns manifest summary with entity counts, files exist on disk,
and
validatePortableExportpasses.Out of Scope
documented as a follow-up).
cron auth path).