发布

  • [OPIK-6921] [BE] derive bulk project from the experiment or dataset (#7049)

    frostbyte_neo 发布于 2026-06-12 15:52:14 +00:00

    • [OPIK-6921] [BE] derive bulk project from the experiment or dataset

    experiment_items_bulk no longer requires project_name to be repeated when it
    can be derived. Resolution for traces without their own project:

    1. the request project_name (when provided); else
    2. the existing experiment's project (when it exists and has one); else
    3. the existing dataset's project (when it exists and has one); else
    4. the default project (deprecated; X-Opik-Deprecation header).

    Derivation only reads existing entities; it never creates an experiment or
    dataset to obtain a project. The experiment (and dataset, when created) are
    created in the resolved project so everything stays consistent.

    Backward compatible: when project_name is provided it is validated against the
    existing experiment's and dataset's projects (409 on mismatch). When omitted,
    the project is derived best-effort, so a mismatch is only possible (and
    tolerated) in that case. The resource emits X-Opik-Deprecation for both the
    default-project fallback and the workspace-wide resolution fallback.

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

    • [OPIK-6921] [BE] emit X-Opik-Deprecation for dataset-derived fallback; docs

    The service now reports which deprecated fallback was used to resolve the bulk
    project (NONE / DATASET / DEFAULT) instead of a bare boolean, and the resource
    sets the X-Opik-Deprecation header on the request thread — the request-scoped
    fallback message must not be mutated from the reactive chain.

    • Deriving the project from a workspace-wide dataset match now surfaces the
      deprecation header (set via RequestContext on the request thread, same
      mechanism as other resources); deriving from the experiment does not.
    • Default-project fallback keeps its own deprecation message.
    • Tests assert: experiment-derived → no header; dataset-derived → header;
      default → header.
    • Docs note clarified: project_name is optional when the experiment/dataset
      already has a project.

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


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

    下载附件