Policy plugin and expression language for the Pilot Protocol daemon.
The repo ships two packages:
policy/ — a coreapi.Service adapter that loads per-network policy
files and emits decisions on the event bus.
policy/policylang/ — the expr-lang/expr–backed evaluator. Used by
the plugin and by cmd/pilotctl for policy linting.
import (
"github.com/pilot-protocol/policy"
"github.com/pilot-protocol/policy/policylang"
)
p , err := policylang .Parse (jsonBytes )
if err != nil {
return err
}
_ = p
rt .Register (policy .NewService (policy.Config {
PolicyDir : "~/.pilot/policy" ,
}))
Root package (github.com/pilot-protocol/policy)
File
What it does
runtime.go
Loads/reloads policy files and watches the policy dir.
runner.go
Per-network expression runner; binds events to the evaluator.
peer.go
Per-peer rate/scope state used by directives.
aliases.go
Re-exports policylang types for source compatibility.
service.go
*Service — coreapi.Service adapter. Build tag !no_policy.
service_disabled.go
Stub when build tag no_policy is set.
File
What it does
policy.go
Policy struct and JSON unmarshal.
engine.go
Compile and cache compiled programs; evaluate against env.
env.go
Event/peer-context binding for the expr-lang VM.
Tag
Effect
no_policy
Compiles a stub whose Start is a no-op.
AGPL-3.0-or-later. See LICENSE .