Skip to content

fix(loop): enforce completion contracts and preserve final handoffs - #499

Merged
huichen merged 1 commit into
mainfrom
fix/loop-completion-evidence
Sep 7, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/loop-completion-evidence

Conversation

@huichen

@huichen huichen commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #497, addressing three still-open correctness issues found in real multi-worker runs:

  1. Enforce completion evidence on automatic paths. Manual completion, agent-backed runs, embedded writeback and the stdio worker bridge share nonempty-evidence/acceptance checks. Normal model return alone does not close a rejected handoff. The bridge also executes configured validators. Manual --force remains explicit; token checks are not scientific correctness checks.
  2. Preserve late outcomes and hand off evidence reliably. Persist full reply text chunks in per-run live journals, keep bounded recent tails in summaries, and deliver structured JSON receipts carrying goal/todo/agent/run/session identity, verification, pending-work count and the full-text journal pointer. Do not cut receipts back to the old 300/800-character opening snippets.
  3. Do not confuse a slice finishing with the goal finishing. Count pending work across owners/classes; remove the misleading last-todo claim and stop inventing successor edges from unrelated runnable tasks. Reconcile current task/validator state before writeback and avoid duplicate closure of already closed tasks.

Sync English AND Chinese architecture and control-plane guides. Bump the skills submodule to merged future-skills PR futuregene/future-skills#46 (future-loop v4.1 and research v3.3).

Validation

  • cargo fmt --all --check — passed.
  • cargo clippy -p future-loop --all-targets --offline -- -D warnings — passed.
  • Full cargo test -p future-loop --offline -- --test-threads=1 — passed before the final bridge entry-point hardening; bridge suite subsequently passed 12/12, including new acceptance/validator regressions.
  • New completion tests cover empty evidence, missing tokens, repaired handoff, long-stream late results, full-text recovery, trusted notification identities and other owner-scoped work remaining open.
  • Existing successor tests now assert no invented peer edges; the workers still execute both independent tasks.
  • Skills offline document/fixture checks passed; no paid model or external competition submission was made.

Scope

No protobuf or event-schema migration; old records remain readable. Structured receipts are serialized in the existing SupervisorNote message. This does not install/restart the production agent, add a science policy engine, promise a monetary cap, or provide an external scoring/GPU adapter. Those remain separate work.

@huichen
huichen merged commit cef8acc into main Sep 7, 2026
12 checks passed
@huichen
huichen deleted the fix/loop-completion-evidence branch September 7, 2026 02:56
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