crbench//

← all cases

The cached shipment payload changes shape without bumping CACHE_VERSION, so old entries are read as current

Tier 1 easy python · cross-file · authored, execution-grounded case

Ground-truth defects

d1 · correctness · high · tracker/cache.py:8
The diff changes the shape of the shipment payload (destination_city and destination_country become a nested destination object) and updates TrackingService.summary to read the new shape, but leaves CACHE_VERSION in tracker/cache.py at 6. The cache is Redis, shared by every replica and outliving a deploy, and CACHE_VERSION is part of every key. After this ships, the new code reads payloads the previous release cached under the same v6 keys, in the old flat shape, and summary() raises KeyError for every shipment still cached until the entries expire. Nothing in the diff references cache.py. The project's history shows every earlier payload change (status enum, eta, carrier, destination, weight) bumped CACHE_VERSION in the same commit.

The change under review

diff
diff --git a/tracker/serializers.py b/tracker/serializers.py
index c1d7330..28abbe8 100644
--- a/tracker/serializers.py
+++ b/tracker/serializers.py
@@ -16,7 +16,6 @@ def shipment_to_payload(shipment: Shipment) -> dict[str, object]:
         "status": shipment.status.value,
         "eta": shipment.eta.isoformat() if shipment.eta else None,
         "carrier": shipment.carrier,
-        "destination_city": shipment.destination_city,
-        "destination_country": shipment.destination_country,
+        "destination": {"city": shipment.destination_city, "country": shipment.destination_country},
         "weight_kg": shipment.weight_kg,
     }
diff --git a/tracker/service.py b/tracker/service.py
index 38e3800..0603fdb 100644
--- a/tracker/service.py
+++ b/tracker/service.py
@@ -28,7 +28,7 @@ class TrackingService:
         """One line for support tooling: where a shipment is going and when it lands."""
         p = self.shipment_payload(shipment_id)
         eta = str(p["eta"])[:16] if p["eta"] else "unknown"
-        destination = f"{p['destination_city']}, {p['destination_country']}"
+        destination = f"{p['destination']['city']}, {p['destination']['country']}"
         return f"{p['tracking_number']}: {p['status']} to {destination} (ETA {eta})"
 
     def is_delayed(self, shipment_id: int, now: datetime) -> bool:

Leaderboard for this case

easy · 9 of 9 bots fully caught it (100% solve rate) · 100% avg coverage.

#BotResultCaughtCoverageFindingsFalse alarms
1 Claude Code (Opus 5.5) solved 1/1 100.0% 2 0
2 Cubic solved 1/1 100.0% 1 0
3 cursor solved 1/1 100.0% 1 0
4 Drape (Deep Review) solved 1/1 100.0% 2 0
5 Drape (Review) solved 1/1 100.0% 1 0
6 greptile solved 1/1 100.0% 1 0
7 Mjolnir (Opus 5.5) solved 1/1 100.0% 2 0
8 Mjolnir (Sonnet 5.5) solved 1/1 100.0% 2 0
9 qodo solved 1/1 100.0% 1 0

