Skip to content

Create packages/ext-agent-orchestrator/ — PubSub reactor extension pattern #70

Open

Description

@harrryyd

What to build

Create packages/ext-agent-orchestrator/, a new package that establishes the documented extension pattern for all fork-specific orchestration work. Extensions subscribe to orchestrationEngine.streamDomainEvents, filter for relevant event types, and dispatch commands back through orchestrationEngine.dispatch() — never modifying decider.ts or ProviderCommandReactor.ts.

Package contents

  1. README.md documenting the extension pattern with examples
  2. Effect Service tag + Layer template for new reactors
  3. A minimal example reactor (e.g., logging events to disk) that demonstrates subscribe → filter → dispatch
  4. Proper package.json, tsconfig.json, and subpath exports

Pattern contract

// Extensions depend on the existing OrchestrationEngine service
// They NEVER import from decider.ts or modify core orchestration files
const makeMyReactor = Effect.gen(function* () {
  const engine = yield* OrchestrationEngineService;
  yield* engine.streamDomainEvents.pipe(
    Stream.filter(isMyEventType),
    Stream.runForEach((event) => /* react + dispatch */)
  );
});

This is HITL because the pattern becomes the architectural contract all future fork work must follow.

Acceptance criteria

  • packages/ext-agent-orchestrator/ exists with correct package structure
  • README.md documents the reactor extension pattern with code examples
  • Minimal example reactor compiles and demonstrates subscribe → filter → dispatch
  • vp check passes
  • No changes to decider.ts, OrchestrationEngine.ts, or ProviderCommandReactor.ts

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions