Repository navigation
feat(cli): multi-round discussion host driver as a library, entry point left open (#588 part 2c) - #689
Merged
Conversation
… caps (#588 part 2a) Every provider call of a discussion is reserved before it runs and settled after it; a call that does not fit the budget records the budget escalation at once. A refused digest falls back to the round as written. Records and the log are capped on write as well as read, and the log and its lock are never opened through a symlink.
…onfig overrides only (#588 part 2b)
# Conflicts: # CHANGELOG.md
…nt left open (#588 part 2c)
# Conflicts: # CHANGELOG.md # crates/tole-cli/src/lib.rs
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
Part 2c of #588: the multi-round discussion's host driver,
tole_cli::discussion_host, as a library. It runs a discussion over the ledger from #667/#685 with the roles from #686 until the gate reports or escalates. No CLI command and no model-facing tool: how a discussion starts is an open question, laid out with its security consequences indocs/automation-design.md("Entry point: open question", recommendation: (c) in two steps).Why
The ledger, the sanitizer, the digest validator, the gate and the roles existed, but nothing called the models. The driver is the orchestration of A8.3 with every rule enforced by code: the gate alone decides, dissent survives, the budget and
max_roundsare hard stops, and a crash resumes without re-running or overspending.Changes
Driver::from_config(cfg, paths, participants, log, secrets, factory, pot): participants are user-config profiles (persona read now), neverscribeorclaim-checker; the role models come fromdiscussion_roles::resolve.Driver::start(contract)refuses a participant it does not voice and a budget above what the pot has left.carve(requested, pot)takes a discussion's budget from the goal's pot (requested, else half of what is left; never more).Driver::run()follows the ledger'sNextuntilDone:discussion::sanitize) beforecontribute; a tool call in a reply runs nothing and is recorded as "no contribution".parse_digest; a refused digest or a failed scribe givesRoundSummary::Fallbackwith the pass-1 text and a sanitized reason.parse_checker; an unreadable checklist meets nothing, so it can never report.DiscussionLog::decide, computed from the ledger. No text a model wrote can report, write, change the roster or call a tool.Escalate(Budget);max_roundsescalates through the gate.factory(OpenAiConfig, secrets): the run's provider connection with the process secrets, no streaming, no fallback chain (as the advisor's).automation-design.md, a threat-model row,epics.md; CHANGELOG.The diff is about 1,000 lines (500 code with doc comments, 470 tests).
Testing
discussion_host_tests.rswith a scripted mock provider (no network): a small discussion to a checked report (no scribe call, models per role, persona redacted, report text, idempotent re-run); a big round digested, a refused digest and a failed scribe falling back; the discussion budget and the goal pot as hard stops (the call that does not fit never runs); carving; a crash (failed provider, and a reserve with no settle) resumed by a new driver without re-asking a finished voice and with exact token accounting; hostile replies (fence close, fake gate JSON, a secret, a tool call, a checker citing a non-existent entry) that change nothing; participants from the user config only, never a role.cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo test --workspace,cargo test -p tole-core --no-default-features,cora review --no-llm: all clean.