Repository navigation
Closed
Labels
enhancementNew feature or requestplannedImplementation plan approvedready-for-reviewReady for code reviewroadmapFuture plans and roadmap items
Description
Problem (User Impact)
Users running parallel workflows get no real-time visibility — the MCP server polls log files, the dashboard can't stream updates, and progress reporting is hardcoded into the execution path. Adding any new consumer (webhook notification, Slack integration, VS Code extension) requires modifying batch-executor internals.
Currently:
- MCP
sequant_runspawns a subprocess and polls.sequant/logs/with a 5-minute window — a race condition that causes silent data loss - Progress callbacks are threaded manually through 4+ function signatures
- Log writer, metrics writer, and CLI spinners are tightly coupled to execution — can't add a consumer without touching orchestration code
- Interactive relay: bidirectional communication with headless runs #383 (interactive relay) and Add subagent lifecycle hooks for token cost visibility and diagnostics #486 (subagent lifecycle hooks) are architecturally blocked by the lack of an event system
Why Now
Depends on RunOrchestrator extraction (#503) — once the engine is a standalone class, it needs a clean way to communicate state changes to multiple consumers without direct coupling.
Acceptance Criteria
- AC-1:
WorkflowEventEmitterclass with typed events:run_started,run_completed,phase_started,phase_completed,phase_failed,issue_status_changed,qa_verdict,progress(at minimum) - AC-2: Events are typed using TypeScript — consumers get autocomplete and type checking on event payloads. Use Node.js
EventEmitterwith a typed wrapper (not RxJS or a pub/sub library) - AC-3:
RunOrchestrator(arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503) emits events at each lifecycle point. Emitting is fire-and-forget for non-critical consumers (logging, progress) and does not block the execution pipeline - AC-4:
LogWriterrefactored to be an event listener — subscribes to phase/run events instead of being called directly from batch-executor - AC-5:
MetricsWriterrefactored to be an event listener - AC-6: CLI progress display (spinners, phase status) refactored to be an event listener — parallel mode suppression becomes a listener config, not an if-statement in batch-executor
- AC-7: MCP server can subscribe to events for real-time progress notifications (replaces log file polling). Actual MCP notification wiring is a follow-up, but the subscription mechanism must work
- AC-8: Event payloads include enough context for any consumer:
{ issueNumber, phase, timestamp, duration?, verdict?, error? } - AC-9: Async listener support via
await Promise.allSettled(listeners)wrapper — a slow listener cannot crash the pipeline
Scope & Gaps to Watch
- Gap: Event ordering guarantees — In parallel execution, events from multiple issues interleave. Consumers must handle this. Document the contract: events are emitted in execution order per-issue, but interleaved across issues
- Gap: Backpressure — If a listener is slow (e.g., webhook with network latency), it must not block phase execution. The emit wrapper must be fire-and-forget with error swallowing for non-critical listeners
- Gap: Serialization — Event payloads must be JSON-serializable for MCP/webhook consumers. No class instances or circular references in payloads
- Risk: Over-engineering — This should be ~200 lines of code total. Node's EventEmitter is sufficient. Don't introduce a message queue, event store, or replay mechanism
Technical Notes
- Best practice from research: Use Node's built-in
EventEmitterwith a typed wrapper (e.g.,strict-event-emitter-typesor a manual generic). Zero runtime dependencies, battle-tested - Current progress reporting:
onProgresscallback inexecuteBatch(), spinner suppression viaconfig.parallelcheck in batch-executor.ts:396-398 - Current log writing:
LogWriter.logPhase()called directly from batch-executor.ts — becomesemitter.on('phase_completed', (e) => logWriter.logPhase(e)) - Current metrics:
MetricsWriter.recordRun()called at end of run — becomesemitter.on('run_completed', ...)
Dependencies
- Depends on: arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503 (RunOrchestrator extraction)
- Blocks: In-process MCP engine (follow-up issue)
- Unblocks: Interactive relay: bidirectional communication with headless runs #383 (interactive relay), Add subagent lifecycle hooks for token cost visibility and diagnostics #486 (subagent lifecycle hooks)
Batch Group
sequant run batch 2 (parallel with phase registry and async I/O — all depend only on #503)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestplannedImplementation plan approvedready-for-reviewReady for code reviewroadmapFuture plans and roadmap items
Activity
admarble commentedon Apr 9, 2026
Architecture Review: Recommended Descoping
After an overcomplexity assessment of the #503-#508 target architecture, this issue should be descoped. The current design builds a full event bus for 2-3 actual consumers — the ROI isn't there yet.
What to keep
WorkflowEventEmitterclass) — yes, build the emitterPromise.allSettled) — yesWhat to remove
LogWriterinto event listener) — works fine as a direct call todayMetricsWriterinto event listener) — sameThese three subsystems are the only current consumers. Refactoring them into subscriber patterns is churn for decoupling that only pays off at 4+ independent listeners. Two of the five diagrammed listeners (Webhooks, MCP Notifications) are future/speculative.
What to downgrade
Rationale
RunOrchestrator, but let existing consumers opt in organically when a real 4th consumer arrives (webhooks, VS Code extension, etc.)Updated AC checklist
WorkflowEventEmitterclass with typed eventsRunOrchestratoremits events at lifecycle points (fire-and-forget){ issueNumber, phase, timestamp, duration?, verdict?, error? }Promise.allSettledwrapper)docs: descope target architecture after overcomplexity review
fix(#494): /assess batch output formatting + label-priority spec-skip (…
admarble commentedon Apr 17, 2026
→ PROCEED — Typed event system (unblocks #383, #486)
Workflow:
spec → exec → qa· 9 ACsContext: #503 (RunOrchestrator extraction) merged via PR #510, so the stated dependency is resolved. Descoped per roadmap — confirm scope during
/spec.⚠ 9 ACs across batch-executor, MCP, and dashboard — multi-file scope
admarble commentedon May 14, 2026
→ PROCEED — Descoped event emitter + RunOrchestrator wiring
Workflow:
spec → exec → qa· -qScope reminder: the 2026-04-09 descoping comment is authoritative — keep AC-1/2/3/8/9 (emitter, typed events, orchestrator wiring, structured payloads, async listener safety). Drop AC-4/5/6 (LogWriter/MetricsWriter/spinner refactors — only migrate when a 4th consumer arrives). AC-7 (MCP subscription) noted as future, not required for this issue.
Independent of #505 — safe to run in parallel.
admarble commentedon May 14, 2026
Complexity: Standard (5 ACs, 1 directory)
AC Quality Check
Operating on the post-descope AC list from the 2026-04-09 architecture review (re-affirmed 2026-05-14): keep AC-1/2/3/8/9; drop AC-4/5/6 (consumer migrations); AC-7 noted as future. Renumbered AC-1 … AC-5 below.
EventEmitter+ typed wrapper, no third-party libPromise.allSettled, which is the measurable test.Scope Assessment
Non-Goals: Implicit in descoping comment. Recommend appending an explicit Non-Goals section to the issue body once /spec lands:
LogWriter,MetricsWriter, or CLI progress display into listenersPromise.allSettledsrc/lib/workflow/)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1:
WorkflowEventEmitterclass with typed eventsVerification: Unit Test
Scenario: Given a fresh
WorkflowEventEmitter→ Whenemit('phase_started', payload)is called with each of the 8 event names → Then registered listeners receive the typed payload; emitting an unknown event name fails TypeScript compilation.Required events (8):
run_started,run_completed,phase_started,phase_completed,phase_failed,issue_status_changed,qa_verdict,progress.Assumptions: Event name set is closed (no string-keyed catchall). Add new events by extending the type map, not by adding
stringindex signature.AC-2: TypeScript-typed events (no third-party pub/sub)
Verification: Unit Test + manual TS check
Scenario: Given
emitter.on('phase_completed', (e) => …)→ When typinge.in an editor → Then autocomplete shows{ issueNumber, phase, timestamp, duration }only;e.verdict(wrong event) fails compilation.Implementation note: Hand-rolled generic preferred (
class TypedEmitter<E extends Record<string, unknown>> extends EventEmitter). Rejectstrict-event-emitter-typesand similar packages per technical notes ("zero runtime dependencies"). The wrapper is ~30 LOC.Assumptions:
node:events'sEventEmittercovers the runtime needs; we only need compile-time typing on.on()/.emit()/.off().AC-3:
RunOrchestratoremits events at lifecycle points (fire-and-forget)Verification: Integration Test (with
RunOrchestrator.run)Scenario: Given an orchestrator with a registered listener that
throws synchronously and a second listener that resolves after 200ms → When a phase completes → Then the pipeline proceeds without delay and without error propagating to the run.Lifecycle points (from
run-orchestrator.ts+batch-executor.ts):run_started→ top ofRunOrchestrator.run()after config resolutionrun_completed→ before return inRunOrchestrator.run()issue_status_changed→ state transitions inapplyProgressEvent(queued → running → passed/failed)phase_started/phase_completed/phase_failed→ existing call sites inbatch-executor.ts:526/579/587/792/844/852qa_verdict→phase-executor.ts:434afterverdictMatchprogress→ existingonActivityping (batch-executor.ts:86, throttled ~10 Hz)Assumptions: Emitter is owned by
RunOrchestrator, threaded intoBatchExecutionContext(replacing or coexisting withonProgress). See Open Question 1.AC-4: Structured event payloads
Verification: Unit Test + JSON-roundtrip test
Scenario: Given each emitted event → When
JSON.stringify(payload)is called → Then the result roundtrips throughJSON.parsewithout loss; no class instances or circular refs are present.Base shape:
{ issueNumber: number, phase?: string, timestamp: string /* ISO 8601 */, duration?: number, verdict?: QaVerdict, error?: string }Per-event refinements:
run_*events omitphase;qa_verdictrequiresverdict;progressaddstext?: string(the existing activity line). Document via a discriminated union keyed by event name.Assumptions: Consumers expecting wall-clock duration get seconds (matches
PhaseLog.durationSeconds);timestampis ISO 8601 (matches existing log schema).AC-5: Async listener safety wrapper
Verification: Unit Test
Scenario: Given 3 listeners (sync-throwing, async-rejecting, async-resolving) attached to
phase_completed→ Whenemitter.emit('phase_completed', payload)is awaited → Then all 3 listeners are invoked, both failures are isolated, and the third still completes; orchestrator code that didawait emitter.emit(...)does not throw.Implementation note: Override
emit()to returnPromise<void>and wrap listener invocations inPromise.allSettledwith logging of rejections atverboselevel. Callers in critical paths (e.g.run_completed)await; fire-and-forget callers (e.g.progress) do not.Assumptions: Rejection logging goes through
console.logatverbose, mirroringlogNonFatalWarning(run-orchestrator.ts:1187). No retry, no dead-letter queue (out of scope per descope).Implementation Plan
Phase 1: Emitter scaffold
src/lib/workflow/event-emitter.ts(~120 LOC budget):TypedEmitter<E>generic base class wrappingnode:events.EventEmitterWorkflowEventstype map (discriminated union, one entry per event name in AC-1)WorkflowEventEmitter extends TypedEmitter<WorkflowEvents>emit()toPromise.allSettledthe listener calls (AC-5)src/lib/workflow/types.tsor a barrel — match local convention.event-emitter.test.ts(~150 LOC budget): type-error fixtures, payload-shape tests,Promise.allSettledfailure-isolation tests.Phase 2: RunOrchestrator wiring
emitter: WorkflowEventEmitterfield toRunOrchestrator; instantiate in constructor.getEmitter()so external consumers (TUI, MCP, follow-up Interactive relay: bidirectional communication with headless runs #383/Add subagent lifecycle hooks for token cost visibility and diagnostics #486) can subscribe.batch-executor.ts(lines 526/579/587/792/844/852) — add a singleemitter.emit(...)next to each existingemitProgressLine(...)/onProgress?.(...)invocation. Do not deleteemitProgressLineoronProgress; they remain in place (descoped — see Non-Goals).BatchExecutionContextso phase-executor.ts can emitqa_verdictat line 434 without reaching back to the orchestrator.Phase 3: Integration test + smoke
RunOrchestrator.run(...)in dry-run mode, subscribe to all 8 events, drive a one-issue stub, assert the expected event sequence + payload roundtrip.batch-executor.test.tsandrun-orchestratortests must continue to pass — no behavior change for callers that don't subscribe.Design Review
src/lib/workflow/— sibling torun-orchestrator.ts. The emitter is workflow-domain plumbing, not generic infra (rejected:src/lib/events/).TypedEmitter<E>generic overnode:events.EventEmitter. Rejected alternatives:strict-event-emitter-types— adds a dep for ~20 LOC of typingonProgresscallback wholesale — out of scope per descopeProgressCallbackpattern (types.ts:364) is the closest neighbor. The emitter generalizes it from one consumer (the renderer) to N consumers. Theverbose-gated non-fatal warning pattern (run-orchestrator.ts:1187) is the model for listener rejection logging.onProgresscallback?" —onProgressis the synchronous TUI render hook; events are the async multi-subscriber surface. The descope explicitly defers consolidating them. Document this dual API in the emitter file header.Promise.allSettledblocks the pipeline if all listeners are slow." — Only when the callerawaits the emit. Fire-and-forget paths (progressevent) don't await. Document which lifecycle points await and which don't.run_startedetc.). Keep snake_case for event names; payload fields stay camelCase.Feature Quality Planning
All standard checks pass. Notable items:
src/lib/workflow/directory — see Conflict Risk Analysis below.onProgresscoexistence is a deliberate non-goal, not an oversight. If a reviewer pushes to consolidate, point them at the descoping comment.Conflict Risk Analysis
feature/505-arch-phase-plugin-registry-...worktree exists at the same HEAD as main (no commits yet). #505 touchessrc/lib/workflow/types.ts,phase-executor.ts, andphase-detection.ts. #504 touchestypes.ts(new export),run-orchestrator.ts,batch-executor.ts, and addsevent-emitter.ts.Overlap:
src/lib/workflow/types.ts— both will add exports; merge conflict possible if both append to the same region.Mitigation: #504 adds a new file (
event-emitter.ts) and a small re-export intypes.ts. Keep thetypes.tstouch minimal (1–3 lines, append at end) to reduce merge surface. Issue assess comment confirms "independent of #505 — safe to run in parallel."Open Questions
onProgresscallback — Recommendation: coexist, emitter owned byRunOrchestrator, exposed viagetEmitter().onProgressstays as-is for the TUI's synchronous render path. Impact if wrong: if we replaceonProgressinstead, TUI render latency grows by one event-loop tick per phase event — measurable on the dashboard. Recommend coexist.progress(activity ping ~10 Hz) be an event at all? — High-frequency stream may pressure listeners. Recommendation: include it, but document that subscribing toprogressis opt-in and listeners must be cheap (no I/O). Impact if wrong: a misbehaving subscriber degrades the run. Mitigation lives in AC-5.emitter.removeAllListeners()in thefinallyblock ofRunOrchestrator.run()(alongsideorchestrator.markDone()at line 773) to prevent leaks across multiplerun()invocations in the same process (MCP server use case). Impact if wrong: memory leak under repeated MCPsequant_runcalls.Recommended Workflow
Phases: spec → testgen → exec → qa
Quality Loop: enabled
Reasoning: All 5 ACs are Unit Test or Integration Test verification — testgen adds value here. Quality loop is enabled per
/assessrecommendation; AC-3 (fire-and-forget) and AC-5 (Promise.allSettled) have subtle failure modes that benefit from iterative refinement.Label Review
Current:
enhancement,roadmap,backlogRecommended:
enhancement,roadmap,planned(dropbacklogsince work is starting)Reason: Issue moved from backlog to active execution per
/assessPROCEED. Theroadmaplabel remains accurate (still an arch-roadmap item);backlogno longer applies.Quality Loop: Will auto-enable per
/assessquality-loop=truemarker.→
gh issue edit 504 --add-label planned --remove-label backlogadmarble commentedon May 14, 2026
/exec Progress Update
PR: #643
AC Coverage (post-descope, renumbered AC-1…AC-5)
WorkflowEventEmitterclass with 8 typed events insrc/lib/workflow/event-emitter.tsnode:events— no third-party pub/sub dependencyRunOrchestratoremits at lifecycle points; all emits are fire-and-forget (void emitter.emit(...))Promise.allSettledwrapper withonListenerErrorhook (which itself swallows throws)Files Changed
src/lib/workflow/event-emitter.ts(new, 234 LOC) —WorkflowEventEmitter+ payload typessrc/lib/workflow/event-emitter.test.ts(new) — 10 unit testssrc/lib/workflow/run-orchestrator.ts— emitter field,getEmitter(), lifecycle emits, listener teardown inmarkDone()src/lib/workflow/types.ts— emitter onBatchExecutionContext+IssueExecutionContext; barrel re-exports__tests__/run-orchestrator-events.test.ts(new) — 9 integration testsCHANGELOG.md—[Unreleased]Added entryQuality Plan Alignment
Promise.allSettledonProgresslogNonFatalWarningfor listener errorsDerived ACs: None — spec did not list a Derived ACs table.
Verification Results
npm run build✅npm run lint✅ (zero warnings)npx vitest run src/lib/workflow/ __tests__/run-orchestrator*.test.ts __tests__/integration/run-orchestrator.integration.test.ts✅ 907/907 passnpx vitest run __tests__/mcp-progress-notifications.test.ts __tests__/mcp✅ 47/47 passNotes
onProgresscoexists with the emitter per the spec's open-question 1 recommendation. The existing synchronous TUI render hook is unchanged; the emitter is the async multi-subscriber surface.orchestrator.getEmitter().on(...)) is in place and works today; the actual MCP-side notification consumer is follow-up work.executeBatchnot wired: that function is unused in src/ — the orchestrator callsrunIssueWithLoggingdirectly. The emitter is still threaded throughBatchExecutionContextso the type contract is preserved.admarble commentedon May 14, 2026
QA Review for Issue #504
AC Coverage
The original 9 ACs were descoped per the 2026-04-09 architecture-review comment. The reduced contract (kept items below) is what this implementation must satisfy.
WorkflowEventEmitterwith 8 typed eventsWorkflowEvents(event-emitter.ts:105-114):run_started,run_completed,phase_started,phase_completed,phase_failed,issue_status_changed,qa_verdict,progress. Verified byevent-emitter.test.ts:17-74.node:events.EventEmitter(event-emitter.ts:138-238).on/off/emitare narrowed tokeyof WorkflowEvents; unknown event names fail compilation. Zero new runtime deps.RunOrchestratoremits at lifecycle points; fire-and-forgetvoid this.emitter.emit(...)(run-orchestrator.ts:344, 365, 393, 405, 419, 436, 1084, 1093, 1101). Slow-listener integration test (run-orchestrator-events.test.ts:365-389) confirms a hung listener doesn't block run completion.LogWriterinto event listenerMetricsWriterinto event listenerorchestrator.getEmitter().on('progress', ...)works today (proven by integration tests). Actual MCP-side wiring is explicit follow-up per the descope.BaseEventPayload(event-emitter.ts:38-43) requiresissueNumber+timestamp; each event extends withphase,duration,verdict,error,iterationas appropriate. JSON-serializable verified by roundtrip test (event-emitter.test.ts:112-139+run-orchestrator-events.test.ts:295-338).Promise.allSettledemit()wraps each listener inPromise.resolve().then(() => listener(payload))thenPromise.allSettled(event-emitter.ts:221-225). Trampoline correctly reifies synchronous throws — verified byevent-emitter.test.ts:143-174. Error handler itself swallows throws (event-emitter.test.ts:207-227).Coverage: 5/5 retained ACs MET; 3 descoped per architecture-review; 1 downgraded (mechanism MET, consumer deferred).
CI Status
typecheckbuild (20.x)build (22.x)validate-skillsvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed.
Mergeable state: MERGEABLE (UNSTABLE briefly during in-progress builds, now resolved).
Quality Metrics
anyadded)Test Coverage Analysis
src/lib/workflow/event-emitter.tssrc/lib/workflow/event-emitter.test.ts(10 tests)src/lib/workflow/run-orchestrator.ts__tests__/run-orchestrator-events.test.ts(9 tests)src/lib/workflow/types.tsCoverage: 2/2 changed source files have tests. All 5 retained ACs exercised by both unit and integration suites.
Vitest run locally (just the new suites): 19/19 pass, ~3s wall-clock.
Code Review
Strengths:
event-emitter.tsknows nothing about orchestration;run-orchestrator.tsknows nothing about how listeners are invoked. The contract is theWorkflowEventsmap.Promise.resolve().then()trampoline inemit()(event-emitter.ts:221-225) is the right pattern — without it, a synchronous throw in a non-async listener would bypassPromise.allSettledand propagate. Test at line 143-174 documents this exact failure mode.setMaxListeners(0)(event-emitter.ts:156) is deliberate — multiple consumers subscribing toprogresswould otherwise trigger Node's leak warning. Comment explains why.markDone()drains listeners (run-orchestrator.ts:285-289), addressing the MCP-server re-use leak called out in the spec's Open Question Doctor: Add Claude Code CLI check #3.timestampsemantics are clear and tested.onListenerErroris wrapped intry { ... } catch {}(event-emitter.ts:230-235) so a misbehaving error handler can't sink the pipeline either — belt-and-suspenders.Minor observations (non-blocking):
run_completednot emitted ifrunIssueWithLoggingthrows.executeOneIssueemitsrun_startedatrun-orchestrator.ts:1084, awaitsrunIssueWithLogging, then emitsrun_completed. If the awaited call throws,run_completedis skipped. In practicerunIssueWithLoggingreturnsIssueResult { success: false }rather than throwing (so this is theoretical), but atry { ... } finally { emit("run_completed", ...) }would harden the contract for future call paths. Out of scope for this PR.BatchExecutionContext.emitter/IssueExecutionContext.emitterare currently unused inside batch-executor. Exec note acknowledges this — the field is threaded for future use. Acceptable as a forward-compatibility hook; would be dead weight if no follow-up issue picks it up.emit()signature isPromise<void>, called withvoid. The unhandled-rejection-by-design pattern is documented in the file header;Promise.allSettledswallowing keeps it safe. Worth a one-line comment at eachvoid this.emitter.emit(...)call site explaining the intentional discard? Not blocking — JSDoc onemit()already covers it.Suggestions (deferable):
once<E>()overload for one-shot listeners (e.g. MCP's "wait for firstqa_verdict"). Trivially implementable viainner.once(). File a follow-up if the MCP consumer needs it.snake_case(per the issue body); the rest of the codebase iscamelCase. The decision is documented in the spec plan — flag it in CONTRIBUTING / a header comment so future contributors don't "fix" it.Test Quality Review
batch-executor,worktree-manager,state-manager,p-limit) but exercises realWorkflowEventEmitter+RunOrchestrator.applyProgressEvent/executeOneIssue.setTimeout(5ms)in the "slow listener" assertion — bounded and deterministic. No flake risk.Anti-Pattern Detection
Dependency Audit
N/A —
package.jsonunchanged. AC-2 (no third-party pub/sub library) satisfied.Code Patterns
No
anycasts added. No empty catches. No hardcoded secrets. No SQL/HTML injection surface. The singletry { ... } catch {}inonListenerErrorinvocation is deliberately empty with an explanatory comment.Call-Site Review
New exported functions detected:
WorkflowEventEmitterclass (constructor,on,off,emit,listenerCount,removeAllListeners),RunOrchestrator.getEmitter().emitter.emit("run_started")run-orchestrator.ts:1084emitter.emit("run_completed")run-orchestrator.ts:1101runIssueWithLoggingresolvesemitter.emit("qa_verdict")run-orchestrator.ts:1093phaseResults)pr.phase === "qa" && pr.verdictemitter.emit("phase_started")run-orchestrator.ts:344event === "start"branchemitter.emit("phase_completed")/phase_failed"run-orchestrator.ts:393, 405event === "failed"emitter.emit("issue_status_changed")run-orchestrator.ts:349, 412, 432prev !== next(de-duped)from === toeventsemitter.emit("progress")run-orchestrator.ts:368linenon-emptygetEmitter()Findings: All call sites match AC constraints. The
from !== tode-dup onissue_status_changedis a nice touch.Execution Evidence
N/A — no
scripts/or CLI option changes.Skill Command Verification
N/A — no
.claude/skills/**/*.mdfiles changed.Detection Pattern Verification
N/A — no skill markdown / regex / grep / awk / jq changes.
CLI Registration Verification
N/A —
RunOptionsnot modified; no new CLI flags.Smoke Test
npm run buildnpm run lint(--max-warnings 0)npx vitest run src/lib/workflow/event-emitter.test.ts __tests__/run-orchestrator-events.test.tsSmoke Test Status: Complete.
CHANGELOG Verification
CHANGELOG.mdexistsfeat(#504):commit)[Unreleased]entry(#504), names new files, documents descope decisionResult: CHANGELOG requirements met.
Risk Assessment
JSON.stringifyin tests. If the MCP consumer needs additional fields, the payload types will need extension — but the discriminatedWorkflowEventsmap makes that a typed, additive change.Adversarial Re-Read
Findings: Walked the diff once more adversarially:
onProgressthreading through 4+ signatures, tightly-coupled writers) are descriptive, not testable fixtures. The discriminatedWorkflowEventsmap literally enumerates the AC-1 event names — that fixture is covered byevent-emitter.test.ts:20-29.Promise.allSettledtest (event-emitter.test.ts:143-174) is a post-fix validation (proves listeners A and C both run after B throws), not a bug repro.053946b, branch up to date with origin/main, no uncommitted changes, no stashed work.issue_status_changedemit sites all use theprev !== nextguard pattern uniformly, no asymmetry between them.node:events, no queue, no replay, no persistence. "~200 lines of code total" — actual implementation is ~239 LOC for the emitter, within target.One asymmetry surfaced (
run_completednot emitted ifrunIssueWithLoggingthrows), already noted under Code Review as non-blocking because the awaited function returns failure rather than throwing.Status: Clean
Verdict: READY_FOR_MERGE
All 5 retained ACs MET; the three descoped ACs are explicitly out of scope per the 2026-04-09 architecture-review comment; AC-7's downgrade is satisfied by the in-place
getEmitter()subscription mechanism.anytypesDocumentation: Before merging, run
/docs 504to surface the newgetEmitter()API for downstream consumers. The header comment onevent-emitter.tsalready documents theonProgresscoexistence decision, but a CONTRIBUTING note about snake_case event names would help future contributors not "fix" the casing.Next Steps
executeOneIssueshould wrap therunIssueWithLoggingcall intry { ... } finally { void emit("run_completed", ...) }so the bracket events stay symmetric for future call paths.fix(#504): emit run_completed in finally; drop unused emitter context…
feat(#504): typed workflow event system for decoupled progress + MCP …
chore(#505): merge origin/main, resolve types.ts + CHANGELOG conflicts
fix(#647): AC-3 — route retry/fallback messages through renderer's ap…
feat(#504): typed workflow event system for decoupled progress + MCP …
fix(#504): emit run_completed in finally; drop unused emitter context…