发布

  • [OPIK-7298] [BE] feat: ingest cipx.session.harness into cipx_trace_identities (#7448)

    frostbyte_neo 发布于 2026-07-14 08:48:10 +00:00

    • [OPIK-7298] [BE] feat: ingest cipx.session.harness into cipx_trace_identities

    The cipx proxy stamps metadata.cipx.session.harness (claude_code / codex /
    ...) on every trace, but ingestion dropped it. Extract it into a new harness
    column so AI-spend composition can group spend by harness instead of assuming
    Claude Code. Adds migration 000101, parses the field in CipxTraceIdentityDAO,
    and covers it in CostIntelligenceIngestionTest.

    Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

    • feat(cipx): fall back to identity.user_id when user_uuid is blank

    Codex traces carry an opaque user_id but no user_uuid, so they landed with
    an empty user_uuid and were excluded from user-scoped views. Fall back to
    user_id so every harness gets a stable per-user key; the ingestion listener
    then writes the email->id mapping, letting the self/leaderboard resolution
    cover both harnesses via one email.

    Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

    • fix(cipx): bump harness migration prefix 000101 -> 000102 to avoid conflict

    000101 was taken on main by 000101_create_traces_local_v2_table.sql after
    this branch was cut.

    Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

    • chore(migrations): end 000102 cipx_trace_identities migration with blank line

    migrations.md requires migration files to end with an empty line.

    Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com


    Co-authored-by: Claude Opus 4.8 noreply@anthropic.com

    下载附件