Move deterministic cc.* metrics into trace metadata - #12
Merged
Conversation
After #11 landed the 11 git-grounded metrics as feedback scores, it became clear that feedback scores should be reserved for evaluative judgments (task_class, summary) and that observational data belongs in metadata. All deterministic metrics now live under metadata.cc alongside identity: repository, branch, head_sha_start, head_sha_end, commits_in_trace, lines_committed, uncommitted_lines, uncommitted_files, files_authored, lines_authored, lines_overwritten. Identity (set at trace creation) and metrics (set at trace close) are merged via GET → mutate → PATCH so non-cc metadata Opik adds (e.g. providers) is preserved. The PATCH carries project_name so Opik accepts the workspace/project check. API client gains a Get helper. metrics.go drops putScore — feedback-score writes are out of the Go hook entirely. Identity comment clarified to note it is preferred over git config for stable user/org primitives.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #11. Moves all deterministic git-grounded metrics out of feedback scores and into
trace.metadata.cc. Feedback scores are now reserved for evaluative judgments (cc.summary,cc.task_class) emitted by the LLM tagger.Why
After #11 we had a split surface: identity in
metadata.cc, but the 11 git metrics as feedback scores. That conflated observation (counts, repo state, sha bounds) with judgment (categorical task type, narrative summary). It also let the LLM tagger fight with the Go hook overcc.repository— different writers, different shapes (category_name="emitted"vs the actual repo string).Cleaner mental model:
metadata.ccfeedback_scorescc.summary,cc.task_classWhat lands on
metadata.ccnowIdentity (set at trace creation, unchanged from #11):
user_email,user_uuid,user_display_name,org_uuid,org_nameGit metrics (moved from feedback scores → merged at trace close):
repository,branch,head_sha_start,head_sha_endcommits_in_trace,lines_committeduncommitted_lines,uncommitted_filesfiles_authored,lines_authored,lines_overwrittenMerge strategy
metadatais a JsonNode — PATCH replaces it wholesale. To preserve identity (set at creation) and any non-ccmetadata Opik adds (e.g.providers),postTraceMetricsnow:metadata.ccwith new git keysmetadataback, withproject_nameincluded (Opik 409s without it)Test plan
metadata.cc(5 identity + 11 git), andmetadata.providers=["anthropic"]survives the merge intactfeedback_scoresfrom the hook (only LLM tagger writes there now)project_namein PATCH body fixes itmake buildsucceeds for all four target platforms🤖 Generated with Claude Code