Skip to content

Correct precomputed fixture timestamp and unsupported-type expectation - #67

Open
typotter wants to merge 3 commits into
mainfrom
typo/precomputed-wire-contract-fixes
Open

typotter wants to merge 3 commits into
mainfrom
typo/precomputed-wire-contract-fixes

Conversation

@typotter

@typotter typotter commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

Two precomputed fixtures fail against the browser SDK because the serial-ID response lacks a creation timestamp and the unsupported-type case expects the wrong error code.

Changes

  • Add createdAt to the serial-ID exposure fixture.
  • Expect PARSE_ERROR for an unsupported wire variation type, following the FFE SDK requirements.

Decisions

Keep the valid-type/wrong-getter TYPE_MISMATCH expectation and all exposure assertions unchanged.

Checklist

  • JSON files are valid (no syntax errors)
  • New test cases reference existing flags in config/ufc-config.json — no new cases
  • New flags have corresponding test cases in evaluation-cases/ — no new flags
  • Expected results match the flag configuration logic

@typotter
typotter marked this pull request as ready for review November 4, 2026 18:49
@typotter
typotter requested a review from a team as a code owner November 4, 2026 18:49
@typotter
typotter requested a balanced review from Copilot November 4, 2026 22:02

Copilot AI 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.

🟢 Approval recommended

No active review issues are recorded for the exposure timestamp and unsupported variation-type fixture updates.

No open issues 🎉

What changed in this PR

Corrects two precomputed assignment fixtures to align with browser SDK behavior and FFE requirements.

Changes:

  • Adds a response creation timestamp to the serial-ID exposure fixture.
  • Changes the unsupported wire variation type expectation to PARSE_ERROR, leaving valid-type/wrong-getter and exposure assertions unchanged.
File Description
precomputed-assignments/​cases/​evaluator/​defaults-and-emission-gates.json Expects PARSE_ERROR for an unsupported variation type.
precomputed-assignments/​cases/​emissions/​serial-id-on-exposure.json Adds createdAt to the mocked response attributes.

Review effort: Balanced

Copilot AI 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.

🟡 Changes recommended

The source description still contradicts the new expectation and README on unsupported variation handling; it should specify per-flag PARSE_ERROR, and its obfuscated companion needs regeneration.

1 open issue

Review effort: Balanced

Comment thread AGENTS.md
| `FLAG_NOT_FOUND` | Flag key not in response, or flag dropped due to malformed data |
| `TYPE_MISMATCH` | Incompatible getter, fractional/out-of-range Integer read, or rejected Double conversion (see the README numeric rules) |
| `PARSE_ERROR` | Enumerated field contains an unexpected value. Unsupported `variationType` values are omitted; lookup returns `FLAG_NOT_FOUND`. |
| `PARSE_ERROR` | Enumerated field contains an unexpected value, including an unsupported `variationType`. Preserve the per-flag parse error; healthy sibling flags remain evaluable. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Comment from Codex working with @sameerank:

🟡 [P2] Align the remaining malformed-flag guidance with this rule

This row now correctly preserves PARSE_ERROR for an unsupported variationType. However, line 149 still says a flag dropped because of malformed data returns FLAG_NOT_FOUND, and lines 188–190 repeat that malformed flags return FLAG_NOT_FOUND. The root README and CONTRIBUTING.md reserve FLAG_NOT_FOUND for keys absent from both active assignments and rejected-key tracking. Please update these two nearby passages so future fixtures do not reintroduce the old behavior.

Suggested wording
| `FLAG_NOT_FOUND` | Flag key absent from both the active and rejected maps |

For the isolation example, state that malformed flags return defaultValue with PARSE_ERROR, while healthy sibling flags remain evaluable.

Was this finding useful? React with 👍 or 👎.

{
"name": "defaults-and-emission-gates",
"description": "Precomputed assignments that validate exposure gates, unknown variation isolation, and default/error flagevaluation payloads. Unsupported variation types are omitted; lookup returns FLAG_NOT_FOUND.",
"description": "Precomputed assignments that validate exposure gates, unknown variation isolation, and default/error flagevaluation payloads. Unsupported variation types preserve a per-flag PARSE_ERROR; healthy sibling flags remain evaluable.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Comment from Codex working with @sameerank:

🔵 [P3] Name the unsupported variation-type case precisely

The updated sentence now documents the correct PARSE_ERROR behavior, but the earlier phrases still say “unknown variation isolation” and “flagevaluation payloads.” This case supplies a known flag with an unsupported wire variationType, and the fixture asserts evaluation results rather than event payload fields. Please use “unsupported variation type isolation” and “flag evaluation results,” then regenerate the obfuscated companion.

Suggested description
Precomputed assignments that validate exposure gates, unsupported variation type isolation, and default/error flag evaluation results. Unsupported variation types preserve a per-flag PARSE_ERROR; healthy sibling flags remain evaluable.

Was this finding useful? React with 👍 or 👎.

@sameerank sameerank 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.

The documentation finds are non-blocking, but seem worth updating before you merge

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.

3 participants