Skip to content

feat(AIC-3230): emit evaluation context identity - #65

Merged
ccschmitz-launchdarkly merged 7 commits into
mainfrom
AIC-3230-spec-first
Sep 3, 2026
Merged

feat(AIC-3230): emit evaluation context identity#65
ccschmitz-launchdarkly merged 7 commits into
mainfrom
AIC-3230-spec-first

Conversation

@ccschmitz-launchdarkly

@ccschmitz-launchdarkly ccschmitz-launchdarkly commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • emit canonical evaluation context identity on the root feature_flag event
  • emit compact per-kind context keys and root span attributes
  • exercise complex organization/user contexts in conversation and judge examples
  • preserve privacy and omit malformed identities
  • fix judge example registration and root example test discovery

Testing

  • uv run pytest (1,155 passed, 11 skipped)
  • targeted mypy for changed production and test modules
  • focused context identity and example tests
  • Ruff lint and format checks

Ran locally and confirmed data went to staging w/ events containing context values.

image

Note

Overview
Adds evaluation context identity to root OpenTelemetry spans when variables.ldContext has a usable identity, read separately from TrackData.

set_ld_span_attributes now derives a canonical context id (with %/: escaping for multi-kind contexts) and per-kind raw keys, writing context.contextKeys.<kind> on the root span and feature_flag.context.id / feature_flag.contextKeys on the existing feature_flag event. Malformed or missing context omits these fields and never raises; only context keys are emitted, not other context attributes.

AGENTS.md and TELEMETRY-CONTRACT.md document the new contract. Examples use a new new_multi_context() helper (org key with %/:) and log context to stderr; the judge example fixes handler registration via examples.register. Tests cover identity edge cases, cross-handler root-only placement, vocabulary lock, and example utils; pytest gets pythonpath = ["."] for discovery.

Reviewed by Cursor Bugbot for commit a371de8. Bugbot is set up for automated code reviews on this repo. Configure here.

@ccschmitz-launchdarkly
ccschmitz-launchdarkly merged commit ca30e83 into main Sep 3, 2026
7 checks passed
@ccschmitz-launchdarkly
ccschmitz-launchdarkly deleted the AIC-3230-spec-first branch September 3, 2026 21:18
@github-actions github-actions Bot mentioned this pull request Sep 3, 2026
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.

2 participants