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.goLoads/reloads policy files and watches the policy dir. runner.goPer-network expression runner; binds events to the evaluator. peer.goPer-peer rate/scope state used by directives. aliases.goRe-exports policylang types for source compatibility. service.go*Service — coreapi.Service adapter. Build tag !no_policy.service_disabled.goStub when build tag no_policy is set.
File What it does policy.goPolicy struct and JSON unmarshal.engine.goCompile and cache compiled programs; evaluate against env. env.goEvent/peer-context binding for the expr-lang VM.
Tag Effect no_policyCompiles a stub whose Start is a no-op.
AGPL-3.0-or-later. See LICENSE .