Wire dormant Orchestration 2.0 components into production flow#669
Merged
Wire dormant Orchestration 2.0 components into production flow#669
Conversation
Connect five previously-dormant Orch 2.0 components to the execution pipeline: - File Lock Registry: bridge claims file locks before instance creation and releases on all exit paths; uses gate.Release (not Fail) for lock conflicts to avoid burning retries under concurrent scaling - Context Propagation: injects prior discoveries into task prompts and shares completion info for cross-instance awareness - Mailbox Event Publishing: adds WithBus functional option so all inter-instance messages publish MailboxMessageEvent to the event bus - Adaptive Lead Observability: logs scaling signal recommendations in the pipeline executor - Approval Auto-Approve: immediately approves gated tasks in the bridge to prevent stuck states while preserving gate infrastructure - Debate Protocol: identifies conflicting task outcomes between execution and review phases and records structured debate sessions for reviewer context (opt-in via WithDebate pipeline option)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MailboxMessageEventto the event bus viaWithBusfunctional optionDetails
Wires 6 dormant Orchestration 2.0 components into the production bridge/pipeline flow. These components were built as part of the Orchestration 2.0 meta-epic (#637/#638) but were never connected to the execution path.
File Lock Registry → Bridge:
ClaimMultiplebefore instance creation,ReleaseAllon every exit path. File lock conflicts usegate.Release(notgate.Fail) to avoid burning retries when scaling increases concurrency.Context Propagation → Bridge:
GetContextForInstanceinjects prior discoveries into task prompts (filtered toMessageDiscovery+MessageWarning, capped at 50 messages).ShareDiscoverybroadcasts completions on success paths.Mailbox Event Publishing:
WithBusfunctional option onNewMailbox; Hub passes its bus automatically. Nil bus is safe (no-op).Adaptive Lead Signals: Executor subscribes to
adaptive.scaling_signalevents and logs them. Dispatch to goroutine prevents deadlock with the synchronous event bus.Approval Gate: Auto-approve immediately after
MarkRunningintercepts a gated task.TaskAwaitingApprovalEventstill fires for observability.Debate Protocol:
DebateCoordinatorinpipeline/debate.goidentifies file overlaps between completed tasks, creates structured debate sessions, and injects resolutions into the review team'sLeadPrompt. Opt-in viaWithDebate().Test plan
go test -race ./internal/bridge/... ./internal/mailbox/... ./internal/coordination/... ./internal/orchestrator/bridgewire/... ./internal/pipeline/... ./internal/team/...debate_test.gocovers conflict detection, debate resolution, and format functionsoptions_test.gocoversWithBusevent publishing, nil bus safety, backward compatibilitygofmt,go vet,go buildall pass