Skip to content

feat(cli): independent read-only discussion participants and uteke round documents (#588 part 2e) - #692

Merged
ajianaz merged 8 commits into
developfrom
feat/discussion-independent
Nov 13, 2026
Merged

ajianaz merged 8 commits into
developfrom
feat/discussion-independent

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Part 2e of #588, the last of the scope that excludes the entry point: independent read-only discussion participants through the existing delegate path, and uteke round documents (digests only) with the parent argument of #576. tole_cli::discussion_host stays a library.

Why

A7/A8.3: inline voices of one model tend to agree, so review and critique may use a really independent participant, which must not escape the delegation caps. A8.4: the round results go into a hierarchy of uteke documents, while raw contributions stay in tole's ledger.

Changes

  • Independent participants (Driver::with_independent(names, runner), for review and critique only; names must be participants of the driver):
    • Independent trait (start, find, poll); DelegateIndependent runs a participant as a consult (read-only) delegated child as its profile through Delegator::consult, so the carve, the depth and live-process caps, the leases and the machine resource guard apply. Its contribution is its completion report (summary and risks), read by the parent with the report caps (O_NOFOLLOW | O_NONBLOCK, size cap), then pass 1 like any turn.
    • Reserved at least 20,000 tokens, settled at the child's measured usage (its whole carve when that cannot be read), charged to the pot.
    • Started at most once, also across a crash: the reservation (the intent) is in the ledger before the child starts; the child's task starts with a marker naming that call; its node id is bound to the call after. A resumed driver polls a bound child; for an unbound intent it looks for the marked child with Delegator::find_child (direct children of a goal at the root, since the root goal is new in every process; direct children of the session's own node in a delegated child; never deeper, so a child cannot plant a match) and starts one only when there is none, under the same reservation. This closes the double-start window named on feat(cli): multi-round discussion host driver as a library, entry point left open (#588 part 2c) #689.
    • Delegator::poll_node settles an ended child (measured usage, report) and drains the queue.
  • uteke round documents (Driver::with_docs(RoundDocs), UtekeDocs over uteke_document):
    • flat slugs goal-<id> (contract, participants, budget, status, outcome and checklist) and goal-<id>-r<n> (the digest, or that the round was passed on as written, with the fallback reason), each round created with parent = goal-<id> and naming the parent in its body;
    • never a raw contribution; each document is redacted, then capped at 16,000 characters, and redacted again by uteke_document;
    • written after each round's summary and again at the close (upserts, so a crash cannot leave one missing); a failure never stops the discussion and is listed, redacted, in Outcome::notes.
  • Threat-model row and CHANGELOG updated; epics.md already lists the part.

Testing

  • discussion_host_tests.rs (mock provider, fake runner and fake document sink): an independent participant is started once with a read-only task, polled, sanitized and settled at what it spent; a run that dies while polling resumes without a second start; a bound child is polled, never restarted; a crash between start and bind finds the marked child (one start, one reservation, exact tokens); an intent with no child starts one under the same reservation; only voices can be independent. Round documents: slugs and parents, digests only (no raw marker, no secret), the fallback/verbatim text, the final goal document with outcome and checklist; a failing sink leaves the discussion complete with redacted notes.
  • delegate_tests.rs: the adapter on a real Delegator with a stand-in child: consult mode, the profile, the carve, the report as contribution, the whole carve charged when no usage is readable, done; a restarted host finds the child by its call; an unknown profile is refused.
  • Mutation checks, each made a test fail: resume ignoring a bound handle, no bind, find ignored, an unbound intent re-reserved, raw text in a round document, unredacted notes, zero spend, execute instead of consult, the marker filter in find_child.
  • 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 --staged: all clean.

… 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.
# Conflicts:
#	CHANGELOG.md
#	crates/tole-cli/src/lib.rs
# Conflicts:
#	CHANGELOG.md
#	crates/tole-cli/src/discussion_host.rs
#	crates/tole-cli/src/discussion_host_tests.rs
#	docs/epics.md
#	docs/threat-model.md
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit c6fd162 into develop Nov 13, 2026
19 checks passed
@ajianaz
ajianaz deleted the feat/discussion-independent branch November 20, 2026 08:36
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.

2 participants