Findings Runtime SDK Sample (C#)
Sprint reference:
SPRINT_20260429_015_FindingsLedger_runtime_documentationtask FL-RUNTIME-DOC-005.
A ~50-line C# console program that demonstrates the runtime instrumentation flow against a local Findings Ledger:
- POST a synthetic trace to
/api/v1/findings/{findingId}/runtime/traces. - GET the resulting score from
/api/v1/findings/{findingId}/runtime/score. - Print the score + per-component breakdown.
The program also retries transient 5xx responses with exponential backoff.
Layout
| File | Purpose |
|---|---|
Program.cs | The sample program (top-level statements). |
findings-runtime-sdk.csproj | .NET 10 console-app project file. |
sample-trace.json | Synthetic trace payload sent to the ingest endpoint. |
Prerequisites
- .NET 10 SDK (matches the rest of the StellaOps repo).
- A running Findings Ledger WebService with runtime instrumentation enabled (
findings:ledger:runtime:enabled = true). Seedocs/modules/findings-ledger/enabling-runtime-instrumentation.md. - A bearer token for an account holding both
findings.runtime.writeandfindings.runtime.readscopes.
Run
export STELLA_FINDINGS_LEDGER_URL="https://stella-ops.local/"
export STELLA_TOKEN="<bearer-token>"
export STELLA_TENANT="demo-prod"
export STELLA_FINDING_ID="00000000-0000-0000-0000-000000000001"
dotnet run --project docs/samples/findings-runtime-sdk
If your finding identifier is different, override STELLA_FINDING_ID. You can pass an alternative trace file as the first program argument:
dotnet run --project docs/samples/findings-runtime-sdk -- ./my-trace.json
Expected output
On a fresh deployment, the first run will print:
POST /api/v1/findings/00000000-0000-0000-0000-000000000001/runtime/traces
-> 202 Accepted
{"findingId":"...","observationId":"...","frameCount":3,"privacyFilterApplied":true}
GET /api/v1/findings/00000000-0000-0000-0000-000000000001/runtime/score
-> 200 OK
score = 0.27
computedAt = "2026-04-28T12:34:56.789+00:00"
breakdown = {
"observationScore": 0.30,
"recencyFactor": 0.99,
"qualityFactor": 1.00
}
If runtime instrumentation is disabled, the score endpoint returns 404 NotFound and the sample prints a hint instead of failing.
Cross-references
- API reference
- Architecture overview
- Enable guide
- CLI commands
