Skip to content

feat(core): discussion contract, sanitizer, digest validator and gate (#588 part 1a) - #665

Merged
ajianaz merged 2 commits into
developfrom
feat/discussion-core
Nov 13, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/discussion-core

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

What

Part 1a of #588: the pure core of the multi-round discussion, tole_core::discussion. No model is called and there is no command yet. The append-only ledger (1b) and the orchestration that calls the models follow as their own PRs, to keep this reviewable.

Why

Profiles should debate a goal over several rounds without re-reading the whole history each round, without losing a dissenting voice and with stop rules that do not rest on the orchestrator grading itself (design profiles-collaboration-secrets.md A8.3: the MAST failure modes, Minority Sentinel). The checks that make that true are deterministic, so they come first and can be tested without a model. #576 (the parent for round documents) is merged.

Changes

  • Contract: question, 1 to 12 acceptance criteria, 1 to 8 participants (profile names), a token budget, max rounds (default 4, at most 10). Question and criteria go through the sanitizer.
  • Sanitizer pass 1 (deterministic): secrets redacted, control and invisible characters removed (the same hidden-character rule as the skill drafts), the <<< >>> fence markers neutralized, sizes capped.
  • Digest validator (pass 2): a scribe's JSON is read against a fixed schema. Every line must name a participant of the round and a raw entry of that round that this participant wrote; a disagreement needs positions from at least two participants; a participant whose contribution appears nowhere is an error, so dissent cannot be dropped. A round under 2400 characters is passed on verbatim with no scribe call.
  • Claim-checker verdicts: one per criterion; a criterion called met needs evidence and every cited entry must exist.
  • gate, in a fixed order: pending approval or an owner-only disagreement hands over at once, then a report only when every criterion is met on the checker's evidence, then budget, the round limit, two rounds with an empty delta, else continue.
  • Fixed prompts for the participant (contract, last digest and its own previous turn only), the scribe and the checker, with everything between fence markers labelled as data.
  • CHANGELOG.md and docs/epics.md are updated in this PR.

Testing

  • cargo fmt --all; clippy -D warnings on tole-core (also --no-default-features): clean.
  • 9 unit tests: contract validation and cleaning, the sanitizer (redaction, bidi, ESC and zero-width removal, fence markers, caps, layout kept), the verbatim threshold, a valid digest read through a code fence with lines cleaned, a digest that invents an entry, misattributes it, drops a voice, has a one-sided disagreement, an empty line, an unknown key, too many lines or a wrong round, the checker's evidence rules, the gate's order and the requests' contents (another speaker's raw turn is not repeated). cargo test -p tole-core: all pass.
  • Cora agent review: review_prepare 0 deterministic findings, review_finalize should_block: false with one info note (profile existence is the host's job).

@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 force-pushed the feat/discussion-core branch from 7c042bd to 03bd3f4 Compare November 13, 2026 08:23
…#588 part 1a)

Adds tole_core::discussion: the contract, the deterministic sanitizer, a
validator for a scribe's digest that keeps every voice, the claim-checker's
verdicts, the gate and the fixed prompts. No model is called.
@ajianaz
ajianaz force-pushed the feat/discussion-core branch from 03bd3f4 to c21a95b Compare November 13, 2026 08:40
@ajianaz
ajianaz merged commit 8c05cd1 into develop Nov 13, 2026
15 checks passed
@ajianaz
ajianaz deleted the feat/discussion-core 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.

1 participant