Skip to content

refactor: replace bigSegmentStatus string with EvaluationReason::BigSegmentsStatus enum#549

Merged
beekld merged 5 commits into
mainfrom
beeklimt/SDK-2366
Jun 11, 2026
Merged

refactor: replace bigSegmentStatus string with EvaluationReason::BigSegmentsStatus enum#549
beekld merged 5 commits into
mainfrom
beeklimt/SDK-2366

Conversation

@beekld

@beekld beekld commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Replace bigSegmentStatus string with typed enum

Renames the (currently unused-but-public) EvaluationReason Big Segments field from singular bigSegmentStatus to spec-compliant plural bigSegmentsStatus, and introduces a typed enum to replace its std::optional<std::string> representation. No evaluator behavior change in this PR — the field still has no in-tree writer; that lands in SDK-2366-2.

What's in

  • New nested enum EvaluationReason::BigSegmentsStatus (kHealthy/kStale/kNotConfigured/kStoreError), mirroring Kind and ErrorKind.
  • friend std::ostream& operator<< for the enum.
  • tag_invoke pair in the JSON serializer (mirrors Kind and ErrorKind).

Breaking changes

  • EvaluationReason::BigSegmentStatus() renamed to BigSegmentsStatus() and now returns std::optional<EvaluationReason::BigSegmentsStatus> instead of std::optional<std::string>.
  • The 7-arg EvaluationReason constructor's last parameter changes type to match.
  • JSON field "bigSegmentStatus" renamed to "bigSegmentsStatus".

The field has never had an in-tree writer and only ever returned an empty optional / been absent from JSON, so no caller could have depended on a value.


Note

Medium Risk
Public API and JSON field renames are breaking for external integrators, though in-tree usage was never populating the field; evaluation behavior is unchanged.

Overview
Replaces the Big Segments field on EvaluationReason with a typed, C-API-stable enum and aligns naming with the spec (bigSegmentsStatus).

EvaluationReason::BigSegmentsStatus is added (kNone, kHealthy, kStale, kNotConfigured, kStoreError) with ostream support. The main constructor and factories now take/store that enum; BigSegmentsStatus() returns the enum (defaulting to kNone when no Big Segment query occurred). The old BigSegmentStatus() string accessor and string-typed constructor remain as deprecated shims.

JSON (de)serialization switches from "bigSegmentStatus" (free string) to "bigSegmentsStatus" with validated enum strings; kNone is omitted on the wire. operator== and debug printing follow the new field.

Call sites and tests are updated accordingly. No evaluator logic change in this PR—the status still is not written by evaluation yet.

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

@beekld
beekld requested a review from a team as a code owner June 10, 2026 04:55
Comment thread libs/internal/src/serialization/json_evaluation_reason.cpp
@beekld
beekld force-pushed the beeklimt/SDK-2366 branch from ae98702 to d0e181f Compare June 11, 2026 21:08

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d0e181f. Configure here.

Comment thread libs/common/src/data/evaluation_reason.cpp
@beekld
beekld merged commit 96af7bf into main Jun 11, 2026
47 checks passed
@beekld
beekld deleted the beeklimt/SDK-2366 branch June 11, 2026 21:51
beekld added a commit that referenced this pull request Jun 11, 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