Findings Runtime SDK Sample (C#)

Sprint reference: SPRINT_20260429_015_FindingsLedger_runtime_documentation task FL-RUNTIME-DOC-005.

A ~50-line C# console program that demonstrates the runtime instrumentation flow against a local Findings Ledger:

  1. POST a synthetic trace to /api/v1/findings/{findingId}/runtime/traces.
  2. GET the resulting score from /api/v1/findings/{findingId}/runtime/score.
  3. Print the score + per-component breakdown.

The program also retries transient 5xx responses with exponential backoff.

Layout

FilePurpose
Program.csThe sample program (top-level statements).
findings-runtime-sdk.csproj.NET 10 console-app project file.
sample-trace.jsonSynthetic trace payload sent to the ingest endpoint.

Prerequisites

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