1.9 KiB
1.9 KiB
V1 Block 23 — Export Abstraction Layer
Purpose: Define Export controller and writer interface.
Note for Codex: Follow tasks exactly; avoid exploratory calls when tasks specify names/files/tests.
Chunk 23.1 — Export controller contract
Recommended level: XHIGH
Status: Complete on 2026-06-26.
Tasks
- Add package
packages/scheduler_export. - Define abstract class
ExportWriterwithFuture<void> begin(ExportContext),Future<void> writeTask(Task),Future<void> end(), plus factory registry. - Define
ExportControllerorchestrating repository queries and writer. - Provide context object with
ownerId,timezone,version.
Acceptance criteria
- JSONWriter and CSVWriter stubs compile and implement interface.
- Unit test writes small set and verifies output.
Completed implementation
- Added package
packages/scheduler_exportwith public entry pointsexport.dartandscheduler_export.dart. - Added
ExportContextcarryingownerId,timezone, andversion. - Added
ExportWriter,ExportWriterFactory, andExportWriterRegistrywith defaultjsonandcsvmappings. - Added
ExportControllerthat reads owner-scoped paged tasks throughTaskRepositoryand streams them to a writer. - Added compiling
JsonExportWriterandCsvExportWriterimplementations backed byStringSink. - Added unit tests for owner-scoped JSON export, CSV output, and custom writer factory registration.
- Wired export tests into the root test wrapper.
Verification
dart pub get: passed.dart format test/scheduler_core_test.dart packages/scheduler_export: passed.cd packages/scheduler_export && dart analyze: passed, no issues found.cd packages/scheduler_export && dart test: passed, 3 tests.dart analyze: passed, no issues found.dart test: passed, 327 tests.scripts/test.sh: not present or not executable.