Skip to content

fix(flag-evaluator): return structured scalar evaluation diagnostics - #748

Merged
roncohen merged 4 commits into
mainfrom
fix/structured-evaluation-diagnostics
Sep 25, 2026
Merged

roncohen merged 4 commits into
mainfrom
fix/structured-evaluation-diagnostics

Conversation

@roncohen

Copy link
Copy Markdown
Contributor

Summary

  • replace direct console.error() calls for numeric, date, and unknown-operator failures with structured evaluation diagnostics
  • distinguish invalid context values from invalid targeting values
  • report malformed runtime operators as UNKNOWN_OPERATOR
  • include relative-date validation that previously failed silently
  • avoid including raw context or targeting values in messages
  • derive the operator type and runtime allowlist from one source of truth

New diagnostic codes

  • INVALID_CONTEXT_VALUE
  • INVALID_TARGETING_VALUE
  • UNKNOWN_OPERATOR

The feature-event ingest schema accepts arbitrary diagnostic code strings, so these flow through existing evalErrors transport. The web OpenAPI enum should be updated when the new flag-evaluation package is consumed there.

Verification

  • cd packages/flag-evaluation && ./node_modules/.bin/vitest run (248 tests)
  • tsc --project packages/flag-evaluation/tsconfig.build.json --noEmit
  • Node SDK client suite after rebuilding flag-evaluation (132 tests)
  • oxlint, oxfmt, and git diff --check

Review

  • completed a simplification/refactor pass
  • completed a final diff review; no actionable findings

Copilot AI lite review requested due to automatic review settings September 24, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread packages/flag-evaluation/src/index.ts Outdated
Copilot AI review requested due to automatic review settings September 25, 2026 10:11
@roncohen
roncohen enabled auto-merge September 25, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 25, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 25, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@roncohen
roncohen disabled auto-merge September 25, 2026 10:22
@roncohen
roncohen enabled auto-merge September 25, 2026 10:23
@roncohen
roncohen added this pull request to the merge queue Sep 25, 2026
@roncohen roncohen changed the title Return structured scalar evaluation diagnostics fix(flag-evaluator): return structured scalar evaluation diagnostics Sep 25, 2026
@roncohen
roncohen removed this pull request from the merge queue due to a manual request Sep 25, 2026
@roncohen
roncohen added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit aa47838 Sep 25, 2026
7 of 8 checks passed
@roncohen
roncohen deleted the fix/structured-evaluation-diagnostics branch September 25, 2026 10:32
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