Settlement as a local-first /settle skill: shared consensus engine, settle CLI, punitive ledger, repo cleanup - #10
Merged
jucasoliveira merged 7 commits intoJul 21, 2026
Conversation
The Rust/Shuttle bot was a hello-world proof of concept (single /ping command) with no integration to the settlement engine. History preserves it if a Discord surface returns later. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
Removes the accidentally committed 30 MB go/settlement binary (arm64 build output — it was the entire git pack weight) and .DS_Store from tracking. go/.gitignore now covers the settlement and settle binary names; the root .gitignore replaces the Python template with entries for OS junk, Go/Node build output, env files, and .settlement/verdicts scratch, keeping the LaTeX-artifact ignores (whitepaper sources and PDF remain tracked). Note: the binary remains in git history; purging it (git filter-repo + force-push) is a separate opt-in follow-up that would shrink clones from ~30 MB to ~1 MB. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
Moves the vote-tallying engine (exact/semantic/numeric/merge strategies, weighted voting, merged-reasoning extraction) verbatim out of core/queue_manager.go into a new settlement-core/consensus package with no gRPC, pool, or SDK dependencies. The one LLM coupling (OpenAI synthesis) is injected via a Synthesizer interface; nil selects the existing offline algorithmic fallbacks. core keeps type aliases and thin checkConsensus/mergeConsensus wrappers, so server behavior and JSON contracts are unchanged. Adds the repo's first test suite: table-driven coverage of all four strategies, weighted-vote semantics, rate-limit handling, and reasoning extraction. Fixes two pre-existing go vet warnings (non-constant fmt.Errorf format strings). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
New settlement-core/settle package + settle binary (stdlib-only,
per-command, no daemon, no network):
settle init scaffold .settlement/ (config.json, ledger.json,
decisions.jsonl, untracked verdicts/ scratch)
settle panel deterministic panel spec for a diff: personas from
config, weights from the ledger, size from diff stats;
quarantined personas seat as weight-0 shadow voters
settle tally adjudicate persona verdict JSONs through the shared
consensus engine (exact_match over approve/reject/
revise), append the decision record; exit codes
0 approve, 2 reject/revise, 3 no consensus
settle outcome record ground truth (held|reverted) as an append-only
event and apply the punitive voting-power rule:
clamp(VP + 0.05*aligned - 0.15*misjudged - 0.02*(VP-1),
0.1, 2.5), quarantine below 0.4
settle log/show/ledger read decisions and voting powers
All schemas carry versioned tags (settle/*@1) for forward compatibility
with the planned graph substrate. Binary-name gitignore entries are
anchored so they no longer shadow the new package directories. Tests
cover store round-trips, panel sizing, tally outcomes with dissent,
ledger asymmetry (penalty > reward, vindicated dissent gains), and
quarantine engagement.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
Platform-agnostic SKILL.md instructing any host assistant how to run a settlement review: capture the diff, build the panel via the settle CLI, spawn one independent subagent per persona seat, collect verdict JSONs, tally, and report the decision with dissents surfaced. Five reviewer personas (correctness, security, api-contract, simplicity, tests), each scoped to a single question with severity calibration and the verdict contract enforced. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
New test.yml runs on pull requests and pushes to master: go build, go vet, go test across all packages, then an end-to-end settle CLI smoke (scripts/settle-dryrun.sh: init -> panel -> canned verdicts -> tally -> outcome, asserting the consensus result and punitive ledger movements). The existing manual deploy workflow is untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
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.
Summary
This PR repositions Settlement from a daemon-only multi-LLM consensus service into a local-first agentic skill, while keeping the existing HTTP service intact on a shared engine. It contains four design documents, a repo cleanup, a behavior-preserving refactor, the new
settleCLI +/settleskill, and the repo's first tests and PR-triggered CI.Design docs (
docs/)AI_MODERNIZATION_ROADMAP.md— audit of the codebase against modern agentic practices (multi-agent tasks, loop engineering, graph engineering) with a phased roadmap.SETTLEMENT_GRAPH_AGENTS_DESIGN.md— graph-spawned agent panels that settle code changes; knowledge-graph blast-radius policy; decisions as queryable precedent.SETTLE_SKILL_MEMORY_AND_PUNITIVE.md— persistent memory tiers, the punitive Proof-of-Adequacy ledger (agents/skills/loops), and packaging: local-first skill, cloud as the paid tier.Repo cleanup
discord/hello-world bot stub (never integrated; history preserves it).go/settlementbinary and.DS_Store; rewrote both.gitignores (anchored binary names, OS junk, env files,.settlement/verdicts/scratch). Note: the blob remains in git history — purging it (git filter-repo+ force-push) is a separate opt-in follow-up that would shrink clones from ~30 MB to ~1 MB.Shared consensus engine (
go/consensus)The vote-tallying engine (exact/semantic/numeric/merge strategies, weighted voting, merged-reasoning extraction) is extracted verbatim from
core/queue_manager.gointo a dependency-free package (no gRPC, no pool, no SDKs). The single LLM coupling is injected via aSynthesizerinterface —nilruns fully offline via the existing algorithmic fallbacks.corekeeps type aliases and thincheckConsensus/mergeConsensuswrappers, so server behavior and JSON contracts are unchanged (verified by build, vet, tests, and a live/api/v1/statssmoke). Also fixes two pre-existinggo vetwarnings.settleCLI (go/cmd/settle, stdlib-only, no daemon, no network)settle init— scaffold.settlement/(config.json,ledger.json,decisions.jsonl;verdicts/stays untracked scratch)settle panel— deterministic panel spec for a diff: personas from config, weights from the ledger, size from diff stats; quarantined personas seat as weight-0 shadow voterssettle tally— adjudicates persona verdict JSONs through the shared engine (exact_matchover approve/reject/revise), appends the decision; exit codes 0 approve / 2 reject-revise / 3 no consensussettle outcome— records ground truth (held/reverted) as an append-only event and applies the punitive rule:clamp(VP + 0.05·aligned − 0.15·misjudged − 0.02·(VP−1), 0.1, 2.5), quarantine below 0.4settle log/show/ledger— read decisions and voting powersAll schemas carry
settle/*@1version tags for forward compatibility with the planned graph substrate. (Deviation from the original plan:config.jsoninstead ofconfig.yaml, keeping the CLI dependency-free.)/settleskill (skill/settle/)Platform-agnostic
SKILL.md: any host assistant captures the diff, builds the panel via the CLI, spawns one independent subagent per seat, collects verdict JSONs, tallies, and reports with dissents surfaced. Ships five persona prompts: correctness, security, api-contract, simplicity, tests.Tests + CI
go/consensusandgo/settletest suites (the repo previously had zero tests): all four strategies, weighted-vote semantics, rate-limit handling, panel sizing, ledger asymmetry (penalty > reward; vindicated dissent gains), quarantine engagement.scripts/settle-dryrun.sh— offline E2E: init → panel → canned verdicts → tally (approve with dissent) → outcome reverted → ledger movements asserted..github/workflows/test.yml— build + vet + test + dry run on every PR and push to master. The existing manual deploy workflow is untouched.Verification
cd go && go build ./... && go vet ./... && go test ./...— green.bash scripts/settle-dryrun.sh— PASS (approvers 1.0→0.85, vindicated dissenter 1.0→1.05 after a reverted approval).GET /api/v1/statsresponds identically post-refactor.🤖 Generated with Claude Code
https://claude.ai/code/session_016Zycxwvy6wPQwiyRSmmJJz
Generated by Claude Code