File size: 1,534 Bytes
9c28998 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | # vsp-otel
**Operationalizes:** VSP — Λ-signed OTel Span Exporter
**Repo:** szl-holdings/vsp-otel
**Path:** ./ (root)
## What it does
Wraps an OpenTelemetry span pipeline with a Λ-signing layer. Every span exported through this module receives:
1. Axis score derivation from span attributes (`lambda.*` attribute namespace)
2. Λ-gate evaluation (uses `@szl/ouroboros-lambda-gate` as upstream)
3. A SHA-256 receipt hash stored in the gate's receipt store if `pass=true`
### Span attribute convention
Encode axis scores as span attributes with the `lambda.` prefix:
```
lambda.moralGrounding = 0.96
lambda.measurabilityHonesty = 0.95
...
```
Missing axes default to `0.90` (gate floor).
## HTTP endpoints
| Method | Path | Description |
|--------|------|-------------|
| `POST` | `/spans/verify` | Sign span(s) and return `{lambda, axes, pass}` |
| `POST` | `/spans/export` | Batch export; returns `{total, passed, failed}` |
| `GET` | `/spans/:hash` | Retrieve stored receipt for a span hash |
### Example `/spans/verify` response
```json
{
"spanId": "span-001",
"lambda": 0.923,
"axes": { "moralGrounding": 0.96, ... },
"pass": true,
"receiptHash": "a3f1..."
}
```
## Env vars
| Var | Default | Purpose |
|-----|---------|---------|
| `VSP_PORT` | `3004` | HTTP listen port |
## Upstream dependency
`@szl/ouroboros-lambda-gate` — receipt storage and gate evaluation.
## Install & test
```bash
pnpm install
pnpm test
# Start server
VSP_PORT=3004 node dist/server.js
```
|