This document outlines how the proven library's formally verified modules integrate with AmbientOps.
| Module | Use Case | Formal Guarantee |
|---|---|---|
SafeStateMachine |
System procedure states | Valid state transitions |
SafeResource |
System resource lifecycle | Clean state management |
SafeProvenance |
Undo tokens and receipts | Tamper-evident history |
| Module | Use Case | Formal Guarantee |
|---|---|---|
SafeCapability |
Permission management | Least privilege |
SafeReversible |
Undo operations | inverse . forward = id |
SafeSchema |
Config validation | Type-safe settings |
system_state → SafeMetric.validate → health_indicator
- SafeMetric for system health measurements
- SafeBuffer for ambient notification queue
- SafeSchema for dashboard configuration
:incident → :triaged → :contained → :resolved
SafeStateMachine ensures panic-safe incident handling:
intake: incident → triagedcontain: triaged → containedresolve: contained → resolved- Each transition has safety guarantees
:scan → :plan → :apply → :undo → :receipt
The "Scan → Plan → Apply → Undo → Receipt" workflow maps to proven modules:
| Phase | proven Module | Guarantee |
|---|---|---|
| Scan | SafeMetric | Valid measurements |
| Plan | SafeGraph | Valid dependency order |
| Apply | SafeStateMachine | Reversible application |
| Undo | SafeReversible | Exact state reversal |
| Receipt | SafeProvenance | Tamper-evident record |
operation → SafeProvenance.logEntry → hash-chained receipt
Every system modification creates:
- Before/after state hash
- Operation details
- Undo token (reversibility proof)
- Chain link to previous entry
AmbientOps safety principles map to proven guarantees:
| Principle | proven Module | Proof |
|---|---|---|
| No fearware | SafeMetric (accurate only) | ValidMetric |
| Evidence first | SafeProvenance | TamperFree |
| Scan is non-mutating | SafeResource (read-only) | NoMutation |
| Apply requires approval | SafeCapability | ExplicitConsent |
| Undo is first-class | SafeReversible | InverseExists |
-- Ward: ambient state is always valid
WardInvariant : ValidState ward -> Safe ward
-- ER: incident handling terminates
ERTermination : Incident -> Eventually Resolved
-- OR: procedures are reversible
ORReversible : (proc : Procedure) -> inverse (apply proc) . apply proc = id
-- Records: history is tamper-evident
RecordsIntegrity : Chain -> HashIntegrityFor the Julia dashboard and Elixir services:
# juliadashboard integration
using ProvenBindings: SafeMetric, SafeProvenance
function record_operation(op::Operation)
SafeProvenance.log_entry(op)
end- Add SafeStateMachine for procedure workflow
- Integrate SafeReversible for undo operations
- Implement SafeProvenance for receipts
- Add SafeMetric for system health