Files
suaveplan/openspec/archive/2026-05-25-enterprise-web-workers/tasks.md
2026-05-27 23:29:53 +01:00

42 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Tasks: enterprise-web-workers
## Scaffolding
- [x] Add `web-workers` to `data:` plugin in `scripts/folder-reorg/assignment.yml`.
- [x] Create `packages/foundation/data/web-workers/` skeleton (`package.json`, `README.md`, `tsconfig.lib.json`, `vite.config.ts`, `vitest.config.ts`).
- [x] Wire workspace catalog deps: `@suaveplan/error`, `@suaveplan/events`, `@suaveplan/opentelemetry`, `@suaveplan/types`, `tslib`, `@opentelemetry/api`.
## Implementation
- [x] `errors/errors.ts` — `WEB_WORKERS_CODES`, `WebWorkersError`, metadata table.
- [x] `types/web-workers.types.ts` — public type surface.
- [x] `observability/observability.ts` + `observability.types.ts`.
- [x] `helpers/define-worker.ts` — `defineWorker({ url, type })` returns `WorkerFactory`.
- [x] `circuit-breaker/circuit-breaker.ts` — per-worker breaker.
- [x] `base-manager/base-manager.ts` + `base-manager.types.ts` — shared lifecycle, RPC pending map, AbortSignal, transfer, backpressure, breaker, OTel emission, `EventBus` wiring.
- [x] `worker-manager/worker-manager.ts` — classic-Worker concrete manager.
- [x] `shared-worker-manager/shared-worker-manager.ts` — `SharedWorker` port-per-client concrete manager.
- [x] `streaming/stream.ts` — `sendStream` async-iterable RPC.
- [x] `worker-pool/scheduler.ts` — round-robin + least-busy.
- [x] `worker-pool/worker-pool.ts` — FIFO queue, scheduler, restart-on-crash, health probe.
- [x] `message-bus/message-bus.ts` — pub/sub + once + broadcast + registerHandler + request (with timeout + AbortSignal).
- [x] `index.ts` — explicit named re-exports (rule 10).
## Documentation
- [x] Sibling `.md` next to every `.ts` per CLAUDE rule (≥200 words, 6 sections).
- [x] Root `README.md` with quick-start + module links.
## Gates
- [x] `bunx turbo lint typecheck test build --filter=@suaveplan/web-workers` green.
- [x] `bunx turbo test:coverage --filter=@suaveplan/web-workers` ≥ 100/100/100/100.
- [x] `bun scripts/folder-reorg/generate-manifest.ts` (refresh MANIFEST).
## Finalisation
- [x] Fold `specs/web-workers/spec.md` into `openspec/specs/web-workers/spec.md`.
- [x] Move change to `openspec/archive/2026-05-25-enterprise-web-workers/`.
- [x] Flip `STATUS.md` row from `–` to `✅` and bump counts.
- [x] Commit on `feat/migrate-web-workers` with Conventional Commit + Claude co-author footer (do not push).