northroot-proof-engine 0.3.2

Core proof computation and validation library for PoSH (Proof of Shape) and PoX (Proof of Execution)
Documentation
# Logical Clocks Evaluation

## Question
Do logical clocks add sufficient value to justify implementation in Northroot Proof?

## Current Ordering Mechanism

**Timestamps**: RFC3339 timestamps with UTC normalization and millisecond precision
- `start_time`, `end_time` fields in span receipts
- Normalized to UTC for determinism
- Included in commitment computation

**Trace ID**: Unique identifier for workflow instance
- 32-character hexadecimal string
- Provides workflow-level identity

## Logical Clocks Overview

Logical clocks (Lamport clocks, vector clocks) provide:
- Causality ordering in distributed systems
- Event ordering without relying on physical time
- Stronger ordering guarantees than timestamps alone

## Evaluation

### Pros of Logical Clocks
1. **Causality Ordering**: Can determine if event A happened before event B
2. **Distributed System Support**: Works in systems with clock skew
3. **Stronger Guarantees**: Not dependent on physical clock synchronization

### Cons of Logical Clocks
1. **Complexity**: Adds complexity to receipt structure and commitment computation
2. **Current System Sufficient**: Timestamps + trace_id provide adequate ordering for current use cases
3. **Not Required**: Current use cases don't require causality ordering beyond timestamps
4. **Commitment Impact**: Would need to include logical clock value in commitment, changing all commitments

### Current Use Cases Analysis

**Timestamps + trace_id are sufficient for**:
- Work unit identification (span_id + trace_id)
- Temporal ordering (start_time, end_time)
- Workflow grouping (trace_id)
- Commitment computation (deterministic hashing)

**Logical clocks would be useful for**:
- Distributed systems with significant clock skew
- Systems requiring strict causality ordering
- Event sourcing systems with complex event dependencies

## Recommendation

**Do not implement logical clocks** at this time:

1. **Current System Adequate**: Timestamps + trace_id provide sufficient ordering for current use cases
2. **Complexity vs Value**: Added complexity doesn't justify benefits for current use cases
3. **Breaking Change**: Would require changes to commitment computation
4. **Future Consideration**: Can be added in future version if use cases emerge that require it

## Rationale

- Northroot Proof focuses on work proof and settlement, not event sourcing
- Timestamps provide adequate temporal ordering
- trace_id provides workflow identity
- Commitment determinism is more important than causality ordering
- Can be added later if needed without breaking existing commitments

## Decision

**Status**: Not implemented
**Action**: Document that timestamps + trace_id provide sufficient ordering for current use cases