Skip to content

Wire dormant Orchestration 2.0 components into production flow#669

Merged
Iron-Ham merged 1 commit intomainfrom
Iron-Ham/wire-orch2-components
Feb 17, 2026
Merged

Wire dormant Orchestration 2.0 components into production flow#669
Iron-Ham merged 1 commit intomainfrom
Iron-Ham/wire-orch2-components

Conversation

@Iron-Ham
Copy link
Owner

Summary

  • File Conflict Prevention — Bridge claims file locks before instance creation and releases on all exit paths, preventing concurrent edits to the same files
  • Context Propagation — Instances receive prior discoveries in their prompts and share completions for cross-instance awareness
  • Mailbox Event Publishing — All inter-instance mailbox messages now publish MailboxMessageEvent to the event bus via WithBus functional option
  • Adaptive Lead Observability — Scaling signal recommendations from the adaptive lead are logged in the pipeline executor
  • Approval Auto-Approve — Bridge auto-approves gated tasks to prevent stuck states while preserving gate infrastructure for future interactive use
  • Debate Protocol Integration — Pipeline review phase can identify conflicting task outcomes and record structured debate sessions for reviewer context

Details

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: ClaimMultiple before instance creation, ReleaseAll on every exit path. File lock conflicts use gate.Release (not gate.Fail) to avoid burning retries when scaling increases concurrency.

Context Propagation → Bridge: GetContextForInstance injects prior discoveries into task prompts (filtered to MessageDiscovery + MessageWarning, capped at 50 messages). ShareDiscovery broadcasts completions on success paths.

Mailbox Event Publishing: WithBus functional option on NewMailbox; Hub passes its bus automatically. Nil bus is safe (no-op).

Adaptive Lead Signals: Executor subscribes to adaptive.scaling_signal events and logs them. Dispatch to goroutine prevents deadlock with the synchronous event bus.

Approval Gate: Auto-approve immediately after MarkRunning intercepts a gated task. TaskAwaitingApprovalEvent still fires for observability.

Debate Protocol: DebateCoordinator in pipeline/debate.go identifies file overlaps between completed tasks, creates structured debate sessions, and injects resolutions into the review team's LeadPrompt. Opt-in via WithDebate().

Test plan

  • All existing tests pass with race detector: go test -race ./internal/bridge/... ./internal/mailbox/... ./internal/coordination/... ./internal/orchestrator/bridgewire/... ./internal/pipeline/... ./internal/team/...
  • New debate_test.go covers conflict detection, debate resolution, and format functions
  • New options_test.go covers WithBus event publishing, nil bus safety, backward compatibility
  • Bridge E2E tests verify file locks are claimed/released during lifecycle
  • gofmt, go vet, go build all pass

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)
@Iron-Ham Iron-Ham merged commit a74ff90 into main Feb 17, 2026
5 of 6 checks passed
@Iron-Ham Iron-Ham deleted the Iron-Ham/wire-orch2-components branch February 17, 2026 18:52
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

Comments