Skip to content

[PLAN] discussion engines: parallel fan-out/fan-in + standalone sanitizer + web-search budget per participant #902

Open

Description

@ajianaz

STATUS: PLAN — blocked until the five #752 branches merge (layering-test + agents/cli-config/cli-delegation/cli-discuss), because this touches discuss/host.rs which those branches are splitting. Do not start before then; rebase at kickoff.

What

Three execution engines for the discussion host (#588), one issue because they touch the same files:

  1. Parallel engine (default OFF; flag --parallel / env TOLE_DISCUSSION_PARALLEL=1): a round splits into two phases — fan-out (every participant gets the SAME context: question + the previous round's digest; N calls in flight at once) → fan-in (collect + sanitize + write to the ledger in contract participant order, not completion order). Sequential stays the default and does not change.
  2. Standalone sanitizer step: the inline sanitizer becomes its own stage shared by both engines — control characters → secrets redaction (feat(core): SecretSet — known-value redaction at every egress sink, child minimum env #595) → markdown fence → length cap → dedupe. Unit-testable per stage.
  3. Web search budget per participant (default OFF; env TOLE_DISCUSSION_WEB=1 / flag --allow-web, budget --web-budget-per-participant N, default 10): inline participants get one read-only web_search tool delegated to nginjen (SearXNG search lane + static scrape fast-path only — no browser engine). Results are truncated (e.g. 4k chars) and enter the ledger tagged [web-source: <url>]. The budget is reserved/settled in the ledger like the token budget; exhausted = the participant continues without web (soft degrade, not an error).

Why

  • Sequential today is a feature (participants read earlier contributions → real-time counter-arguments; deterministic order; per-call budget) and it stays the default. But for wide brainstorming it throttles: each participant waits its turn and each signal is only its own viewpoint. Parallel gives signal variety (anti-groupthink); convergence still happens when participants read the previous round's digest. The owner picks per discussion.
  • Decision research needs fresh references (competitor numbers, pricing, November 2026 events). The current pattern = pre-discussion search via nginjen locked into --question (proven hallucination-free), but it is static. A persona with a web budget can pull references mid-round for claims that surface during the debate.
  • The foundation already exists: per-reply sanitize, deterministic per-seq ledger, reserve/settle budget per call, per-call retry (retry_of), per-step resume — all live (tested 16-17 Nov: 3×8 load test + 3 multi-round research runs, zero data loss).

Design sketch (open for discussion)

  • Parallel: bounded concurrency for fan-out (join all before fan-in; small stagger between launches to avoid provider rate limits). A crash mid-fan-out resumes per-participant (the per-call ledger already has retry_of), never replays the round
  • The ledger stays the source of truth: entries are written in contract order AFTER fan-in completes — replay/audit keeps its shape
  • Web tool on the participant wire: one web_search {query} tool (Risk::Read), results source-tagged; budget recorded as reserve/settle with what: web — shows up in audit
  • Standalone sanitizer: tole_core::sanitize::Pipeline (or discuss/sanitizer.rs) with per-stage unit tests; called by both engines
  • Interaction with [PLAN] workspace layering: modular structure inside the three published crates #752: the refactor branches are splitting discuss/*.rs — build AFTER those merge, rebased on top

Open questions (for the owner at kickoff)

  1. Web tool: web_search only, or also web_fetch(url) read-only?
  2. Web budget exhausted: silent degrade (proposed) or a hard stop for the contribution?
  3. Parallel: mixable per round (round 1 parallel, round 2 sequential) or one mode per discussion?

Testing (draft)

  • Parallel: 2 participants × 2 rounds → contract-order ledger, no cross-contamination, per-participant resume verified
  • Web budget: 3 calls → the 4th is refused with a clear message; [web-source: url] entries land in the ledger
  • Sanitizer: unit tests per stage; pipeline output identical between sequential and parallel for the same input
  • Sequential default: ledger format snapshot unchanged (backward compat)
  • Load: 8 participants in parallel against Bifrost without 429s (stagger works)

Activity

  1. added
    pending
    enhancement
    on Nov 17, 2026
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

    enhancementpending

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions