Skip to content

Commit eff84ae

Browse files
committed
feat: add structured handoff governance
1 parent ef47364 commit eff84ae

24 files changed

Lines changed: 2988 additions & 46 deletions

GOVERNANCE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Apply multiplicative penalties for:
2222
- Agreement cannot materially increase confidence unless independence is demonstrated.
2323
- High-impact synthesis fails if provenance is incomplete.
2424
- Domain reliability is scoped by capability area, not global reputation.
25+
- Handoff acceptance depends on objective, constraint, provenance, and next-action fidelity, not just transport success.
26+
- Boundary-local repair is preferred over full reruns when a corrupted handoff can be repaired deterministically.
2527

2628
## Pass Condition
2729

@@ -32,6 +34,7 @@ A high-impact claim reaches synthesis only when:
3234
- required review and counterparty outputs exist
3335
- blocking dissent is resolved or escalated
3436
- independent evidence threshold is satisfied
37+
- the inherited task-state is usable without re-deriving missing context inside the next agent
3538

3639
## Fail Condition
3740

HANDOFF_CONTRACTS.md

Lines changed: 87 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,104 @@
11
# HANDOFF_CONTRACTS
22

3-
Rebis handoffs are explicit contracts, not lossy summaries.
3+
Rebis handoffs are explicit governed contracts, not lossy natural-language summaries.
44

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.
66

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
1638

1739
## Validation Rules
1840

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+
1951
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.
2679

2780
## Pass Condition
2881

2982
A receiving agent/module can reconstruct:
3083
- what must be done
31-
- what is known
84+
- what has already been completed
3285
- 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
3589

3690
## Fail Condition
3791

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.

OBSERVABILITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Each significant process should capture:
88
- objective at start
99
- assumptions
1010
- participating roles/modules
11+
- transition packets and handoff packets
1112
- evidence timeline
1213
- confidence transitions
1314
- policy checks triggered
@@ -30,6 +31,7 @@ Triggered for:
3031

3132
- replayable trace fingerprint
3233
- failure origin stage
34+
- failure origin handoff or transition packet when applicable
3335
- structured cause classes
3436
- lessons learned
3537
- suggested threshold or rule updates
@@ -39,3 +41,4 @@ Triggered for:
3941
- Decision traces are replayable.
4042
- Review can identify where drift or governance failure began.
4143
- Incident review produces update suggestions, not just blame labels.
44+
- Handoff lineage is inspectable without reconstructing context from freeform narrative summaries.

PROVENANCE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ Every Rebis decision node must remain replayable and reopenable.
88
- assignedRoles
99
- skillsUsed
1010
- evidenceSources
11+
- evidence_refs
12+
- provenance_refs
1113
- dissentRecords
1214
- finalConfidence
1315
- assumptions
1416
- openQuestions
1517
- acceptanceCriteria
1618
- reopenConditions
1719
- timestamp and version lineage
20+
- packet_hash or lineage fingerprint where available
1821

1922
## Reopenability
2023

@@ -31,6 +34,7 @@ Minimum reopen logic:
3134
The provenance record is paired with a decision-trajectory trace:
3235
- objective at start
3336
- evidence timeline
37+
- handoff packet lineage
3438
- confidence transitions
3539
- policy checks triggered
3640
- dissent and objections
@@ -45,3 +49,4 @@ The provenance record is paired with a decision-trajectory trace:
4549
- Reopen conditions are mandatory.
4650
- Provenance can be replayed after the fact.
4751
- Incident review can identify where failure began.
52+
- Boundary corruption can be traced to the specific handoff packet where task-state fidelity was lost.

0 commit comments

Comments
 (0)