Skip to content

feat(ports): define JobStore + EventStream ports (§0.1)#6

Merged
casabre merged 1 commit into
mainfrom
feat/store-ports
Jul 3, 2026
Merged

feat(ports): define JobStore + EventStream ports (§0.1)#6
casabre merged 1 commit into
mainfrom
feat/store-ports

Conversation

@casabre

@casabre casabre commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Fourth §0.1 increment — "define, don't implement" the two control-plane ports so the durable backends (gated behind the second-replica trigger) become a drop-in swap.

What

  • ports/event-stream.tsEventStream (publish/subscribe). EventBus now implements it (generic publish/subscribe alongside the existing job-event sugar), so the singleton eventBus is the in-memory EventStream.
  • ports/job-store.tsJobStore contract with the tenant-partitioning (Caller), owner/idempotency/wait-state seams already in the signatures; documented as the contract the current McpTaskManager Map satisfies today.
  • No app rewiring; Map/eventBus stay the impls. Type-only port files excluded from coverage (like base.ts/runner.ts).

Gates

typecheck ✅ · lint ✅ · test:coverage ✅ (375 tests, 100%) · build ✅.

🤖 Generated with Claude Code

Define the two control-plane ports (§0.1 "define, don't implement") so the
durable backends gated behind the second-replica trigger become a swap, not a
rewrite. No app rewiring — the current Map/eventBus remain the impls.

- ports/event-stream.ts: EventStream (publish/subscribe). EventBus now formally
  implements it (generic publish/subscribe alongside the job-event sugar), so the
  singleton eventBus IS the in-memory EventStream.
- ports/job-store.ts: JobStore contract with tenant-partitioning (Caller) and
  owner/idempotency/wait-state seams already in the signatures; documented as the
  contract the current McpTaskManager Map satisfies de-facto.
- Type-only port files excluded from coverage (like base.ts/runner.ts).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@casabre casabre merged commit f797f6d into main Jul 3, 2026
10 checks passed
@casabre casabre deleted the feat/store-ports branch July 3, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant