Skip to content

feat(core): child-agent handoff schema, validation and verify gate (#383, 1/2) - #396

Merged
ajianaz merged 3 commits into
developfrom
feat/child-handoff-schema
Oct 16, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/child-handoff-schema

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Part 1 of 2 of the child-agent handoff: the typed document, its validation and the close gate. The child-side tool and the agent_poll enforcement follow in part 2.

Why

#383. A child's result reaches other agents only as the parent's retelling, and a child can finish without anyone checking its work.

Changes

  • handoff.rs (new, ungated so embedders have it): Handoff { version, role, summary, artifacts, verify }; roles explore / implement / verify / fix; artifacts are references (workspace-relative path plus optional rev), read by downstream children themselves rather than relayed by the parent.
  • Strict validation for model-authored input: unknown fields and roles are errors; all fields bounded; a path must be workspace-relative with no .., backslash, control characters or leading -; a rev must be a plain commit/ref name (alphanumeric start, safe charset, no ..), so neither can be parsed as an option or escape the workspace.
  • Handoff::gate(): an implement/fix child without passing verification is Unverified / VerifyFailed, never closed silently. fix_prompt() builds the follow-up fix child's prompt from references and bounded evidence; text rendered for another model escapes control characters.
  • docs/child-agents-handoff.md: design, role table, gate semantics, limits (verification evidence is self-reported), and the explicit anti-goal: no DAG scheduler or dependency engine, nothing is spawned automatically. README doc link, CHANGELOG.

Testing

  • 6 unit tests: roundtrip and strictness, bad path/rev matrix (incl. option-looking refs), size bounds, the gate, the fix prompt by reference, no line break-out from model text.
  • fmt, clippy -D warnings, cargo test --workspace and cargo check --no-default-features pass; cora review --staged clean.
  • Not done: the multi-child integration and live E2E from the issue; they need part 2.

Refs #383

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

return bad("artifact path has control characters or a backslash");
}
if path.starts_with('/') || path.starts_with('~') {
return bad(format!("artifact path {path:?} must be workspace-relative"));
@ajianaz
ajianaz merged commit 3a71bf9 into develop Oct 16, 2026
17 checks passed
@ajianaz
ajianaz deleted the feat/child-handoff-schema branch October 16, 2026 06:08
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