MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / NewEngine

Function NewEngine

internal/piguard/engine.go:36–44  ·  view source on GitHub ↗

NewEngine builds an Engine. At least one detector is expected; an Engine with no detectors always reports Degraded (fail-to-review), which is the safe posture.

(cfg EngineConfig, detectors ...Detector)

Source from the content-addressed store, hash-verified

34// NewEngine builds an Engine. At least one detector is expected; an Engine with no
35// detectors always reports Degraded (fail-to-review), which is the safe posture.
36func NewEngine(cfg EngineConfig, detectors ...Detector) *Engine {
37 if cfg.Timeout <= 0 {
38 cfg.Timeout = defaultDetectorTimeout
39 }
40 if cfg.MinOK <= 0 {
41 cfg.MinOK = 1
42 }
43 return &Engine{detectors: detectors, cfg: cfg}
44}
45
46// Aggregate is the combined verdict plus the control signals the wiring layer needs
47// to choose an action without knowing per-detector internals.

Callers 15

NewServerFunction · 0.92
testScreenServerFunction · 0.92
NewAPIFunction · 0.92
testScreenAPIFunction · 0.92
mainFunction · 0.92
detectsFunction · 0.85

Calls

no outgoing calls

Tested by 12

testScreenServerFunction · 0.74
testScreenAPIFunction · 0.74
detectsFunction · 0.68