Bot results

Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact medium
The module docstring says this is "the JSON shape the API returns", and the diff takes out the top-level destination_city and destination_country keys. Nothing replaces them for compatibility, so any existing client that reads those keys breaks. That alone substantiates the finding. The finding's 'no test coverage' detail is weaker, since test_summary still exercises the new nested shape through summary(), but that does not undo the breaking change. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
tracker/cache.py:8
The serialized shipment payload changes shape here: flat `destination_city`/`destination_country` become a nested `destination` object. CACHE_VERSION is still 6, though, so cache keys don't change. Payloads already in Redis under `shipment:v6:*` keep the old flat shape and are returned as-is until they're evicted or invalidated. After deploy, `TrackingService.summary` reads `p['destination']['city']` from those stale entries and raises KeyError, so the support summary fails for every shipment already in the cache. `shipment_payload` and `search` also return a mix of old and new shapes to API clients. Bump CACHE_VERSION when the payload shape changes, or handle both shapes.
tracker/serializers.py:19
This is a breaking change to the public shipment API response. The top-level `destination_city` and `destination_country` fields are removed and replaced by a nested `destination` object, with no versioning or deprecation period. Any external consumer reading the old fields breaks silently, and during a rolling deploy old and new pods serve different shapes. No tests were updated or added to cover the new shape.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ off by one
valid · matches d1 · impact high
raw comments (2)
tracker/service.py:31
<!-- cubic:v=cd7594e1-ba5b-4193-8b07-8babb47399d6 --> <!-- cubic:review-run=849123d7-6e5c-57cd-a9e3-72647353f5fd --> <!-- metadata:{"confidence":8} --> P2: When a pre-deployment flat payload remains under the existing cache key, `summary()` raises `KeyError` instead of producing the support summary. Bump the cache schema version for this payload change or migrate/fallback for old cached entries. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At tracker/service.py, line 31: <comment>When a pre-deployment flat payload remains under the existing cache key, `summary()` raises `KeyError` instead of producing the support summary. Bump the cache schema version for this payload change or migrate/fallback for old cached entries.</comment> <file context> @@ -28,7 +28,7 @@ def summary(self, shipment_id: int) -> str: p = self.shipment_payload(shipment_id) eta = str(p["eta"])[:16] if p["eta"] else "unknown" - destination = f"{p['destination_city']}, {p['destination_country']}" + destination = f"{p['destination']['city']}, {p['destination']['country']}" return f"{p['tracking_number']}: {p['status']} to {destination} (ETA {eta})" </file context> ``` </details>
PR-level
<!-- cubic:review-summary:start --> **1 issue found** across 2 files <!-- cubic:review-summary:end --> <details> <summary>Prompt for AI agents (unresolved issues)</summary> ```text Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately. <file name="tracker/service.py"> <violation number="1" location="tracker/service.py:31"> P2: When a pre-deployment flat payload remains under the existing cache key, `summary()` raises `KeyError` instead of producing the support summary. Bump the cache schema version for this payload change or migrate/fallback for old cached entries.</violation> </file> ``` </details> <sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/103/ai_pr_review_github_delivery_21fdf2e9f7d55d9e98bfa21c87fd3e2a8773cef254e0c4d0a467d0759400fcdf?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F103)</sub> <!-- cubic:review-post:ai_pr_review_github_delivery_21fdf2e9f7d55d9e98bfa21c87fd3e2a8773cef254e0c4d0a467d0759400fcdf:9d4e3c23be99511b233a175fc596ec8e288ce75f:849123d7-6e5c-57cd-a9e3-72647353f5fd -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
tracker/serializers.py:19
### Cache version not bumped **High Severity** <!-- DESCRIPTION START --> The nested `destination` payload is cached under the same `CACHE_VERSION` as the old flat keys, so Redis keeps serving `destination_city`/`destination_country`. `summary` then reads `p['destination']` and raises `KeyError` for still-cached shipments, and the tracking page keeps getting the previous shape. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: a9632893-308a-4465-9618-6b344e255c50 --> <!-- LOCATIONS START tracker/serializers.py#L18-L19 tracker/service.py#L30-L31 LOCATIONS END --> <details> <summary>Additional Locations (1)</summary> - [`tracker/service.py#L30-L31`](https://github.com/drape-io/crbench-cursor-2026-09/blob/133f0e5b1705a0ecc9e2455f34570bee02601482/tracker/service.py#L30-L31) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojc5YjE4NzE2LTg5YjYtNGJmZC04YTExLTg2MDk1ZTExMDBiOSIsImVuY3J5cHRpb25LZXkiOiJVV1hia213cnJvNVByYVUzT1owUFg4RktQOURKWHFoNGdpSXB5MWo5NTdzIiwiYnJhbmNoIjoicHItMzZhOTQ4MWM3ZiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojc5YjE4NzE2LTg5YjYtNGJmZC04YTExLTg2MDk1ZTExMDBiOSIsImVuY3J5cHRpb25LZXkiOiJVV1hia213cnJvNVByYVUzT1owUFg4RktQOURKWHFoNGdpSXB5MWo5NTdzIiwiYnJhbmNoIjoicHItMzZhOTQ4MWM3ZiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjEwMywiY29tbWl0U2hhIjoiMTMzZjBlNWIxNzA1YTBlY2M5ZTI0NTVmMzQ1NzBiZWUwMjYwMTQ4MiIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 133f0e5b1705a0ecc9e2455f34570bee02601482. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PR-level
<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aToxMmY3Y2YyOS0wMjE2LTRhNGUtODNiMC1mNjE0NjlkNDFlM2MiLCJlbmNyeXB0aW9uS2V5IjoiMDZCRHdaMFBQX01nR1NyWDhNekZnU005WDFMenBySG41VWMxWHBWanRRQSIsImJyYW5jaCI6InByLTM2YTk0ODFjN2YiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 133f0e5b1705a0ecc9e2455f34570bee02601482. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact medium
The serializer docstring calls this the JSON shape the API returns, and `search` returns it to callers. The diff removes the flat `destination_city`/`destination_country` keys and nests them, with no fallback. Any client that reads the old keys breaks. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
tracker/serializers.py:19
**Old cached payloads crash summary after deploy** The payload shape changed but `CACHE_VERSION` wasn't bumped, so Redis entries written before the deploy are still served under the same key. `summary` then hits a KeyError on `p['destination']`, and `search`/`shipment_payload` return a mix of old and new shapes. Bump `CACHE_VERSION` in tracker/cache.py (e.g. to 7) along with this change. ``` tracker/serializers.py:19 "destination": {"city": shipment.destination_city, "country": shipment.destination_country}, tracker/service.py:31 destination = f"{p['destination']['city']}, {p['destination']['country']}" tracker/cache.py:8 CACHE_VERSION = 6 tracker/cache.py:11 def key_for(shipment_id: int) -> str: tracker/cache.py:12 return f"shipment:v{CACHE_VERSION}:{shipment_id}" tracker/cache.py:28 def get(self, shipment_id: int) -> dict[str, object] | None: tracker/cache.py:29 raw = self._backend.get(key_for(shipment_id)) tracker/cache.py:30 return None if raw is None else json.loads(raw) tracker/service.py:20 cached = self._cache.get(shipment_id) tracker/service.py:21 if cached is not None: ```
tracker/serializers.py:19
**API payload drops `destination_city` fields clients use** `search` returns this payload to API callers. The top-level `destination_city`/`destination_country` keys are gone with no deprecation or versioning, so existing clients that read them break. Keep the flat keys next to `destination` until clients have migrated. ``` tracker/serializers.py:19 "destination": {"city": shipment.destination_city, "country": shipment.destination_country}, tracker/serializers.py:19 (base) "destination_city": shipment.destination_city, tracker/serializers.py:20 (base) "destination_country": shipment.destination_country, tracker/service.py:1 """Shipment tracking: the operations the API exposes.""" tracker/service.py:38 def search(self, tracking_number: str) -> dict[str, object] | None: tracker/service.py:39 shipment = self._store.find_by_tracking_number(tracking_number) tracker/service.py:40 return None if shipment is None else self.shipment_payload(shipment.id) ```
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (1)
tracker/serializers.py:19
**Payload shape changed without bumping cache version** The payload now nests destination, but `CACHE_VERSION` in cache.py is still 6. Redis entries written before deploy keep the flat shape, and `summary()` raises KeyError on them (and `search()` returns the old shape) until they are evicted. Bump CACHE_VERSION to 7 in tracker/cache.py. ``` tracker/serializers.py:19 "destination": {"city": shipment.destination_city, "country": shipment.destination_country}, tracker/service.py:31 destination = f"{p['destination']['city']}, {p['destination']['country']}" tracker/cache.py:8 CACHE_VERSION = 6 tracker/cache.py:12 return f"shipment:v{CACHE_VERSION}:{shipment_id}" docs/architecture.md:3 The API is a single stateless service behind a load balancer. Shipments live in Postgres and docs/architecture.md:4 serialized shipment payloads are cached in Redis. ```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
tracker/service.py:31
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Stale Cache Breaks Summaries** If Redis contains an existing `shipment:v6:*` entry, it still has the flat `destination_city` and `destination_country` fields. `shipment_payload()` returns that cached value without running the updated serializer, so this nested lookup raises `KeyError: 'destination'` and breaks the support summary. Bump the cache version alongside this payload schema change.
PR-level
<!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=66790199"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a>Confidence Score: 4/5</h2> The PR is not safe to merge until the cache namespace is advanced or old cached payloads are migrated. <h2>Findings</h2> 1. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top">&nbsp;**Stale Cache Breaks Summaries** <a href="https://github.com/drape-io/crbench-greptile-2026-09/pull/103#discussion_r4059119123">▶</a> <h3>Summary</h3> This PR replaces the two top-level destination fields in shipment payloads with a nested `destination` object and updates support summaries to consume that object. - Adds `destination.city` and `destination.country` to serialized shipments. - Updates support-summary formatting for the nested shape. - Leaves the serialized-payload cache version unchanged, allowing old payloads to reach the new reader. <details open><summary>Diagram</summary> ```mermaid %%{init: {'theme': 'neutral'}}%% flowchart LR Request[Summary request] --> Cache{Version 6 cache hit?} Cache -->|Yes: old flat payload| Old[destination_city / destination_country] Cache -->|No| Serializer[Updated serializer] Serializer --> New[destination.city / destination.country] Old --> Reader[Updated summary reader] New --> Reader Reader -->|Old payload| Failure[KeyError: destination] Reader -->|New payload| Summary[Formatted support summary] ``` </details> <sub>Reviews (1) · Last reviewed commit: ["Nest the destination in shipment payload..."](https://github.com/drape-io/crbench-greptile-2026-09/commit/093abb217ea7f61b2120df764c722b898052ed2f)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · impact high
The change switches the serialized payload to a nested shape, but CACHE_VERSION stays at 6 and put() sets no TTL. So old flat entries stored under the same key are still returned, and summary indexes p['destination'] on them, which raises KeyError. [grounded: diff] [consensus 3/3: valid=3]
valid · matches d1 · impact high
raw comments (2)
tracker/serializers.py:19
[P1] Payload shape changed but the cache key version was not bumped `ShipmentCache` keeps `json.dumps(shipment_to_payload(...))` in Redis under `shipment:v{CACHE_VERSION}:{id}`. `CACHE_VERSION` is still 6 and `put` sets no expiry, so payloads cached before this change keep the old flat shape (`destination_city`/`destination_country`) indefinitely. After deploy, `TrackingService.shipment_payload` and `search` return those old entries and API clients get a mix of old and new shapes. `summary` (tracker/service.py:31) raises `KeyError: 'destination'` for every shipment that was already cached. The same thing happens the other way during a rolling deploy (`replicaCount: 2`, shared Redis): old pods read new nested entries and fail on `p['destination_city']`. Bumping `CACHE_VERSION` in tracker/cache.py together with this shape change would keep the old and new formats under separate keys.
tracker/serializers.py:19
[P1] Payload shape changed without bumping CACHE_VERSION, so cached entries break `summary` · This change replaces the flat `destination_city`/`destination_country` keys with a nested `destination` object. But cached payloads are still read and written under `shipment:v6:{id}` (`tracker/cache.py:8`). `ShipmentCache.put` never sets a TTL, so payloads Redis cached before this deploy keep being served by `shipment_payload` indefinitely, and the new `summary` raises `KeyError: 'destination'` when it reads `p['destination']['city']` from them. During a rolling deploy, old pods also keep writing flat-shaped payloads under the same key, so new pods hit the same error. API callers would also get mixed payload shapes depending on whether the cache was hit. Every earlier payload-shape change in this repo bumped `CACHE_VERSION` (carrier, destination, weight, ETA, status enum), and this one needs the same bump.
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact high
The serializer changed the payload shape, but the cache key version was left at 6 and put() sets no TTL. So flat entries written before the deploy are still returned by shipment_payload(), and summary() then raises KeyError on p['destination']. Old pods running mid-deploy hit the same problem the other way round when they read the new nested entries. [grounded: tree tracker/cache.py] [consensus 3/3: valid=3]
raw comments (2)
tracker/serializers.py:19
[P1] Payload shape changed without bumping CACHE_VERSION `shipment_to_payload` now emits a nested `destination` object, but `CACHE_VERSION` in `tracker/cache.py` (currently 6, and bumped on earlier payload-shape changes) is unchanged. Redis entries written before deploy still have the flat `destination_city` and `destination_country` keys under the same `shipment:v6:*` keys. After deploy, `shipment_payload` returns those stale entries from `ShipmentCache.get`. `summary()` then raises `KeyError: 'destination'`, and `search()` and `shipment_payload()` return the old shape to callers. This persists until each entry is invalidated or evicted, and Redis is shared across instances during a rolling deploy. Bumping `CACHE_VERSION` to 7 in the same change avoids it.
tracker/serializers.py:19
[P1] Payload shape changed without bumping CACHE_VERSION The serialized payload now nests `destination`, but `CACHE_VERSION` in `tracker/cache.py` is still 6, so the cache key is unchanged. `ShipmentCache.put` sets no TTL, so existing Redis entries written with the old flat `destination_city`/`destination_country` shape stay valid indefinitely. After deploy, `shipment_payload()` returns those stale entries from the cache. `summary()` then raises `KeyError: 'destination'` for any shipment cached before the deploy. The same mismatch occurs in reverse during a rolling deploy: old pods read new nested entries and fail on `p['destination_city']`. Any other consumer of the cached payload also sees an inconsistent shape. The key version should be bumped alongside this serializer change so old and new shapes don't share keys.
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (3)
tracker/service.py:31
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 1\. Cached shipments crash support summaries <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>TrackingService.summary</i></b> now indexes <b><i>p[&#x27;destination&#x27;][&#x27;city&#x27;]</i></b>, but cache entries under version 6 can still contain the previous top-level destination fields. After deployment, a shipment served from such an entry raises <b><i>KeyError</i></b> before returning a summary, and <b><i>shipment_payload</i></b> also continues exposing the old shape until that cache entry is replaced. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description The summary now requires a nested `destination` object, but the cache keeps using version 6, so pre-deployment entries with `destination_city` and `destination_country` can be returned after rollout and cause `summary()` to raise `KeyError`. ## Fix Focus Areas - tracker/cache.py[10-10] - tracker/service.py[27-32] ## Recommended Fix Bump `CACHE_VERSION` so all existing cached payloads are bypassed after deployment, or add explicit cache-shape validation/migration before returning a cached payload. Ensure both `shipment_payload()` and `summary()` always operate on the nested destination shape. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
PR-level
<h3>Code Review by Qodo</h3> <code>🐞 Bugs (1)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <br/> <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> <details> <summary> 1. Cached shipments crash support summaries <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>TrackingService.summary</i></b> now indexes <b><i>p[&#x27;destination&#x27;][&#x27;city&#x27;]</i></b>, but cache entries under version 6 >can still contain the previous top-level destination fields. After deployment, a shipment served >from such an entry raises <b><i>KeyError</i></b> before returning a summary, and <b><i>shipment_payload</i></b> also >continues exposing the old shape until that cache entry is replaced. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[tracker/service.py[31]](https://github.com/drape-io/crbench-qodo-2026-09/pull/103/files#diff-c765d0913a406bf2ed144c979a40131c4d4d7da3311c0628d2546603ad473d35R31-R31)</code> > >```diff >+ destination = f"{p['destination']['city']}, {p['destination']['country']}" >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >The changed serializer writes the nested destination shape, while <b><i>ShipmentCache</i></b> still reads and >writes keys using unchanged cache version 6. Redis-backed cache entries therefore survive the >rollout with the old flattened payload, and the changed summary directly indexes the missing nested >key. ></pre> > > <code>[tracker/service.py[27-32]](https://github.com/drape-io/crbench-qodo-2026-09/blob/00a6b4a429d496e8174144b02fd0bfda6cf0423d/tracker/service.py/#L27-L32)</code> > <code>[tracker/serializers.py[12-21]](https://github.com/drape-io/crbench-qodo-2026-09/blob/00a6b4a429d496e8174144b02fd0bfda6cf0423d/tracker/serializers.py/#L12-L21)</code> > <code>[tracker/cache.py[10-29]](https://github.com/drape-io/crbench-qodo-2026-09/blob/00a6b4a429d496e8174144b02fd0bfda6cf0423d/tracker/cache.py/#L10-L29)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >The summary now requires a nested `destination` object, but the cache keeps using version 6, so pre-deployment entries with `destination_city` and `destination_country` can be returned after rollout and cause `summary()` to raise `KeyError`. > >## Fix Focus Areas >- tracker/cache.py[10-10] >- tracker/service.py[27-32] > >## Recommended Fix >Bump `CACHE_VERSION` so all existing cached payloads are bypassed after deployment, or add explicit cache-shape validation/migration before returning a cached payload. Ensure both `shipment_payload()` and `summary()` always operate on the nested destination shape. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-context:start --> <details><summary><strong>Context sources</strong></summary> <div>Review mode: <code>🚀 Fast</code>: This is a small, localized payload-shape change with one corresponding consumer update and no high-risk concerns.</div> <!-- qodo-context:end --> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:start --> <details> <summary><strong>Tip of the day</strong></summary> <br/> <pre>💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR</pre> <a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:end --> <!-- https://github.com/drape-io/crbench-qodo-2026-09/commit/00a6b4a429d496e8174144b02fd0bfda6cf0423d --> <a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>
PR-level
<h3>PR Summary by Qodo</h3> Nest destination fields in shipment payloads <code>✨ Enhancement</code> <code>🕐 Less than 10 minutes</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <details> <summary>AI Description</summary> <dl> <dd> <br/> ><pre> >• Nests city and country in an extensible destination payload object. >• Updates support summaries to read the new destination shape. ></pre> </dd> </dl> </details> <details> <summary>Diagram</summary> <dl> <dd> <br/> ```mermaid sequenceDiagram participant Consumer as API / Support participant Service as Tracking Service participant Cache as Shipment Cache participant Serializer as Payload Serializer Consumer->>Service: Request shipment data Service->>Cache: Read payload alt Cache miss Service->>Serializer: Serialize shipment Serializer-->>Service: Nested destination Service->>Cache: Store payload end Service-->>Consumer: Payload or summary ``` </dd> </dl> </details> <details> <summary>High-Level Assessment</summary> <dl> <dd> <br/> >A nested destination object is the appropriate approach because it keeps related location fields together and supports future postcode or coordinate additions without adding more top-level keys. A separate domain value object would be unnecessary while the change remains limited to the external payload contract. Because serialized payloads are cached under versioned keys, deployment should invalidate or version-bump pre-change cache entries to prevent consumers from receiving the old flat shape. </dd> </dl> </details> <details> <summary> Files changed (2) <code> +2 / -3 </code> </summary> <dl> <dd> <br/> <details> <summary>Enhancement (2) <code> +2 / -3 </code></summary> <dl> <dd> <details> <summary>serializers.py<code>Nest destination fields in serialized shipments</code> <code>+1/-2</code></summary> <br/> >Nest destination fields in serialized shipments > ><pre> >• Replaces the top-level destination_city and destination_country keys with a destination object containing city and country. This creates an extensible location structure for future fields. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/103/files#diff-f7853b9744af3856616afb137f4acb3c8b4fa56fd39decdc9499f6ca6892a9b7'>tracker/serializers.py</a> </details> <details> <summary>service.py<code>Read nested destination fields in support summaries</code> <code>+1/-1</code></summary> <br/> >Read nested destination fields in support summaries > ><pre> >• Updates summary formatting to retrieve city and country from the new destination object while preserving the existing output text. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/103/files#diff-c765d0913a406bf2ed144c979a40131c4d4d7da3311c0628d2546603ad473d35'>tracker/service.py</a> </details> </dd> </dl> </details> </dd> </dl> </details>