Initial Commit
This commit is contained in:
67
openspec/archive/2026-05-19-add-api-plugin-export/tasks.md
Normal file
67
openspec/archive/2026-05-19-add-api-plugin-export/tasks.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# Tasks — Ship `@suaveplan/api-plugin-export`
|
||||
|
||||
## 1. Spec authoring
|
||||
|
||||
- [x] 1.1 Read `../suaveplan/enterprise/api-plugin-export.md` end-to-end
|
||||
- [x] 1.2 Read upstream `../suaveplan/packages/server/api-plugin-export/src/` end-to-end
|
||||
- [x] 1.3 Read `openspec/AGENTS.md` §§ 2a, 6a, 7, 12, 13, 14
|
||||
- [x] 1.4 Draft `proposal.md` from template
|
||||
- [x] 1.5 Fill `## Source mapping` table — every requirement cites a line range or appears in the no-source-line table
|
||||
- [x] 1.6 Draft `specs/api-plugin-export/spec.md` from template with `**Verified by:**` lines on every requirement
|
||||
|
||||
## 2. Implementation
|
||||
|
||||
- [x] 2.1 `package.json` v0.1.0, `sideEffects: false`, subpath exports, `workspace:^` peers, istanbul, vite build
|
||||
- [x] 2.2 `tsconfig.json` + `tsconfig.lib.json` extending `tsconfig.base.json`
|
||||
- [x] 2.3 `vite.config.ts` (dts + preserveModules, externals)
|
||||
- [x] 2.4 `vitest.config.ts` via `createTestConfig` style — istanbul, forks, 100/100/100/100
|
||||
- [x] 2.5 `tests/setup/polyfills.ts` — real `MeterProvider`
|
||||
- [x] 2.6 `src/error-codes/error-codes.ts` — `defineCodes("EXPORT", [...])` + `ExportError`
|
||||
- [x] 2.7 `src/types/types.ts` + Zod schemas (`ExportFormatSchema` etc.)
|
||||
- [x] 2.8 `src/exporters/csv/csv.ts` — `CsvExporter` + `escapeCsvField` + `formatCellValue` + `convertToCsv`
|
||||
- [x] 2.9 `src/exporters/json/json.ts` — `JsonExporter` + `projectRow` + `convertToJson`
|
||||
- [x] 2.10 `src/exporters/xlsx/xlsx.ts` — `XlsxExporter` + `escapeXml` + `columnIndexToLetter` + `formatXlsxCell` + `buildSpreadsheetXml`
|
||||
- [x] 2.11 `src/services/export/export-service.ts` — `getExporter` / `inferColumns` / `runExport` / `DEFAULT_EXPORT_CONFIG`
|
||||
- [x] 2.12 `src/routes/exports/exports.ts` — `createExportRoutes` with `GET /`, `POST /`, `GET /:id`, `DELETE /:id`
|
||||
- [x] 2.13 `src/otel/instruments.ts` — `ExportInstruments` + `getExportInstruments` + `resetExportInstruments`
|
||||
- [x] 2.14 `src/services/registry-augmentation.ts` — `exportProviders` + `exportJobs` slots
|
||||
- [x] 2.15 `src/plugin/plugin.ts` — `createExportPlugin` honouring caller-supplied options, mounting routes via `ctx.getService("app")`
|
||||
- [x] 2.16 `src/index.ts` — explicit named re-exports, side-effect import of error-codes + registry-augmentation
|
||||
|
||||
## 3. Tests
|
||||
|
||||
- [x] 3.1 Unit tests per feature module
|
||||
- [x] 3.2 Spec-conformance test pinning every `EXPORT_*` code to a production throw site + side-effect imports in `index.ts`
|
||||
- [x] 3.3 Every `it(...)` carries `{ timeout: 5000 }` (or 30000 for genuinely async)
|
||||
|
||||
## 4. Documentation
|
||||
|
||||
- [x] 4.1 Sibling `.md` for every implementation `.ts` (≥ 200 words, basic + advanced examples, full API reference)
|
||||
- [x] 4.2 `README.md` at package root only
|
||||
- [x] 4.3 No CLAUDE.md changes (out of scope — forbidden path)
|
||||
|
||||
## 5. Pre-archive verification (the 5-gate triple)
|
||||
|
||||
- [x] 5.1 `bun run check` — Biome clean
|
||||
- [x] 5.2 `bunx turbo lint typecheck test --filter=@suaveplan/api-plugin-export` — green
|
||||
- [x] 5.3 `bunx turbo test:coverage --filter=@suaveplan/api-plugin-export` — 100/100/100/100
|
||||
- [x] 5.4 `bun scripts/openspec-conformance.ts @suaveplan/api-plugin-export` — 0 errors
|
||||
- [x] 5.5 `bunx turbo build --filter=@suaveplan/api-plugin-export` — green
|
||||
|
||||
## 6. Pre-archive 9-row checklist (AGENTS.md §13 + skill §7)
|
||||
|
||||
- [x] 6.1 Generics threaded
|
||||
- [x] 6.2 Zod schemas wired at every declared boundary (`CreateExportJobSchema`, `ExportPluginOptionsSchema`, `ExportJobListQuerySchema`)
|
||||
- [x] 6.3 Every error code thrown from ≥ 1 production path (asserted by spec-conformance test)
|
||||
- [x] 6.4 Strict-mode behaviours tested (row cap + size cap throws `ExportError`; provider missing → 404; bad options → `ExportError(INVALID_CONFIG)`)
|
||||
- [x] 6.5 OTel instruments emitted from production paths, asserted with real in-memory `MeterProvider`
|
||||
- [x] 6.6 Lifecycle dedup — `onClose` clears both maps; `onInit` registers services exactly once
|
||||
- [x] 6.7 No retroactive tick — every box reflects work in this change
|
||||
- [x] 6.8 No `export *` in any feature-module barrel (no feature barrels exist; root barrel uses named exports)
|
||||
- [x] 6.9 No direct `vitest` / `bun:test` imports — all tests import from `@suaveplan/testing/runner`
|
||||
|
||||
## 7. Archive
|
||||
|
||||
- [x] 7.1 Fold spec delta into `openspec/specs/api-plugin-export/spec.md`
|
||||
- [x] 7.2 Move `openspec/changes/add-api-plugin-export/` → `openspec/archive/2026-05-19-add-api-plugin-export/`
|
||||
- [x] 7.3 No MANIFEST.md refresh (forbidden path per task brief)
|
||||
Reference in New Issue
Block a user