发布

  • [OPIK-6417] [SDK] feat: cascade trace + span comments in opik migrate dataset (#6714)

    frostbyte_neo 发布于 2026-05-18 09:51:10 +00:00

    • [OPIK-6417] [SDK] feat: cascade trace + span comments in opik migrate dataset

    Slice 4 of opik migrate dataset. The Slice 3 cascade already
    copies traces + spans + feedback scores + assertion results, but
    comments live as READ_ONLY on the trace/span Public view -- they
    can't ride along create_traces / create_spans and were
    silently dropped at the destination.

    Re-emit them via the dedicated single-comment write endpoints
    (POST /v1/private/traces/{id}/comments,
    POST /v1/private/spans/{id}/comments) after the destination
    trace/span flushes. Each POST is wrapped with the existing
    ensure_rest_api_call_respecting_rate_limit helper; order is
    preserved by iterating the source comments list in place so the
    destination read order matches.

    Counters surface on a new cascade_experiments_summary audit
    record alongside traces_migrated / spans_migrated (additive --
    the existing cascade_experiments action record shape is
    unchanged).

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • test(e2e): use verifiers for comment round-trip assertions

    Extend verifiers.verify_trace / verify_span with an optional
    comments kwarg that asserts equality on the source-ordered list
    of comment texts. Refactor the cascade-comments e2e to delegate
    to the shared verifiers instead of hand-rolling REST polling and
    content/order checks.

    Addresses PR review feedback from baz-reviewer[bot] on PR #6714:
    comment text/order is part of the TracePublic.comments /
    SpanPublic.comments contract, so it belongs on the shared
    verifier surface (consistent with how the sibling
    test_migrate_dataset__evaluate_shape__round_trips test already
    verifies traces via verifiers.verify_trace).

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com


    Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com

    下载附件