How samudralaajaykumarrr/delegationproof works
DelegationProof is an offline CLI that validates a declared delegation model and, on verification, reports violations of applicable authority-safety invariants. The documented workflow runs from a model file through loading and version dispatch, delegation-graph analysis, verification, and deterministic text or JSON output. The graph preserves the distinct checks added across schema versions, including bounded lifecycle exploration for temporal approvals. Source excerpts are partial; some subsystem links rely on the README’s documented architecture and capabilities.
Main entry points: main.go Command handler · report Finding contract · loader Load and validate · graph.go Delegation graph
Components 18
CLI workflow
- Command handler
cmd/delegationproof/main.go
Model input
- Load and validate
internal/loader - Versioned models
internal/model - Resource bounds
internal/limits/limits.go
Delegation analysis
- Delegation graph
internal/graph/graph.go - Lifecycle BFS
internal/explore/explore.go
Safety checks
- Authority preservation
internal/verify/verify.go - Target binding
internal/verify/verify_v2.go - Requester authorization
internal/verify/verify_v3.go - Delegation depth
internal/verify/verify_v4.go - Approval preservation
internal/verify/verify_v5.go - Temporal approvals
internal/verify/verify_v6.go
Findings
- Finding contract
internal/report - Text renderer
internal/report/text.go - JSON renderer
internal/report/json.go
Other components
- CLI user
- Model JSON
- CLI result
Connections 33
- CLI user → Command handler: invokes
- CLI user → Model JSON: provides
- Command handler → Load and validate: loads path
- Load and validate → Model JSON: reads
- Load and validate → Resource bounds: checks bounds
- Load and validate → Versioned models: decodes model
- Load and validate → Delegation graph: checks acyclicity
- Load and validate → Command handler: returns document
- Command handler → Authority preservation: dispatches v1
- Command handler → Target binding: dispatches v2
- Command handler → Requester authorization: dispatches v3
- Command handler → Delegation depth: dispatches v4
- Command handler → Approval preservation: dispatches v5
- Command handler → Temporal approvals: dispatches v6
- Authority preservation → Delegation graph: sorts and traces
- Target binding → Delegation graph: sorts and traces
- Requester authorization → Delegation graph: sorts and traces
- Delegation depth → Delegation graph: sorts and traces
- Approval preservation → Delegation graph: sorts and traces
- Temporal approvals → Delegation graph: sorts and traces
- Temporal approvals → Lifecycle BFS: checks lifecycle
- Authority preservation → Finding contract: creates findings
- Target binding → Finding contract: creates findings
- Requester authorization → Finding contract: creates findings
- Delegation depth → Finding contract: creates findings
- Approval preservation → Finding contract: creates findings
- Temporal approvals → Finding contract: creates findings
- Command handler → Text renderer: renders text
- Command handler → JSON renderer: renders JSON
- Finding contract → Text renderer: formats findings
- Finding contract → JSON renderer: encodes findings
- Command handler → CLI result: writes output
- CLI result → CLI user: reports outcome