T09 · Insecure Skill Coding Practices
- Location
discovery.py:65- Finding
Text-Only Grouping Can Misclassify Unrelated Markets as a Confirmed Set
- Content
View full analysis
exclusivity confirmed. Anything else (partial set, mixed letters, advance/qualify wording) -> NOT confirmed.""" if len(legs) != COMPLETE_SET_SIZE: return False letters = {GROUP_RE.search(_norm(m.question)).group(1).upper() for m in legs if GROUP_RE.search(_norm(getattr(m, "question", "")))} return len(letters) == 1 ``` The discovery logic places every matching market into a bucket identified only by the group letter: ```python def discover_sets(client, limit=200): """Return [(label, [markets])] of confirmed mutually-exclusive sets, deduped by market id. Unconfirmed candidates are printed as alerts and excluded.""" sets = _configured_sets(client) seen = {} for q in SEARCH_QUERIES: try: for m in _fetch_markets(client, q, limit): if getattr(m, "status", "active") != "active": continue match = GROUP_RE.search(_norm(getattr(m, "question", ""))) if match: seen.setdefault(match.group(1).upper(), {})[m.id] = m except Exception as exc: # one bad query must not kill the run print(f" ! discovery query {q!r} failed: {exc}") for letter, d in sorted(seen.items()): legs = list(d.values()) if is_confirmed_set(legs): sets.append((f"Group {letter}", legs)) else: print(f" ALERT [unconfirmed-set] Group {letter}: {len(legs)} visible leg(s) — " f"exclusivity unconfirmed from text; alert only, no arb.") return sets ``` ### Technical Analysis The trading strate ...[truncated 2533 chars]- Remediation
View remediation
