Skip to content

EVC – Evidence-Validated Confidence. A low-latency, explainable trust gate for LLM outputs. Signals → aggregation → temporal E(t) → policy (ALLOW / STEP_UP / BLOCK). Core TypeScript monorepo (library + HTTP service), built for edge and server runtimes.

License

Notifications You must be signed in to change notification settings

LumenSyntax/TruthSyntax

Repository files navigation

TruthSyntax — EVC (Evidence-Validated Confidence)

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


Requirements

  • Node.js ≥ 20
  • pnpm ≥ 10

Quickstart

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

Healthcheck

curl -s http://localhost:8787/health
# → { "status": "ok" }

Evaluate (cURL)

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"]
}

API

Endpoints

  • GET /health{ status: "ok" }
  • POST /evc/evaluate{ decision, score, reasons[] }

Packages

@lumen-syntax/evc-core

Core scoring & policy:

  • Aggregate signalsA(t)
  • EWMA smoothing → E(t)
  • Policy thresholds → ALLOW | STEP_UP | BLOCK

@lumen-syntax/evc-service

HTTP wrapper for the core engine.

  • GET /health
  • POST /evc/evaluate (requires Authorization and x-session-id headers)

Development

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

Contributing

Pull Requests welcome. Please:

  • Keep README and OpenAPI in sync with the implementation.
  • Include runnable examples when adding new endpoints.

License

Apache-2.0 © Lumen Syntax

About

EVC – Evidence-Validated Confidence. A low-latency, explainable trust gate for LLM outputs. Signals → aggregation → temporal E(t) → policy (ALLOW / STEP_UP / BLOCK). Core TypeScript monorepo (library + HTTP service), built for edge and server runtimes.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published