EVC is a small, explainable trust gate for actions and model outputs.
It ingests signals → aggregates into an instant score A(t) → smooths over time into E(t) → applies a policy to decide:
ALLOW | STEP_UP | BLOCK
.
-
Monorepo: TypeScript + pnpm workspaces
-
Packages:
@lumen-syntax/evc-core
— core library (aggregation, EWMA smoothing, policy)@lumen-syntax/evc-service
— HTTP service exposing/evc/evaluate
-
License: Apache-2.0
- Node.js ≥ 20
- pnpm ≥ 10
Install and build all workspaces:
pnpm install
pnpm -r build
Run the HTTP service (dev):
pnpm --filter @lumen-syntax/evc-service dev
By default the service listens on http://localhost:8787
.
Auth headers The
POST /evc/evaluate
endpoint expects:
Authorization: Bearer dev-token
x-session-id: run-123
curl -s http://localhost:8787/health
# → { "status": "ok" }
curl -s -X POST http://localhost:8787/evc/evaluate \
-H 'Authorization: Bearer dev-token' \
-H 'x-session-id: run-123' \
-H 'Content-Type: application/json' \
-d @examples/curl/evaluate.json
Example request body (examples/curl/evaluate.json
):
{
"signals": [
{ "name": "uncertainty", "value": 0.12, "weight": 1.0, "evidence": "mc-dropout" },
{ "name": "consistency", "value": 0.88, "weight": 1.2, "evidence": "n=5 majority" },
{ "name": "novelty", "value": 0.30, "weight": 0.8, "evidence": "embedding-drift" },
{ "name": "verification", "value": 0.92, "weight": 1.5, "evidence": "tool-check:pass" }
],
"alpha": 0.6,
"thresholds": { "allow": 0.75, "step_up": 0.5 }
}
Example response:
{
"decision": "ALLOW",
"score": 0.81,
"reasons": ["temporal_consistency", "low_uncertainty"]
}
-
Minimal OpenAPI:
packages/evc-service/openapi.yaml
-
Examples:
Endpoints
GET /health
→{ status: "ok" }
POST /evc/evaluate
→{ decision, score, reasons[] }
Core scoring & policy:
- Aggregate signals → A(t)
- EWMA smoothing → E(t)
- Policy thresholds → ALLOW | STEP_UP | BLOCK
HTTP wrapper for the core engine.
GET /health
POST /evc/evaluate
(requiresAuthorization
andx-session-id
headers)
Root scripts:
pnpm -r lint
pnpm -r typecheck
pnpm -r test
pnpm -r build
pnpm format
Service package scripts (most useful for local runs):
pnpm --filter @lumen-syntax/evc-service dev
pnpm --filter @lumen-syntax/evc-service build
pnpm --filter @lumen-syntax/evc-service start
pnpm --filter @lumen-syntax/evc-service test
Pull Requests welcome. Please:
- Keep README and OpenAPI in sync with the implementation.
- Include runnable examples when adding new endpoints.
Apache-2.0 © Lumen Syntax