Architectural Decision Log
This document records significant architectural decisions made during the design of Speculative Execution.
Architectural Decision Log
This document records significant architectural decisions made during the design of Speculative Execution.
ADR-001: On-Chain Task Dependencies Required
Date: 2026-01-28
Status: Accepted
Issue: #259
Context
The original design doc (#245) proposed speculative execution but didn't specify where dependency information comes from. The on-chain Task struct has no depends_on field.
Decision
Add depends_on: Option<Pubkey> to the Task struct as a prerequisite for speculation.
Rationale
None)Consequences
ADR-002: Proof Ordering Invariant
Date: 2026-01-28
Status: Accepted
Issue: #271
Context
When should a speculative task's proof be submitted on-chain?
Decision
A task's proof can ONLY be submitted when ALL ancestor commitments are CONFIRMED on-chain.
Rationale
Consequences
ADR-003: Exponential Stake Bonding
Date: 2026-01-28
Status: Accepted
Issue: #275
Context
How much stake should be required for speculative commitments?
Decision
bonded_stake = base_bond × (2 ^ speculation_depth)
Rationale
Consequences
ADR-004: Runtime-First, On-Chain Optional
Date: 2026-01-28
Status: Accepted
Issues: #271, #273
Context
Should speculative commitments be recorded on-chain?
Decision
Phase 1 implements pure runtime speculation. Phase 2 adds optional on-chain commitments.
Rationale
Consequences
ADR-005: Rollback Order (Leaves First)
Date: 2026-01-28
Status: Accepted
Issue: #269
Context
When rolling back a failed speculation chain, what order should tasks be rolled back?
Decision
Reverse topological order (leaves first, then parents).
Rationale
Consequences
ADR-006: Claim Expiry Buffer
Date: 2026-01-28
Status: Accepted
Issue: #271
Context
Should we speculate on tasks whose claims might expire before proof confirmation?
Decision
Only speculate if claim_expiry - now > claimBufferMs (configurable, default 60s).
Rationale
Consequences
ADR-007: 50/50 Slash Distribution
Date: 2026-01-28
Status: Accepted
Issue: #275
Context
How should slashed stake be distributed?
Decision
50% to protocol treasury, 50% to affected downstream agents (proportional to wasted compute).
Rationale
Consequences
Template for Future Decisions
## ADR-XXX: [Title]
**Date:** YYYY-MM-DD
**Status:** Proposed | Accepted | Deprecated | Superseded
**Issue:** #XXX
### Context
[What is the issue we're addressing?]
### Decision
[What did we decide?]
### Rationale
[Why did we make this decision?]
### Consequences
[What are the implications?]