Repository navigation
feat(ENG-4364): opt-in tier3 drop_shape_only_fields for whole-result reviews - #81
Merged
Merged
Conversation
…reviews Port of StackOneHQ/defender#157. The whole-result serializer can leave out `path: value` lines whose key is a plain path of short field names and whose whole value is null, a boolean, a number, a UUID or hex ID, an ISO date or a hex colour. Left-out strings count as covered. Off by default; the returned result and Tier 1/2 are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Python's IGNORECASE folded U+017F to s and U+0131 to i, so values like "falſe" were left out in Python but kept in TS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of the TypeScript fix: top-level array elements stay in the reviewer input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # tests/conformance/VERSION
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.
What
Port of StackOneHQ/defender#157: the opt-in Tier 3 option
drop_shape_only_fields(also accepted asdropShapeOnlyFields), defaultFalse, for whole-result reviews.With it on, the whole-result serializer leaves a
path: valueline out of the reviewer input when:Multi-line values, text-like keys, empty values and top-level values always stay. Left-out strings count as covered, so filtering alone never flags oversize. Only the reviewer's input changes.
Regexes are ASCII-only and lengths are UTF-16, as in TS.
Tests
tier3-serializecases.uv run pytest: 795 passed.uv run ruff check: clean.🤖 Generated with Claude Code
Summary by cubic
Adds an opt-in
drop_shape_only_fields(dropShapeOnlyFields) option, defaultFalse, that trims whole-result reviewer input by leaving outpath: valuelines whose key is a plain path of short field names and whose whole value is null, a boolean, a number, a UUID or hex ID, an ISO date, or a hex colour. This reduces per-review input size for the Tier 3 judge, supporting the load-reduction work in ENG-4364. Only the reviewer's input changes; the returned result and Tier 1/2 behavior are unaffected.tier3-serializecases, plus unit tests for the snake_case option, default-off behavior, UTF-16 accounting next to astral text, and ASCII-only case folding.Written for commit d4013c3. Summary will update on new commits.