Skip to content

feat(otlp): inbound OTLP — validate, analyze --otlp, loop/steering analyses, faithful round-trip - #72

Merged
drewstone merged 3 commits into
mainfrom
feat/otlp-inbound
Aug 2, 2026
Merged

feat(otlp): inbound OTLP — validate, analyze --otlp, loop/steering analyses, faithful round-trip#72
drewstone merged 3 commits into
mainfrom
feat/otlp-inbound

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

traces becomes consumable by any system that emits the span contract, with no adapter:

  • traces validate <file|dir> — the conformance report: verdict (error = not a trace → exit 1; warn = analysable but degraded), every finding, and the capability table naming what each gap costs.
  • traces analyze --otlp <file|dir> — OTLP-JSONL straight into the existing pipeline (reused, not forked). Directory ingest skips non-OTLP files instead of counting their lines as errors.
  • loop-convergence + steering-chain implemented — the two analyses this project exists for: round-over-round score series per loop, and the steered_by link chain showing which verdict caused which retry. Previously advertised with no implementation (audit finding).
  • Faithful round-trip — re-export preserves kinds, status, producer timestamps, unknown kinds, and the finding-code set; a re-validated artifact carries its source's verdict. Laundering (EVALUATOR→CHAIN downgrades, vanishing findings, invented trace ids) was found by three audit rounds and is now pinned by a 25-fixture invariant test with declared-exception semantics.
  • Content-verified dependency — the installed contract is compared byte-for-byte against the lockfile-pinned tarball; a stale build of the same version fails the suite (mutation-proven).
  • Adapters demoted in docs to the legacy edge for formats we don't control.

Verification

  • 41 files / 538 tests green; typecheck/build/check:package green; CI runs the full suite on every PR.
  • Proven against real VB artifacts: the 280-span flat trace (correctly reported as analysable-but-degraded with named costs) and a real 2-shot cell (conforms; re-declared ancestors merge).
  • Breaking-flag note: convert --otlp (write) is now --otlp-out; --otlp means read. Deprecation shim + changeset included.
  • Full audit ledger: agent-runtime#694.

…alyses, faithful round-trip

The analysis pipeline was OTLP-native with no inbound path: 18 adapters read
proprietary session stores and --otlp was an output flag. Any system that
already emits OpenInference spans still needed an adapter. Now:

- traces validate <file|dir> renders the contract's conformance report — the
  verdict, every finding, and the capability table naming what can be analysed
  and what each gap costs. Exit 1 only when the input is not a trace.
- traces analyze --otlp feeds existing OTLP-JSONL straight into the pipeline.
  Directories ingest every OTLP file and skip raw event logs instead of
  counting their lines as errors. Reports gate every table on its capability —
  numbers whose inputs are incomplete are marked, never printed bare.
- loop-convergence and steering-chain are implemented, not advertised:
  per-loop round-over-round score series, and the steered_by link chain
  showing which verdict caused which retry.
- The round trip is faithful: re-exporting preserves span kinds, status,
  producer timestamps, unknown kinds, and the finding-code set — a re-validated
  artifact carries its source's verdict. The one impossible case (a span with
  no trace id must be minted one or the artifact is unreadable) is declared on
  the fixture and stated in the report, not silently absorbed.
- The contract build is stamped on every exported artifact and verified against
  the lockfile-pinned tarball byte-for-byte — the digest leg fails on any tree
  that is not the locked one.
- Adapters are demoted in the docs to the legacy edge for formats we do not
  control; the way to integrate a new system is: emit the contract, point
  --otlp at it.

Suite: 41 files / 538 tests. Source-text guard added after two raw NUL bytes
were found hiding files from grep — one already shipped on main.
…luting a JSON stream

CI failed with 'Unexpected token s, "source tex"... is not valid JSON': the
guard's success line printed to stdout, and a packaging step that parses its
child's stdout as JSON swallowed it. Diagnostics belong on stderr; success is
otherwise silent.
@drewstone
drewstone merged commit d3b4b42 into main Aug 2, 2026
1 check passed
@drewstone
drewstone deleted the feat/otlp-inbound branch August 2, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant