mirror of
https://github.com/luxfi/fhe.git
synced 2026-07-27 07:24:44 +00:00
Adds a small, declarative rule engine on top of the existing
PolicyProgram. Six ops only — lt, lte, eq, in, and, or — with an
AND/OR reduction across clauses. Anything beyond that is the job of
the general FHE evaluator, not a policy gate.
rule_engine.go parser + compiler (YAML -> RulePlan)
rule_executor.go step dispatch + per-clause FHE primitive calls
rule_batch.go N-intent fan-out, one Engine per worker
plan_cache.go compile-once-per-(policy_id, sha256(yaml))
Five example wallet-tier policies (treasury_cold, hot_wallet_allowlist,
bridge_routing, validator_staking, gas_topup) ship under examples/
and are exercised by the compile suite.
Concurrency: luxfi/fhe.Evaluator is NOT goroutine-safe (internal
blind-rotation scratch). Batch executor therefore uses one Engine
per worker via EngineFactory; bootstrap key + parameters are
read-only and shared. Measured ~4x speedup on a 4-worker M1 batch
of 16 intents (33s -> 9s for the smoke plan).
Tests: 28 sub-cases across DSL parsing, malformed-input rejection,
example compile, AND/OR evaluation, missing-operand rejection,
batch evaluation at conc={1,4}, and plan-cache hit/forget/distinct-hash.
All pass against luxfi/fhe primitives at PN10QP27.
103 lines
4.4 KiB
AMPL
103 lines
4.4 KiB
AMPL
module github.com/luxfi/fhe
|
|
|
|
go 1.26.1
|
|
|
|
require (
|
|
github.com/google/uuid v1.6.0
|
|
github.com/hanzoai/base v0.39.1
|
|
github.com/luxfi/database v1.17.44
|
|
github.com/luxfi/lattice/v7 v7.0.0
|
|
github.com/luxfi/mdns v0.1.0
|
|
github.com/luxfi/metric v1.5.0
|
|
github.com/spf13/cobra v1.10.2
|
|
github.com/urfave/cli/v3 v3.6.2
|
|
golang.org/x/crypto v0.49.0
|
|
gopkg.in/yaml.v3 v3.0.1
|
|
)
|
|
|
|
require (
|
|
github.com/ALTree/bigfloat v0.2.0 // indirect
|
|
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
|
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
|
github.com/dgraph-io/ristretto/v2 v2.4.0 // indirect
|
|
github.com/disintegration/imaging v1.6.2 // indirect
|
|
github.com/domodwyer/mailyak/v3 v3.6.2 // indirect
|
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
|
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
|
|
github.com/fatih/color v1.19.0 // indirect
|
|
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
|
|
github.com/ganigeorgiev/fexpr v0.5.0 // indirect
|
|
github.com/go-logr/logr v1.4.3 // indirect
|
|
github.com/go-logr/stdr v1.2.2 // indirect
|
|
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
|
|
github.com/gogo/protobuf v1.3.2 // indirect
|
|
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
|
|
github.com/golang/mock v1.6.0 // indirect
|
|
github.com/google/flatbuffers v25.12.19+incompatible // indirect
|
|
github.com/google/go-cmp v0.7.0 // indirect
|
|
github.com/gorilla/rpc v1.2.1 // indirect
|
|
github.com/grandcat/zeroconf v1.0.0 // indirect
|
|
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect
|
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
|
|
github.com/hanzoai/dbx v1.13.0 // indirect
|
|
github.com/holiman/uint256 v1.3.2 // indirect
|
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
|
github.com/jackc/pgx/v5 v5.9.1 // indirect
|
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
|
github.com/klauspost/compress v1.18.4 // indirect
|
|
github.com/luxfi/cache v1.2.1 // indirect
|
|
github.com/luxfi/codec v1.1.3 // indirect
|
|
github.com/luxfi/compress v0.0.5 // indirect
|
|
github.com/luxfi/concurrent v0.0.3 // indirect
|
|
github.com/luxfi/crypto v1.17.45 // indirect
|
|
github.com/luxfi/ids v1.2.9 // indirect
|
|
github.com/luxfi/log v1.4.1 // indirect
|
|
github.com/luxfi/math v1.2.3 // indirect
|
|
github.com/luxfi/math/big v0.1.0 // indirect
|
|
github.com/luxfi/mock v0.1.1 // indirect
|
|
github.com/luxfi/zapdb/v4 v4.9.3 // indirect
|
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
github.com/miekg/dns v1.1.72 // indirect
|
|
github.com/mr-tron/base58 v1.2.0 // indirect
|
|
github.com/ncruces/go-strftime v1.0.0 // indirect
|
|
github.com/nexus-rpc/sdk-go v0.6.0 // indirect
|
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
|
github.com/robfig/cron v1.2.0 // indirect
|
|
github.com/spf13/cast v1.10.0 // indirect
|
|
github.com/spf13/pflag v1.0.10 // indirect
|
|
github.com/stretchr/objx v0.5.3 // indirect
|
|
github.com/stretchr/testify v1.11.1 // indirect
|
|
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
|
go.opentelemetry.io/otel v1.40.0 // indirect
|
|
go.opentelemetry.io/otel/metric v1.40.0 // indirect
|
|
go.opentelemetry.io/otel/trace v1.40.0 // indirect
|
|
go.temporal.io/api v1.62.6 // indirect
|
|
go.temporal.io/sdk v1.41.1 // indirect
|
|
go.uber.org/mock v0.6.0 // indirect
|
|
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
|
|
golang.org/x/image v0.38.0 // indirect
|
|
golang.org/x/mod v0.34.0 // indirect
|
|
golang.org/x/net v0.52.0 // indirect
|
|
golang.org/x/oauth2 v0.36.0 // indirect
|
|
golang.org/x/sync v0.20.0 // indirect
|
|
golang.org/x/sys v0.42.0 // indirect
|
|
golang.org/x/text v0.35.0 // indirect
|
|
golang.org/x/time v0.15.0 // indirect
|
|
golang.org/x/tools v0.43.0 // indirect
|
|
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
|
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
|
|
google.golang.org/grpc v1.80.0 // indirect
|
|
google.golang.org/protobuf v1.36.11 // indirect
|
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
|
modernc.org/libc v1.70.0 // indirect
|
|
modernc.org/mathutil v1.7.1 // indirect
|
|
modernc.org/memory v1.11.0 // indirect
|
|
modernc.org/sqlite v1.48.0 // indirect
|
|
)
|