utas: My Squad filter corpus — every filter identified, root cause measured
Controlled retail capture, one criterion at a time, cleared between each. 47 transactions. Every filter the My Squad picker sends is now known from the wire rather than guessed. Route: GET /ut/game/fifa17/club -- the picker hits UTAS and reuses the general club-inventory route. level=any|gold quality lowercase, ALWAYS present rare=SP "Special" uppercase, OMITTED when off position=ST position uppercase, omitted when off nation=52 entity id numeric league=13 entity id numeric team=5 entity id numeric, NESTED under league sort=desc client constant; the UI has no sort control start=/count=11 pagination Two encoding families: short string enums, and numeric FIFA ids. The ids must never reach Core. Filters compose as plain ANDs in one query -- string and id filters alike -- so each maps independently. THE ROOT CAUSE IS SELF-AMPLIFYING. club_route honours type, team and league; it never reads start, count, level, sort or year. Because start is ignored, every page returns the same full set, so the client concludes the page was full and asks for the next one. One scroll produced 22 requests and 6.2 MB, stopping at start=200 only because the client gave up -- against a filtered set of 32 items that should have been three pages. That also explains why the bug reads as erratic rather than broken: league=13&position=ST returns every Premier League player instead of Premier League strikers. Plausible, wrongly sized, hard to notice. Measured filtered sets, from the real cluttered club -- these are the acceptance test for the fix: unfiltered 1962 league=13 350 league=13&team=5 32 Two client behaviours worth carrying forward: the picker fires a query per highlighted entry, not per selection (two requests for one club pick), and parameter ORDER is not stable, so parsing must be key-value. FIXTURE SIZE: bodies over 4 KB are truncated in the committed fixture, with body_full_len and body_full_sha256 retained, because the same 1.1 MB club response repeats ~25 times and its hash already proves identity. 13.3 MB -> 247 KB. The raw .ofcap keeps every byte, privately and gitignored. Truncation is recorded per transaction so a trimmed fixture is never mistaken for a whole response. Audited across all three identifier surfaces -- headers, JSON bodies, query strings -- before and after the size change: no leaks. 6/6 sanitiser mutations still killed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,7 @@ committed fixture, and preserves exact bodies first, sanitises second.
|
||||
"""
|
||||
import argparse
|
||||
import base64
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
@@ -326,7 +327,18 @@ def cmd_parse(args):
|
||||
"keepalive_observed": keepalive,
|
||||
},
|
||||
}
|
||||
out.write(json.dumps(sanitize(rec), sort_keys=True) + "\n")
|
||||
rec = sanitize(rec)
|
||||
if getattr(args, "max_body", 0):
|
||||
for side in ("request", "response"):
|
||||
raw = base64.b64decode(rec[side]["body_b64"])
|
||||
if len(raw) > args.max_body:
|
||||
rec[side]["body_b64"] = base64.b64encode(
|
||||
raw[: args.max_body]
|
||||
).decode()
|
||||
rec[side]["body_truncated"] = True
|
||||
rec[side]["body_full_len"] = len(raw)
|
||||
rec[side]["body_full_sha256"] = hashlib.sha256(raw).hexdigest()
|
||||
out.write(json.dumps(rec, sort_keys=True) + "\n")
|
||||
total += 1
|
||||
|
||||
os.chmod(out_path, 0o644)
|
||||
@@ -567,6 +579,14 @@ def main():
|
||||
|
||||
p = sub.add_parser("parse")
|
||||
p.add_argument("--session", required=True)
|
||||
# Repository-safe size. The raw .ofcap keeps every byte privately; a
|
||||
# committed fixture that repeats an identical 1.1MB response 25 times is
|
||||
# 13MB of git history proving something its own sha256 already proves.
|
||||
# Bodies over the limit are replaced by a bounded head sample, and the
|
||||
# omission is RECORDED per transaction so nobody mistakes a truncated
|
||||
# fixture for the whole response.
|
||||
p.add_argument("--max-body", type=int, default=0,
|
||||
help="bytes; 0 = keep every body in full")
|
||||
p.set_defaults(fn=cmd_parse)
|
||||
|
||||
s = sub.add_parser("snapshot")
|
||||
|
||||
Reference in New Issue
Block a user