|
1 | 1 | # HANDOFF_CONTRACTS |
2 | 2 |
|
3 | | -Rebis handoffs are explicit contracts, not lossy summaries. |
| 3 | +Rebis handoffs are explicit governed contracts, not lossy natural-language summaries. |
4 | 4 |
|
5 | | -## Required Fields |
| 5 | +The runtime now represents those contracts as a compact `Handoff State Packet (HSP)` so downstream agents, tools, and merge runtimes inherit validated task-state instead of spending compute re-deriving intent from prose. |
6 | 6 |
|
7 | | -- objective |
8 | | -- knownInputs |
9 | | -- assumptions |
10 | | -- constraints |
11 | | -- openQuestions |
12 | | -- acceptanceCriteria |
13 | | -- requiredEvidenceThreshold |
14 | | -- failureConditions |
15 | | -- escalationConditions |
| 7 | +## Handoff State Packet |
| 8 | + |
| 9 | +Required fields: |
| 10 | +- `run_id` |
| 11 | +- `handoff_id` |
| 12 | +- `source_step_id` |
| 13 | +- `source_agent_id` |
| 14 | +- `target_agent_id` |
| 15 | +- `target_tool_id` |
| 16 | +- `original_objective` |
| 17 | +- `current_subgoal` |
| 18 | +- `hard_constraints` |
| 19 | +- `active_assumptions` |
| 20 | +- `evidence_refs` |
| 21 | +- `provenance_refs` |
| 22 | +- `completed_work` |
| 23 | +- `remaining_work` |
| 24 | +- `expected_next_action` |
| 25 | +- `risk_flags` |
| 26 | +- `uncertainty_flags` |
| 27 | +- `confidence_score` |
| 28 | +- `checkpoint_status` |
| 29 | +- `checkpoint_reasons` |
| 30 | +- `repair_instructions` |
| 31 | +- `created_at` |
| 32 | + |
| 33 | +These fields are intentionally compact: |
| 34 | +- objective identity survives the boundary |
| 35 | +- constraints and assumptions stay machine-comparable |
| 36 | +- provenance stays attached through ids and refs |
| 37 | +- repair can target one corrupted field without rewriting the entire chain |
16 | 38 |
|
17 | 39 | ## Validation Rules |
18 | 40 |
|
| 41 | +The handoff validator checks: |
| 42 | +- `objective_fidelity` |
| 43 | +- `subgoal_fidelity` |
| 44 | +- `constraint_fidelity` |
| 45 | +- `assumption_consistency` |
| 46 | +- `provenance_fidelity` |
| 47 | +- `completion_integrity` |
| 48 | +- `next_action_integrity` |
| 49 | +- `drift_risk_score` |
| 50 | + |
19 | 51 | A handoff fails if: |
20 | | -- objective is missing |
21 | | -- known inputs are empty |
22 | | -- assumptions are dropped |
23 | | -- open questions are omitted |
24 | | -- acceptance criteria are missing |
25 | | -- evidence threshold is undefined |
| 52 | +- the original objective is missing or mutated |
| 53 | +- the active subgoal no longer matches the inherited task state |
| 54 | +- hard constraints are omitted or changed |
| 55 | +- assumptions contradict prior state or each other |
| 56 | +- evidence or provenance is detached where it is required |
| 57 | +- completed work no longer matches the lineage being handed forward |
| 58 | +- the next action is ambiguous, missing, or off-objective |
| 59 | + |
| 60 | +Validation outcomes: |
| 61 | +- `PASS` |
| 62 | +- `REVISE` |
| 63 | +- `HALT` |
| 64 | +- `ESCALATE` |
| 65 | + |
| 66 | +`REVISE` means repair the smallest broken field only. |
| 67 | + |
| 68 | +## Minimal Repair |
| 69 | + |
| 70 | +Rebis treats many handoff failures as boundary-local repair problems, not full-rerun problems. |
| 71 | + |
| 72 | +Examples: |
| 73 | +- missing hard constraint -> restore that constraint only |
| 74 | +- detached evidence -> attach the missing evidence refs only |
| 75 | +- ambiguous next action -> rewrite only `expected_next_action` |
| 76 | +- missing remaining work -> rebuild only `remaining_work` |
| 77 | + |
| 78 | +The purpose is to preserve valid prior work and reduce wasted recovery compute. |
26 | 79 |
|
27 | 80 | ## Pass Condition |
28 | 81 |
|
29 | 82 | A receiving agent/module can reconstruct: |
30 | 83 | - what must be done |
31 | | -- what is known |
| 84 | +- what has already been completed |
32 | 85 | - what is still uncertain |
33 | | -- what counts as success |
34 | | -- when to fail or escalate |
| 86 | +- what evidence supports the current state |
| 87 | +- what counts as a valid next action |
| 88 | +- when to revise, halt, or escalate |
35 | 89 |
|
36 | 90 | ## Fail Condition |
37 | 91 |
|
38 | | -If a handoff drops assumptions or open questions, the system must reject or reopen the transfer. |
| 92 | +If a handoff drops assumptions, provenance, or key open risks, the system must reject, repair, or reopen the transfer instead of silently accepting it. |
| 93 | + |
| 94 | +If only one recoverable field is corrupted, the system should patch that field and preserve the rest of the lineage rather than rerunning the full workflow. |
| 95 | + |
| 96 | +## Replayability |
| 97 | + |
| 98 | +Every HSP should remain: |
| 99 | +- serializable to JSON |
| 100 | +- replayable from logs |
| 101 | +- linked to source and target steps |
| 102 | +- inspectable during incident review |
| 103 | + |
| 104 | +That replayable boundary lineage is part of how Rebis keeps long-horizon workflows inspectable after the fact. |
0 commit comments