Repository navigation
feat(loop): verified completion and delegation with a completion contract (CLEAN-156, CLEAN-157) - #30
Merged
maksymhryzodub-prog merged 1 commit intoOct 26, 2026
Conversation
maksymhryzodub-prog
force-pushed
the
feat/CLEAN-156-verified-completion
branch
from
October 26, 2026 14:24
3967799 to
649fd95
Compare
…ract (CLEAN-156, CLEAN-157) US5 and US6 of the ECC harness principles (specs/001-ecc-agent-principles, T071-T084). Both land in the loop's final-response path, so they ship as one change. Verified completion (US5): - Every write-effect tool call of a turn is recorded (tool, outcome, result head). When any exist, the final LLM call does not stream and the draft reply goes through VerificationService: the auxiliary model compares it with the outcomes and either passes it or rewrites it into a factual report quoting the real error, status or block reason. Bounded by verification.timeoutMs; on timeout the draft goes out as "(unverified)". Read-only turns never call the verifier. - Model answers are parsed with a fence- and prose-tolerant JSON extractor, shared with the instinct review. - tests/evals/completion-claims.jsonl + "no-false-done" mode: 12/12. Delegation (US6): - delegate_task runs sub-tasks as internal child tasks with a fresh history, the parent's identity and tools minus everything that leaves the conversation (messaging, memory, skills, secrets, cron, channels, further delegation), concurrently up to tools.delegate.maxParallel, each with a time budget and a summary cut to summaryChars. - Completion contract: a turn cannot end while its workers run; the loop waits up to the budget, cancels the rest and hands the model a note of what finished and what was cancelled for one more iteration. - /tasks shows workers under their parent; spawn_agent is pointed at external coding work. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
maksymhryzodub-prog
force-pushed
the
feat/CLEAN-156-verified-completion
branch
from
October 26, 2026 14:26
649fd95 to
a8d1b43
Compare
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.
Verified completion (US5, CLEAN-156)
write-effect tool call of a turn is recorded (tool, outcome, result head). When any exist, the final LLM call does not stream and the draft goes throughVerificationService: the aux model compares it with the outcomes →{ok:true}or a factual rewrite quoting the real error / status / block reason. Bounded byverification.timeoutMs; on timeout the draft is delivered with(unverified). Read-only turns never call the verifier; a verifier failure or odd answer lets the draft through.extractJsonObject(fence- and prose-tolerant) now parses both the verifier's and the instinct curator's answers — the earlier first-brace/last-brace slice broke on explanations containing braces.tests/evals/completion-claims.jsonl(no-false-done): 12/12 live — 7 false claims rewritten without repeating the claim, 5 honest replies passed.Delegation (US6, CLEAN-157)
delegate_task(admin): sub-tasks run as internal child tasks with a fresh history (goal + context), the parent's identity, and the parent's tools minusDELEGATE_BLOCKED(delegate_task,spawn_agent,memory_save,telegram_send,tts,skill_*,secret_set/delete,cron_*,approve_user,set_access_strategy, everychannel_*). Concurrent up totools.delegate.maxParallel, per-worker budget, summary cut tosummaryChars; a timed-out worker is aborted and reported with its partial output./tasksindents workers under their parent;spawn_agent's description now points todelegate_taskfor in-runtime sub-tasks.Plan deviation
DelegateServicelives inruntime/loop/domain/rather thanagent/task/domain/as the plan said: it runs workers throughLoopService, andagent → runtimewould break the slice dependency rule. The types and the blocked set stay inagent/task/domain/delegate.types.ts.Tests
bun test: 305 pass (+17: verification service 7, loop verification 3, delegate service 4, loop contract 2, parser 1), 1 pre-existing Windows-only failure.bun run eval: guardrails 31/31 · skill-selection 96/100 · corrections 13/13 · completion-claims 12/12.tsc --noEmit: clean apart from the pre-existingbridleAttachments.spec.ts.Jira: https://dreamvention.atlassian.net/browse/CLEAN-156 · https://dreamvention.atlassian.net/browse/CLEAN-157
🤖 Generated with Claude Code