Datasets:
Publish devopsbench-100 v2 realism release (part 3)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- task_files/dob100-036-port-close-blocked-issues/05-deployment-state.json +254 -0
- task_files/dob100-036-port-close-blocked-issues/06-repository-context.txt +8 -0
- task_files/dob100-036-port-close-blocked-issues/07-ci-and-tests.csv +85 -0
- task_files/dob100-036-port-close-blocked-issues/08-data-change-controls.sql +12 -0
- task_files/dob100-036-port-close-blocked-issues/09-feature-and-security.yaml +181 -0
- task_files/dob100-036-port-close-blocked-issues/10-vendor-trackers.json +170 -0
- task_files/dob100-036-port-close-blocked-issues/11-knowledge-base.md +101 -0
- task_files/dob100-036-port-close-blocked-issues/12-chat-and-status.json +126 -0
- task_files/dob100-036-port-close-blocked-issues/13-approval-and-ownership.md +76 -0
- task_files/dob100-036-port-close-blocked-issues/14-tool-contracts.json +255 -0
- task_files/dob100-037-port-copy-priority-issues/01-work-ticket.md +228 -0
- task_files/dob100-037-port-copy-priority-issues/02-service-catalog.csv +12 -0
- task_files/dob100-037-port-copy-priority-issues/03-observability.log +17 -0
- task_files/dob100-037-port-copy-priority-issues/04-incident-room.json +236 -0
- task_files/dob100-037-port-copy-priority-issues/05-deployment-state.json +254 -0
- task_files/dob100-037-port-copy-priority-issues/06-repository-context.txt +23 -0
- task_files/dob100-037-port-copy-priority-issues/07-ci-and-tests.csv +85 -0
- task_files/dob100-037-port-copy-priority-issues/08-data-change-controls.sql +12 -0
- task_files/dob100-037-port-copy-priority-issues/09-feature-and-security.yaml +163 -0
- task_files/dob100-037-port-copy-priority-issues/10-vendor-trackers.json +426 -0
- task_files/dob100-037-port-copy-priority-issues/11-knowledge-base.md +200 -0
- task_files/dob100-037-port-copy-priority-issues/12-chat-and-status.json +102 -0
- task_files/dob100-037-port-copy-priority-issues/13-approval-and-ownership.md +76 -0
- task_files/dob100-037-port-copy-priority-issues/14-tool-contracts.json +306 -0
- task_files/dob100-038-port-count-inflight-work/01-work-ticket.md +41 -0
- task_files/dob100-038-port-count-inflight-work/02-service-catalog.csv +13 -0
- task_files/dob100-038-port-count-inflight-work/03-observability.log +20 -0
- task_files/dob100-038-port-count-inflight-work/04-incident-room.json +226 -0
- task_files/dob100-038-port-count-inflight-work/05-deployment-state.json +254 -0
- task_files/dob100-038-port-count-inflight-work/06-repository-context.txt +7 -0
- task_files/dob100-038-port-count-inflight-work/07-ci-and-tests.csv +85 -0
- task_files/dob100-038-port-count-inflight-work/08-data-change-controls.sql +12 -0
- task_files/dob100-038-port-count-inflight-work/09-feature-and-security.yaml +181 -0
- task_files/dob100-038-port-count-inflight-work/10-vendor-trackers.json +181 -0
- task_files/dob100-038-port-count-inflight-work/11-knowledge-base.md +92 -0
- task_files/dob100-038-port-count-inflight-work/12-chat-and-status.json +126 -0
- task_files/dob100-038-port-count-inflight-work/13-approval-and-ownership.md +76 -0
- task_files/dob100-038-port-count-inflight-work/14-tool-contracts.json +260 -0
- task_files/dob100-039-port-count-unowned-work/01-work-ticket.md +30 -0
- task_files/dob100-039-port-count-unowned-work/02-service-catalog.csv +13 -0
- task_files/dob100-039-port-count-unowned-work/03-observability.log +20 -0
- task_files/dob100-039-port-count-unowned-work/04-incident-room.json +226 -0
- task_files/dob100-039-port-count-unowned-work/05-deployment-state.json +254 -0
- task_files/dob100-039-port-count-unowned-work/06-repository-context.txt +7 -0
- task_files/dob100-039-port-count-unowned-work/07-ci-and-tests.csv +85 -0
- task_files/dob100-039-port-count-unowned-work/08-data-change-controls.sql +12 -0
- task_files/dob100-039-port-count-unowned-work/09-feature-and-security.yaml +181 -0
- task_files/dob100-039-port-count-unowned-work/10-vendor-trackers.json +181 -0
- task_files/dob100-039-port-count-unowned-work/11-knowledge-base.md +92 -0
- task_files/dob100-039-port-count-unowned-work/12-chat-and-status.json +126 -0
task_files/dob100-036-port-close-blocked-issues/05-deployment-state.json
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"deployment_id",
|
| 6 |
+
"service",
|
| 7 |
+
"environment",
|
| 8 |
+
"version",
|
| 9 |
+
"status",
|
| 10 |
+
"canary_percent"
|
| 11 |
+
],
|
| 12 |
+
"row_count": 22,
|
| 13 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 14 |
+
"table": "deployments",
|
| 15 |
+
"task_relevant_rows": [
|
| 16 |
+
{
|
| 17 |
+
"canary_percent": 100,
|
| 18 |
+
"deployment_id": 9251,
|
| 19 |
+
"environment": "staging",
|
| 20 |
+
"service": "storefront-web",
|
| 21 |
+
"status": "succeeded",
|
| 22 |
+
"version": "v3.2.4"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"canary_percent": 100,
|
| 26 |
+
"deployment_id": 9252,
|
| 27 |
+
"environment": "production",
|
| 28 |
+
"service": "storefront-web",
|
| 29 |
+
"status": "succeeded",
|
| 30 |
+
"version": "v3.2.4"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"canary_percent": 100,
|
| 34 |
+
"deployment_id": 9253,
|
| 35 |
+
"environment": "staging",
|
| 36 |
+
"service": "api-gateway",
|
| 37 |
+
"status": "succeeded",
|
| 38 |
+
"version": "v5.0.9"
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"canary_percent": 100,
|
| 42 |
+
"deployment_id": 9254,
|
| 43 |
+
"environment": "production",
|
| 44 |
+
"service": "api-gateway",
|
| 45 |
+
"status": "succeeded",
|
| 46 |
+
"version": "v5.0.9"
|
| 47 |
+
}
|
| 48 |
+
]
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"columns": [
|
| 52 |
+
"route_id",
|
| 53 |
+
"service",
|
| 54 |
+
"route",
|
| 55 |
+
"rps",
|
| 56 |
+
"share_pct"
|
| 57 |
+
],
|
| 58 |
+
"row_count": 13,
|
| 59 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 60 |
+
"table": "traffic_profile",
|
| 61 |
+
"task_relevant_rows": [
|
| 62 |
+
{
|
| 63 |
+
"route": "GET /",
|
| 64 |
+
"route_id": 9201,
|
| 65 |
+
"rps": 420,
|
| 66 |
+
"service": "storefront-web",
|
| 67 |
+
"share_pct": 100
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"route": "GET /product/:id",
|
| 71 |
+
"route_id": 9202,
|
| 72 |
+
"rps": 310,
|
| 73 |
+
"service": "storefront-web",
|
| 74 |
+
"share_pct": 100
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"route": "POST /v1/orders",
|
| 78 |
+
"route_id": 9203,
|
| 79 |
+
"rps": 145,
|
| 80 |
+
"service": "api-gateway",
|
| 81 |
+
"share_pct": 100
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"route": "POST /v2/orders",
|
| 85 |
+
"route_id": 9204,
|
| 86 |
+
"rps": 0,
|
| 87 |
+
"service": "api-gateway",
|
| 88 |
+
"share_pct": 0
|
| 89 |
+
}
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"columns": [
|
| 94 |
+
"service",
|
| 95 |
+
"desired_replicas",
|
| 96 |
+
"ready_replicas",
|
| 97 |
+
"strategy",
|
| 98 |
+
"storage_class"
|
| 99 |
+
],
|
| 100 |
+
"row_count": 10,
|
| 101 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 102 |
+
"table": "k8s_deployments",
|
| 103 |
+
"task_relevant_rows": [
|
| 104 |
+
{
|
| 105 |
+
"desired_replicas": 2,
|
| 106 |
+
"ready_replicas": 1,
|
| 107 |
+
"service": "analytics-worker",
|
| 108 |
+
"storage_class": "standard",
|
| 109 |
+
"strategy": "RollingUpdate"
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"desired_replicas": 3,
|
| 113 |
+
"ready_replicas": 3,
|
| 114 |
+
"service": "api-gateway",
|
| 115 |
+
"storage_class": "standard",
|
| 116 |
+
"strategy": "RollingUpdate"
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"desired_replicas": 3,
|
| 120 |
+
"ready_replicas": 3,
|
| 121 |
+
"service": "catalog",
|
| 122 |
+
"storage_class": "standard",
|
| 123 |
+
"strategy": "RollingUpdate"
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"desired_replicas": 64,
|
| 127 |
+
"ready_replicas": 6,
|
| 128 |
+
"service": "checkout",
|
| 129 |
+
"storage_class": "standard",
|
| 130 |
+
"strategy": "RollingUpdate"
|
| 131 |
+
}
|
| 132 |
+
]
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"columns": [
|
| 136 |
+
"pod",
|
| 137 |
+
"namespace",
|
| 138 |
+
"service",
|
| 139 |
+
"image_tag",
|
| 140 |
+
"phase",
|
| 141 |
+
"restarts",
|
| 142 |
+
"memory_limit_mb",
|
| 143 |
+
"memory_usage_mb",
|
| 144 |
+
"node",
|
| 145 |
+
"pending_reason"
|
| 146 |
+
],
|
| 147 |
+
"row_count": 14,
|
| 148 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 149 |
+
"table": "k8s_pods",
|
| 150 |
+
"task_relevant_rows": [
|
| 151 |
+
{
|
| 152 |
+
"image_tag": "v2.1.7",
|
| 153 |
+
"memory_limit_mb": 512,
|
| 154 |
+
"memory_usage_mb": 511,
|
| 155 |
+
"namespace": "production",
|
| 156 |
+
"node": "node-a1",
|
| 157 |
+
"pending_reason": "",
|
| 158 |
+
"phase": "CrashLoopBackOff",
|
| 159 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 160 |
+
"restarts": 47,
|
| 161 |
+
"service": "analytics-worker"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"image_tag": "v2.1.7",
|
| 165 |
+
"memory_limit_mb": 512,
|
| 166 |
+
"memory_usage_mb": 498,
|
| 167 |
+
"namespace": "production",
|
| 168 |
+
"node": "node-a1",
|
| 169 |
+
"pending_reason": "",
|
| 170 |
+
"phase": "Running",
|
| 171 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 172 |
+
"restarts": 39,
|
| 173 |
+
"service": "analytics-worker"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"image_tag": "v2.6.3",
|
| 177 |
+
"memory_limit_mb": 2048,
|
| 178 |
+
"memory_usage_mb": 890,
|
| 179 |
+
"namespace": "production",
|
| 180 |
+
"node": "node-a1",
|
| 181 |
+
"pending_reason": "",
|
| 182 |
+
"phase": "Running",
|
| 183 |
+
"pod": "checkout-5b8c-aa10",
|
| 184 |
+
"restarts": 0,
|
| 185 |
+
"service": "checkout"
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"image_tag": "v2.7.0",
|
| 189 |
+
"memory_limit_mb": 2048,
|
| 190 |
+
"memory_usage_mb": 1120,
|
| 191 |
+
"namespace": "production",
|
| 192 |
+
"node": "node-a2",
|
| 193 |
+
"pending_reason": "",
|
| 194 |
+
"phase": "Running",
|
| 195 |
+
"pod": "payments-6c1d-bb22",
|
| 196 |
+
"restarts": 0,
|
| 197 |
+
"service": "payments"
|
| 198 |
+
}
|
| 199 |
+
]
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"columns": [
|
| 203 |
+
"event_id",
|
| 204 |
+
"namespace",
|
| 205 |
+
"pod",
|
| 206 |
+
"reason",
|
| 207 |
+
"message",
|
| 208 |
+
"count",
|
| 209 |
+
"day"
|
| 210 |
+
],
|
| 211 |
+
"row_count": 8,
|
| 212 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 213 |
+
"table": "k8s_events",
|
| 214 |
+
"task_relevant_rows": [
|
| 215 |
+
{
|
| 216 |
+
"count": 47,
|
| 217 |
+
"day": 419,
|
| 218 |
+
"event_id": 9001,
|
| 219 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 220 |
+
"namespace": "production",
|
| 221 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 222 |
+
"reason": "OOMKilled"
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"count": 47,
|
| 226 |
+
"day": 419,
|
| 227 |
+
"event_id": 9002,
|
| 228 |
+
"message": "Back-off restarting failed container analytics",
|
| 229 |
+
"namespace": "production",
|
| 230 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 231 |
+
"reason": "CrashLoopBackOff"
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"count": 39,
|
| 235 |
+
"day": 420,
|
| 236 |
+
"event_id": 9003,
|
| 237 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 238 |
+
"namespace": "production",
|
| 239 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 240 |
+
"reason": "OOMKilled"
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"count": 1,
|
| 244 |
+
"day": 417,
|
| 245 |
+
"event_id": 9004,
|
| 246 |
+
"message": "Stopping container gateway for rollout",
|
| 247 |
+
"namespace": "production",
|
| 248 |
+
"pod": "api-gateway-9f2e-cc33",
|
| 249 |
+
"reason": "Killing"
|
| 250 |
+
}
|
| 251 |
+
]
|
| 252 |
+
}
|
| 253 |
+
]
|
| 254 |
+
}
|
task_files/dob100-036-port-close-blocked-issues/06-repository-context.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"content": "\"\"\"Integration coverage for checkout idempotency.\n\nSuite: integration. Tracked as flaky in CI under ENG-2401 -- reruns pass.\n\"\"\"\nfrom __future__ import annotations\n\nimport time\n\nimport pytest\n\nfrom checkout.orchestrator import submit_order\nfrom tests.helpers import make_cart, reset_orders\n\n\ndef build_idempotency_key(prefix=\"test\"):\n # One key per wall-clock second is plenty: the suite never runs two cases\n # inside the same second. (CI shards this suite across four workers, so it\n # very much does, and the workers then generate identical keys.)\n return \"%s-%d\" % (prefix, int(time.time()))\n\n\n@pytest.fixture(autouse=True)\ndef clean_orders():\n reset_orders()\n yield\n reset_orders()\n\n\ndef test_duplicate_submit_returns_same_order():\n key = build_idempotency_key()\n cart = make_cart(items=3, total_cents=4599)\n\n first = submit_order(cart, idempotency_key=key)\n second = submit_order(cart, idempotency_key=key)\n\n assert first.order_id == second.order_id\n assert second.replayed is True\n\n\ndef test_distinct_keys_create_distinct_orders():\n cart = make_cart(items=1, total_cents=1299)\n\n left = submit_order(cart, idempotency_key=build_idempotency_key(\"left\"))\n right = submit_order(cart, idempotency_key=build_idempotency_key(\"right\"))\n\n assert left.order_id != right.order_id\n\n\ndef test_capture_failure_releases_inventory(monkeypatch):\n cart = make_cart(items=2, total_cents=2500)\n released = []\n\n monkeypatch.setattr(\n \"checkout.orchestrator.inventory.release\", lambda hold_id: released.append(hold_id)\n )\n monkeypatch.setattr(\n \"checkout.orchestrator.payments.capture\",\n lambda **kwargs: (_ for _ in ()).throw(RuntimeError(\"upstream down\")),\n )\n\n with pytest.raises(Exception):\n submit_order(cart, idempotency_key=build_idempotency_key(\"fail\"))\n\n assert len(released) == 1\n", "file_id": 14, "language": "python", "loc": 64, "owner": "Mei Tanaka", "path": "tests/test_idempotency.py", "service": "checkout", "source_table": "repo_files"}
|
| 2 |
+
{"content": "// Package proxy manages upstream connections for the API gateway.\n//\n// Rewritten in v5.1.0: every route now gets its own transport so per-route TLS\n// material and per-route timeouts are honoured.\npackage proxy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/novacart/api-gateway/internal/config\"\n\t\"github.com/novacart/api-gateway/internal/log\"\n)\n\nconst (\n\tdialTimeout = 2 * time.Second\n\tidleConnTimeout = 90 * time.Second\n\tmaxIdlePerHost = 64\n\thealthCheckEvery = 15 * time.Second\n)\n\n// Conn wraps a transport dedicated to a single upstream.\ntype Conn struct {\n\tUpstream string\n\tTransport *http.Transport\n\tclient *http.Client\n\tdone chan struct{}\n\tcreatedAt time.Time\n}\n\n// Pool hands out upstream connections.\ntype Pool struct {\n\tcfg *config.Upstreams\n\tinFlight int64\n}\n\nfunc NewPool(cfg *config.Upstreams) *Pool { return &Pool{cfg: cfg} }\n\n// Acquire builds a connection for the given upstream. Building a transport is\n// cheap, so v5.1.0 does it per request rather than keeping long-lived ones.\nfunc (p *Pool) Acquire(ctx context.Context, upstream string) (*Conn, error) {\n\tif upstream == \"\" {\n\t\treturn nil, fmt.Errorf(\"proxy: empty upstream\")\n\t}\n\tatomic.AddInt64(&p.inFlight, 1)\n\n\ttransport := &http.Transport{\n\t\tDialContext: (&net.Dialer{Timeout: dialTimeout}).DialContext,\n\t\tTLSClientConfig: p.cfg.TLSFor(upstream),\n\t\tMaxIdleConnsPerHost: maxIdlePerHost,\n\t\tIdleConnTimeout: idleConnTimeout,\n\t}\n\n\tc := &Conn{Upstream: upstream, Transport: transport, done: make(chan struct{}),\n\t\tclient: &http.Client{Transport: transport}, createdAt: time.Now()}\n\n\t// Watchdog: keep probing this upstream for as long as the connection lives.\n\tgo func() {\n\t\tticker := time.NewTicker(healthCheckEvery)\n\t\tdefer ticker.Stop()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ticker.C:\n\t\t\t\tp.probe(c)\n\t\t\tcase <-c.done:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\tlog.Debugf(\"acquired upstream=%s in_flight=%d\", upstream, atomic.LoadInt64(&p.inFlight))\n\treturn c, nil\n}\n\n// Release closes the transport and stops the watchdog goroutine.\n//\n// NOTE: the v5.1.0 rewrite dropped the call to Release from Do -- the handler\n// returns as soon as it has the response. Nothing else calls it, so every\n// request leaves behind an idle transport plus a live watchdog goroutine.\nfunc (p *Pool) Release(c *Conn) {\n\tclose(c.done)\n\tc.Transport.CloseIdleConnections()\n\tatomic.AddInt64(&p.inFlight, -1)\n\tlog.Debugf(\"released upstream=%s age=%s\", c.Upstream, time.Since(c.createdAt))\n}\n\nfunc (p *Pool) probe(c *Conn) {\n\treq, _ := http.NewRequest(http.MethodHead, \"http://\"+c.Upstream+\"/healthz\", nil)\n\tif resp, err := c.client.Do(req); err == nil {\n\t\t_ = resp.Body.Close()\n\t}\n}\n\n// Do proxies a single request to the named upstream.\nfunc (p *Pool) Do(ctx context.Context, upstream string, req *http.Request) (*http.Response, error) {\n\tc, err := p.Acquire(ctx, upstream)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"acquire %s: %w\", upstream, err)\n\t}\n\n\tresp, err := c.client.Do(req.WithContext(ctx))\n\tif err != nil {\n\t\tlog.Errorf(\"upstream=%s request failed: %v\", upstream, err)\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}\n", "file_id": 25, "language": "go", "loc": 111, "owner": "Priya Nair", "path": "internal/proxy/pool.go", "service": "api-gateway", "source_table": "repo_files"}
|
| 3 |
+
{"additions": 214, "author": "Priya Nair", "commit_id": 1, "day": 1, "deletions": 0, "files": "internal/router/routes.go,internal/config/config.go", "message": "api-gateway: initial edge skeleton with healthz and access log", "service": "api-gateway", "sha": "3f8a1c2", "source_table": "commits"}
|
| 4 |
+
{"additions": 96, "author": "Sam Whitfield", "commit_id": 2, "day": 2, "deletions": 0, "files": "src/catalog/models.py", "message": "catalog: define Product and Money value objects", "service": "catalog", "sha": "9d41b07", "source_table": "commits"}
|
| 5 |
+
{"additions": 74, "author": "Nina Kowalski", "commit_id": 3, "day": 3, "deletions": 0, "files": "src/checkout/config.py", "message": "checkout: bootstrap service package and settings module", "service": "checkout", "sha": "c72e5a9", "source_table": "commits"}
|
| 6 |
+
{"additions": 131, "author": "Diego Ramos", "commit_id": 4, "day": 4, "deletions": 0, "files": "src/payments/capture.py", "message": "payments: wire libpayproc client and capture happy path", "service": "payments", "sha": "18be6d4", "source_table": "commits"}
|
| 7 |
+
{"author": "Priya Nair", "body": "Perf: new upstream pool.", "merged_version": "v5.1.0", "number": 9201, "service": "api-gateway", "source_table": "pull_requests", "status": "merged", "ticket_key": "", "title": "Connection pool rewrite"}
|
| 8 |
+
{"author": "Diego Ramos", "body": "Draft, do not merge yet.", "merged_version": "", "number": 9202, "service": "catalog", "source_table": "pull_requests", "status": "open", "ticket_key": "", "title": "Price rounding cleanup"}
|
task_files/dob100-036-port-close-blocked-issues/07-ci-and-tests.csv
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_table,detail,exercise_id,func,hidden_tests,name,path,pr_number,quarantined,run_id,service,spec,stage,stage_id,starter,status,suite,test_id,visible_tests
|
| 2 |
+
ci_runs,all checks passed,,,,,,9201,,1,api-gateway,,,,,passed,,,
|
| 3 |
+
ci_runs,intermittent failure: test_checkout_idempotency (rerun may pass),,,,,,,,2,checkout,,,,,failed,,,
|
| 4 |
+
ci_runs,all checks passed,,,,,,,,3,checkout,,,,,passed,,,
|
| 5 |
+
ci_runs,all checks passed,,,,,,,,4,payments,,,,,passed,,,
|
| 6 |
+
ci_stages,ok,,,,,,,,1,,,build,1,,passed,,,
|
| 7 |
+
ci_stages,ok,,,,,,,,1,,,unit,2,,passed,,,
|
| 8 |
+
ci_stages,ok,,,,,,,,1,,,integration,3,,passed,,,
|
| 9 |
+
ci_stages,ok,,,,,,,,1,,,regression,4,,passed,,,
|
| 10 |
+
tests_catalog,,,,,test_cart_totals,,,0,,checkout,,,,,passing,unit,9901,
|
| 11 |
+
tests_catalog,,,,,test_checkout_idempotency,,,0,,checkout,,,,,flaky,integration,9902,
|
| 12 |
+
tests_catalog,,,,,test_capture_retries,,,0,,payments,,,,,passing,unit,9903,
|
| 13 |
+
tests_catalog,,,,,test_ranking,,,0,,search,,,,,passing,unit,9904,
|
| 14 |
+
code_exercises,,9401,next_delay_ms,"[[""attempt 1 is base_ms, not double"", ""assert next_delay_ms(1, 100, 10000) == 100""], [""the cap is a ceiling on the value"", ""assert next_delay_ms(9, 100, 5000) == 5000""], [""the cap applies at the boundary"", ""assert next_delay_ms(6, 100, 3200) == 3200""], [""attempt below 1 is not a retry"", ""try:\n next_delay_ms(0, 100, 10000)\nexcept ValueError:\n pass\nelse:\n raise AssertionError('attempt 0 must raise ValueError')""]]",,src/payments/backoff.py,,,,payments,"Implement next_delay_ms(attempt, base_ms, max_ms).
|
| 15 |
+
|
| 16 |
+
Retries are numbered from 1: the delay before the FIRST retry is attempt=1.
|
| 17 |
+
The delay doubles with each attempt - base_ms for attempt 1, twice that for
|
| 18 |
+
attempt 2, four times for attempt 3 - and is capped at max_ms. The cap is a
|
| 19 |
+
ceiling on the returned value, not on the exponent.
|
| 20 |
+
|
| 21 |
+
attempt < 1 is not a retry and must raise ValueError.",,,"""""""Backoff schedule for the payments retry path.""""""
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def next_delay_ms(attempt, base_ms, max_ms):
|
| 25 |
+
""""""Delay before retry number `attempt`, capped at max_ms.""""""
|
| 26 |
+
raise NotImplementedError
|
| 27 |
+
",,,,"[[""the delay doubles"", ""assert next_delay_ms(3, 100, 10000) == 2 * next_delay_ms(2, 100, 10000)""], [""delays are positive"", ""assert next_delay_ms(2, 100, 10000) > 0""]]"
|
| 28 |
+
code_exercises,,9402,chunk,"[[""empty input produces no groups"", ""assert chunk([], 3) == []""], [""an exact multiple has no trailing empty group"", ""assert chunk([1, 2, 3, 4], 2) == [[1, 2], [3, 4]]""], [""order is preserved"", ""assert chunk(['a', 'b', 'c'], 1) == [['a'], ['b'], ['c']]""], [""a size below 1 is meaningless"", ""for bad in (0, -1):\n try:\n chunk([1, 2], bad)\n except ValueError:\n pass\n else:\n raise AssertionError('size %r must raise ValueError' % bad)""], [""an iterator is accepted, not just a list"", ""assert chunk(iter([1, 2, 3]), 2) == [[1, 2], [3]]""]]",,src/payments/chunking.py,,,,payments,"Implement chunk(items, size) returning a list of lists.
|
| 29 |
+
|
| 30 |
+
Settlement batches a day's captures so one long-tailed merchant cannot stall
|
| 31 |
+
the run. Split `items` into consecutive groups of at most `size`, preserving
|
| 32 |
+
order. The final group may be shorter. An empty input produces no groups at
|
| 33 |
+
all - not one empty group. A size below 1 is meaningless and must raise
|
| 34 |
+
ValueError.
|
| 35 |
+
|
| 36 |
+
`items` is whatever captures.list_settlable() returned, which is any iterable
|
| 37 |
+
and is sometimes a one-pass generator, so do not assume it can be indexed or
|
| 38 |
+
measured with len().",,,"""""""Batch chunking for nightly settlement.""""""
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def chunk(items, size):
|
| 42 |
+
""""""Split items into consecutive groups of at most `size`.""""""
|
| 43 |
+
raise NotImplementedError
|
| 44 |
+
",,,,"[[""splits with a remainder"", ""assert chunk([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]""]]"
|
| 45 |
+
code_exercises,,9403,cache_key,"[[""insertion order does not matter"", ""a = {}\na['q'] = 'shoes'\na['page'] = 1\nb = {}\nb['page'] = 1\nb['q'] = 'shoes'\nassert cache_key(a) == cache_key(b)""], [""different values differ"", ""assert cache_key({'q': 'shoes'}) != cache_key({'q': 'boots'})""], [""an explicit None is not an absent key"", ""assert cache_key({'q': 'shoes', 'filter': None}) != cache_key({'q': 'shoes'})""], [""keys and values cannot run together"", ""assert cache_key({'a': 'xb', 'b': ''}) != cache_key({'a': 'x', 'bb': ''})""]]",,src/search/cache_key.py,,,,search,"Implement cache_key(params) returning a string.
|
| 46 |
+
|
| 47 |
+
The search result cache is keyed on the query parameters. Two calls with the
|
| 48 |
+
same parameters must produce the same key regardless of the order the keys
|
| 49 |
+
were inserted into the dict, because callers build them in different orders
|
| 50 |
+
and a mismatch silently halves the hit rate.
|
| 51 |
+
|
| 52 |
+
Different parameters must produce different keys. A parameter explicitly set
|
| 53 |
+
to None is not the same request as one that was never supplied. Values may be
|
| 54 |
+
strings, numbers, booleans or None.",,,"""""""Cache key derivation for the search result cache.""""""
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def cache_key(params):
|
| 58 |
+
""""""A stable key for a parameter dict.""""""
|
| 59 |
+
raise NotImplementedError
|
| 60 |
+
",,,,"[[""identical dicts agree"", ""assert cache_key({'q': 'shoes', 'page': 1}) == cache_key({'q': 'shoes', 'page': 1})""]]"
|
| 61 |
+
code_exercises,,9404,TokenBucket,"[[""partial time is not discarded"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(500)\nassert b.allow(1000)""], [""the bucket never exceeds capacity"", ""b = TokenBucket(2, 100)\nassert b.allow(0) and b.allow(0)\nassert b.allow(10000) and b.allow(10000)\nassert not b.allow(10000)""], [""a backwards clock grants nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)""], [""a backwards clock does not wedge the bucket"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)\nassert b.allow(2000)""], [""a refused request consumes nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nfor _ in range(5):\n assert not b.allow(0)\nassert b.allow(1000)""]]",,src/gateway/token_bucket.py,,,,api-gateway,"Implement class TokenBucket(capacity, refill_per_sec) with one method,
|
| 62 |
+
allow(now_ms), returning True if a request may proceed and False otherwise.
|
| 63 |
+
|
| 64 |
+
A bucket starts full. Each allowed request consumes exactly one token; a
|
| 65 |
+
refused request consumes none. Tokens refill continuously at refill_per_sec
|
| 66 |
+
and the bucket never holds more than capacity.
|
| 67 |
+
|
| 68 |
+
Refill is continuous, not stepwise: two calls 500ms apart at 1 token/sec must
|
| 69 |
+
together restore one whole token, so partial time must not be discarded. The
|
| 70 |
+
first call establishes the clock and refills nothing.
|
| 71 |
+
|
| 72 |
+
now_ms comes from a wall clock that is occasionally stepped backwards by NTP.
|
| 73 |
+
A backwards jump must never grant tokens and must never make the bucket
|
| 74 |
+
permanently unable to refill: treat time as not having advanced, and take the
|
| 75 |
+
new reading as the current clock.",,,"""""""Per-client rate limiting at the API gateway edge.""""""
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
class TokenBucket:
|
| 79 |
+
def __init__(self, capacity, refill_per_sec):
|
| 80 |
+
raise NotImplementedError
|
| 81 |
+
|
| 82 |
+
def allow(self, now_ms):
|
| 83 |
+
""""""True if a request may proceed, consuming one token.""""""
|
| 84 |
+
raise NotImplementedError
|
| 85 |
+
",,,,"[[""a full bucket allows up to capacity"", ""b = TokenBucket(2, 1)\nassert b.allow(0) and b.allow(0) and not b.allow(0)""], [""waiting restores a token"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(0)\nassert b.allow(1000)""]]"
|
task_files/dob100-036-port-close-blocked-issues/08-data-change-controls.sql
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
-- migrations: {"environment": "staging", "migration_id": 1, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 2 |
+
-- migrations: {"environment": "production", "migration_id": 2, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 3 |
+
-- migrations: {"environment": "staging", "migration_id": 3, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 4 |
+
-- migrations: {"environment": "production", "migration_id": 4, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 5 |
+
-- migration_requirements: {"migration_name": "0088_loyalty_ledger", "module": "loyalty_redeem", "req_id": 9151, "service": "checkout"}
|
| 6 |
+
-- migration_requirements: {"migration_name": "0123_loyalty_points", "module": "loyalty_accrual", "req_id": 9152, "service": "catalog"}
|
| 7 |
+
-- migration_requirements: {"migration_name": "0042_settlement_splits", "module": "split_settlement", "req_id": 9153, "service": "payments"}
|
| 8 |
+
-- migration_requirements: {"migration_name": "0034_backorders", "module": "backorder_queue", "req_id": 9154, "service": "inventory"}
|
| 9 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9901, "note": "", "role": "payments_rw", "service": "payments", "state": "active"}
|
| 10 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9902, "note": "", "role": "checkout_rw", "service": "checkout", "state": "active"}
|
| 11 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9903, "note": "", "role": "catalog_ro", "service": "catalog", "state": "active"}
|
| 12 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9904, "note": "", "role": "search_ro", "service": "search", "state": "active"}
|
task_files/dob100-036-port-close-blocked-issues/09-feature-and-security.yaml
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"flag_id",
|
| 6 |
+
"key",
|
| 7 |
+
"service",
|
| 8 |
+
"description",
|
| 9 |
+
"environment",
|
| 10 |
+
"enabled",
|
| 11 |
+
"rollout_percent"
|
| 12 |
+
],
|
| 13 |
+
"row_count": 8,
|
| 14 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 15 |
+
"table": "feature_flags",
|
| 16 |
+
"task_relevant_rows": [
|
| 17 |
+
{
|
| 18 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 19 |
+
"enabled": 1,
|
| 20 |
+
"environment": "production",
|
| 21 |
+
"flag_id": 9301,
|
| 22 |
+
"key": "instant_refunds",
|
| 23 |
+
"rollout_percent": 100,
|
| 24 |
+
"service": "checkout"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 28 |
+
"enabled": 1,
|
| 29 |
+
"environment": "staging",
|
| 30 |
+
"flag_id": 9302,
|
| 31 |
+
"key": "instant_refunds",
|
| 32 |
+
"rollout_percent": 100,
|
| 33 |
+
"service": "checkout"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"description": "Redesigned search results page.",
|
| 37 |
+
"enabled": 0,
|
| 38 |
+
"environment": "production",
|
| 39 |
+
"flag_id": 9303,
|
| 40 |
+
"key": "new_search_ui",
|
| 41 |
+
"rollout_percent": 0,
|
| 42 |
+
"service": "search"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"description": "Redesigned search results page.",
|
| 46 |
+
"enabled": 1,
|
| 47 |
+
"environment": "staging",
|
| 48 |
+
"flag_id": 9304,
|
| 49 |
+
"key": "new_search_ui",
|
| 50 |
+
"rollout_percent": 100,
|
| 51 |
+
"service": "search"
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"columns": [
|
| 57 |
+
"vuln_id",
|
| 58 |
+
"cve",
|
| 59 |
+
"package",
|
| 60 |
+
"service",
|
| 61 |
+
"severity",
|
| 62 |
+
"fixed_version",
|
| 63 |
+
"status"
|
| 64 |
+
],
|
| 65 |
+
"row_count": 4,
|
| 66 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 67 |
+
"table": "vulnerabilities",
|
| 68 |
+
"task_relevant_rows": [
|
| 69 |
+
{
|
| 70 |
+
"cve": "CVE-2026-31337",
|
| 71 |
+
"fixed_version": "2.4.0",
|
| 72 |
+
"package": "libpayproc",
|
| 73 |
+
"service": "payments",
|
| 74 |
+
"severity": "critical",
|
| 75 |
+
"status": "open",
|
| 76 |
+
"vuln_id": 9801
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"cve": "CVE-2026-40881",
|
| 80 |
+
"fixed_version": "11.4.0",
|
| 81 |
+
"package": "stripe-sdk",
|
| 82 |
+
"service": "checkout",
|
| 83 |
+
"severity": "high",
|
| 84 |
+
"status": "open",
|
| 85 |
+
"vuln_id": 9802
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"cve": "CVE-2026-22190",
|
| 89 |
+
"fixed_version": "2.11.0",
|
| 90 |
+
"package": "pydantic",
|
| 91 |
+
"service": "catalog",
|
| 92 |
+
"severity": "medium",
|
| 93 |
+
"status": "remediated",
|
| 94 |
+
"vuln_id": 9803
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"cve": "CVE-2026-51002",
|
| 98 |
+
"fixed_version": "2.33.0",
|
| 99 |
+
"package": "requests",
|
| 100 |
+
"service": "payments",
|
| 101 |
+
"severity": "high",
|
| 102 |
+
"status": "open",
|
| 103 |
+
"vuln_id": 9804
|
| 104 |
+
}
|
| 105 |
+
]
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"columns": [
|
| 109 |
+
"rule_id",
|
| 110 |
+
"name",
|
| 111 |
+
"service_label",
|
| 112 |
+
"expr",
|
| 113 |
+
"severity",
|
| 114 |
+
"group_by",
|
| 115 |
+
"routes_to"
|
| 116 |
+
],
|
| 117 |
+
"row_count": 5,
|
| 118 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 119 |
+
"table": "alert_rules",
|
| 120 |
+
"task_relevant_rows": [
|
| 121 |
+
{
|
| 122 |
+
"expr": "histogram_quantile(0.99, gateway_latency) > 250",
|
| 123 |
+
"group_by": "service",
|
| 124 |
+
"name": "GatewayHighLatency",
|
| 125 |
+
"routes_to": "EP-Platform",
|
| 126 |
+
"rule_id": 601,
|
| 127 |
+
"service_label": "gateway_service",
|
| 128 |
+
"severity": "critical"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"expr": "rate(gateway_errors[5m]) > 0.01",
|
| 132 |
+
"group_by": "service",
|
| 133 |
+
"name": "GatewayErrorRate",
|
| 134 |
+
"routes_to": "EP-Platform",
|
| 135 |
+
"rule_id": 602,
|
| 136 |
+
"service_label": "gateway_service",
|
| 137 |
+
"severity": "high"
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"expr": "avg(latency) by (cluster) > 400",
|
| 141 |
+
"group_by": "cluster",
|
| 142 |
+
"name": "ClusterWideLatency",
|
| 143 |
+
"routes_to": "EP-Platform",
|
| 144 |
+
"rule_id": 603,
|
| 145 |
+
"service_label": "",
|
| 146 |
+
"severity": "critical"
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"expr": "cache_hit_ratio{tier=\"gateway-edge\"} < 0.8",
|
| 150 |
+
"group_by": "service",
|
| 151 |
+
"name": "EdgeCacheHitRate",
|
| 152 |
+
"routes_to": "EP-Platform",
|
| 153 |
+
"rule_id": 604,
|
| 154 |
+
"service_label": "edge_cache_service",
|
| 155 |
+
"severity": "medium"
|
| 156 |
+
}
|
| 157 |
+
]
|
| 158 |
+
},
|
| 159 |
+
{
|
| 160 |
+
"columns": [
|
| 161 |
+
"silence_id",
|
| 162 |
+
"matcher",
|
| 163 |
+
"created_by",
|
| 164 |
+
"reason",
|
| 165 |
+
"expires_day"
|
| 166 |
+
],
|
| 167 |
+
"row_count": 1,
|
| 168 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 169 |
+
"table": "alert_silences",
|
| 170 |
+
"task_relevant_rows": [
|
| 171 |
+
{
|
| 172 |
+
"created_by": "Sam Whitfield",
|
| 173 |
+
"expires_day": 402,
|
| 174 |
+
"matcher": "alertname=\"EdgeCacheHitRate\"",
|
| 175 |
+
"reason": "muted during the CDN migration, never lifted",
|
| 176 |
+
"silence_id": 801
|
| 177 |
+
}
|
| 178 |
+
]
|
| 179 |
+
}
|
| 180 |
+
]
|
| 181 |
+
}
|
task_files/dob100-036-port-close-blocked-issues/10-vendor-trackers.json
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"key",
|
| 6 |
+
"project",
|
| 7 |
+
"summary",
|
| 8 |
+
"issue_type",
|
| 9 |
+
"status",
|
| 10 |
+
"resolution",
|
| 11 |
+
"priority",
|
| 12 |
+
"component",
|
| 13 |
+
"assignee",
|
| 14 |
+
"created_day",
|
| 15 |
+
"updated_day"
|
| 16 |
+
],
|
| 17 |
+
"row_count": 11,
|
| 18 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 19 |
+
"table": "jira_issues",
|
| 20 |
+
"task_relevant_rows": [
|
| 21 |
+
{
|
| 22 |
+
"assignee": "Diego Ramos",
|
| 23 |
+
"component": "payments",
|
| 24 |
+
"created_day": 402,
|
| 25 |
+
"issue_type": "Bug",
|
| 26 |
+
"key": "ENG-3002",
|
| 27 |
+
"priority": "High",
|
| 28 |
+
"project": "ENG",
|
| 29 |
+
"resolution": "Fixed",
|
| 30 |
+
"status": "Done",
|
| 31 |
+
"summary": "Duplicate charge on retried payment",
|
| 32 |
+
"updated_day": 409
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"assignee": "Mei Tanaka",
|
| 36 |
+
"component": "search",
|
| 37 |
+
"created_day": 408,
|
| 38 |
+
"issue_type": "Bug",
|
| 39 |
+
"key": "ENG-3003",
|
| 40 |
+
"priority": "Medium",
|
| 41 |
+
"project": "ENG",
|
| 42 |
+
"resolution": "",
|
| 43 |
+
"status": "Blocked",
|
| 44 |
+
"summary": "Search returns stale results after reindex",
|
| 45 |
+
"updated_day": 417
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"assignee": "",
|
| 49 |
+
"component": "checkout",
|
| 50 |
+
"created_day": 396,
|
| 51 |
+
"issue_type": "Bug",
|
| 52 |
+
"key": "ENG-3004",
|
| 53 |
+
"priority": "Low",
|
| 54 |
+
"project": "ENG",
|
| 55 |
+
"resolution": "Won't Do",
|
| 56 |
+
"status": "Done",
|
| 57 |
+
"summary": "Cart total rounds incorrectly for multi-currency",
|
| 58 |
+
"updated_day": 404
|
| 59 |
+
}
|
| 60 |
+
]
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"columns": [
|
| 64 |
+
"identifier",
|
| 65 |
+
"team",
|
| 66 |
+
"title",
|
| 67 |
+
"state",
|
| 68 |
+
"priority",
|
| 69 |
+
"label",
|
| 70 |
+
"created_day"
|
| 71 |
+
],
|
| 72 |
+
"row_count": 4,
|
| 73 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 74 |
+
"table": "linear_issues",
|
| 75 |
+
"task_relevant_rows": [
|
| 76 |
+
{
|
| 77 |
+
"created_day": 411,
|
| 78 |
+
"identifier": "GRW-88",
|
| 79 |
+
"label": "bug",
|
| 80 |
+
"priority": 1,
|
| 81 |
+
"state": "In Progress",
|
| 82 |
+
"team": "Growth",
|
| 83 |
+
"title": "Checkout slow at peak \u2014 customers dropping off"
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
"created_day": 408,
|
| 87 |
+
"identifier": "GRW-91",
|
| 88 |
+
"label": "bug",
|
| 89 |
+
"priority": 3,
|
| 90 |
+
"state": "Todo",
|
| 91 |
+
"team": "Growth",
|
| 92 |
+
"title": "Search shows stale products after reindex"
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"created_day": 417,
|
| 96 |
+
"identifier": "GRW-95",
|
| 97 |
+
"label": "bug",
|
| 98 |
+
"priority": 4,
|
| 99 |
+
"state": "Todo",
|
| 100 |
+
"team": "Growth",
|
| 101 |
+
"title": "Autocomplete flickers on slow connections"
|
| 102 |
+
},
|
| 103 |
+
{
|
| 104 |
+
"created_day": 416,
|
| 105 |
+
"identifier": "GRW-97",
|
| 106 |
+
"label": "bug,performance",
|
| 107 |
+
"priority": 2,
|
| 108 |
+
"state": "In Progress",
|
| 109 |
+
"team": "Growth",
|
| 110 |
+
"title": "Product images load from origin, not CDN"
|
| 111 |
+
}
|
| 112 |
+
]
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
"columns": [
|
| 116 |
+
"number",
|
| 117 |
+
"repo",
|
| 118 |
+
"title",
|
| 119 |
+
"state",
|
| 120 |
+
"labels",
|
| 121 |
+
"created_day"
|
| 122 |
+
],
|
| 123 |
+
"row_count": 28,
|
| 124 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 125 |
+
"table": "github_issues",
|
| 126 |
+
"task_relevant_rows": [
|
| 127 |
+
{
|
| 128 |
+
"created_day": 404,
|
| 129 |
+
"labels": "security",
|
| 130 |
+
"number": 4422,
|
| 131 |
+
"repo": "novacart/growth",
|
| 132 |
+
"state": "closed",
|
| 133 |
+
"title": "Duplicate charge on retried capture"
|
| 134 |
+
}
|
| 135 |
+
]
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"columns": [
|
| 139 |
+
"source",
|
| 140 |
+
"target",
|
| 141 |
+
"kind"
|
| 142 |
+
],
|
| 143 |
+
"row_count": 4,
|
| 144 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 145 |
+
"table": "issue_links",
|
| 146 |
+
"task_relevant_rows": [
|
| 147 |
+
{
|
| 148 |
+
"kind": "duplicates",
|
| 149 |
+
"source": "ENG-3001",
|
| 150 |
+
"target": "GRW-88"
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"kind": "duplicates",
|
| 154 |
+
"source": "ENG-3001",
|
| 155 |
+
"target": "4412"
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
"kind": "duplicates",
|
| 159 |
+
"source": "ENG-3003",
|
| 160 |
+
"target": "GRW-91"
|
| 161 |
+
},
|
| 162 |
+
{
|
| 163 |
+
"kind": "duplicates",
|
| 164 |
+
"source": "ENG-3003",
|
| 165 |
+
"target": "4402"
|
| 166 |
+
}
|
| 167 |
+
]
|
| 168 |
+
}
|
| 169 |
+
]
|
| 170 |
+
}
|
task_files/dob100-036-port-close-blocked-issues/11-knowledge-base.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 11 Knowledge Base
|
| 2 |
+
|
| 3 |
+
## documents (30 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"doc_id": 9603,
|
| 9 |
+
"kind": "runbook",
|
| 10 |
+
"title": "Retry and timeout standard",
|
| 11 |
+
"service": "",
|
| 12 |
+
"author": "Priya Nair",
|
| 13 |
+
"day": 241,
|
| 14 |
+
"body": "# Retry and timeout standard\n\nApplies to every cross-service call in the NovaCart fleet. Two config keys per\ndownstream dependency, named after the downstream service.\n\n## The two keys\n\nFor a caller talking to downstream service `X`:\n\n- `<downstream>_retry_max_attempts` - **must be 3**\n- `<downstream>_timeout_ms` - **must be at most 2000**\n\nSo `payments` calling `notifications` runs with\n`notifications_retry_max_attempts=3` and `notifications_timeout_ms=2000` (or\nlower). `checkout` calling `payments` runs with `payments_retry_max_attempts=3`\nand `payment_timeout_ms` inside the 2000ms ceiling.\n\nRetries use exponential backoff with jitter; the backoff schedule is applied\nautomatically by the shared HTTP client, so you do not configure delays. Three\nattempts means one initial call plus two retries, worst case roughly\n`3 * timeout_ms` plus backoff.\n\n## Why 3 and why 2000\n\n**A retry value of 0 means one timeout permanently fails the request.** There is\nno second chance. A single blip in a downstream - a pod restart, a brief GC\npause, a rebalanced connection - becomes a user-visible failure and a failed\norder. This is not hypothetical: payments ran with\n`notifications_retry_max_attempts=0` and `notifications_timeout_ms=30000` for\nseveral weeks and pushed `error_rate_pct` from a baseline of 0.4% to 3.8%,\nstraight through the 1.0% SLO.\n\nThe 2000ms ceiling exists because timeouts multiply up the call stack. A 30000ms\ntimeout on a leaf call does not \"wait patiently\" - it holds a request-handling\nworker and a database connection for thirty seconds, and under load that is how\nyou exhaust a pool (see \"Connection pool sizing\"). If a downstream genuinely\ncannot answer in two seconds, the call belongs on a queue, not in the request\npath.\n\n## Checklist for a new dependency\n\n1. Add `<downstream>_retry_max_attempts=3` to the caller's config.\n2. Add `<downstream>_timeout_ms` at or below 2000.\n3. Confirm the call is idempotent, or that the downstream deduplicates by\n idempotency key. Retrying a non-idempotent write is worse than failing.\n4. Confirm the caller's own inbound timeout is larger than\n `attempts * timeout_ms` plus backoff, or the retry budget is fiction.\n5. Add the dependency to the service's dependency section in its design doc.\n\n## Anti-patterns\n\n- Retrying on 4xx. Only retry timeouts, connection errors, 429, and 5xx.\n- Retrying inside a retry. Nested retries multiply: 3 x 3 = 9 calls.\n- Raising the timeout to \"fix\" a slow downstream. Fix the downstream.\n"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"doc_id": 9612,
|
| 18 |
+
"kind": "runbook",
|
| 19 |
+
"title": "Queue consumer tuning",
|
| 20 |
+
"service": "notifications",
|
| 21 |
+
"author": "Priya Nair",
|
| 22 |
+
"day": 226,
|
| 23 |
+
"body": "# Queue consumer tuning\n\nOwner: platform. Primary consumer service: `notifications` (tier 2), which\ndrains the email, SMS, and push delivery queues. The same rules apply to any\nservice that consumes from the message broker.\n\n## The rule\n\n`prefetch_count` must be a **bounded** value. **Recommended: 50.**\n\n`prefetch_count=0` means **unlimited prefetch** and is the single worst setting\nin this runbook.\n\n## What prefetch does\n\nPrefetch is the number of unacknowledged messages the broker will push to a\nsingle consumer. With `prefetch_count=50`, a consumer holds at most 50\nin-flight messages; the broker will not send a 51st until one is acknowledged.\nThis is the backpressure mechanism - it is what lets a slow consumer tell the\nbroker to slow down.\n\nWith `prefetch_count=0` there is no backpressure. The broker pushes the entire\nbacklog to whichever consumer connects first. Consequences, all of which we have\nseen in `notifications`:\n\n- **Memory pressure.** A 400k-message backlog lands in one process's heap. RSS\n climbs until the container hits its memory limit.\n- **Consumer restarts.** The container is OOM-killed, the unacknowledged\n messages are redelivered, the restarted consumer grabs them all again, and it\n is killed again. A restart loop that looks like a broker problem and is not.\n- **Terrible load distribution.** One consumer holds everything while its\n siblings sit idle, so scaling out does nothing.\n- **Head-of-line latency.** A high-priority message sits behind 400k others.\n\n## Sizing\n\n| Message profile | prefetch_count |\n| ------------------------------ | -------------- |\n| Fast, uniform (a few ms each) | 100-200 |\n| Standard delivery work | **50** |\n| Slow or variable (seconds) | 5-10 |\n| Long-running jobs (minutes) | 1 |\n\nRule of thumb: `prefetch_count` should be roughly the number of messages a\nconsumer can process in one to two seconds. Start at 50 and adjust with\nevidence.\n\n## Related settings\n\n- `smtp_pool` on `notifications` bounds concurrent SMTP connections. Prefetch\n above the SMTP concurrency just buys queueing inside the process.\n- Ack **after** the work is done, never on receipt. Acking on receipt turns a\n crash into silent message loss.\n- Dead-letter after 5 delivery attempts so a poison message cannot loop forever.\n\n## Changing it\n\nRepo config: PR with a `config` change, CI, merge, staging, production.\n`notifications` is tier 2 - straight 100% deploy after staging. Watch consumer\nmemory and queue depth for one full peak after the change.\n"
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"doc_id": 9614,
|
| 27 |
+
"kind": "design_doc",
|
| 28 |
+
"title": "Checkout architecture",
|
| 29 |
+
"service": "checkout",
|
| 30 |
+
"author": "Diego Ramos",
|
| 31 |
+
"day": 198,
|
| 32 |
+
"body": "# Checkout architecture\n\nService: `checkout` (tier 1, python, commerce). Owns the cart and the checkout\norchestration state machine. SLOs: `error_rate_pct < 1.0`,\n`latency_p99_ms < 400`.\n\n## Responsibilities\n\n`checkout` owns the transition from \"a cart exists\" to \"an order exists and is\npaid\". It does not own money movement (that is `payments`), product data (that\nis `catalog`), or customer notification (that is `notifications`). It owns the\nsequencing and the guarantee that the sequence happens exactly once.\n\nModules: `cart`, `checkout_flow`, and - once the loyalty program ships -\n`loyalty_redeem`.\n\n## The state machine\n\nEvery checkout session is a row with an explicit state:\n\n```\ncart_open -> pricing_locked -> payment_pending -> paid -> order_created\n | |\n +-> abandoned +-> payment_failed\n```\n\nTransitions are append-only and each is stamped with the idempotency key of the\nrequest that caused it. Replaying a request that has already produced a\ntransition returns the existing result rather than performing it again. This is\nwhat makes the checkout endpoint safe to retry, which matters because clients\nretry aggressively on mobile networks.\n\n## Dependencies\n\n| Downstream | Call | Timeout budget |\n| --------------- | ------------------------ | ------------------------- |\n| `catalog` | price and availability | `<= 2000ms`, 3 attempts |\n| `payments` | authorize and capture | `payment_timeout_ms` |\n| `notifications` | order confirmation | async, fire-and-forget |\n\nAll synchronous calls follow the \"Retry and timeout standard\": three attempts,\ntimeout at or below 2000ms. The `notifications` call is deliberately\nasynchronous - a confirmation email must never be able to fail an order.\n\n## Pricing lock\n\nAt `pricing_locked` we snapshot the price, the promotion, and the tax\ncomputation into the session row. From that point the customer pays the price\nthey were shown even if `catalog` changes underneath. The lock expires after 20\nminutes, after which the session re-prices.\n\n## Failure handling\n\n- `payments` timeout: the session stays `payment_pending` and a reconciliation\n job asks `payments` for the authoritative status. We never assume a timeout\n means \"did not happen\".\n- `catalog` unavailable: fail closed. We do not sell at a guessed price.\n- Partial capture: not supported; a capture is all-or-nothing per order.\n\n## Feature flags\n\nCheckout-adjacent behavior ships behind flags - `instant_refunds`,\n`express_checkout`. Per the \"Feature flags\" runbook, the code deploys first and\nthe flag is enabled afterwards at no more than 10%. `instant_refunds` is the\ncautionary tale: ramped to 100% in production, it took `error_rate_pct` from\n0.3% to 5.5% via a nil-pointer panic in the refund worker.\n\n## Open questions\n\n- Should the pricing lock move into `catalog` so `search` can honor it too?\n- Cart merge on login is still last-write-wins; it should be a real merge.\n"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"doc_id": 9617,
|
| 36 |
+
"kind": "design_doc",
|
| 37 |
+
"title": "Loyalty points program",
|
| 38 |
+
"service": "",
|
| 39 |
+
"author": "Diego Ramos",
|
| 40 |
+
"day": 288,
|
| 41 |
+
"body": "# Loyalty points program\n\nCross-service feature spanning `catalog`, `checkout`, and `storefront-web`.\nCustomers earn points on purchases and redeem them for order discounts.\n\n## Modules and ownership\n\n| Module | Service | Responsibility |\n| ----------------- | ----------------- | ------------------------------------- |\n| `loyalty_accrual` | `catalog` | Points-earning rules per product |\n| `loyalty_redeem` | `checkout` | Applying points as an order discount |\n| `loyalty_widget` | `storefront-web` | Balance display and redeem affordance |\n\nEach module ships in **its own PR against its own service**. There is no shared\nlibrary; the contract between them is the points-rate field on the product\npayload and the redeem call on the checkout API.\n\n## Why this split\n\nAccrual rules are product data - they vary per product and per category, they\nchange with merchandising campaigns, and they belong next to pricing. Redemption\nis an order-level money decision and belongs in the checkout state machine.\nDisplay is display. Putting accrual in `checkout` would have meant `checkout`\nreading the product rules table, which is exactly the coupling we spent last\nyear removing.\n\n## Rollout order\n\nDeployment order matters and is not negotiable:\n\n**`catalog` - then `checkout` - then `storefront-web`.**\n\nThe reasoning is a strict data dependency chain:\n\n1. `catalog` must be emitting a points rate on the product payload before\n `checkout` can compute a balance to redeem against. If `checkout` ships\n first, every redeem attempt reads a missing field and either errors or\n silently computes zero.\n2. `checkout` must expose the redeem endpoint and be live before\n `storefront-web` renders a redeem button. If the widget ships first,\n customers see a button that 404s - a visible, embarrassing failure on the\n busiest page we have.\n\n`catalog` is tier 2 (straight production deploy after staging). `checkout` and\n`storefront-web` are tier 1, so each is staging-first, then a production canary\nat `canary_percent <= 25`, `assess_canary`, then `promote_canary` - see\n\"Deployment policy\". Do not begin the next service's production deploy until the\nprevious one is fully promoted.\n\n## Points model\n\nBalances live in an append-only ledger, mirroring the approach in \"Payments\nsettlement pipeline\": `earn`, `redeem`, `expire`, `adjust`. Balance is the sum,\nnever a stored counter. Redemption is authorized at `pricing_locked` and\ncommitted at `paid`; an abandoned cart releases the hold after 20 minutes.\n\nDefault rate is 1 point per whole currency unit, 100 points equals one currency\nunit of discount, points expire 12 months after earning. Maximum redemption is\n50% of order subtotal.\n\n## Risks\n\n- Double-redeem across concurrent sessions. Mitigated by the hold and by the\n idempotency key on the checkout transition.\n- Accrual rule changes retroactively altering historical balances. The ledger\n stamps the rate version at earn time.\n"
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"doc_id": 9622,
|
| 45 |
+
"kind": "postmortem",
|
| 46 |
+
"title": "Postmortem: search cache stampede after index rebuild",
|
| 47 |
+
"service": "search",
|
| 48 |
+
"author": "Mei Tanaka",
|
| 49 |
+
"day": 183,
|
| 50 |
+
"body": "# Postmortem: search cache stampede after index rebuild\n\n**Severity:** sev2\n**Service:** `search`\n**Duration:** 34 minutes of degraded search\n**Author:** Mei Tanaka\n**Status:** action items complete\n\n## Summary\n\nA planned index rebuild swapped the search index alias at a moderate traffic\nhour. The alias swap invalidated the entire query cache. Every in-flight query\nmissed simultaneously and hit the primary index, driving `latency_p99_ms` from\n~210ms to a peak of 2100ms and firing the `search latency_p99_ms` alert against\nits 300ms SLO. Search was slow, not down; conversion on search-originated\nsessions dropped an estimated 18% for the duration.\n\n## Timeline (UTC)\n\n- **14:02** Engineer starts a full index rebuild for an analyzer change. Routine;\n done a dozen times before.\n- **14:41** Rebuild completes. Alias swaps to the new index. Query cache keys are\n namespaced by index generation, so the swap invalidates 100% of the cache.\n- **14:42** `latency_p99_ms` crosses 300ms. Alert fires, `medium`.\n- **14:44** On-call acknowledges. Initial hypothesis: the new analyzer is slow.\n- **14:51** Index CPU is pegged; per-query cost is unchanged from before the\n rebuild. Hypothesis discarded - it is volume, not per-query cost.\n- **14:58** Cache hit ratio confirmed at 3%, against a normal 76%. Root cause\n identified.\n- **15:06** Traffic to search temporarily shed at the gateway by 30% to let the\n cache refill.\n- **15:16** Hit ratio back above 60%; p99 at 340ms and falling.\n- **15:22** Shedding removed. p99 at 215ms.\n- **15:26** Alert resolved, incident resolved, update posted in `#incidents`.\n\n## Root cause\n\nThe query cache is namespaced by index generation. An alias swap therefore\nperforms a **complete, instantaneous cache flush** with no warm-up. Because the\ncache normally absorbs about **75% of index load**, the index was asked to serve\nroughly 4x its steady-state query volume within one second. Requests queued,\nlatency rose, clients retried, and the retries added load - a classic stampede\nwith a positive feedback loop.\n\n## Contributing factors\n\n- No warm-up step in the rebuild procedure. The runbook ended at \"swap alias\".\n- Rebuild was run at 14:00 local, in the daily traffic ramp, because the job\n takes 40 minutes and nobody wanted to babysit it at night.\n- Single-flight coalescing existed for identical concurrent queries but the\n stampede was across *thousands of distinct* queries, so coalescing did nothing.\n- No alert on cache hit ratio, so the actual signal was invisible for 14 minutes.\n\n## What went well\n\n- Alerting fired within a minute of the SLO breach.\n- Load shedding at the gateway was the correct blunt instrument and worked.\n\n## Action items\n\n1. Add a **warm-up phase** to the rebuild: replay the top 5000 queries against\n the new index before swapping the alias. **Done.**\n2. Add **+/-10% TTL jitter** to `cache_ttl_s=300` so natural expiry never\n synchronizes. **Done.**\n3. Alert on **cache hit ratio below 50%** for 5 minutes. **Done.**\n4. Move scheduled rebuilds to 03:00-05:00 UTC. **Done.**\n5. Document the stampede risk in the \"Search caching\" runbook. **Done.**\n"
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"doc_id": 9623,
|
| 54 |
+
"kind": "postmortem",
|
| 55 |
+
"title": "Postmortem: catalog migration 0043 forced a rollback",
|
| 56 |
+
"service": "catalog",
|
| 57 |
+
"author": "Diego Ramos",
|
| 58 |
+
"day": 202,
|
| 59 |
+
"body": "# Postmortem: catalog migration 0043 forced a rollback\n\n**Severity:** sev1\n**Service:** `catalog` (with knock-on impact to `checkout` and `storefront-web`)\n**Duration:** 22 minutes of failed product-detail pages\n**Author:** Diego Ramos\n**Status:** action items complete\n\n## Summary\n\nMigration `0043_rename_price_column` renamed `catalog_products.price_cents` to\n`price_minor_units` in a single step, and the matching code version `v1.8.0` was\ndeployed immediately after. The migration was applied to production before the\ndeploy, as policy requires - but the migration was **not backwards compatible**\nwith the code version already running. Between the migration completing and the\nnew version being fully rolled out, the running `v1.7.6` instances queried a\ncolumn that no longer existed. Product-detail and category pages returned 500s;\n`checkout` fell back to failing closed on pricing, per its design.\n\n## Timeline (UTC)\n\n- **09:12** `apply_migration(catalog, production, 0043)` starts.\n- **09:13** Migration completes. Column renamed.\n- **09:13** `v1.7.6` instances begin throwing\n `UndefinedColumn: price_cents` on every pricing query.\n- **09:14** `catalog` error rate goes vertical. `checkout` starts failing closed.\n Two alerts fire.\n- **09:15** Deploy of `v1.8.0` starts, as planned, but rolls instance by instance.\n- **09:17** On-call acknowledges, declares sev1.\n- **09:19** Commander recognizes the pattern: schema ahead of code, partial fleet.\n- **09:21** Decision: do **not** attempt to reverse the migration. Accelerate the\n `v1.8.0` rollout instead.\n- **09:31** Rollout complete on all instances. Errors stop.\n- **09:34** Metrics confirmed recovered; alerts resolved; incident resolved.\n- **09:40** Update posted in `#incidents`; status page updated and cleared.\n- Later that day: `v1.8.0` was rolled back for an unrelated defect found in\n review, which is when the second lesson landed - the rolled-back `v1.7.6` code\n could not read the renamed column either, and a hotfix `v1.8.1` had to be cut\n because **migrations are forward-only** and there was no going back.\n\n## Root cause\n\nA **destructive, non-backwards-compatible schema change shipped in one step**. A\ncolumn rename is two incompatible states with no overlap: code that knows the old\nname and code that knows the new name cannot both work against the same schema.\nAny window in which both code versions run - and a rolling deploy guarantees such\na window - is an outage.\n\n## Contributing factors\n\n- The \"migration before code\" rule was followed correctly, and following it\n correctly was *insufficient*. The rule says nothing about compatibility with\n the code already running.\n- The migration had one reviewer, from the authoring team.\n- Rolling deploys were assumed to be fast enough not to matter. They are not.\n- `catalog` is tier 2, so there was no canary to catch it at 25%.\n\n## What went well\n\n- Nobody tried to hand-write a reverse migration under pressure. Rolling forward\n was the right call and it was made in six minutes.\n- `checkout` failing closed on pricing prevented selling at a wrong price.\n\n## Action items\n\n1. Write the **N-1 rule** into the \"Database migration policy\": every migration\n must leave the schema usable by the currently deployed code. **Done.**\n2. Mandate the **expand/contract** pattern for renames: add column, dual-write,\n backfill, switch reads, drop in a later migration. **Done.**\n3. Require a **second reviewer from platform** for migrations on tables above ten\n million rows. **Done.**\n4. Add a CI check that flags `DROP COLUMN`, `RENAME COLUMN`, and new `NOT NULL`\n constraints for explicit sign-off. **Done.**\n"
|
| 60 |
+
}
|
| 61 |
+
]
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## confluence_pages (4 rows)
|
| 65 |
+
|
| 66 |
+
```json
|
| 67 |
+
[
|
| 68 |
+
{
|
| 69 |
+
"page_id": 8001,
|
| 70 |
+
"space": "ENG",
|
| 71 |
+
"title": "Checkout Platform \u2014 architecture",
|
| 72 |
+
"body": "Checkout Platform is owned by the Commerce Platform team. It calls payments and inventory synchronously. Escalate via #commerce.",
|
| 73 |
+
"last_updated_day": 372,
|
| 74 |
+
"stale": 0
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"page_id": 8002,
|
| 78 |
+
"space": "ENG",
|
| 79 |
+
"title": "Gateway runbook (legacy)",
|
| 80 |
+
"body": "The Edge Team owns the gateway. Page the Edge Team rota for any 5xx spike. Restart procedure targets host gw-prod-03.",
|
| 81 |
+
"last_updated_day": 181,
|
| 82 |
+
"stale": 1
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"page_id": 8003,
|
| 86 |
+
"space": "ENG",
|
| 87 |
+
"title": "Weekly reporting conventions",
|
| 88 |
+
"body": "Engineering weekly reports run Monday to Sunday, ISO-8601 week numbering, in UTC. Note that the service-owner spreadsheet uses a Sunday start and will disagree by one day at the boundary.",
|
| 89 |
+
"last_updated_day": 401,
|
| 90 |
+
"stale": 0
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"page_id": 8004,
|
| 94 |
+
"space": "ENG",
|
| 95 |
+
"title": "Incident severity ladder",
|
| 96 |
+
"body": "P1 = customer-facing outage, P2 = degraded customer experience, P3 = internal only, P4 = cosmetic. Customer-facing status is recorded on the public status page, not on the incident.",
|
| 97 |
+
"last_updated_day": 395,
|
| 98 |
+
"stale": 0
|
| 99 |
+
}
|
| 100 |
+
]
|
| 101 |
+
```
|
task_files/dob100-036-port-close-blocked-issues/12-chat-and-status.json
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"message_id",
|
| 6 |
+
"channel",
|
| 7 |
+
"author",
|
| 8 |
+
"body"
|
| 9 |
+
],
|
| 10 |
+
"row_count": 6,
|
| 11 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 12 |
+
"table": "messages",
|
| 13 |
+
"task_relevant_rows": [
|
| 14 |
+
{
|
| 15 |
+
"author": "Priya Nair",
|
| 16 |
+
"body": "Declared incident 9701 (sev1): api-gateway p99 through the roof since the v5.1.0 promote.",
|
| 17 |
+
"channel": "#incidents",
|
| 18 |
+
"message_id": 1
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"author": "Diego Ramos",
|
| 22 |
+
"body": "Incident 9702 (sev2): checkout error rate tracks the instant_refunds ramp exactly.",
|
| 23 |
+
"channel": "#incidents",
|
| 24 |
+
"message_id": 2
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"author": "Alex Osei",
|
| 28 |
+
"body": "Incident 9703 (sev2): inventory reservations timing out at peak; pool looks undersized.",
|
| 29 |
+
"channel": "#incidents",
|
| 30 |
+
"message_id": 3
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"author": "Mei Tanaka",
|
| 34 |
+
"body": "Reminder: deployment policy = staging first; tier-1 canary at 25% then promote.",
|
| 35 |
+
"channel": "#eng",
|
| 36 |
+
"message_id": 4
|
| 37 |
+
}
|
| 38 |
+
]
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"columns": [
|
| 42 |
+
"channel",
|
| 43 |
+
"purpose"
|
| 44 |
+
],
|
| 45 |
+
"row_count": 4,
|
| 46 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 47 |
+
"table": "channels",
|
| 48 |
+
"task_relevant_rows": [
|
| 49 |
+
{
|
| 50 |
+
"channel": "#incidents",
|
| 51 |
+
"purpose": "Incident coordination and status updates."
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"channel": "#security",
|
| 55 |
+
"purpose": "Security advisories and audit notes."
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"channel": "#eng",
|
| 59 |
+
"purpose": "General engineering."
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"channel": "#deploys",
|
| 63 |
+
"purpose": "Deployment announcements."
|
| 64 |
+
}
|
| 65 |
+
]
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"columns": [
|
| 69 |
+
"post_id",
|
| 70 |
+
"state",
|
| 71 |
+
"title",
|
| 72 |
+
"body"
|
| 73 |
+
],
|
| 74 |
+
"row_count": 1,
|
| 75 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 76 |
+
"table": "status_page",
|
| 77 |
+
"task_relevant_rows": [
|
| 78 |
+
{
|
| 79 |
+
"body": "Catalog read replica maintenance completed with no customer impact.",
|
| 80 |
+
"post_id": 1,
|
| 81 |
+
"state": "resolved",
|
| 82 |
+
"title": "Scheduled maintenance completed"
|
| 83 |
+
}
|
| 84 |
+
]
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"columns": [
|
| 88 |
+
"post_id",
|
| 89 |
+
"title",
|
| 90 |
+
"impact",
|
| 91 |
+
"state",
|
| 92 |
+
"published_day",
|
| 93 |
+
"linked_incident"
|
| 94 |
+
],
|
| 95 |
+
"row_count": 3,
|
| 96 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 97 |
+
"table": "status_page_posts",
|
| 98 |
+
"task_relevant_rows": [
|
| 99 |
+
{
|
| 100 |
+
"impact": "major",
|
| 101 |
+
"linked_incident": 5101,
|
| 102 |
+
"post_id": 7001,
|
| 103 |
+
"published_day": 412,
|
| 104 |
+
"state": "resolved",
|
| 105 |
+
"title": "Degraded checkout performance"
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"impact": "minor",
|
| 109 |
+
"linked_incident": 5102,
|
| 110 |
+
"post_id": 7002,
|
| 111 |
+
"published_day": 415,
|
| 112 |
+
"state": "monitoring",
|
| 113 |
+
"title": "Elevated error rates on payments"
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"impact": "major",
|
| 117 |
+
"linked_incident": 5103,
|
| 118 |
+
"post_id": 7003,
|
| 119 |
+
"published_day": 417,
|
| 120 |
+
"state": "resolved",
|
| 121 |
+
"title": "API latency affecting some customers"
|
| 122 |
+
}
|
| 123 |
+
]
|
| 124 |
+
}
|
| 125 |
+
]
|
| 126 |
+
}
|
task_files/dob100-036-port-close-blocked-issues/13-approval-and-ownership.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 13 Approval And Ownership
|
| 2 |
+
|
| 3 |
+
## approval_policy (5 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"policy_id": 502,
|
| 9 |
+
"action": "retire_endpoint_with_live_traffic",
|
| 10 |
+
"approver_role": "service-owner",
|
| 11 |
+
"rationale": "drops in-flight customer requests; cannot be undone once clients fail"
|
| 12 |
+
}
|
| 13 |
+
]
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
## owner_spreadsheet (5 rows)
|
| 17 |
+
|
| 18 |
+
```json
|
| 19 |
+
[
|
| 20 |
+
{
|
| 21 |
+
"row_id": 1,
|
| 22 |
+
"service_label": "Checkout (commerce)",
|
| 23 |
+
"owning_team": "Commerce Platform",
|
| 24 |
+
"slack_channel": "#commerce",
|
| 25 |
+
"last_reviewed_day": 340,
|
| 26 |
+
"week_start": "sunday"
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"row_id": 2,
|
| 30 |
+
"service_label": "Payments (commerce)",
|
| 31 |
+
"owning_team": "Commerce Platform",
|
| 32 |
+
"slack_channel": "#commerce",
|
| 33 |
+
"last_reviewed_day": 340,
|
| 34 |
+
"week_start": "sunday"
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"row_id": 3,
|
| 38 |
+
"service_label": "Search (growth)",
|
| 39 |
+
"owning_team": "Discovery Squad",
|
| 40 |
+
"slack_channel": "#growth",
|
| 41 |
+
"last_reviewed_day": 210,
|
| 42 |
+
"week_start": "sunday"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"row_id": 4,
|
| 46 |
+
"service_label": "Gateway (platform)",
|
| 47 |
+
"owning_team": "Edge Team",
|
| 48 |
+
"slack_channel": "#edge",
|
| 49 |
+
"last_reviewed_day": 180,
|
| 50 |
+
"week_start": "sunday"
|
| 51 |
+
}
|
| 52 |
+
]
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## oncall (4 rows)
|
| 56 |
+
|
| 57 |
+
```json
|
| 58 |
+
[
|
| 59 |
+
{
|
| 60 |
+
"team": "platform",
|
| 61 |
+
"engineer": "Priya Nair"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"team": "commerce",
|
| 65 |
+
"engineer": "Diego Ramos"
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"team": "growth",
|
| 69 |
+
"engineer": "Mei Tanaka"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"team": "sre",
|
| 73 |
+
"engineer": "Alex Osei"
|
| 74 |
+
}
|
| 75 |
+
]
|
| 76 |
+
```
|
task_files/dob100-036-port-close-blocked-issues/14-tool-contracts.json
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"note": "These are the exact sandbox schemas used by this task; first-party NovaCart tools and vendor-shaped adapters are labeled as such in their descriptions.",
|
| 3 |
+
"tools": [
|
| 4 |
+
{
|
| 5 |
+
"description": "Fetch one ticket by key (e.g. ENG-2101).",
|
| 6 |
+
"json_schema": {
|
| 7 |
+
"description": "Fetch one ticket by key (e.g. ENG-2101).",
|
| 8 |
+
"name": "get_ticket",
|
| 9 |
+
"parameters": {
|
| 10 |
+
"properties": {
|
| 11 |
+
"key": {
|
| 12 |
+
"description": "key",
|
| 13 |
+
"type": "string"
|
| 14 |
+
}
|
| 15 |
+
},
|
| 16 |
+
"required": [
|
| 17 |
+
"key"
|
| 18 |
+
],
|
| 19 |
+
"type": "object"
|
| 20 |
+
}
|
| 21 |
+
},
|
| 22 |
+
"name": "get_ticket",
|
| 23 |
+
"parameters": [
|
| 24 |
+
{
|
| 25 |
+
"default": null,
|
| 26 |
+
"description": "key",
|
| 27 |
+
"name": "key",
|
| 28 |
+
"required": true,
|
| 29 |
+
"type": "str"
|
| 30 |
+
}
|
| 31 |
+
],
|
| 32 |
+
"read_tables": [
|
| 33 |
+
"tickets"
|
| 34 |
+
],
|
| 35 |
+
"return_type": "dict",
|
| 36 |
+
"source_code": "def get_ticket(db_path=None, key=None):\n \"\"\"Fetch one ticket by key (e.g. ENG-2101).\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('get_ticket',)); conn.commit()\n except Exception:\n pass\n if key is None:\n return {'ok': False, 'error': 'missing required parameter: key'}\n row = conn.execute('SELECT * FROM tickets WHERE key=?', (key,)).fetchone()\n if row is None:\n return {'ok': False, 'error': 'no such ticket: ' + str(key)}\n return dict(row)\n finally:\n conn.close()\n",
|
| 37 |
+
"tool_id": "tool_get_ticket",
|
| 38 |
+
"write_tables": []
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"description": "Search Jira issues. Jira status is a per-project workflow, not open/closed: a resolved issue has status='Done' AND a resolution set. Filter by project, status, issue_type, component or priority.",
|
| 42 |
+
"json_schema": {
|
| 43 |
+
"description": "Search Jira issues. Jira status is a per-project workflow, not open/closed: a resolved issue has status='Done' AND a resolution set. Filter by project, status, issue_type, component or priority.",
|
| 44 |
+
"name": "jira_search",
|
| 45 |
+
"parameters": {
|
| 46 |
+
"properties": {
|
| 47 |
+
"component": {
|
| 48 |
+
"description": "component",
|
| 49 |
+
"type": "string"
|
| 50 |
+
},
|
| 51 |
+
"issue_type": {
|
| 52 |
+
"description": "issue_type",
|
| 53 |
+
"type": "string"
|
| 54 |
+
},
|
| 55 |
+
"limit": {
|
| 56 |
+
"description": "limit",
|
| 57 |
+
"type": "integer"
|
| 58 |
+
},
|
| 59 |
+
"project": {
|
| 60 |
+
"description": "project",
|
| 61 |
+
"type": "string"
|
| 62 |
+
},
|
| 63 |
+
"status": {
|
| 64 |
+
"description": "status",
|
| 65 |
+
"type": "string"
|
| 66 |
+
}
|
| 67 |
+
},
|
| 68 |
+
"required": [],
|
| 69 |
+
"type": "object"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"name": "jira_search",
|
| 73 |
+
"parameters": [
|
| 74 |
+
{
|
| 75 |
+
"default": "None",
|
| 76 |
+
"description": "project",
|
| 77 |
+
"name": "project",
|
| 78 |
+
"required": false,
|
| 79 |
+
"type": "str"
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"default": "None",
|
| 83 |
+
"description": "status",
|
| 84 |
+
"name": "status",
|
| 85 |
+
"required": false,
|
| 86 |
+
"type": "str"
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
"default": "None",
|
| 90 |
+
"description": "issue_type",
|
| 91 |
+
"name": "issue_type",
|
| 92 |
+
"required": false,
|
| 93 |
+
"type": "str"
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"default": "None",
|
| 97 |
+
"description": "component",
|
| 98 |
+
"name": "component",
|
| 99 |
+
"required": false,
|
| 100 |
+
"type": "str"
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"default": "50",
|
| 104 |
+
"description": "limit",
|
| 105 |
+
"name": "limit",
|
| 106 |
+
"required": false,
|
| 107 |
+
"type": "int"
|
| 108 |
+
}
|
| 109 |
+
],
|
| 110 |
+
"read_tables": [
|
| 111 |
+
"jira_issues"
|
| 112 |
+
],
|
| 113 |
+
"return_type": "list[dict]",
|
| 114 |
+
"source_code": "def jira_search(db_path=None, project=None, status=None, issue_type=None, component=None, limit=50):\n \"\"\"Search Jira issues. Jira status is a per-project workflow, not open/closed: a resolved issue has status='Done' AND a resolution set. Filter by project, status, issue_type, component or priority.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('jira_search',)); conn.commit()\n except Exception:\n pass\n sql = 'SELECT * FROM jira_issues'\n conds, args = [], []\n for col, val in (('project', project), ('status', status), ('issue_type', issue_type),\n ('component', component)):\n if val:\n conds.append(col + '=?'); args.append(val)\n if conds:\n sql += ' WHERE ' + ' AND '.join(conds)\n return [dict(r) for r in conn.execute(sql + ' ORDER BY key LIMIT ?', args + [int(limit)]).fetchall()]\n finally:\n conn.close()\n",
|
| 115 |
+
"tool_id": "tool_jira_search",
|
| 116 |
+
"write_tables": []
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"description": "Transition a Jira issue. Jira status is a per-project workflow, so moving an issue to 'Done' does NOT by itself mean it was fixed - a completed issue also carries a resolution (e.g. 'Fixed'). Set both.",
|
| 120 |
+
"json_schema": {
|
| 121 |
+
"description": "Transition a Jira issue. Jira status is a per-project workflow, so moving an issue to 'Done' does NOT by itself mean it was fixed - a completed issue also carries a resolution (e.g. 'Fixed'). Set both.",
|
| 122 |
+
"name": "jira_transition_issue",
|
| 123 |
+
"parameters": {
|
| 124 |
+
"properties": {
|
| 125 |
+
"key": {
|
| 126 |
+
"description": "key",
|
| 127 |
+
"type": "string"
|
| 128 |
+
},
|
| 129 |
+
"resolution": {
|
| 130 |
+
"description": "resolution",
|
| 131 |
+
"type": "string"
|
| 132 |
+
},
|
| 133 |
+
"status": {
|
| 134 |
+
"description": "status",
|
| 135 |
+
"enum": [
|
| 136 |
+
"Backlog",
|
| 137 |
+
"In Progress",
|
| 138 |
+
"In Review",
|
| 139 |
+
"Blocked",
|
| 140 |
+
"Done"
|
| 141 |
+
],
|
| 142 |
+
"type": "string"
|
| 143 |
+
}
|
| 144 |
+
},
|
| 145 |
+
"required": [
|
| 146 |
+
"key",
|
| 147 |
+
"status"
|
| 148 |
+
],
|
| 149 |
+
"type": "object"
|
| 150 |
+
}
|
| 151 |
+
},
|
| 152 |
+
"name": "jira_transition_issue",
|
| 153 |
+
"parameters": [
|
| 154 |
+
{
|
| 155 |
+
"default": null,
|
| 156 |
+
"description": "key",
|
| 157 |
+
"name": "key",
|
| 158 |
+
"required": true,
|
| 159 |
+
"type": "str"
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"default": null,
|
| 163 |
+
"description": "status",
|
| 164 |
+
"name": "status",
|
| 165 |
+
"required": true,
|
| 166 |
+
"type": "str"
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"default": "",
|
| 170 |
+
"description": "resolution",
|
| 171 |
+
"name": "resolution",
|
| 172 |
+
"required": false,
|
| 173 |
+
"type": "str"
|
| 174 |
+
}
|
| 175 |
+
],
|
| 176 |
+
"read_tables": [
|
| 177 |
+
"jira_issues"
|
| 178 |
+
],
|
| 179 |
+
"return_type": "dict",
|
| 180 |
+
"source_code": "def jira_transition_issue(db_path=None, key=None, status=None, resolution=''):\n \"\"\"Transition a Jira issue. Jira status is a per-project workflow, so moving an issue to 'Done' does NOT by itself mean it was fixed - a completed issue also carries a resolution (e.g. 'Fixed'). Set both.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('jira_transition_issue',)); conn.commit()\n except Exception:\n pass\n if key is None:\n return {'ok': False, 'error': 'missing required parameter: key'}\n if status is None:\n return {'ok': False, 'error': 'missing required parameter: status'}\n def _audit(conn, _tool, _svc, _detail):\n conn.execute('INSERT INTO audit_events(tool, service, detail) VALUES (?,?,?)', (_tool, _svc, _json.dumps(_detail)))\n row = conn.execute('SELECT * FROM jira_issues WHERE key=?', (key,)).fetchone()\n if row is None:\n return {'ok': False, 'error': 'no such Jira issue: ' + str(key)}\n valid = ('Backlog', 'In Progress', 'In Review', 'Blocked', 'Done')\n if status not in valid:\n return {'ok': False, 'error': 'status must be one of: ' + ', '.join(valid)}\n if status == 'Done' and not (resolution or '').strip():\n return {'ok': False, 'error': 'transitioning to Done requires a resolution '\n '(for example Fixed) - a status alone does not record the outcome'}\n conn.execute('UPDATE jira_issues SET status=?, resolution=? WHERE key=?',\n (status, resolution or '', key))\n _audit(conn, 'jira_transition_issue', row['component'] or '',\n {'key': key, 'status': status, 'resolution': resolution or ''})\n conn.commit()\n return {'ok': True, 'key': key, 'status': status, 'resolution': resolution or ''}\n finally:\n conn.close()\n",
|
| 181 |
+
"tool_id": "tool_jira_transition_issue",
|
| 182 |
+
"write_tables": [
|
| 183 |
+
"audit_events",
|
| 184 |
+
"jira_issues"
|
| 185 |
+
]
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"description": "Update a ticket's status and/or assignee.",
|
| 189 |
+
"json_schema": {
|
| 190 |
+
"description": "Update a ticket's status and/or assignee.",
|
| 191 |
+
"name": "update_ticket",
|
| 192 |
+
"parameters": {
|
| 193 |
+
"properties": {
|
| 194 |
+
"assignee": {
|
| 195 |
+
"description": "assignee",
|
| 196 |
+
"type": "string"
|
| 197 |
+
},
|
| 198 |
+
"key": {
|
| 199 |
+
"description": "key",
|
| 200 |
+
"type": "string"
|
| 201 |
+
},
|
| 202 |
+
"status": {
|
| 203 |
+
"description": "open|in_progress|in_review|done",
|
| 204 |
+
"enum": [
|
| 205 |
+
"open",
|
| 206 |
+
"in_progress",
|
| 207 |
+
"in_review",
|
| 208 |
+
"done"
|
| 209 |
+
],
|
| 210 |
+
"type": "string"
|
| 211 |
+
}
|
| 212 |
+
},
|
| 213 |
+
"required": [
|
| 214 |
+
"key"
|
| 215 |
+
],
|
| 216 |
+
"type": "object"
|
| 217 |
+
}
|
| 218 |
+
},
|
| 219 |
+
"name": "update_ticket",
|
| 220 |
+
"parameters": [
|
| 221 |
+
{
|
| 222 |
+
"default": null,
|
| 223 |
+
"description": "key",
|
| 224 |
+
"name": "key",
|
| 225 |
+
"required": true,
|
| 226 |
+
"type": "str"
|
| 227 |
+
},
|
| 228 |
+
{
|
| 229 |
+
"default": "None",
|
| 230 |
+
"description": "open|in_progress|in_review|done",
|
| 231 |
+
"name": "status",
|
| 232 |
+
"required": false,
|
| 233 |
+
"type": "str"
|
| 234 |
+
},
|
| 235 |
+
{
|
| 236 |
+
"default": "None",
|
| 237 |
+
"description": "assignee",
|
| 238 |
+
"name": "assignee",
|
| 239 |
+
"required": false,
|
| 240 |
+
"type": "str"
|
| 241 |
+
}
|
| 242 |
+
],
|
| 243 |
+
"read_tables": [
|
| 244 |
+
"tickets"
|
| 245 |
+
],
|
| 246 |
+
"return_type": "dict",
|
| 247 |
+
"source_code": "def update_ticket(db_path=None, key=None, status=None, assignee=None):\n \"\"\"Update a ticket's status and/or assignee.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('update_ticket',)); conn.commit()\n except Exception:\n pass\n if key is None:\n return {'ok': False, 'error': 'missing required parameter: key'}\n def _audit(conn, _tool, _svc, _detail):\n conn.execute('INSERT INTO audit_events(tool, service, detail) VALUES (?,?,?)', (_tool, _svc, _json.dumps(_detail)))\n row = conn.execute('SELECT * FROM tickets WHERE key=?', (key,)).fetchone()\n if row is None:\n return {'ok': False, 'error': 'no such ticket: ' + str(key)}\n if status is None and assignee is None:\n return {'ok': False, 'error': 'provide status and/or assignee'}\n if status is not None and status not in ('open', 'in_progress', 'in_review', 'done'):\n return {'ok': False, 'error': 'invalid status: ' + str(status)}\n ns = row['status'] if status is None else status\n na = row['assignee'] if assignee is None else assignee\n conn.execute('UPDATE tickets SET status=?, assignee=? WHERE key=?', (ns, na, key))\n _audit(conn, 'update_ticket', row['service'], {'key': key, 'status': ns})\n conn.commit()\n return {'ok': True, 'key': key, 'status': ns, 'assignee': na}\n finally:\n conn.close()\n",
|
| 248 |
+
"tool_id": "tool_update_ticket",
|
| 249 |
+
"write_tables": [
|
| 250 |
+
"audit_events",
|
| 251 |
+
"tickets"
|
| 252 |
+
]
|
| 253 |
+
}
|
| 254 |
+
]
|
| 255 |
+
}
|
task_files/dob100-037-port-copy-priority-issues/01-work-ticket.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 01 Work Ticket
|
| 2 |
+
|
| 3 |
+
## tickets (187 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"ticket_id": 9101,
|
| 9 |
+
"key": "ENG-2101",
|
| 10 |
+
"type": "bug",
|
| 11 |
+
"title": "Payments error rate breaching the 1% SLO",
|
| 12 |
+
"description": "payments error_rate_pct is 4.2% against a 1.0% SLO (alarm 9601) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 13 |
+
"status": "open",
|
| 14 |
+
"priority": "critical",
|
| 15 |
+
"assignee": "",
|
| 16 |
+
"service": "payments"
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"ticket_id": 9102,
|
| 20 |
+
"key": "ENG-2102",
|
| 21 |
+
"type": "bug",
|
| 22 |
+
"title": "Inventory reservations failing under peak traffic",
|
| 23 |
+
"description": "inventory error_rate_pct is 4.7% against a 1.0% SLO (alarm 9606) and incident 9703 is open Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 24 |
+
"status": "open",
|
| 25 |
+
"priority": "high",
|
| 26 |
+
"assignee": "",
|
| 27 |
+
"service": "inventory"
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"ticket_id": 9103,
|
| 31 |
+
"key": "ENG-2103",
|
| 32 |
+
"type": "bug",
|
| 33 |
+
"title": "Analytics worker restarting under queue load",
|
| 34 |
+
"description": "analytics-worker error_rate_pct is 6.0% against a 2.0% SLO (alarm 9609) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 35 |
+
"status": "open",
|
| 36 |
+
"priority": "high",
|
| 37 |
+
"assignee": "",
|
| 38 |
+
"service": "analytics-worker"
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"ticket_id": 9104,
|
| 42 |
+
"key": "ENG-2104",
|
| 43 |
+
"type": "bug",
|
| 44 |
+
"title": "Notification delivery failures from hung SMTP calls",
|
| 45 |
+
"description": "notifications error_rate_pct is 3.6% against a 1.5% SLO (alarm 9608) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 46 |
+
"status": "open",
|
| 47 |
+
"priority": "high",
|
| 48 |
+
"assignee": "",
|
| 49 |
+
"service": "notifications"
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"ticket_id": 9105,
|
| 53 |
+
"key": "ENG-2105",
|
| 54 |
+
"type": "bug",
|
| 55 |
+
"title": "Payments: eliminate the permanent-failure path on notification timeouts",
|
| 56 |
+
"description": "payments error_rate_pct is 4.2% (SLO 1.0%) and the error tracker shows 18k events on 'pay-timeout-01' Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 57 |
+
"status": "open",
|
| 58 |
+
"priority": "critical",
|
| 59 |
+
"assignee": "",
|
| 60 |
+
"service": "payments"
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"ticket_id": 9106,
|
| 64 |
+
"key": "ENG-2106",
|
| 65 |
+
"type": "bug",
|
| 66 |
+
"title": "Payments waits 30s on the notifications call",
|
| 67 |
+
"description": "payments waits 30s on the notifications call, far beyond the standard Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 68 |
+
"status": "open",
|
| 69 |
+
"priority": "medium",
|
| 70 |
+
"assignee": "",
|
| 71 |
+
"service": "payments"
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"ticket_id": 9107,
|
| 75 |
+
"key": "ENG-2107",
|
| 76 |
+
"type": "bug",
|
| 77 |
+
"title": "Checkout waits 8s on the payments call",
|
| 78 |
+
"description": "checkout waits 8s on the payments call, beyond the standard Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 79 |
+
"status": "open",
|
| 80 |
+
"priority": "medium",
|
| 81 |
+
"assignee": "",
|
| 82 |
+
"service": "checkout"
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"ticket_id": 9108,
|
| 86 |
+
"key": "ENG-2108",
|
| 87 |
+
"type": "bug",
|
| 88 |
+
"title": "Analytics rollups run in batches large enough to amplify memory pressure",
|
| 89 |
+
"description": "large rollup batches amplify memory pressure on the consumer Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 90 |
+
"status": "open",
|
| 91 |
+
"priority": "low",
|
| 92 |
+
"assignee": "",
|
| 93 |
+
"service": "analytics-worker"
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"ticket_id": 9109,
|
| 97 |
+
"key": "ENG-2201",
|
| 98 |
+
"type": "bug",
|
| 99 |
+
"title": "Search p99 latency exceeds the 300ms SLO",
|
| 100 |
+
"description": "search latency_p99_ms is 850ms against a 300ms SLO (alarm 9602) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 101 |
+
"status": "open",
|
| 102 |
+
"priority": "high",
|
| 103 |
+
"assignee": "",
|
| 104 |
+
"service": "search"
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"ticket_id": 9110,
|
| 108 |
+
"key": "ENG-2202",
|
| 109 |
+
"type": "bug",
|
| 110 |
+
"title": "Catalog pricing p99 regression",
|
| 111 |
+
"description": "catalog latency_p99_ms is 645ms against a 300ms SLO (alarm 9605) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 112 |
+
"status": "open",
|
| 113 |
+
"priority": "high",
|
| 114 |
+
"assignee": "",
|
| 115 |
+
"service": "catalog"
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"ticket_id": 9111,
|
| 119 |
+
"key": "ENG-2203",
|
| 120 |
+
"type": "bug",
|
| 121 |
+
"title": "Media assets served from origin instead of the CDN",
|
| 122 |
+
"description": "media-service latency_p99_ms is 800ms against a 400ms SLO (alarm 9607) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 123 |
+
"status": "open",
|
| 124 |
+
"priority": "medium",
|
| 125 |
+
"assignee": "",
|
| 126 |
+
"service": "media-service"
|
| 127 |
+
},
|
| 128 |
+
{
|
| 129 |
+
"ticket_id": 9112,
|
| 130 |
+
"key": "ENG-2204",
|
| 131 |
+
"type": "bug",
|
| 132 |
+
"title": "Catalog: remove the N+1 pricing query from the hot path",
|
| 133 |
+
"description": "catalog latency_p99_ms is 645ms (SLO 300ms) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 134 |
+
"status": "open",
|
| 135 |
+
"priority": "high",
|
| 136 |
+
"assignee": "",
|
| 137 |
+
"service": "catalog"
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"ticket_id": 9113,
|
| 141 |
+
"key": "ENG-2205",
|
| 142 |
+
"type": "bug",
|
| 143 |
+
"title": "API gateway holds a new upstream connection per request",
|
| 144 |
+
"description": "the gateway opens a new upstream connection per request and never releases it Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 145 |
+
"status": "open",
|
| 146 |
+
"priority": "high",
|
| 147 |
+
"assignee": "",
|
| 148 |
+
"service": "api-gateway"
|
| 149 |
+
},
|
| 150 |
+
{
|
| 151 |
+
"ticket_id": 9114,
|
| 152 |
+
"key": "ENG-2206",
|
| 153 |
+
"type": "bug",
|
| 154 |
+
"title": "Catalog cache entries expire sooner than the standard allows",
|
| 155 |
+
"description": "catalog caches entries for only 120s, well under the standard Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 156 |
+
"status": "open",
|
| 157 |
+
"priority": "low",
|
| 158 |
+
"assignee": "",
|
| 159 |
+
"service": "catalog"
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"ticket_id": 9115,
|
| 163 |
+
"key": "ENG-2207",
|
| 164 |
+
"type": "bug",
|
| 165 |
+
"title": "Search query fan-out is narrower than the index can support",
|
| 166 |
+
"description": "search queries fan out over only 4 shards at 180 rps Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.",
|
| 167 |
+
"status": "open",
|
| 168 |
+
"priority": "medium",
|
| 169 |
+
"assignee": "",
|
| 170 |
+
"service": "search"
|
| 171 |
+
},
|
| 172 |
+
{
|
| 173 |
+
"ticket_id": 9116,
|
| 174 |
+
"key": "ENG-2208",
|
| 175 |
+
"type": "incident",
|
| 176 |
+
"title": "SEV1: api-gateway latency surge since the v5.1.0 rollout",
|
| 177 |
+
"description": "Incident 9701: api-gateway p99 latency surged right after v5.1.0 was promoted.",
|
| 178 |
+
"status": "open",
|
| 179 |
+
"priority": "critical",
|
| 180 |
+
"assignee": "",
|
| 181 |
+
"service": "api-gateway"
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"ticket_id": 9117,
|
| 185 |
+
"key": "ENG-2301",
|
| 186 |
+
"type": "feature",
|
| 187 |
+
"title": "Ship express checkout behind a feature flag at 10%",
|
| 188 |
+
"description": "Implement the express_checkout module in the checkout service, gated behind a NEW feature flag named 'express_checkout', and roll it out to 10% of production traffic.",
|
| 189 |
+
"status": "open",
|
| 190 |
+
"priority": "medium",
|
| 191 |
+
"assignee": "",
|
| 192 |
+
"service": "checkout"
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"ticket_id": 9118,
|
| 196 |
+
"key": "ENG-2302",
|
| 197 |
+
"type": "feature",
|
| 198 |
+
"title": "Ship search autocomplete behind a feature flag",
|
| 199 |
+
"description": "Implement the autocomplete module in the search service, gated behind a NEW feature flag named 'search_autocomplete', and roll it out to 10% of production traffic.",
|
| 200 |
+
"status": "open",
|
| 201 |
+
"priority": "medium",
|
| 202 |
+
"assignee": "",
|
| 203 |
+
"service": "search"
|
| 204 |
+
},
|
| 205 |
+
{
|
| 206 |
+
"ticket_id": 9119,
|
| 207 |
+
"key": "ENG-2303",
|
| 208 |
+
"type": "feature",
|
| 209 |
+
"title": "Ship saved carts (schema change) behind a feature flag",
|
| 210 |
+
"description": "Implement the saved_carts module in the checkout service, gated behind a NEW feature flag named 'saved_carts', and roll it out to 10% of production traffic.",
|
| 211 |
+
"status": "open",
|
| 212 |
+
"priority": "medium",
|
| 213 |
+
"assignee": "",
|
| 214 |
+
"service": "checkout"
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
"ticket_id": 9120,
|
| 218 |
+
"key": "ENG-2304",
|
| 219 |
+
"type": "feature",
|
| 220 |
+
"title": "Ship WebP delivery behind a feature flag",
|
| 221 |
+
"description": "Implement the webp_pipeline module in media-service, gated behind a NEW feature flag named 'webp_delivery', and roll it out to 10% of production traffic.",
|
| 222 |
+
"status": "open",
|
| 223 |
+
"priority": "low",
|
| 224 |
+
"assignee": "",
|
| 225 |
+
"service": "media-service"
|
| 226 |
+
}
|
| 227 |
+
]
|
| 228 |
+
```
|
task_files/dob100-037-port-copy-priority-issues/02-service-catalog.csv
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_table,depends_on,description,environment,key,kind,language,name,repo_version,service,service_id,team,tier,value
|
| 2 |
+
services,,"Customer-facing storefront (Next.js): browse, cart, checkout UI.",,,frontend,typescript,storefront-web,v3.2.4,,9001,growth,1,
|
| 3 |
+
services,,"Public API edge: routing, auth, rate limiting, traffic weighting.",,,backend,go,api-gateway,v5.1.0,,9002,platform,1,
|
| 4 |
+
services,,"Product catalog, pricing, and merchandising.",,,backend,python,catalog,v1.9.2,,9003,commerce,2,
|
| 5 |
+
services,,Cart and checkout orchestration.,,,backend,python,checkout,v2.6.3,,9004,commerce,1,
|
| 6 |
+
service_dependencies,api-gateway,,,,http,,,,storefront-web,,,,
|
| 7 |
+
service_dependencies,cdn-edge,,,,cdn,,,,storefront-web,,,,
|
| 8 |
+
service_dependencies,checkout,,,,http,,,,api-gateway,,,,
|
| 9 |
+
service_dependencies,catalog,,,,http,,,,api-gateway,,,,
|
| 10 |
+
env_state,,,staging,/internal/debug,endpoint,,,,api-gateway,,,,active
|
| 11 |
+
env_state,,,production,/internal/debug,endpoint,,,,api-gateway,,,,active
|
| 12 |
+
env_state,,,production,/internal/debug,traffic,,,,api-gateway,,,,0
|
task_files/dob100-037-port-copy-priority-issues/03-observability.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"environment": "production", "metric": "error_rate_pct", "service": "payments", "source_table": "service_metrics", "value": 4.2}
|
| 2 |
+
{"environment": "production", "metric": "latency_p99_ms", "service": "search", "source_table": "service_metrics", "value": 850.0}
|
| 3 |
+
{"environment": "production", "metric": "error_rate_pct", "service": "checkout", "source_table": "service_metrics", "value": 5.5}
|
| 4 |
+
{"environment": "production", "metric": "latency_p99_ms", "service": "api-gateway", "source_table": "service_metrics", "value": 1030.0}
|
| 5 |
+
{"environment": "production", "level": "INFO", "log_id": 9023, "message": "traffic split: /v1/orders 100%, /v2/orders 0%; /internal/debug reachable without auth", "service": "api-gateway", "source_table": "logs"}
|
| 6 |
+
{"culprit": "src/payments/notify_client.py in send_receipt", "event_id": 1, "events": 18422, "fingerprint": "pay-timeout-01", "service": "payments", "source_table": "error_events", "status": "unresolved", "title": "ConnectionTimeout: notifications call exceeded 30000ms"}
|
| 7 |
+
{"culprit": "src/checkout/refunds.py in instant_refund", "event_id": 2, "events": 9310, "fingerprint": "chk-nil-refund", "service": "checkout", "source_table": "error_events", "status": "unresolved", "title": "TypeError: NoneType has no attribute 'amount'"}
|
| 8 |
+
{"culprit": "internal/proxy/pool.go in Acquire", "event_id": 3, "events": 24187, "fingerprint": "gw-pool-exhaust", "service": "api-gateway", "source_table": "error_events", "status": "unresolved", "title": "dial tcp: connection pool exhausted"}
|
| 9 |
+
{"culprit": "StockRepository.reserve", "event_id": 4, "events": 7740, "fingerprint": "inv-pool-wait", "service": "inventory", "source_table": "error_events", "status": "unresolved", "title": "SQLTimeoutException: connection wait timeout"}
|
| 10 |
+
{"counter_reset": 0, "day": 418, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 1, "source_table": "prom_series", "value": 138.0}
|
| 11 |
+
{"counter_reset": 0, "day": 419, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 2, "source_table": "prom_series", "value": 141.0}
|
| 12 |
+
{"counter_reset": 0, "day": 420, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 3, "source_table": "prom_series", "value": 139.0}
|
| 13 |
+
{"counter_reset": 0, "day": 418, "label_env": "production", "label_service": "checkout_service", "metric": "http_errors_total:rate5m", "series_id": 4, "source_table": "prom_series", "value": 7.6}
|
| 14 |
+
{"events": 2317, "first_seen_day": 410, "issue_id": "CHECKOUT-1A", "last_seen_day": 420, "level": "error", "project_slug": "checkout-web", "source_table": "sentry_issues", "status": "unresolved", "title": "TypeError: NoneType has no attribute 'amount'", "users_affected": 890}
|
| 15 |
+
{"events": 1904, "first_seen_day": 409, "issue_id": "CHECKOUT-2B", "last_seen_day": 420, "level": "error", "project_slug": "checkout-web", "source_table": "sentry_issues", "status": "unresolved", "title": "TimeoutError: payments call exceeded 8000ms", "users_affected": 1502}
|
| 16 |
+
{"events": 18422, "first_seen_day": 405, "issue_id": "PAY-9C", "last_seen_day": 420, "level": "error", "project_slug": "payments-backend", "source_table": "sentry_issues", "status": "unresolved", "title": "ConnectionTimeout: notifications call exceeded 30000ms", "users_affected": 6210}
|
| 17 |
+
{"events": 640, "first_seen_day": 414, "issue_id": "SRCH-3D", "last_seen_day": 419, "level": "warning", "project_slug": "search", "source_table": "sentry_issues", "status": "resolved", "title": "IndexRefreshTimeout", "users_affected": 210}
|
task_files/dob100-037-port-copy-priority-issues/04-incident-room.json
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"incident_id",
|
| 6 |
+
"severity",
|
| 7 |
+
"title",
|
| 8 |
+
"service",
|
| 9 |
+
"status",
|
| 10 |
+
"commander"
|
| 11 |
+
],
|
| 12 |
+
"row_count": 3,
|
| 13 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 14 |
+
"table": "incidents",
|
| 15 |
+
"task_relevant_rows": [
|
| 16 |
+
{
|
| 17 |
+
"commander": "",
|
| 18 |
+
"incident_id": 9701,
|
| 19 |
+
"service": "api-gateway",
|
| 20 |
+
"severity": "sev1",
|
| 21 |
+
"status": "open",
|
| 22 |
+
"title": "API gateway latency surge after v5.1.0 rollout"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"commander": "",
|
| 26 |
+
"incident_id": 9702,
|
| 27 |
+
"service": "checkout",
|
| 28 |
+
"severity": "sev2",
|
| 29 |
+
"status": "open",
|
| 30 |
+
"title": "Checkout error spike since instant_refunds ramp"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"commander": "",
|
| 34 |
+
"incident_id": 9703,
|
| 35 |
+
"service": "inventory",
|
| 36 |
+
"severity": "sev2",
|
| 37 |
+
"status": "open",
|
| 38 |
+
"title": "Inventory reservation failures during peak"
|
| 39 |
+
}
|
| 40 |
+
]
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"columns": [
|
| 44 |
+
"alert_id",
|
| 45 |
+
"service",
|
| 46 |
+
"metric",
|
| 47 |
+
"severity",
|
| 48 |
+
"status",
|
| 49 |
+
"message"
|
| 50 |
+
],
|
| 51 |
+
"row_count": 10,
|
| 52 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 53 |
+
"table": "alerts",
|
| 54 |
+
"task_relevant_rows": [
|
| 55 |
+
{
|
| 56 |
+
"alert_id": 9601,
|
| 57 |
+
"message": "payments error_rate_pct 4.2 exceeds SLO 1.0",
|
| 58 |
+
"metric": "error_rate_pct",
|
| 59 |
+
"service": "payments",
|
| 60 |
+
"severity": "high",
|
| 61 |
+
"status": "firing"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"alert_id": 9603,
|
| 65 |
+
"message": "checkout error_rate_pct 5.5 exceeds SLO 1.0",
|
| 66 |
+
"metric": "error_rate_pct",
|
| 67 |
+
"service": "checkout",
|
| 68 |
+
"severity": "high",
|
| 69 |
+
"status": "firing"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"alert_id": 9606,
|
| 73 |
+
"message": "inventory error_rate_pct 4.7 exceeds SLO 1.0",
|
| 74 |
+
"metric": "error_rate_pct",
|
| 75 |
+
"service": "inventory",
|
| 76 |
+
"severity": "high",
|
| 77 |
+
"status": "firing"
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"alert_id": 9610,
|
| 81 |
+
"message": "checkout latency_p99_ms 530.0 exceeds SLO 400.0",
|
| 82 |
+
"metric": "latency_p99_ms",
|
| 83 |
+
"service": "checkout",
|
| 84 |
+
"severity": "high",
|
| 85 |
+
"status": "firing"
|
| 86 |
+
}
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"columns": [
|
| 91 |
+
"incident_number",
|
| 92 |
+
"title",
|
| 93 |
+
"pd_service_id",
|
| 94 |
+
"urgency",
|
| 95 |
+
"priority",
|
| 96 |
+
"status",
|
| 97 |
+
"created_day",
|
| 98 |
+
"resolved_day"
|
| 99 |
+
],
|
| 100 |
+
"row_count": 7,
|
| 101 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 102 |
+
"table": "pd_incidents",
|
| 103 |
+
"task_relevant_rows": [
|
| 104 |
+
{
|
| 105 |
+
"created_day": 411,
|
| 106 |
+
"incident_number": 5101,
|
| 107 |
+
"pd_service_id": "PSVC001",
|
| 108 |
+
"priority": "P2",
|
| 109 |
+
"resolved_day": 412,
|
| 110 |
+
"status": "resolved",
|
| 111 |
+
"title": "Elevated checkout latency",
|
| 112 |
+
"urgency": "high"
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
"created_day": 414,
|
| 116 |
+
"incident_number": 5102,
|
| 117 |
+
"pd_service_id": "PSVC002",
|
| 118 |
+
"priority": "P1",
|
| 119 |
+
"resolved_day": null,
|
| 120 |
+
"status": "triggered",
|
| 121 |
+
"title": "Payments error rate above SLO",
|
| 122 |
+
"urgency": "high"
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"created_day": 416,
|
| 126 |
+
"incident_number": 5103,
|
| 127 |
+
"pd_service_id": "PSVC003",
|
| 128 |
+
"priority": "P1",
|
| 129 |
+
"resolved_day": null,
|
| 130 |
+
"status": "acknowledged",
|
| 131 |
+
"title": "Gateway latency surge after release",
|
| 132 |
+
"urgency": "high"
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"created_day": 415,
|
| 136 |
+
"incident_number": 5105,
|
| 137 |
+
"pd_service_id": "PSVC005",
|
| 138 |
+
"priority": "P2",
|
| 139 |
+
"resolved_day": null,
|
| 140 |
+
"status": "triggered",
|
| 141 |
+
"title": "Inventory reservation timeouts",
|
| 142 |
+
"urgency": "high"
|
| 143 |
+
},
|
| 144 |
+
{
|
| 145 |
+
"created_day": 417,
|
| 146 |
+
"incident_number": 5106,
|
| 147 |
+
"pd_service_id": "PSVC001",
|
| 148 |
+
"priority": "P2",
|
| 149 |
+
"resolved_day": 418,
|
| 150 |
+
"status": "resolved",
|
| 151 |
+
"title": "Checkout latency spike (recurrence)",
|
| 152 |
+
"urgency": "high"
|
| 153 |
+
}
|
| 154 |
+
]
|
| 155 |
+
},
|
| 156 |
+
{
|
| 157 |
+
"columns": [
|
| 158 |
+
"pd_service_id",
|
| 159 |
+
"name",
|
| 160 |
+
"escalation_policy",
|
| 161 |
+
"status"
|
| 162 |
+
],
|
| 163 |
+
"row_count": 5,
|
| 164 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 165 |
+
"table": "pd_services",
|
| 166 |
+
"task_relevant_rows": [
|
| 167 |
+
{
|
| 168 |
+
"escalation_policy": "EP-Commerce",
|
| 169 |
+
"name": "checkout-api",
|
| 170 |
+
"pd_service_id": "PSVC001",
|
| 171 |
+
"status": "active"
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"escalation_policy": "EP-Commerce",
|
| 175 |
+
"name": "payments-api",
|
| 176 |
+
"pd_service_id": "PSVC002",
|
| 177 |
+
"status": "active"
|
| 178 |
+
},
|
| 179 |
+
{
|
| 180 |
+
"escalation_policy": "EP-Platform",
|
| 181 |
+
"name": "edge-gateway",
|
| 182 |
+
"pd_service_id": "PSVC003",
|
| 183 |
+
"status": "active"
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"escalation_policy": "EP-Growth",
|
| 187 |
+
"name": "search-svc",
|
| 188 |
+
"pd_service_id": "PSVC004",
|
| 189 |
+
"status": "active"
|
| 190 |
+
}
|
| 191 |
+
]
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"columns": [
|
| 195 |
+
"schedule_id",
|
| 196 |
+
"schedule_name",
|
| 197 |
+
"escalation_policy",
|
| 198 |
+
"user_name",
|
| 199 |
+
"day"
|
| 200 |
+
],
|
| 201 |
+
"row_count": 4,
|
| 202 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 203 |
+
"table": "pd_oncall",
|
| 204 |
+
"task_relevant_rows": [
|
| 205 |
+
{
|
| 206 |
+
"day": 418,
|
| 207 |
+
"escalation_policy": "EP-Commerce",
|
| 208 |
+
"schedule_id": "SCHED-COM",
|
| 209 |
+
"schedule_name": "Commerce primary",
|
| 210 |
+
"user_name": "Diego Ramos"
|
| 211 |
+
},
|
| 212 |
+
{
|
| 213 |
+
"day": 419,
|
| 214 |
+
"escalation_policy": "EP-Commerce",
|
| 215 |
+
"schedule_id": "SCHED-COM",
|
| 216 |
+
"schedule_name": "Commerce primary",
|
| 217 |
+
"user_name": "Diego Ramos"
|
| 218 |
+
},
|
| 219 |
+
{
|
| 220 |
+
"day": 419,
|
| 221 |
+
"escalation_policy": "EP-Platform",
|
| 222 |
+
"schedule_id": "SCHED-PLT",
|
| 223 |
+
"schedule_name": "Platform primary",
|
| 224 |
+
"user_name": "Priya Nair"
|
| 225 |
+
},
|
| 226 |
+
{
|
| 227 |
+
"day": 419,
|
| 228 |
+
"escalation_policy": "EP-Growth",
|
| 229 |
+
"schedule_id": "SCHED-GRW",
|
| 230 |
+
"schedule_name": "Growth primary",
|
| 231 |
+
"user_name": "Mei Tanaka"
|
| 232 |
+
}
|
| 233 |
+
]
|
| 234 |
+
}
|
| 235 |
+
]
|
| 236 |
+
}
|
task_files/dob100-037-port-copy-priority-issues/05-deployment-state.json
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"deployment_id",
|
| 6 |
+
"service",
|
| 7 |
+
"environment",
|
| 8 |
+
"version",
|
| 9 |
+
"status",
|
| 10 |
+
"canary_percent"
|
| 11 |
+
],
|
| 12 |
+
"row_count": 22,
|
| 13 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 14 |
+
"table": "deployments",
|
| 15 |
+
"task_relevant_rows": [
|
| 16 |
+
{
|
| 17 |
+
"canary_percent": 100,
|
| 18 |
+
"deployment_id": 9251,
|
| 19 |
+
"environment": "staging",
|
| 20 |
+
"service": "storefront-web",
|
| 21 |
+
"status": "succeeded",
|
| 22 |
+
"version": "v3.2.4"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"canary_percent": 100,
|
| 26 |
+
"deployment_id": 9252,
|
| 27 |
+
"environment": "production",
|
| 28 |
+
"service": "storefront-web",
|
| 29 |
+
"status": "succeeded",
|
| 30 |
+
"version": "v3.2.4"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"canary_percent": 100,
|
| 34 |
+
"deployment_id": 9253,
|
| 35 |
+
"environment": "staging",
|
| 36 |
+
"service": "api-gateway",
|
| 37 |
+
"status": "succeeded",
|
| 38 |
+
"version": "v5.0.9"
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"canary_percent": 100,
|
| 42 |
+
"deployment_id": 9254,
|
| 43 |
+
"environment": "production",
|
| 44 |
+
"service": "api-gateway",
|
| 45 |
+
"status": "succeeded",
|
| 46 |
+
"version": "v5.0.9"
|
| 47 |
+
}
|
| 48 |
+
]
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"columns": [
|
| 52 |
+
"route_id",
|
| 53 |
+
"service",
|
| 54 |
+
"route",
|
| 55 |
+
"rps",
|
| 56 |
+
"share_pct"
|
| 57 |
+
],
|
| 58 |
+
"row_count": 13,
|
| 59 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 60 |
+
"table": "traffic_profile",
|
| 61 |
+
"task_relevant_rows": [
|
| 62 |
+
{
|
| 63 |
+
"route": "GET /",
|
| 64 |
+
"route_id": 9201,
|
| 65 |
+
"rps": 420,
|
| 66 |
+
"service": "storefront-web",
|
| 67 |
+
"share_pct": 100
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"route": "GET /product/:id",
|
| 71 |
+
"route_id": 9202,
|
| 72 |
+
"rps": 310,
|
| 73 |
+
"service": "storefront-web",
|
| 74 |
+
"share_pct": 100
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"route": "POST /v1/orders",
|
| 78 |
+
"route_id": 9203,
|
| 79 |
+
"rps": 145,
|
| 80 |
+
"service": "api-gateway",
|
| 81 |
+
"share_pct": 100
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"route": "POST /v2/orders",
|
| 85 |
+
"route_id": 9204,
|
| 86 |
+
"rps": 0,
|
| 87 |
+
"service": "api-gateway",
|
| 88 |
+
"share_pct": 0
|
| 89 |
+
}
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"columns": [
|
| 94 |
+
"service",
|
| 95 |
+
"desired_replicas",
|
| 96 |
+
"ready_replicas",
|
| 97 |
+
"strategy",
|
| 98 |
+
"storage_class"
|
| 99 |
+
],
|
| 100 |
+
"row_count": 10,
|
| 101 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 102 |
+
"table": "k8s_deployments",
|
| 103 |
+
"task_relevant_rows": [
|
| 104 |
+
{
|
| 105 |
+
"desired_replicas": 2,
|
| 106 |
+
"ready_replicas": 1,
|
| 107 |
+
"service": "analytics-worker",
|
| 108 |
+
"storage_class": "standard",
|
| 109 |
+
"strategy": "RollingUpdate"
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"desired_replicas": 3,
|
| 113 |
+
"ready_replicas": 3,
|
| 114 |
+
"service": "api-gateway",
|
| 115 |
+
"storage_class": "standard",
|
| 116 |
+
"strategy": "RollingUpdate"
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"desired_replicas": 3,
|
| 120 |
+
"ready_replicas": 3,
|
| 121 |
+
"service": "catalog",
|
| 122 |
+
"storage_class": "standard",
|
| 123 |
+
"strategy": "RollingUpdate"
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"desired_replicas": 64,
|
| 127 |
+
"ready_replicas": 6,
|
| 128 |
+
"service": "checkout",
|
| 129 |
+
"storage_class": "standard",
|
| 130 |
+
"strategy": "RollingUpdate"
|
| 131 |
+
}
|
| 132 |
+
]
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"columns": [
|
| 136 |
+
"pod",
|
| 137 |
+
"namespace",
|
| 138 |
+
"service",
|
| 139 |
+
"image_tag",
|
| 140 |
+
"phase",
|
| 141 |
+
"restarts",
|
| 142 |
+
"memory_limit_mb",
|
| 143 |
+
"memory_usage_mb",
|
| 144 |
+
"node",
|
| 145 |
+
"pending_reason"
|
| 146 |
+
],
|
| 147 |
+
"row_count": 14,
|
| 148 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 149 |
+
"table": "k8s_pods",
|
| 150 |
+
"task_relevant_rows": [
|
| 151 |
+
{
|
| 152 |
+
"image_tag": "v2.1.7",
|
| 153 |
+
"memory_limit_mb": 512,
|
| 154 |
+
"memory_usage_mb": 511,
|
| 155 |
+
"namespace": "production",
|
| 156 |
+
"node": "node-a1",
|
| 157 |
+
"pending_reason": "",
|
| 158 |
+
"phase": "CrashLoopBackOff",
|
| 159 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 160 |
+
"restarts": 47,
|
| 161 |
+
"service": "analytics-worker"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"image_tag": "v2.1.7",
|
| 165 |
+
"memory_limit_mb": 512,
|
| 166 |
+
"memory_usage_mb": 498,
|
| 167 |
+
"namespace": "production",
|
| 168 |
+
"node": "node-a1",
|
| 169 |
+
"pending_reason": "",
|
| 170 |
+
"phase": "Running",
|
| 171 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 172 |
+
"restarts": 39,
|
| 173 |
+
"service": "analytics-worker"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"image_tag": "v2.6.3",
|
| 177 |
+
"memory_limit_mb": 2048,
|
| 178 |
+
"memory_usage_mb": 890,
|
| 179 |
+
"namespace": "production",
|
| 180 |
+
"node": "node-a1",
|
| 181 |
+
"pending_reason": "",
|
| 182 |
+
"phase": "Running",
|
| 183 |
+
"pod": "checkout-5b8c-aa10",
|
| 184 |
+
"restarts": 0,
|
| 185 |
+
"service": "checkout"
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"image_tag": "v2.7.0",
|
| 189 |
+
"memory_limit_mb": 2048,
|
| 190 |
+
"memory_usage_mb": 1120,
|
| 191 |
+
"namespace": "production",
|
| 192 |
+
"node": "node-a2",
|
| 193 |
+
"pending_reason": "",
|
| 194 |
+
"phase": "Running",
|
| 195 |
+
"pod": "payments-6c1d-bb22",
|
| 196 |
+
"restarts": 0,
|
| 197 |
+
"service": "payments"
|
| 198 |
+
}
|
| 199 |
+
]
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"columns": [
|
| 203 |
+
"event_id",
|
| 204 |
+
"namespace",
|
| 205 |
+
"pod",
|
| 206 |
+
"reason",
|
| 207 |
+
"message",
|
| 208 |
+
"count",
|
| 209 |
+
"day"
|
| 210 |
+
],
|
| 211 |
+
"row_count": 8,
|
| 212 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 213 |
+
"table": "k8s_events",
|
| 214 |
+
"task_relevant_rows": [
|
| 215 |
+
{
|
| 216 |
+
"count": 47,
|
| 217 |
+
"day": 419,
|
| 218 |
+
"event_id": 9001,
|
| 219 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 220 |
+
"namespace": "production",
|
| 221 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 222 |
+
"reason": "OOMKilled"
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"count": 47,
|
| 226 |
+
"day": 419,
|
| 227 |
+
"event_id": 9002,
|
| 228 |
+
"message": "Back-off restarting failed container analytics",
|
| 229 |
+
"namespace": "production",
|
| 230 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 231 |
+
"reason": "CrashLoopBackOff"
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"count": 39,
|
| 235 |
+
"day": 420,
|
| 236 |
+
"event_id": 9003,
|
| 237 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 238 |
+
"namespace": "production",
|
| 239 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 240 |
+
"reason": "OOMKilled"
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"count": 1,
|
| 244 |
+
"day": 417,
|
| 245 |
+
"event_id": 9004,
|
| 246 |
+
"message": "Stopping container gateway for rollout",
|
| 247 |
+
"namespace": "production",
|
| 248 |
+
"pod": "api-gateway-9f2e-cc33",
|
| 249 |
+
"reason": "Killing"
|
| 250 |
+
}
|
| 251 |
+
]
|
| 252 |
+
}
|
| 253 |
+
]
|
| 254 |
+
}
|
task_files/dob100-037-port-copy-priority-issues/06-repository-context.txt
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"content": "\"\"\"Typed configuration loader for the payments service.\n\nResolution order, first hit wins: process environment\n(``NOVACART_PAYMENTS_<KEY>``), the document at ``/etc/novacart/payments.json``,\nthen ``_DEFAULTS``. Read once at start and cached, so changing a value needs a\ndeploy.\n\"\"\"\nfrom __future__ import annotations\n\nimport json\nimport logging\nimport os\nimport threading\n\nlog = logging.getLogger(__name__)\n\nCONFIG_PATH = os.environ.get(\"NOVACART_CONFIG_PATH\", \"/etc/novacart/payments.json\")\nENV_PREFIX = \"NOVACART_PAYMENTS_\"\n\n_DEFAULTS = {\n \"notifications_base_url\": \"http://notifications.internal:8080\",\n \"notifications_timeout_ms\": 30000,\n # Retry policy standard says 3 for every cross-service call.\n \"notifications_retry_max_attempts\": 0,\n \"db_pool_size\": 20,\n \"settlement_batch_size\": 250,\n \"capture_timeout_ms\": 8000,\n}\n\n_lock = threading.Lock()\n_cache = None\n\n\ndef _read_document(path):\n try:\n with open(path, \"r\", encoding=\"utf-8\") as handle:\n return json.load(handle)\n except FileNotFoundError:\n log.warning(\"config document %s missing; using compiled defaults\", path)\n return {}\n except json.JSONDecodeError:\n log.exception(\"config document %s is not valid JSON; refusing to guess\", path)\n raise\n\n\ndef load():\n \"\"\"Return the frozen config mapping, reading it on first call.\"\"\"\n global _cache\n with _lock:\n if _cache is not None:\n return _cache\n merged = dict(_DEFAULTS)\n merged.update(_read_document(CONFIG_PATH))\n for key, default in _DEFAULTS.items():\n raw = os.environ.get(ENV_PREFIX + key.upper())\n if raw is not None:\n merged[key] = int(raw) if isinstance(default, int) else raw\n log.info(\"startup config: %s\",\n \" \".join(\"%s=%s\" % (k, v) for k, v in sorted(merged.items())))\n _cache = merged\n return merged\n\n\ndef get(key, default=None):\n \"\"\"Return one config value. Unknown keys warn and fall back to ``default``.\"\"\"\n config = load()\n if key not in config:\n log.warning(\"config key %r is not declared in _DEFAULTS\", key)\n return default\n return config[key]\n", "file_id": 5, "language": "python", "loc": 70, "owner": "Diego Ramos", "path": "src/payments/settings.py", "service": "payments", "source_table": "repo_files"}
|
| 2 |
+
{"content": "\"\"\"Cart aggregate: line items, totals, and promotion application.\n\nTotals are computed in integer cents throughout. Rounding happens exactly once,\nat tax time, using banker's rounding to match the finance ledger.\n\"\"\"\nfrom __future__ import annotations\n\nimport logging\nfrom dataclasses import dataclass, field\nfrom decimal import ROUND_HALF_EVEN, Decimal\n\nfrom checkout import config\nfrom checkout.promotions import apply_promotions\n\nlog = logging.getLogger(__name__)\n\n\nclass CartLimitExceeded(ValueError):\n pass\n\n\n@dataclass\nclass LineItem:\n sku: str\n quantity: int\n unit_price_cents: int\n\n @property\n def subtotal_cents(self):\n return self.quantity * self.unit_price_cents\n\n\n@dataclass\nclass Cart:\n cart_id: str\n currency: str = config.CURRENCY_DEFAULT\n items: list = field(default_factory=list)\n promo_codes: list = field(default_factory=list)\n\n def add(self, item):\n if len(self.items) >= config.MAX_LINE_ITEMS:\n raise CartLimitExceeded(\"cart %s is full\" % self.cart_id)\n for existing in self.items:\n if existing.sku == item.sku:\n existing.quantity += item.quantity\n return existing\n self.items.append(item)\n return item\n\ndef subtotal_cents(cart):\n return sum(item.subtotal_cents for item in cart.items)\n\n\ndef tax_cents(taxable_cents, rate):\n product = Decimal(taxable_cents) * Decimal(str(rate))\n return int(product.quantize(Decimal(\"1\"), rounding=ROUND_HALF_EVEN))\n\n\ndef totals(cart, tax_rate=0.0, shipping_cents=0):\n gross = subtotal_cents(cart)\n discount = apply_promotions(cart, gross)\n taxable = max(gross - discount, 0)\n tax = tax_cents(taxable, tax_rate)\n total = taxable + tax + shipping_cents\n log.debug(\"totals cart=%s gross=%d discount=%d tax=%d total=%d\",\n cart.cart_id, gross, discount, tax, total)\n return {\"subtotal_cents\": gross, \"discount_cents\": discount, \"tax_cents\": tax,\n \"shipping_cents\": shipping_cents, \"total_cents\": total,\n \"currency\": cart.currency}\n", "file_id": 12, "language": "python", "loc": 69, "owner": "Nina Kowalski", "path": "src/checkout/cart.py", "service": "checkout", "source_table": "repo_files"}
|
| 3 |
+
{"content": "-- 0031_refund_ledger.sql\n-- Adds the refund ledger backing the instant_refunds pilot.\n-- Forward-only: the async settlement worker keeps writing to refund_intent,\n-- the inline path writes both rows in one transaction.\n\nBEGIN;\n\nCREATE TABLE IF NOT EXISTS refund_ledger (\n id BIGSERIAL PRIMARY KEY,\n order_id TEXT NOT NULL,\n processor_ref TEXT,\n amount_cents BIGINT NOT NULL CHECK (amount_cents > 0),\n currency CHAR(3) NOT NULL DEFAULT 'USD',\n status TEXT NOT NULL DEFAULT 'pending',\n actor TEXT NOT NULL,\n created_at TIMESTAMPTZ NOT NULL DEFAULT now(),\n settled_at TIMESTAMPTZ,\n CONSTRAINT refund_ledger_status_ck\n CHECK (status IN ('pending', 'settled', 'cancelled', 'failed'))\n);\n\n-- One open refund per order; settled/cancelled rows are kept for audit.\nCREATE UNIQUE INDEX IF NOT EXISTS refund_ledger_open_order_uq\n ON refund_ledger (order_id)\n WHERE status = 'pending';\n\nCREATE INDEX IF NOT EXISTS refund_ledger_settled_at_idx\n ON refund_ledger (settled_at DESC)\n WHERE settled_at IS NOT NULL;\n\nALTER TABLE refund_intent\n ADD COLUMN IF NOT EXISTS ledger_entry_id BIGINT REFERENCES refund_ledger (id);\n\nCOMMIT;\n", "file_id": 15, "language": "sql", "loc": 34, "owner": "Lena Ortiz", "path": "db/migrations/0031_refund_ledger.sql", "service": "checkout", "source_table": "repo_files"}
|
| 4 |
+
{"content": "\"\"\"Database access for the catalog service.\n\nMethods take and return domain objects from ``catalog.models``. Bulk variants\nexist for the hot paths; single-row variants remain for admin tooling.\n\"\"\"\nfrom __future__ import annotations\n\nimport logging\n\nfrom catalog.db import pool\nfrom catalog.models import Availability, Money, PriceRow, Product\n\nlog = logging.getLogger(__name__)\n\n_PRODUCT_COLUMNS = \"id, sku, title, category_id, availability, attributes, updated_at\"\n\n\ndef _to_product(row):\n return Product(id=row[\"id\"], sku=row[\"sku\"], title=row[\"title\"],\n category_id=row[\"category_id\"],\n availability=Availability(row[\"availability\"]),\n attributes=row[\"attributes\"] or {},\n updated_at=row[\"updated_at\"])\n\n\ndef _to_price(row):\n sale = None\n if row[\"sale_price_cents\"] is not None:\n sale = Money(row[\"sale_price_cents\"], row[\"currency\"])\n return PriceRow(product_id=row[\"product_id\"],\n list_price=Money(row[\"list_price_cents\"], row[\"currency\"]),\n sale_price=sale, price_tier=row[\"price_tier\"])\n\n\ndef list_products(category_id, limit=200):\n sql = (\"SELECT \" + _PRODUCT_COLUMNS + \" FROM product WHERE category_id = %s \"\n \"AND availability <> 'discontinued' ORDER BY rank_hint DESC, sku ASC \"\n \"LIMIT %s\")\n with pool.cursor() as cur:\n cur.execute(sql, (category_id, limit))\n rows = cur.fetchall()\n log.debug(\"list_products category=%s rows=%d\", category_id, len(rows))\n return [_to_product(row) for row in rows]\n\n\ndef fetch_price(product_id, currency=\"USD\"):\n \"\"\"Single-row price lookup. One round trip per call.\"\"\"\n sql = (\"SELECT product_id, list_price_cents, sale_price_cents, currency, \"\n \"price_tier FROM product_price WHERE product_id = %s AND currency = %s\")\n with pool.cursor() as cur:\n cur.execute(sql, (product_id, currency))\n row = cur.fetchone()\n if row is None:\n log.warning(\"no price row product=%s currency=%s\", product_id, currency)\n return None\n return _to_price(row)\n\n\ndef fetch_prices_bulk(product_ids, currency=\"USD\"):\n \"\"\"Batched price lookup: one round trip for the whole page.\"\"\"\n if not product_ids:\n return {}\n sql = (\"SELECT product_id, list_price_cents, sale_price_cents, currency, \"\n \"price_tier FROM product_price WHERE currency = %s AND product_id = ANY(%s)\")\n with pool.cursor() as cur:\n cur.execute(sql, (currency, list(product_ids)))\n rows = cur.fetchall()\n log.debug(\"fetch_prices_bulk requested=%d found=%d\", len(product_ids), len(rows))\n return {row[\"product_id\"]: _to_price(row) for row in rows}\n", "file_id": 17, "language": "python", "loc": 69, "owner": "Sam Whitfield", "path": "src/catalog/repository.py", "service": "catalog", "source_table": "repo_files"}
|
| 5 |
+
{"content": "\"\"\"Query execution for product search.\n\nparse -> build the index query -> execute -> rank. The query cache sits in front\nof execution and normally absorbs the large majority of index load.\n\"\"\"\nfrom __future__ import annotations\n\nimport hashlib\nimport json\nimport logging\nimport time\n\nfrom search import ranking, settings\nfrom search.cache import RedisCache\nfrom search.index import IndexClient\n\nlog = logging.getLogger(__name__)\n\n# Turned off during the index-rebuild incident so cache writes would stop\n# amplifying load on the Redis cluster while we reshard. Flip back to true once\n# the rebuild lands. (Rebuild landed; this never got flipped back.)\nCACHE_ENABLED = settings.get(\"cache_enabled\", False)\nCACHE_TTL_S = settings.get(\"cache_ttl_s\", 300)\nINDEX_SHARDS = settings.get(\"index_shards\", 4)\n\ncache = RedisCache(namespace=\"search:q\")\nindex = IndexClient(shards=INDEX_SHARDS)\n\n\ndef cache_key(term, filters, page, size):\n document = {\"t\": term.strip().lower(), \"f\": filters or {}, \"p\": page, \"s\": size}\n payload = json.dumps(document, sort_keys=True, separators=(\",\", \":\"))\n return hashlib.sha1(payload.encode(\"utf-8\")).hexdigest()\n\n\ndef search(term, filters=None, page=0, size=24, user_segment=\"anon\"):\n started = time.monotonic()\n key = cache_key(term, filters, page, size)\n\n if CACHE_ENABLED:\n cached = cache.get(key)\n if cached is not None:\n log.debug(\"cache hit term=%r key=%s\", term, key)\n return cached\n else:\n log.warning(\n \"query cache disabled (cache_enabled=false); every request is hitting \"\n \"the primary index\"\n )\n\n hits = index.execute(term=term, filters=filters or {}, offset=page * size, limit=size)\n results = ranking.rank(hits, term=term, user_segment=user_segment)\n payload = {\"term\": term, \"page\": page, \"size\": size, \"total\": hits.total,\n \"results\": [r.to_dict() for r in results]}\n\n if CACHE_ENABLED:\n cache.set(key, payload, ttl_s=CACHE_TTL_S)\n\n elapsed_ms = int((time.monotonic() - started) * 1000)\n log.info(\n \"search term=%r hits=%d elapsed_ms=%d cache_enabled=%s\",\n term, hits.total, elapsed_ms, CACHE_ENABLED,\n )\n return payload\n\n\ndef invalidate(term, filters=None, page=0, size=24):\n cache.delete(cache_key(term, filters, page, size))\n", "file_id": 20, "language": "python", "loc": 68, "owner": "Mei Tanaka", "path": "src/search/query.py", "service": "search", "source_table": "repo_files"}
|
| 6 |
+
{"content": "\"\"\"Result ranking.\n\nScore is a weighted blend of relevance, recency decay, merchandising boost and\na per-segment term. Weights live in config; their sum is asserted at import so\nscores stay comparable across deploys.\n\"\"\"\nfrom __future__ import annotations\n\nimport logging\nimport math\nimport time\nfrom dataclasses import dataclass\n\nfrom search import settings\n\nlog = logging.getLogger(__name__)\n\nWEIGHTS = {\"relevance\": settings.get(\"rank_w_relevance\", 0.55),\n \"recency\": settings.get(\"rank_w_recency\", 0.15),\n \"merch\": settings.get(\"rank_w_merch\", 0.20),\n \"segment\": settings.get(\"rank_w_segment\", 0.10)}\nRECENCY_HALFLIFE_DAYS = settings.get(\"rank_recency_halflife_days\", 45)\n\nif abs(sum(WEIGHTS.values()) - 1.0) > 1e-6:\n raise ValueError(\"ranking weights must sum to 1.0, got %r\" % WEIGHTS)\n\n\n@dataclass\nclass RankedHit:\n product_id: str\n title: str\n score: float\n components: dict\n\n def to_dict(self):\n return {\"product_id\": self.product_id, \"title\": self.title,\n \"score\": round(self.score, 5)}\n\n\ndef _recency(updated_at_epoch, now=None):\n now = now or time.time()\n age_days = max((now - updated_at_epoch) / 86400.0, 0.0)\n return math.exp(-age_days * math.log(2) / RECENCY_HALFLIFE_DAYS)\n\n\ndef _segment_boost(hit, user_segment):\n if user_segment == \"anon\":\n return 0.0\n affinity = hit.segment_affinity or {}\n return min(affinity.get(user_segment, 0.0), 1.0)\n\n\ndef rank(hits, term, user_segment=\"anon\"):\n ranked = []\n for hit in hits:\n components = {\n \"relevance\": hit.relevance,\n \"recency\": _recency(hit.updated_at_epoch),\n \"merch\": hit.merch_boost,\n \"segment\": _segment_boost(hit, user_segment),\n }\n score = sum(WEIGHTS[name] * value for name, value in components.items())\n ranked.append(RankedHit(hit.product_id, hit.title, score, components))\n\n ranked.sort(key=lambda r: (-r.score, r.product_id))\n if ranked:\n log.debug(\"ranked term=%r top=%s score=%.4f\", term, ranked[0].product_id,\n ranked[0].score)\n return ranked\n", "file_id": 21, "language": "python", "loc": 69, "owner": "Jordan Blake", "path": "src/search/ranking.py", "service": "search", "source_table": "repo_files"}
|
| 7 |
+
{"content": "\"\"\"Unit coverage for ranking blend behaviour.\"\"\"\nfrom __future__ import annotations\n\nimport time\nfrom dataclasses import dataclass, field\n\nfrom search import ranking\n\n\n@dataclass\nclass FakeHit:\n product_id: str\n title: str = \"widget\"\n relevance: float = 0.5\n merch_boost: float = 0.0\n updated_at_epoch: float = field(default_factory=time.time)\n segment_affinity: dict = field(default_factory=dict)\n\n\ndef test_higher_relevance_ranks_first():\n hits = [FakeHit(\"a\", relevance=0.2), FakeHit(\"b\", relevance=0.9)]\n ranked = ranking.rank(hits, term=\"widget\")\n assert [r.product_id for r in ranked] == [\"b\", \"a\"]\n\n\ndef test_ties_break_on_product_id_for_stability():\n hits = [FakeHit(\"z\", relevance=0.5), FakeHit(\"a\", relevance=0.5)]\n ranked = ranking.rank(hits, term=\"widget\")\n assert [r.product_id for r in ranked] == [\"a\", \"z\"]\n\n\ndef test_stale_documents_decay():\n fresh = FakeHit(\"fresh\", relevance=0.5)\n stale = FakeHit(\"stale\", relevance=0.5, updated_at_epoch=time.time() - 400 * 86400)\n ranked = ranking.rank([stale, fresh], term=\"widget\")\n assert ranked[0].product_id == \"fresh\"\n\n\ndef test_segment_boost_ignored_for_anonymous_traffic():\n hit = FakeHit(\"p1\", segment_affinity={\"loyalty\": 1.0})\n anon = ranking.rank([hit], term=\"widget\")[0].components[\"segment\"]\n member = ranking.rank([hit], term=\"widget\", user_segment=\"loyalty\")[0].components[\"segment\"]\n assert anon == 0.0\n assert member == 1.0\n", "file_id": 23, "language": "python", "loc": 44, "owner": "Jordan Blake", "path": "tests/test_ranking.py", "service": "search", "source_table": "repo_files"}
|
| 8 |
+
{"content": "// Package config loads gateway configuration from the mounted config map and\n// the process environment. Values are read once at boot; traffic weights are\n// the exception and refresh from the control plane every 10 seconds.\npackage config\n\nimport (\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n)\n\nconst defaultPath = \"/etc/novacart/gateway.json\"\n\n// Gateway is the full effective configuration.\ntype Gateway struct {\n\tEnv string `json:\"env\"`\n\tVersion string `json:\"version\"`\n\tListenAddr string `json:\"listen_addr\"`\n\tRateLimitRPS int `json:\"rate_limit_rps\"`\n\tUpstreamHosts map[string]string `json:\"upstream_hosts\"`\n\tRequestTimeout time.Duration `json:\"-\"`\n\tDebugEnabled bool `json:\"debug_enabled\"`\n}\n\n// Upstreams carries per-route transport settings.\ntype Upstreams struct {\n\tmu sync.RWMutex\n\ttls map[string]*tls.Config\n\tfallback *tls.Config\n}\n\nvar (\n\tonce sync.Once\n\tloaded *Gateway\n\tloadErr error\n)\n\n// TLSFor returns the TLS config for an upstream, falling back to the shared\n// default when the upstream has no dedicated entry.\nfunc (u *Upstreams) TLSFor(upstream string) *tls.Config {\n\tu.mu.RLock()\n\tdefer u.mu.RUnlock()\n\tif cfg, ok := u.tls[upstream]; ok {\n\t\treturn cfg.Clone()\n\t}\n\treturn u.fallback.Clone()\n}\n\nfunc envInt(key string, fallback int) int {\n\tif value, err := strconv.Atoi(os.Getenv(key)); err == nil {\n\t\treturn value\n\t}\n\treturn fallback\n}\n\n// Load reads the config document exactly once.\nfunc Load() (*Gateway, error) {\n\tonce.Do(func() {\n\t\tpath := defaultPath\n\t\tif custom := os.Getenv(\"NOVACART_GATEWAY_CONFIG\"); custom != \"\" {\n\t\t\tpath = custom\n\t\t}\n\t\tblob, err := os.ReadFile(path)\n\t\tif err != nil {\n\t\t\tloadErr = fmt.Errorf(\"read %s: %w\", path, err)\n\t\t\treturn\n\t\t}\n\t\tcfg := &Gateway{ListenAddr: \":8080\", RateLimitRPS: 500}\n\t\tif err := json.Unmarshal(blob, cfg); err != nil {\n\t\t\tloadErr = fmt.Errorf(\"parse %s: %w\", path, err)\n\t\t\treturn\n\t\t}\n\t\tcfg.RateLimitRPS = envInt(\"NOVACART_GATEWAY_RPS\", cfg.RateLimitRPS)\n\t\tcfg.RequestTimeout = time.Duration(envInt(\"NOVACART_GATEWAY_TIMEOUT_MS\", 5000)) * time.Millisecond\n\t\tloaded = cfg\n\t})\n\treturn loaded, loadErr\n}\n", "file_id": 24, "language": "go", "loc": 82, "owner": "Priya Nair", "path": "internal/config/config.go", "service": "api-gateway", "source_table": "repo_files"}
|
| 9 |
+
{"content": "// Package proxy manages upstream connections for the API gateway.\n//\n// Rewritten in v5.1.0: every route now gets its own transport so per-route TLS\n// material and per-route timeouts are honoured.\npackage proxy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/novacart/api-gateway/internal/config\"\n\t\"github.com/novacart/api-gateway/internal/log\"\n)\n\nconst (\n\tdialTimeout = 2 * time.Second\n\tidleConnTimeout = 90 * time.Second\n\tmaxIdlePerHost = 64\n\thealthCheckEvery = 15 * time.Second\n)\n\n// Conn wraps a transport dedicated to a single upstream.\ntype Conn struct {\n\tUpstream string\n\tTransport *http.Transport\n\tclient *http.Client\n\tdone chan struct{}\n\tcreatedAt time.Time\n}\n\n// Pool hands out upstream connections.\ntype Pool struct {\n\tcfg *config.Upstreams\n\tinFlight int64\n}\n\nfunc NewPool(cfg *config.Upstreams) *Pool { return &Pool{cfg: cfg} }\n\n// Acquire builds a connection for the given upstream. Building a transport is\n// cheap, so v5.1.0 does it per request rather than keeping long-lived ones.\nfunc (p *Pool) Acquire(ctx context.Context, upstream string) (*Conn, error) {\n\tif upstream == \"\" {\n\t\treturn nil, fmt.Errorf(\"proxy: empty upstream\")\n\t}\n\tatomic.AddInt64(&p.inFlight, 1)\n\n\ttransport := &http.Transport{\n\t\tDialContext: (&net.Dialer{Timeout: dialTimeout}).DialContext,\n\t\tTLSClientConfig: p.cfg.TLSFor(upstream),\n\t\tMaxIdleConnsPerHost: maxIdlePerHost,\n\t\tIdleConnTimeout: idleConnTimeout,\n\t}\n\n\tc := &Conn{Upstream: upstream, Transport: transport, done: make(chan struct{}),\n\t\tclient: &http.Client{Transport: transport}, createdAt: time.Now()}\n\n\t// Watchdog: keep probing this upstream for as long as the connection lives.\n\tgo func() {\n\t\tticker := time.NewTicker(healthCheckEvery)\n\t\tdefer ticker.Stop()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ticker.C:\n\t\t\t\tp.probe(c)\n\t\t\tcase <-c.done:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\tlog.Debugf(\"acquired upstream=%s in_flight=%d\", upstream, atomic.LoadInt64(&p.inFlight))\n\treturn c, nil\n}\n\n// Release closes the transport and stops the watchdog goroutine.\n//\n// NOTE: the v5.1.0 rewrite dropped the call to Release from Do -- the handler\n// returns as soon as it has the response. Nothing else calls it, so every\n// request leaves behind an idle transport plus a live watchdog goroutine.\nfunc (p *Pool) Release(c *Conn) {\n\tclose(c.done)\n\tc.Transport.CloseIdleConnections()\n\tatomic.AddInt64(&p.inFlight, -1)\n\tlog.Debugf(\"released upstream=%s age=%s\", c.Upstream, time.Since(c.createdAt))\n}\n\nfunc (p *Pool) probe(c *Conn) {\n\treq, _ := http.NewRequest(http.MethodHead, \"http://\"+c.Upstream+\"/healthz\", nil)\n\tif resp, err := c.client.Do(req); err == nil {\n\t\t_ = resp.Body.Close()\n\t}\n}\n\n// Do proxies a single request to the named upstream.\nfunc (p *Pool) Do(ctx context.Context, upstream string, req *http.Request) (*http.Response, error) {\n\tc, err := p.Acquire(ctx, upstream)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"acquire %s: %w\", upstream, err)\n\t}\n\n\tresp, err := c.client.Do(req.WithContext(ctx))\n\tif err != nil {\n\t\tlog.Errorf(\"upstream=%s request failed: %v\", upstream, err)\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}\n", "file_id": 25, "language": "go", "loc": 111, "owner": "Priya Nair", "path": "internal/proxy/pool.go", "service": "api-gateway", "source_table": "repo_files"}
|
| 10 |
+
{"content": "// Package router wires public API routes to their upstream services.\n//\n// Route table is declarative: handlers are generic proxies, and anything\n// route-specific (auth requirement, traffic weight, deprecation) lives in the\n// Route struct so the control plane can reason about it.\npackage router\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/novacart/api-gateway/internal/handlers\"\n\t\"github.com/novacart/api-gateway/internal/middleware\"\n\t\"github.com/novacart/api-gateway/internal/proxy\"\n)\n\n// Route describes one public endpoint.\ntype Route struct {\n\tPath string\n\tMethods []string\n\tUpstream string\n\tAuthRequired bool\n\tDeprecated bool\n\tWeight int // percentage of traffic, resolved by the control plane\n}\n\n// Table is the canonical route list for the edge.\nvar Table = []Route{\n\t{Path: \"/v1/orders\", Methods: []string{\"GET\", \"POST\"}, Upstream: \"checkout.internal:8080\", AuthRequired: true, Weight: 100},\n\t{Path: \"/v2/orders\", Methods: []string{\"GET\", \"POST\", \"PATCH\"}, Upstream: \"checkout.internal:8080\", AuthRequired: true, Weight: 0},\n\t{Path: \"/v1/checkout\", Methods: []string{\"POST\"}, Upstream: \"checkout.internal:8080\", AuthRequired: true, Weight: 100},\n\t{Path: \"/v1/catalog\", Methods: []string{\"GET\"}, Upstream: \"catalog.internal:8080\", Weight: 100},\n\t{Path: \"/v1/search\", Methods: []string{\"GET\"}, Upstream: \"search.internal:8080\", Weight: 100},\n\t{Path: \"/v1/media\", Methods: []string{\"GET\"}, Upstream: \"media-service.internal:8080\", Weight: 100},\n\t{Path: \"/internal/debug\", Methods: []string{\"GET\"}, Upstream: \"\", Weight: 0},\n}\n\n// New builds the edge mux.\nfunc New(pool *proxy.Pool) http.Handler {\n\tmux := http.NewServeMux()\n\n\tfor _, route := range Table {\n\t\tr := route\n\t\tif r.Upstream == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tvar h http.Handler = handlers.NewProxyHandler(pool, r.Upstream, r.Path)\n\t\th = middleware.MethodFilter(r.Methods, h)\n\t\tif r.AuthRequired {\n\t\t\th = middleware.RequireToken(h)\n\t\t}\n\t\tif r.Deprecated {\n\t\t\th = middleware.DeprecationNotice(r.Path, h)\n\t\t}\n\t\th = middleware.RateLimit(h)\n\t\th = middleware.AccessLog(r.Path, h)\n\t\tmux.Handle(r.Path, h)\n\t}\n\n\tmux.Handle(\"/internal/debug\", handlers.Debug())\n\tmux.HandleFunc(\"/healthz\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, _ = w.Write([]byte(\"ok\"))\n\t})\n\treturn mux\n}\n", "file_id": 26, "language": "go", "loc": 65, "owner": "Tom Becker", "path": "internal/router/routes.go", "service": "api-gateway", "source_table": "repo_files"}
|
| 11 |
+
{"content": "package handlers\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/novacart/api-gateway/internal/config\"\n\t\"github.com/novacart/api-gateway/internal/log\"\n)\n\n// Debug returns the /internal/debug handler.\n//\n// Intended for the platform team during rollouts: it dumps the effective\n// gateway config, the full process environment and a goroutine count so we can\n// tell at a glance which build a pod is running.\n//\n// It is mounted before the auth middleware chain in router.New, so it answers\n// any caller that can reach the listener. \"internal\" here means \"we do not\n// advertise it\" -- the ingress does not filter the path.\nfunc Debug() http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tcfg, err := config.Load()\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"config unavailable\", http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tenv := map[string]string{}\n\t\tfor _, entry := range os.Environ() {\n\t\t\tparts := strings.SplitN(entry, \"=\", 2)\n\t\t\tif len(parts) == 2 {\n\t\t\t\tenv[parts[0]] = parts[1]\n\t\t\t}\n\t\t}\n\n\t\tpayload := map[string]interface{}{\n\t\t\t\"version\": cfg.Version,\n\t\t\t\"env\": cfg.Env,\n\t\t\t\"listen_addr\": cfg.ListenAddr,\n\t\t\t\"rate_limit_rps\": cfg.RateLimitRPS,\n\t\t\t\"upstreams\": cfg.UpstreamHosts,\n\t\t\t\"goroutines\": runtime.NumGoroutine(),\n\t\t\t\"environment\": env,\n\t\t\t\"remote_addr\": r.RemoteAddr,\n\t\t}\n\n\t\tlog.Infof(\"debug dump served to %s\", r.RemoteAddr)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tenc := json.NewEncoder(w)\n\t\tenc.SetIndent(\"\", \" \")\n\t\tif err := enc.Encode(payload); err != nil {\n\t\t\tlog.Errorf(\"debug encode failed: %v\", err)\n\t\t}\n\t})\n}\n", "file_id": 27, "language": "go", "loc": 58, "owner": "Tom Becker", "path": "internal/handlers/debug.go", "service": "api-gateway", "source_table": "repo_files"}
|
| 12 |
+
{"content": "package com.novacart.inventory;\n\nimport com.zaxxer.hikari.HikariConfig;\nimport com.zaxxer.hikari.HikariDataSource;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.sql.*;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Stock reads and writes. The pool is created here rather than injected so the\n * sizing stays visible next to the queries that depend on it.\n */\npublic final class StockRepository {\n\n private static final Logger LOG = LoggerFactory.getLogger(StockRepository.class);\n\n /**\n * Connection pool size. Sized during the 2-pod pilot and never revisited;\n * inventory now runs 12 pods behind the checkout reserve path, and every\n * reserve call holds a connection for the length of the upstream write.\n */\n private static final int DB_POOL_SIZE = 5;\n\n private static final long CONNECTION_TIMEOUT_MS = 3_000L;\n private static final String SELECT_ON_HAND =\n \"SELECT sku, on_hand, reserved FROM stock_level WHERE sku = ? FOR UPDATE\";\n private static final String SELECT_BATCH =\n \"SELECT sku, on_hand, reserved FROM stock_level WHERE sku = ANY (?)\";\n\n\n private final HikariDataSource dataSource;\n\n public StockRepository(String jdbcUrl, String user, String password) {\n HikariConfig config = new HikariConfig();\n config.setJdbcUrl(jdbcUrl);\n config.setUsername(user);\n config.setPassword(password);\n config.setMaximumPoolSize(DB_POOL_SIZE);\n config.setMinimumIdle(DB_POOL_SIZE);\n config.setConnectionTimeout(CONNECTION_TIMEOUT_MS);\n config.setPoolName(\"inventory-stock\");\n this.dataSource = new HikariDataSource(config);\n LOG.info(\"stock pool ready db_pool_size={} connection_timeout_ms={}\",\n DB_POOL_SIZE, CONNECTION_TIMEOUT_MS);\n }\n\n public StockLevel findForUpdate(Connection tx, String sku) throws SQLException {\n try (PreparedStatement ps = tx.prepareStatement(SELECT_ON_HAND)) {\n ps.setString(1, sku);\n try (ResultSet rs = ps.executeQuery()) {\n if (!rs.next()) {\n LOG.warn(\"no stock row for sku={}\", sku);\n return null;\n }\n return new StockLevel(rs.getString(\"sku\"), rs.getInt(\"on_hand\"),\n rs.getInt(\"reserved\"));\n }\n }\n }\n public List<StockLevel> findAll(List<String> skus) {\n List<StockLevel> levels = new ArrayList<>(skus.size());\n long started = System.nanoTime();\n try (Connection conn = dataSource.getConnection();\n PreparedStatement ps = conn.prepareStatement(SELECT_BATCH)) {\n ps.setArray(1, conn.createArrayOf(\"text\", skus.toArray()));\n try (ResultSet rs = ps.executeQuery()) {\n while (rs.next()) {\n levels.add(new StockLevel(rs.getString(\"sku\"), rs.getInt(\"on_hand\"),\n rs.getInt(\"reserved\")));\n }\n }\n } catch (SQLException e) {\n LOG.error(\"stock lookup failed for {} skus (pool size {}): {}\",\n skus.size(), DB_POOL_SIZE, e.getMessage(), e);\n throw new StockUnavailableException(\"stock lookup failed\", e);\n }\n LOG.debug(\"findAll skus={} took_ms={}\", skus.size(),\n (System.nanoTime() - started) / 1_000_000L);\n return levels;\n }\n\n public Connection begin() throws SQLException {\n Connection conn = dataSource.getConnection();\n conn.setAutoCommit(false);\n return conn;\n }\n}\n", "file_id": 29, "language": "java", "loc": 90, "owner": "Tom Becker", "path": "src/main/java/com/novacart/inventory/StockRepository.java", "service": "inventory", "source_table": "repo_files"}
|
| 13 |
+
{"content": "package com.novacart.inventory;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.sql.Connection;\nimport java.sql.SQLException;\nimport java.time.Duration;\nimport java.time.Instant;\nimport java.util.List;\nimport java.util.UUID;\n\n/**\n * Places and releases stock holds for checkout. A hold is soft: it decrements\n * availability without moving on_hand, and expires after {@link #HOLD_TTL}.\n */\npublic class ReservationService {\n\n private static final Logger LOG = LoggerFactory.getLogger(ReservationService.class);\n private static final Duration HOLD_TTL = Duration.ofMinutes(20);\n\n private final StockRepository stock;\n private final HoldRepository holds;\n\n public ReservationService(StockRepository stock, HoldRepository holds) {\n this.stock = stock;\n this.holds = holds;\n }\n\n public Hold reserve(String orderId, List<ReservationLine> lines) {\n String holdId = \"hold_\" + UUID.randomUUID().toString().substring(0, 12);\n Instant expiresAt = Instant.now().plus(HOLD_TTL);\n\n Connection tx = null;\n try {\n tx = stock.begin();\n for (ReservationLine line : lines) {\n StockLevel level = stock.findForUpdate(tx, line.sku());\n if (level == null) {\n throw new StockUnavailableException(\"unknown sku \" + line.sku());\n }\n int available = level.onHand() - level.reserved();\n if (available < line.quantity()) {\n LOG.warn(\"insufficient stock sku={} requested={} available={}\",\n line.sku(), line.quantity(), available);\n throw new StockUnavailableException(\"insufficient stock: \" + line.sku());\n }\n holds.appendLine(tx, holdId, line.sku(), line.quantity());\n }\n holds.create(tx, holdId, orderId, expiresAt);\n tx.commit();\n LOG.info(\"reserved hold={} order={} lines={}\", holdId, orderId, lines.size());\n return new Hold(holdId, orderId, expiresAt);\n } catch (SQLException e) {\n rollbackQuietly(tx);\n LOG.error(\"reserve failed order={}: {}\", orderId, e.getMessage(), e);\n throw new StockUnavailableException(\"reserve failed for order \" + orderId, e);\n } finally {\n closeQuietly(tx);\n }\n }\n\n public void release(String holdId) {\n holds.release(holdId);\n LOG.info(\"released hold={}\", holdId);\n }\n\n private void rollbackQuietly(Connection tx) {\n if (tx == null) {\n return;\n }\n try {\n tx.rollback();\n } catch (SQLException ignored) {\n LOG.debug(\"rollback failed; connection is being discarded\");\n }\n }\n\n private void closeQuietly(Connection tx) {\n try {\n if (tx != null) {\n tx.close();\n }\n } catch (SQLException e) {\n LOG.warn(\"could not return connection to pool: {}\", e.getMessage());\n }\n }\n}\n", "file_id": 30, "language": "java", "loc": 88, "owner": "Ravi Shah", "path": "src/main/java/com/novacart/inventory/ReservationService.java", "service": "inventory", "source_table": "repo_files"}
|
| 14 |
+
{"content": "\"\"\"Asset delivery.\n\nProduct imagery lives in the object store, behind the CDN -- which is where\nevery read is meant to terminate. Origin egress is billed per GB.\n\"\"\"\nfrom __future__ import annotations\n\nimport logging\nimport mimetypes\nimport time\n\nfrom media import settings\nfrom media.store import ObjectStore\n\nlog = logging.getLogger(__name__)\n\n# Turned off while the CDN vendor migration was in flight -- signed URLs from\n# the old edge were 404ing for a slice of traffic, so we pointed reads back at\n# origin \"for a day or two\". The migration finished; this is still false, so\n# every asset request is served straight from the bucket.\nCDN_ENABLED = settings.get(\"cdn_enabled\", False)\nCDN_BASE_URL = settings.get(\"cdn_base_url\", \"https://cdn.novacart.io\")\nSIGNED_URL_TTL_S = settings.get(\"signed_url_ttl_s\", 900)\nORIGIN_BUCKET = settings.get(\"origin_bucket\", \"novacart-media-prod\")\n\nstore = ObjectStore(bucket=ORIGIN_BUCKET)\n\n\nclass AssetNotFound(LookupError):\n pass\n\n\ndef _key(asset_id, variant):\n return \"assets/%s/%s\" % (asset_id, variant)\n\n\ndef asset_url(asset_id, variant=\"800w\"):\n \"\"\"Return the URL a client should fetch this asset from.\"\"\"\n key = _key(asset_id, variant)\n if CDN_ENABLED:\n return \"%s/%s\" % (CDN_BASE_URL, key)\n log.debug(\"cdn disabled; issuing origin signed URL for %s\", key)\n return store.signed_url(key, ttl_s=SIGNED_URL_TTL_S)\n\n\ndef serve(asset_id, variant=\"800w\"):\n \"\"\"Stream an asset body plus response headers.\n\n With ``cdn_enabled`` false this is on the hot path for every product image\n on every page view, so each render fans out into origin reads.\n \"\"\"\n key = _key(asset_id, variant)\n started = time.monotonic()\n\n if CDN_ENABLED:\n return {\"redirect\": \"%s/%s\" % (CDN_BASE_URL, key), \"cache\": \"cdn\"}\n\n try:\n body = store.get(key)\n except store.NotFound as exc:\n log.warning(\"asset miss key=%s\", key)\n raise AssetNotFound(key) from exc\n\n elapsed_ms = int((time.monotonic() - started) * 1000)\n content_type = mimetypes.guess_type(key)[0] or \"application/octet-stream\"\n log.info(\"served asset from origin key=%s bytes=%d elapsed_ms=%d cdn_enabled=%s\",\n key, len(body), elapsed_ms, CDN_ENABLED)\n headers = {\"Content-Type\": content_type, \"Cache-Control\": \"public, max-age=86400\",\n \"X-Served-By\": \"origin\"}\n return {\"body\": body, \"headers\": headers, \"cache\": \"origin\"}\n", "file_id": 32, "language": "python", "loc": 70, "owner": "Jordan Blake", "path": "src/media/assets.py", "service": "media-service", "source_table": "repo_files"}
|
| 15 |
+
{"content": "\"\"\"Image variant generation.\n\nUploads land as a single original; this module derives the responsive ladder\n(``320w`` through ``1600w``) plus a WebP twin for each rung. Work is idempotent:\nre-running a transcode over an existing variant is a no-op unless the source\netag changed.\n\"\"\"\nfrom __future__ import annotations\n\nimport io\nimport logging\n\nfrom PIL import Image, UnidentifiedImageError\n\nfrom media import settings\nfrom media.store import ObjectStore\n\nlog = logging.getLogger(__name__)\n\nLADDER = (320, 640, 800, 1200, 1600)\nJPEG_QUALITY = settings.get(\"jpeg_quality\", 82)\nWEBP_QUALITY = settings.get(\"webp_quality\", 78)\nMAX_SOURCE_BYTES = settings.get(\"max_source_bytes\", 25 * 1024 * 1024)\n\nstore = ObjectStore(bucket=settings.get(\"origin_bucket\", \"novacart-media-prod\"))\n\n\nclass TranscodeError(RuntimeError):\n pass\n\n\ndef _resize(image, width):\n if image.width <= width:\n return image.copy()\n height = round(image.height * (width / image.width))\n return image.resize((width, height), Image.LANCZOS)\n\n\ndef _encode(image, fmt):\n buffer = io.BytesIO()\n quality = WEBP_QUALITY if fmt == \"WEBP\" else JPEG_QUALITY\n image.convert(\"RGB\").save(buffer, format=fmt, quality=quality, optimize=True)\n return buffer.getvalue()\n\n\ndef transcode(asset_id, source_key, source_etag):\n raw = store.get(source_key)\n if len(raw) > MAX_SOURCE_BYTES:\n raise TranscodeError(\n \"source %s is %d bytes, over the %d limit\" % (source_key, len(raw), MAX_SOURCE_BYTES)\n )\n try:\n original = Image.open(io.BytesIO(raw))\n original.load()\n except UnidentifiedImageError as exc:\n raise TranscodeError(\"unreadable source %s\" % source_key) from exc\n\n written = []\n for width in LADDER:\n resized = _resize(original, width)\n for fmt, ext in ((\"JPEG\", \"jpg\"), (\"WEBP\", \"webp\")):\n key = \"assets/%s/%dw.%s\" % (asset_id, width, ext)\n if store.etag(key) == source_etag:\n log.debug(\"variant %s already current; skipping\", key)\n continue\n store.put(key, _encode(resized, fmt), metadata={\"source_etag\": source_etag})\n written.append(key)\n\n log.info(\"transcoded asset=%s variants=%d source=%s\", asset_id, len(written), source_key)\n return written\n", "file_id": 33, "language": "python", "loc": 70, "owner": "Sam Whitfield", "path": "src/media/transcode.py", "service": "media-service", "source_table": "repo_files"}
|
| 16 |
+
{"content": "\"\"\"Outbound delivery.\n\nEmail goes out through the transactional provider's HTTP API; SMS and push have\ntheir own adapters. This module owns the provider call and the delivery record.\n\"\"\"\nfrom __future__ import annotations\n\nimport logging\n\nimport requests\n\nfrom notifications import settings\nfrom notifications.store import delivery_log\nfrom notifications.templates import render\n\nlog = logging.getLogger(__name__)\n\nPROVIDER_URL = settings.get(\"provider_url\", \"https://mail.provider.io/v3/send\")\nPROVIDER_TOKEN = settings.get(\"provider_token\", \"\")\nSMTP_POOL = settings.get(\"smtp_pool\", 8)\n\n# Provider-facing socket timeout, in milliseconds. Read here so it shows up in\n# the startup config dump. The requests call below does not pass it, so the\n# effective timeout is whatever the OS gives us -- i.e. none.\nSMTP_TIMEOUT_MS = settings.get(\"smtp_timeout_ms\", 5000)\n\n_session = requests.Session()\n_session.headers.update({\n \"Authorization\": \"Bearer %s\" % PROVIDER_TOKEN,\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"novacart-notifications/1.4\",\n})\n\n\nclass DeliveryError(RuntimeError):\n pass\n\n\ndef _payload(template, to, variables):\n subject, html, text = render(template, variables)\n return {\"to\": [{\"email\": to}], \"subject\": subject, \"html\": html, \"text\": text,\n \"pool\": \"transactional-%d\" % SMTP_POOL}\n\n\ndef send(template, to, variables, correlation_id=None):\n body = _payload(template, to, variables)\n record = delivery_log.open(template=template, to=to, correlation_id=correlation_id)\n\n try:\n response = _session.post(PROVIDER_URL, json=body)\n except requests.RequestException as exc:\n delivery_log.fail(record.id, reason=str(exc))\n log.error(\"provider call failed template=%s to=%s: %s\", template, to, exc)\n raise DeliveryError(\"provider unreachable\") from exc\n\n if response.status_code >= 400:\n delivery_log.fail(record.id, reason=\"http_%d\" % response.status_code)\n log.error(\n \"provider rejected message template=%s status=%d body=%s\",\n template, response.status_code, response.text[:280],\n )\n raise DeliveryError(\"provider returned %d\" % response.status_code)\n\n provider_id = response.json().get(\"message_id\")\n delivery_log.succeed(record.id, provider_id=provider_id)\n log.info(\"delivered template=%s to=%s provider_id=%s correlation_id=%s\",\n template, to, provider_id, correlation_id)\n return provider_id\n", "file_id": 36, "language": "python", "loc": 68, "owner": "Alex Osei", "path": "src/notifications/sender.py", "service": "notifications", "source_table": "repo_files"}
|
| 17 |
+
{"content": "\"\"\"Template registry and rendering.\n\nTemplates are Jinja files on disk under ``templates/<name>/``; each directory\nholds ``subject.txt``, ``body.html`` and ``body.txt``. Rendering is strict --\nan undefined variable is an error, not an empty string, because a receipt with\na blank amount is worse than a bounced send.\n\"\"\"\nfrom __future__ import annotations\n\nimport functools\nimport logging\nimport os\n\nfrom jinja2 import Environment, FileSystemLoader, StrictUndefined, TemplateNotFound\n\nfrom notifications import settings\n\nlog = logging.getLogger(__name__)\n\nTEMPLATE_ROOT = settings.get(\"template_root\", \"/srv/notifications/templates\")\nDEFAULT_LOCALE = settings.get(\"default_locale\", \"en-US\")\n\nREQUIRED_FILES = (\"subject.txt\", \"body.html\", \"body.txt\")\n\n\nclass TemplateError(RuntimeError):\n pass\n\n\n@functools.lru_cache(maxsize=1)\ndef _env():\n env = Environment(\n loader=FileSystemLoader(TEMPLATE_ROOT),\n undefined=StrictUndefined,\n autoescape=True,\n trim_blocks=True,\n lstrip_blocks=True,\n )\n env.filters[\"money\"] = lambda cents: \"%d.%02d\" % (cents // 100, cents % 100)\n return env\n\n\ndef available():\n if not os.path.isdir(TEMPLATE_ROOT):\n log.error(\"template root %s does not exist\", TEMPLATE_ROOT)\n return []\n names = []\n for entry in sorted(os.listdir(TEMPLATE_ROOT)):\n path = os.path.join(TEMPLATE_ROOT, entry)\n if all(os.path.exists(os.path.join(path, f)) for f in REQUIRED_FILES):\n names.append(entry)\n else:\n log.warning(\"template %s is incomplete; skipping\", entry)\n return names\n\n\ndef render(name, variables, locale=None):\n locale = locale or DEFAULT_LOCALE\n context = dict(variables, locale=locale)\n try:\n subject = _env().get_template(\"%s/subject.txt\" % name).render(context).strip()\n html = _env().get_template(\"%s/body.html\" % name).render(context)\n text = _env().get_template(\"%s/body.txt\" % name).render(context)\n except TemplateNotFound as exc:\n log.error(\"template %s missing file %s\", name, exc.name)\n raise TemplateError(\"template %s is not installed\" % name) from exc\n\n log.debug(\"rendered template=%s locale=%s subject=%r\", name, locale, subject)\n return subject, html, text\n", "file_id": 37, "language": "python", "loc": 69, "owner": "Alex Osei", "path": "src/notifications/templates.py", "service": "notifications", "source_table": "repo_files"}
|
| 18 |
+
{"content": "\"\"\"Delivery queue.\n\nCallers enqueue; workers pop and hand off to ``sender.send``. Failures retry\nwith exponential backoff up to ``MAX_ATTEMPTS``, then park on the DLQ.\n\"\"\"\nfrom __future__ import annotations\n\nimport json\nimport logging\nimport random\nimport time\n\nimport redis\n\nfrom notifications import settings\nfrom notifications.sender import DeliveryError, send\n\nlog = logging.getLogger(__name__)\n\nQUEUE_KEY = \"notifications:outbound\"\nDLQ_KEY = \"notifications:dead\"\nMAX_ATTEMPTS = settings.get(\"max_attempts\", 5)\nBASE_BACKOFF_S = settings.get(\"base_backoff_s\", 0.5)\n\nclient = redis.Redis.from_url(settings.get(\"redis_url\", \"redis://redis.internal:6379/2\"))\n\n\ndef enqueue(template, to, variables, correlation_id=None):\n message = {\"template\": template, \"to\": to, \"variables\": variables,\n \"correlation_id\": correlation_id, \"attempts\": 0}\n client.lpush(QUEUE_KEY, json.dumps(message))\n log.debug(\"enqueued template=%s to=%s\", template, to)\n\n\ndef _backoff(attempts):\n ceiling = BASE_BACKOFF_S * (2 ** attempts)\n return min(ceiling, 30.0) * (0.5 + random.random() / 2.0)\n\n\ndef _requeue(message):\n message[\"attempts\"] += 1\n if message[\"attempts\"] >= MAX_ATTEMPTS:\n client.lpush(DLQ_KEY, json.dumps(message))\n log.error(\"message parked on DLQ template=%s to=%s attempts=%d\",\n message[\"template\"], message[\"to\"], message[\"attempts\"])\n return\n time.sleep(_backoff(message[\"attempts\"]))\n client.lpush(QUEUE_KEY, json.dumps(message))\n\n\ndef work_once(timeout_s=5):\n popped = client.brpop(QUEUE_KEY, timeout=timeout_s)\n if popped is None:\n return False\n message = json.loads(popped[1])\n try:\n send(message[\"template\"], message[\"to\"], message[\"variables\"],\n correlation_id=message.get(\"correlation_id\"))\n except DeliveryError:\n log.warning(\"delivery failed; requeueing template=%s\", message[\"template\"])\n _requeue(message)\n return True\n\n\ndef run_forever():\n log.info(\"notification worker online queue=%s max_attempts=%d\", QUEUE_KEY, MAX_ATTEMPTS)\n while True:\n work_once()\n", "file_id": 38, "language": "python", "loc": 68, "owner": "Priya Nair", "path": "src/notifications/queue.py", "service": "notifications", "source_table": "repo_files"}
|
| 19 |
+
{"additions": 9, "author": "Lena Ortiz", "commit_id": 167, "day": 170, "deletions": 2, "files": "db/migrations/0031_refund_ledger.sql", "message": "checkout: partial unique index on open refunds", "service": "checkout", "sha": "c07b48f", "source_table": "commits"}
|
| 20 |
+
{"additions": 7, "author": "Jordan Blake", "commit_id": 202, "day": 205, "deletions": 2, "files": "src/media/assets.py", "message": "media-service: X-Served-By header for edge debugging", "service": "media-service", "sha": "e6152ba", "source_table": "commits"}
|
| 21 |
+
{"additions": 64, "author": "Tom Becker", "commit_id": 223, "day": 226, "deletions": 2, "files": "internal/handlers/debug.go,internal/router/routes.go", "message": "api-gateway: mount /internal/debug for rollout inspection", "service": "api-gateway", "sha": "27b0da6", "source_table": "commits"}
|
| 22 |
+
{"additions": 8, "author": "Tom Becker", "commit_id": 241, "day": 244, "deletions": 2, "files": "internal/handlers/debug.go", "message": "api-gateway: include goroutine count in the debug dump", "service": "api-gateway", "sha": "f70e2b4", "source_table": "commits"}
|
| 23 |
+
{"author": "Diego Ramos", "body": "Draft, do not merge yet.", "merged_version": "", "number": 9202, "service": "catalog", "source_table": "pull_requests", "status": "open", "ticket_key": "", "title": "Price rounding cleanup"}
|
task_files/dob100-037-port-copy-priority-issues/07-ci-and-tests.csv
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_table,detail,exercise_id,func,hidden_tests,name,path,pr_number,quarantined,run_id,service,spec,stage,stage_id,starter,status,suite,test_id,visible_tests
|
| 2 |
+
ci_runs,all checks passed,,,,,,9201,,1,api-gateway,,,,,passed,,,
|
| 3 |
+
ci_runs,intermittent failure: test_checkout_idempotency (rerun may pass),,,,,,,,2,checkout,,,,,failed,,,
|
| 4 |
+
ci_runs,all checks passed,,,,,,,,3,checkout,,,,,passed,,,
|
| 5 |
+
ci_runs,all checks passed,,,,,,,,4,payments,,,,,passed,,,
|
| 6 |
+
ci_stages,ok,,,,,,,,1,,,build,1,,passed,,,
|
| 7 |
+
ci_stages,ok,,,,,,,,1,,,unit,2,,passed,,,
|
| 8 |
+
ci_stages,ok,,,,,,,,1,,,integration,3,,passed,,,
|
| 9 |
+
ci_stages,ok,,,,,,,,1,,,regression,4,,passed,,,
|
| 10 |
+
tests_catalog,,,,,test_cart_totals,,,0,,checkout,,,,,passing,unit,9901,
|
| 11 |
+
tests_catalog,,,,,test_checkout_idempotency,,,0,,checkout,,,,,flaky,integration,9902,
|
| 12 |
+
tests_catalog,,,,,test_capture_retries,,,0,,payments,,,,,passing,unit,9903,
|
| 13 |
+
tests_catalog,,,,,test_ranking,,,0,,search,,,,,passing,unit,9904,
|
| 14 |
+
code_exercises,,9401,next_delay_ms,"[[""attempt 1 is base_ms, not double"", ""assert next_delay_ms(1, 100, 10000) == 100""], [""the cap is a ceiling on the value"", ""assert next_delay_ms(9, 100, 5000) == 5000""], [""the cap applies at the boundary"", ""assert next_delay_ms(6, 100, 3200) == 3200""], [""attempt below 1 is not a retry"", ""try:\n next_delay_ms(0, 100, 10000)\nexcept ValueError:\n pass\nelse:\n raise AssertionError('attempt 0 must raise ValueError')""]]",,src/payments/backoff.py,,,,payments,"Implement next_delay_ms(attempt, base_ms, max_ms).
|
| 15 |
+
|
| 16 |
+
Retries are numbered from 1: the delay before the FIRST retry is attempt=1.
|
| 17 |
+
The delay doubles with each attempt - base_ms for attempt 1, twice that for
|
| 18 |
+
attempt 2, four times for attempt 3 - and is capped at max_ms. The cap is a
|
| 19 |
+
ceiling on the returned value, not on the exponent.
|
| 20 |
+
|
| 21 |
+
attempt < 1 is not a retry and must raise ValueError.",,,"""""""Backoff schedule for the payments retry path.""""""
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def next_delay_ms(attempt, base_ms, max_ms):
|
| 25 |
+
""""""Delay before retry number `attempt`, capped at max_ms.""""""
|
| 26 |
+
raise NotImplementedError
|
| 27 |
+
",,,,"[[""the delay doubles"", ""assert next_delay_ms(3, 100, 10000) == 2 * next_delay_ms(2, 100, 10000)""], [""delays are positive"", ""assert next_delay_ms(2, 100, 10000) > 0""]]"
|
| 28 |
+
code_exercises,,9402,chunk,"[[""empty input produces no groups"", ""assert chunk([], 3) == []""], [""an exact multiple has no trailing empty group"", ""assert chunk([1, 2, 3, 4], 2) == [[1, 2], [3, 4]]""], [""order is preserved"", ""assert chunk(['a', 'b', 'c'], 1) == [['a'], ['b'], ['c']]""], [""a size below 1 is meaningless"", ""for bad in (0, -1):\n try:\n chunk([1, 2], bad)\n except ValueError:\n pass\n else:\n raise AssertionError('size %r must raise ValueError' % bad)""], [""an iterator is accepted, not just a list"", ""assert chunk(iter([1, 2, 3]), 2) == [[1, 2], [3]]""]]",,src/payments/chunking.py,,,,payments,"Implement chunk(items, size) returning a list of lists.
|
| 29 |
+
|
| 30 |
+
Settlement batches a day's captures so one long-tailed merchant cannot stall
|
| 31 |
+
the run. Split `items` into consecutive groups of at most `size`, preserving
|
| 32 |
+
order. The final group may be shorter. An empty input produces no groups at
|
| 33 |
+
all - not one empty group. A size below 1 is meaningless and must raise
|
| 34 |
+
ValueError.
|
| 35 |
+
|
| 36 |
+
`items` is whatever captures.list_settlable() returned, which is any iterable
|
| 37 |
+
and is sometimes a one-pass generator, so do not assume it can be indexed or
|
| 38 |
+
measured with len().",,,"""""""Batch chunking for nightly settlement.""""""
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def chunk(items, size):
|
| 42 |
+
""""""Split items into consecutive groups of at most `size`.""""""
|
| 43 |
+
raise NotImplementedError
|
| 44 |
+
",,,,"[[""splits with a remainder"", ""assert chunk([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]""]]"
|
| 45 |
+
code_exercises,,9403,cache_key,"[[""insertion order does not matter"", ""a = {}\na['q'] = 'shoes'\na['page'] = 1\nb = {}\nb['page'] = 1\nb['q'] = 'shoes'\nassert cache_key(a) == cache_key(b)""], [""different values differ"", ""assert cache_key({'q': 'shoes'}) != cache_key({'q': 'boots'})""], [""an explicit None is not an absent key"", ""assert cache_key({'q': 'shoes', 'filter': None}) != cache_key({'q': 'shoes'})""], [""keys and values cannot run together"", ""assert cache_key({'a': 'xb', 'b': ''}) != cache_key({'a': 'x', 'bb': ''})""]]",,src/search/cache_key.py,,,,search,"Implement cache_key(params) returning a string.
|
| 46 |
+
|
| 47 |
+
The search result cache is keyed on the query parameters. Two calls with the
|
| 48 |
+
same parameters must produce the same key regardless of the order the keys
|
| 49 |
+
were inserted into the dict, because callers build them in different orders
|
| 50 |
+
and a mismatch silently halves the hit rate.
|
| 51 |
+
|
| 52 |
+
Different parameters must produce different keys. A parameter explicitly set
|
| 53 |
+
to None is not the same request as one that was never supplied. Values may be
|
| 54 |
+
strings, numbers, booleans or None.",,,"""""""Cache key derivation for the search result cache.""""""
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def cache_key(params):
|
| 58 |
+
""""""A stable key for a parameter dict.""""""
|
| 59 |
+
raise NotImplementedError
|
| 60 |
+
",,,,"[[""identical dicts agree"", ""assert cache_key({'q': 'shoes', 'page': 1}) == cache_key({'q': 'shoes', 'page': 1})""]]"
|
| 61 |
+
code_exercises,,9404,TokenBucket,"[[""partial time is not discarded"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(500)\nassert b.allow(1000)""], [""the bucket never exceeds capacity"", ""b = TokenBucket(2, 100)\nassert b.allow(0) and b.allow(0)\nassert b.allow(10000) and b.allow(10000)\nassert not b.allow(10000)""], [""a backwards clock grants nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)""], [""a backwards clock does not wedge the bucket"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)\nassert b.allow(2000)""], [""a refused request consumes nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nfor _ in range(5):\n assert not b.allow(0)\nassert b.allow(1000)""]]",,src/gateway/token_bucket.py,,,,api-gateway,"Implement class TokenBucket(capacity, refill_per_sec) with one method,
|
| 62 |
+
allow(now_ms), returning True if a request may proceed and False otherwise.
|
| 63 |
+
|
| 64 |
+
A bucket starts full. Each allowed request consumes exactly one token; a
|
| 65 |
+
refused request consumes none. Tokens refill continuously at refill_per_sec
|
| 66 |
+
and the bucket never holds more than capacity.
|
| 67 |
+
|
| 68 |
+
Refill is continuous, not stepwise: two calls 500ms apart at 1 token/sec must
|
| 69 |
+
together restore one whole token, so partial time must not be discarded. The
|
| 70 |
+
first call establishes the clock and refills nothing.
|
| 71 |
+
|
| 72 |
+
now_ms comes from a wall clock that is occasionally stepped backwards by NTP.
|
| 73 |
+
A backwards jump must never grant tokens and must never make the bucket
|
| 74 |
+
permanently unable to refill: treat time as not having advanced, and take the
|
| 75 |
+
new reading as the current clock.",,,"""""""Per-client rate limiting at the API gateway edge.""""""
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
class TokenBucket:
|
| 79 |
+
def __init__(self, capacity, refill_per_sec):
|
| 80 |
+
raise NotImplementedError
|
| 81 |
+
|
| 82 |
+
def allow(self, now_ms):
|
| 83 |
+
""""""True if a request may proceed, consuming one token.""""""
|
| 84 |
+
raise NotImplementedError
|
| 85 |
+
",,,,"[[""a full bucket allows up to capacity"", ""b = TokenBucket(2, 1)\nassert b.allow(0) and b.allow(0) and not b.allow(0)""], [""waiting restores a token"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(0)\nassert b.allow(1000)""]]"
|
task_files/dob100-037-port-copy-priority-issues/08-data-change-controls.sql
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
-- migrations: {"environment": "staging", "migration_id": 1, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 2 |
+
-- migrations: {"environment": "production", "migration_id": 2, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 3 |
+
-- migrations: {"environment": "staging", "migration_id": 3, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 4 |
+
-- migrations: {"environment": "production", "migration_id": 4, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 5 |
+
-- migration_requirements: {"migration_name": "0088_loyalty_ledger", "module": "loyalty_redeem", "req_id": 9151, "service": "checkout"}
|
| 6 |
+
-- migration_requirements: {"migration_name": "0123_loyalty_points", "module": "loyalty_accrual", "req_id": 9152, "service": "catalog"}
|
| 7 |
+
-- migration_requirements: {"migration_name": "0042_settlement_splits", "module": "split_settlement", "req_id": 9153, "service": "payments"}
|
| 8 |
+
-- migration_requirements: {"migration_name": "0034_backorders", "module": "backorder_queue", "req_id": 9154, "service": "inventory"}
|
| 9 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9901, "note": "", "role": "payments_rw", "service": "payments", "state": "active"}
|
| 10 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9902, "note": "", "role": "checkout_rw", "service": "checkout", "state": "active"}
|
| 11 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9903, "note": "", "role": "catalog_ro", "service": "catalog", "state": "active"}
|
| 12 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9904, "note": "", "role": "search_ro", "service": "search", "state": "active"}
|
task_files/dob100-037-port-copy-priority-issues/09-feature-and-security.yaml
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"flag_id",
|
| 6 |
+
"key",
|
| 7 |
+
"service",
|
| 8 |
+
"description",
|
| 9 |
+
"environment",
|
| 10 |
+
"enabled",
|
| 11 |
+
"rollout_percent"
|
| 12 |
+
],
|
| 13 |
+
"row_count": 8,
|
| 14 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 15 |
+
"table": "feature_flags",
|
| 16 |
+
"task_relevant_rows": [
|
| 17 |
+
{
|
| 18 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 19 |
+
"enabled": 1,
|
| 20 |
+
"environment": "production",
|
| 21 |
+
"flag_id": 9301,
|
| 22 |
+
"key": "instant_refunds",
|
| 23 |
+
"rollout_percent": 100,
|
| 24 |
+
"service": "checkout"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 28 |
+
"enabled": 1,
|
| 29 |
+
"environment": "staging",
|
| 30 |
+
"flag_id": 9302,
|
| 31 |
+
"key": "instant_refunds",
|
| 32 |
+
"rollout_percent": 100,
|
| 33 |
+
"service": "checkout"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"description": "Redesigned search results page.",
|
| 37 |
+
"enabled": 0,
|
| 38 |
+
"environment": "production",
|
| 39 |
+
"flag_id": 9303,
|
| 40 |
+
"key": "new_search_ui",
|
| 41 |
+
"rollout_percent": 0,
|
| 42 |
+
"service": "search"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"description": "Redesigned search results page.",
|
| 46 |
+
"enabled": 1,
|
| 47 |
+
"environment": "staging",
|
| 48 |
+
"flag_id": 9304,
|
| 49 |
+
"key": "new_search_ui",
|
| 50 |
+
"rollout_percent": 100,
|
| 51 |
+
"service": "search"
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"columns": [
|
| 57 |
+
"vuln_id",
|
| 58 |
+
"cve",
|
| 59 |
+
"package",
|
| 60 |
+
"service",
|
| 61 |
+
"severity",
|
| 62 |
+
"fixed_version",
|
| 63 |
+
"status"
|
| 64 |
+
],
|
| 65 |
+
"row_count": 4,
|
| 66 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 67 |
+
"table": "vulnerabilities",
|
| 68 |
+
"task_relevant_rows": [
|
| 69 |
+
{
|
| 70 |
+
"cve": "CVE-2026-31337",
|
| 71 |
+
"fixed_version": "2.4.0",
|
| 72 |
+
"package": "libpayproc",
|
| 73 |
+
"service": "payments",
|
| 74 |
+
"severity": "critical",
|
| 75 |
+
"status": "open",
|
| 76 |
+
"vuln_id": 9801
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"cve": "CVE-2026-40881",
|
| 80 |
+
"fixed_version": "11.4.0",
|
| 81 |
+
"package": "stripe-sdk",
|
| 82 |
+
"service": "checkout",
|
| 83 |
+
"severity": "high",
|
| 84 |
+
"status": "open",
|
| 85 |
+
"vuln_id": 9802
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"cve": "CVE-2026-51002",
|
| 89 |
+
"fixed_version": "2.33.0",
|
| 90 |
+
"package": "requests",
|
| 91 |
+
"service": "payments",
|
| 92 |
+
"severity": "high",
|
| 93 |
+
"status": "open",
|
| 94 |
+
"vuln_id": 9804
|
| 95 |
+
}
|
| 96 |
+
]
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
"columns": [
|
| 100 |
+
"rule_id",
|
| 101 |
+
"name",
|
| 102 |
+
"service_label",
|
| 103 |
+
"expr",
|
| 104 |
+
"severity",
|
| 105 |
+
"group_by",
|
| 106 |
+
"routes_to"
|
| 107 |
+
],
|
| 108 |
+
"row_count": 5,
|
| 109 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 110 |
+
"table": "alert_rules",
|
| 111 |
+
"task_relevant_rows": [
|
| 112 |
+
{
|
| 113 |
+
"expr": "histogram_quantile(0.99, gateway_latency) > 250",
|
| 114 |
+
"group_by": "service",
|
| 115 |
+
"name": "GatewayHighLatency",
|
| 116 |
+
"routes_to": "EP-Platform",
|
| 117 |
+
"rule_id": 601,
|
| 118 |
+
"service_label": "gateway_service",
|
| 119 |
+
"severity": "critical"
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"expr": "rate(gateway_errors[5m]) > 0.01",
|
| 123 |
+
"group_by": "service",
|
| 124 |
+
"name": "GatewayErrorRate",
|
| 125 |
+
"routes_to": "EP-Platform",
|
| 126 |
+
"rule_id": 602,
|
| 127 |
+
"service_label": "gateway_service",
|
| 128 |
+
"severity": "high"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"expr": "queue_depth > 1000",
|
| 132 |
+
"group_by": "service",
|
| 133 |
+
"name": "LegacyCheckoutQueueDepth",
|
| 134 |
+
"routes_to": "EP-Commerce",
|
| 135 |
+
"rule_id": 605,
|
| 136 |
+
"service_label": "checkout_legacy_worker",
|
| 137 |
+
"severity": "high"
|
| 138 |
+
}
|
| 139 |
+
]
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"columns": [
|
| 143 |
+
"silence_id",
|
| 144 |
+
"matcher",
|
| 145 |
+
"created_by",
|
| 146 |
+
"reason",
|
| 147 |
+
"expires_day"
|
| 148 |
+
],
|
| 149 |
+
"row_count": 1,
|
| 150 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 151 |
+
"table": "alert_silences",
|
| 152 |
+
"task_relevant_rows": [
|
| 153 |
+
{
|
| 154 |
+
"created_by": "Sam Whitfield",
|
| 155 |
+
"expires_day": 402,
|
| 156 |
+
"matcher": "alertname=\"EdgeCacheHitRate\"",
|
| 157 |
+
"reason": "muted during the CDN migration, never lifted",
|
| 158 |
+
"silence_id": 801
|
| 159 |
+
}
|
| 160 |
+
]
|
| 161 |
+
}
|
| 162 |
+
]
|
| 163 |
+
}
|
task_files/dob100-037-port-copy-priority-issues/10-vendor-trackers.json
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"key",
|
| 6 |
+
"project",
|
| 7 |
+
"summary",
|
| 8 |
+
"issue_type",
|
| 9 |
+
"status",
|
| 10 |
+
"resolution",
|
| 11 |
+
"priority",
|
| 12 |
+
"component",
|
| 13 |
+
"assignee",
|
| 14 |
+
"created_day",
|
| 15 |
+
"updated_day"
|
| 16 |
+
],
|
| 17 |
+
"row_count": 11,
|
| 18 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 19 |
+
"table": "jira_issues",
|
| 20 |
+
"task_relevant_rows": [
|
| 21 |
+
{
|
| 22 |
+
"assignee": "Diego Ramos",
|
| 23 |
+
"component": "payments",
|
| 24 |
+
"created_day": 414,
|
| 25 |
+
"issue_type": "Bug",
|
| 26 |
+
"key": "ENG-2101",
|
| 27 |
+
"priority": "Highest",
|
| 28 |
+
"project": "ENG",
|
| 29 |
+
"resolution": "",
|
| 30 |
+
"status": "In Progress",
|
| 31 |
+
"summary": "Payments error rate breaching the 1% SLO",
|
| 32 |
+
"updated_day": 419
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"assignee": "Alex Osei",
|
| 36 |
+
"component": "inventory",
|
| 37 |
+
"created_day": 415,
|
| 38 |
+
"issue_type": "Bug",
|
| 39 |
+
"key": "ENG-2102",
|
| 40 |
+
"priority": "High",
|
| 41 |
+
"project": "ENG",
|
| 42 |
+
"resolution": "",
|
| 43 |
+
"status": "In Progress",
|
| 44 |
+
"summary": "Inventory reservations failing under peak traffic",
|
| 45 |
+
"updated_day": 419
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"assignee": "Alex Osei",
|
| 49 |
+
"component": "analytics-worker",
|
| 50 |
+
"created_day": 415,
|
| 51 |
+
"issue_type": "Bug",
|
| 52 |
+
"key": "ENG-2103",
|
| 53 |
+
"priority": "High",
|
| 54 |
+
"project": "ENG",
|
| 55 |
+
"resolution": "",
|
| 56 |
+
"status": "In Progress",
|
| 57 |
+
"summary": "Analytics worker restarting under queue load",
|
| 58 |
+
"updated_day": 419
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"assignee": "Priya Nair",
|
| 62 |
+
"component": "notifications",
|
| 63 |
+
"created_day": 414,
|
| 64 |
+
"issue_type": "Bug",
|
| 65 |
+
"key": "ENG-2104",
|
| 66 |
+
"priority": "High",
|
| 67 |
+
"project": "ENG",
|
| 68 |
+
"resolution": "",
|
| 69 |
+
"status": "In Progress",
|
| 70 |
+
"summary": "Notification delivery failures from hung SMTP calls",
|
| 71 |
+
"updated_day": 419
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"assignee": "Mei Tanaka",
|
| 75 |
+
"component": "search",
|
| 76 |
+
"created_day": 413,
|
| 77 |
+
"issue_type": "Bug",
|
| 78 |
+
"key": "ENG-2201",
|
| 79 |
+
"priority": "High",
|
| 80 |
+
"project": "ENG",
|
| 81 |
+
"resolution": "",
|
| 82 |
+
"status": "In Progress",
|
| 83 |
+
"summary": "Search p99 latency exceeds the 300ms SLO",
|
| 84 |
+
"updated_day": 419
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"assignee": "Diego Ramos",
|
| 88 |
+
"component": "catalog",
|
| 89 |
+
"created_day": 412,
|
| 90 |
+
"issue_type": "Bug",
|
| 91 |
+
"key": "ENG-2202",
|
| 92 |
+
"priority": "High",
|
| 93 |
+
"project": "ENG",
|
| 94 |
+
"resolution": "",
|
| 95 |
+
"status": "In Progress",
|
| 96 |
+
"summary": "Catalog pricing p99 regression",
|
| 97 |
+
"updated_day": 419
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"assignee": "",
|
| 101 |
+
"component": "media-service",
|
| 102 |
+
"created_day": 416,
|
| 103 |
+
"issue_type": "Bug",
|
| 104 |
+
"key": "ENG-2203",
|
| 105 |
+
"priority": "Medium",
|
| 106 |
+
"project": "ENG",
|
| 107 |
+
"resolution": "",
|
| 108 |
+
"status": "Backlog",
|
| 109 |
+
"summary": "Media assets served from origin instead of the CDN",
|
| 110 |
+
"updated_day": 418
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"assignee": "",
|
| 114 |
+
"component": "checkout",
|
| 115 |
+
"created_day": 411,
|
| 116 |
+
"issue_type": "Bug",
|
| 117 |
+
"key": "ENG-3001",
|
| 118 |
+
"priority": "Medium",
|
| 119 |
+
"project": "ENG",
|
| 120 |
+
"resolution": "",
|
| 121 |
+
"status": "Backlog",
|
| 122 |
+
"summary": "Checkout latency spike during evening peak",
|
| 123 |
+
"updated_day": 413
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"assignee": "Diego Ramos",
|
| 127 |
+
"component": "payments",
|
| 128 |
+
"created_day": 402,
|
| 129 |
+
"issue_type": "Bug",
|
| 130 |
+
"key": "ENG-3002",
|
| 131 |
+
"priority": "High",
|
| 132 |
+
"project": "ENG",
|
| 133 |
+
"resolution": "Fixed",
|
| 134 |
+
"status": "Done",
|
| 135 |
+
"summary": "Duplicate charge on retried payment",
|
| 136 |
+
"updated_day": 409
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"assignee": "Mei Tanaka",
|
| 140 |
+
"component": "search",
|
| 141 |
+
"created_day": 408,
|
| 142 |
+
"issue_type": "Bug",
|
| 143 |
+
"key": "ENG-3003",
|
| 144 |
+
"priority": "Medium",
|
| 145 |
+
"project": "ENG",
|
| 146 |
+
"resolution": "",
|
| 147 |
+
"status": "Blocked",
|
| 148 |
+
"summary": "Search returns stale results after reindex",
|
| 149 |
+
"updated_day": 417
|
| 150 |
+
},
|
| 151 |
+
{
|
| 152 |
+
"assignee": "",
|
| 153 |
+
"component": "checkout",
|
| 154 |
+
"created_day": 396,
|
| 155 |
+
"issue_type": "Bug",
|
| 156 |
+
"key": "ENG-3004",
|
| 157 |
+
"priority": "Low",
|
| 158 |
+
"project": "ENG",
|
| 159 |
+
"resolution": "Won't Do",
|
| 160 |
+
"status": "Done",
|
| 161 |
+
"summary": "Cart total rounds incorrectly for multi-currency",
|
| 162 |
+
"updated_day": 404
|
| 163 |
+
}
|
| 164 |
+
]
|
| 165 |
+
},
|
| 166 |
+
{
|
| 167 |
+
"columns": [
|
| 168 |
+
"identifier",
|
| 169 |
+
"team",
|
| 170 |
+
"title",
|
| 171 |
+
"state",
|
| 172 |
+
"priority",
|
| 173 |
+
"label",
|
| 174 |
+
"created_day"
|
| 175 |
+
],
|
| 176 |
+
"row_count": 4,
|
| 177 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 178 |
+
"table": "linear_issues",
|
| 179 |
+
"task_relevant_rows": [
|
| 180 |
+
{
|
| 181 |
+
"created_day": 411,
|
| 182 |
+
"identifier": "GRW-88",
|
| 183 |
+
"label": "bug",
|
| 184 |
+
"priority": 1,
|
| 185 |
+
"state": "In Progress",
|
| 186 |
+
"team": "Growth",
|
| 187 |
+
"title": "Checkout slow at peak \u2014 customers dropping off"
|
| 188 |
+
},
|
| 189 |
+
{
|
| 190 |
+
"created_day": 408,
|
| 191 |
+
"identifier": "GRW-91",
|
| 192 |
+
"label": "bug",
|
| 193 |
+
"priority": 3,
|
| 194 |
+
"state": "Todo",
|
| 195 |
+
"team": "Growth",
|
| 196 |
+
"title": "Search shows stale products after reindex"
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"created_day": 417,
|
| 200 |
+
"identifier": "GRW-95",
|
| 201 |
+
"label": "bug",
|
| 202 |
+
"priority": 4,
|
| 203 |
+
"state": "Todo",
|
| 204 |
+
"team": "Growth",
|
| 205 |
+
"title": "Autocomplete flickers on slow connections"
|
| 206 |
+
},
|
| 207 |
+
{
|
| 208 |
+
"created_day": 416,
|
| 209 |
+
"identifier": "GRW-97",
|
| 210 |
+
"label": "bug,performance",
|
| 211 |
+
"priority": 2,
|
| 212 |
+
"state": "In Progress",
|
| 213 |
+
"team": "Growth",
|
| 214 |
+
"title": "Product images load from origin, not CDN"
|
| 215 |
+
}
|
| 216 |
+
]
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
"columns": [
|
| 220 |
+
"number",
|
| 221 |
+
"repo",
|
| 222 |
+
"title",
|
| 223 |
+
"state",
|
| 224 |
+
"labels",
|
| 225 |
+
"created_day"
|
| 226 |
+
],
|
| 227 |
+
"row_count": 28,
|
| 228 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 229 |
+
"table": "github_issues",
|
| 230 |
+
"task_relevant_rows": [
|
| 231 |
+
{
|
| 232 |
+
"created_day": 396,
|
| 233 |
+
"labels": "bug",
|
| 234 |
+
"number": 4404,
|
| 235 |
+
"repo": "novacart/storefront",
|
| 236 |
+
"state": "closed",
|
| 237 |
+
"title": "Rate limiter allows bursts above the configured ceiling"
|
| 238 |
+
},
|
| 239 |
+
{
|
| 240 |
+
"created_day": 403,
|
| 241 |
+
"labels": "bug,priority",
|
| 242 |
+
"number": 4407,
|
| 243 |
+
"repo": "novacart/platform",
|
| 244 |
+
"state": "open",
|
| 245 |
+
"title": "Refund webhook retried indefinitely on 4xx"
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"created_day": 410,
|
| 249 |
+
"labels": "bug,customer-report",
|
| 250 |
+
"number": 4409,
|
| 251 |
+
"repo": "novacart/commerce",
|
| 252 |
+
"state": "open",
|
| 253 |
+
"title": "Dark mode toggle resets on navigation"
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"created_day": 417,
|
| 257 |
+
"labels": "enhancement",
|
| 258 |
+
"number": 4411,
|
| 259 |
+
"repo": "novacart/growth",
|
| 260 |
+
"state": "open",
|
| 261 |
+
"title": "Checkout page hangs before redirect"
|
| 262 |
+
},
|
| 263 |
+
{
|
| 264 |
+
"created_day": 407,
|
| 265 |
+
"labels": "chore",
|
| 266 |
+
"number": 4417,
|
| 267 |
+
"repo": "novacart/storefront",
|
| 268 |
+
"state": "open",
|
| 269 |
+
"title": "Settlement batch size is not configurable"
|
| 270 |
+
},
|
| 271 |
+
{
|
| 272 |
+
"created_day": 414,
|
| 273 |
+
"labels": "docs",
|
| 274 |
+
"number": 4418,
|
| 275 |
+
"repo": "novacart/platform",
|
| 276 |
+
"state": "open",
|
| 277 |
+
"title": "Search reindex job has never completed"
|
| 278 |
+
},
|
| 279 |
+
{
|
| 280 |
+
"created_day": 397,
|
| 281 |
+
"labels": "bug,regression",
|
| 282 |
+
"number": 4419,
|
| 283 |
+
"repo": "novacart/commerce",
|
| 284 |
+
"state": "open",
|
| 285 |
+
"title": "Autocomplete returns deleted products"
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"created_day": 411,
|
| 289 |
+
"labels": "bug,priority,customer-report",
|
| 290 |
+
"number": 4424,
|
| 291 |
+
"repo": "novacart/data",
|
| 292 |
+
"state": "open",
|
| 293 |
+
"title": "Upgrade the base image to bookworm"
|
| 294 |
+
},
|
| 295 |
+
{
|
| 296 |
+
"created_day": 418,
|
| 297 |
+
"labels": "bug",
|
| 298 |
+
"number": 4427,
|
| 299 |
+
"repo": "novacart/storefront",
|
| 300 |
+
"state": "open",
|
| 301 |
+
"title": "Stale search results after catalog update"
|
| 302 |
+
},
|
| 303 |
+
{
|
| 304 |
+
"created_day": 401,
|
| 305 |
+
"labels": "bug,priority",
|
| 306 |
+
"number": 4430,
|
| 307 |
+
"repo": "novacart/platform",
|
| 308 |
+
"state": "open",
|
| 309 |
+
"title": "Document the traffic-shift ceiling"
|
| 310 |
+
},
|
| 311 |
+
{
|
| 312 |
+
"created_day": 408,
|
| 313 |
+
"labels": "bug,customer-report",
|
| 314 |
+
"number": 4431,
|
| 315 |
+
"repo": "novacart/commerce",
|
| 316 |
+
"state": "closed",
|
| 317 |
+
"title": "Cart total rounds incorrectly at 3 decimal places"
|
| 318 |
+
},
|
| 319 |
+
{
|
| 320 |
+
"created_day": 415,
|
| 321 |
+
"labels": "enhancement",
|
| 322 |
+
"number": 4432,
|
| 323 |
+
"repo": "novacart/growth",
|
| 324 |
+
"state": "open",
|
| 325 |
+
"title": "Session cookie missing SameSite attribute"
|
| 326 |
+
},
|
| 327 |
+
{
|
| 328 |
+
"created_day": 398,
|
| 329 |
+
"labels": "enhancement,priority",
|
| 330 |
+
"number": 4434,
|
| 331 |
+
"repo": "novacart/data",
|
| 332 |
+
"state": "open",
|
| 333 |
+
"title": "Inventory count drifts after partial fulfilment"
|
| 334 |
+
},
|
| 335 |
+
{
|
| 336 |
+
"created_day": 405,
|
| 337 |
+
"labels": "chore",
|
| 338 |
+
"number": 4436,
|
| 339 |
+
"repo": "novacart/storefront",
|
| 340 |
+
"state": "open",
|
| 341 |
+
"title": "Export job writes an empty header row"
|
| 342 |
+
},
|
| 343 |
+
{
|
| 344 |
+
"created_day": 419,
|
| 345 |
+
"labels": "bug,regression",
|
| 346 |
+
"number": 4438,
|
| 347 |
+
"repo": "novacart/commerce",
|
| 348 |
+
"state": "open",
|
| 349 |
+
"title": "Product images load at full resolution on mobile"
|
| 350 |
+
},
|
| 351 |
+
{
|
| 352 |
+
"created_day": 402,
|
| 353 |
+
"labels": "security",
|
| 354 |
+
"number": 4441,
|
| 355 |
+
"repo": "novacart/growth",
|
| 356 |
+
"state": "open",
|
| 357 |
+
"title": "Analytics rollup double-counts refunded orders"
|
| 358 |
+
},
|
| 359 |
+
{
|
| 360 |
+
"created_day": 409,
|
| 361 |
+
"labels": "bug,priority,customer-report",
|
| 362 |
+
"number": 4444,
|
| 363 |
+
"repo": "novacart/data",
|
| 364 |
+
"state": "open",
|
| 365 |
+
"title": "Timezone handling breaks the nightly cutover"
|
| 366 |
+
},
|
| 367 |
+
{
|
| 368 |
+
"created_day": 416,
|
| 369 |
+
"labels": "bug",
|
| 370 |
+
"number": 4447,
|
| 371 |
+
"repo": "novacart/storefront",
|
| 372 |
+
"state": "closed",
|
| 373 |
+
"title": "Webhook signature check accepts an empty signature"
|
| 374 |
+
},
|
| 375 |
+
{
|
| 376 |
+
"created_day": 399,
|
| 377 |
+
"labels": "bug,priority",
|
| 378 |
+
"number": 4448,
|
| 379 |
+
"repo": "novacart/platform",
|
| 380 |
+
"state": "open",
|
| 381 |
+
"title": "Bulk import silently drops rows over 10k"
|
| 382 |
+
},
|
| 383 |
+
{
|
| 384 |
+
"created_day": 406,
|
| 385 |
+
"labels": "bug,customer-report",
|
| 386 |
+
"number": 4451,
|
| 387 |
+
"repo": "novacart/commerce",
|
| 388 |
+
"state": "open",
|
| 389 |
+
"title": "Coupon stacking bypasses the maximum discount"
|
| 390 |
+
}
|
| 391 |
+
]
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"columns": [
|
| 395 |
+
"source",
|
| 396 |
+
"target",
|
| 397 |
+
"kind"
|
| 398 |
+
],
|
| 399 |
+
"row_count": 4,
|
| 400 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 401 |
+
"table": "issue_links",
|
| 402 |
+
"task_relevant_rows": [
|
| 403 |
+
{
|
| 404 |
+
"kind": "duplicates",
|
| 405 |
+
"source": "ENG-3001",
|
| 406 |
+
"target": "GRW-88"
|
| 407 |
+
},
|
| 408 |
+
{
|
| 409 |
+
"kind": "duplicates",
|
| 410 |
+
"source": "ENG-3001",
|
| 411 |
+
"target": "4412"
|
| 412 |
+
},
|
| 413 |
+
{
|
| 414 |
+
"kind": "duplicates",
|
| 415 |
+
"source": "ENG-3003",
|
| 416 |
+
"target": "GRW-91"
|
| 417 |
+
},
|
| 418 |
+
{
|
| 419 |
+
"kind": "duplicates",
|
| 420 |
+
"source": "ENG-3003",
|
| 421 |
+
"target": "4402"
|
| 422 |
+
}
|
| 423 |
+
]
|
| 424 |
+
}
|
| 425 |
+
]
|
| 426 |
+
}
|
task_files/dob100-037-port-copy-priority-issues/11-knowledge-base.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 11 Knowledge Base
|
| 2 |
+
|
| 3 |
+
## documents (30 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"doc_id": 9608,
|
| 9 |
+
"kind": "runbook",
|
| 10 |
+
"title": "API deprecation",
|
| 11 |
+
"service": "api-gateway",
|
| 12 |
+
"author": "Priya Nair",
|
| 13 |
+
"day": 259,
|
| 14 |
+
"body": "# API deprecation\n\nHow to retire a public endpoint without breaking integrators. Traffic weights\nlive in `api-gateway` production runtime state; endpoint status lives in the\nrepo.\n\n## The three phases\n\n### 1. Deprecate and deploy\n\nMark the endpoint `deprecated` via an `endpoint` PR change, and **deploy that\nfirst**. Deprecation is a real code change: the gateway starts emitting\n`Deprecation` and `Sunset` response headers, the endpoint is flagged in the\npublic API reference, and usage is tagged by client id so we can see who is\nstill on it. `api-gateway` is tier 1, so this deploy is staging first, then a\nproduction canary at `canary_percent <= 25`, `assess_canary`, `promote_canary`.\n\nDo not shift any traffic yet. Deprecated is a label, not a redirect.\n\n### 2. Shift traffic in stages\n\nMove traffic from the legacy endpoint to its replacement in steps of **at most\n50 percentage points per step**. A typical path is 100 - 50 - 0 with a soak in\nbetween, and for a high-volume endpoint 100 - 75 - 50 - 25 - 0 is better.\n\nAt each step:\n\n- Watch the replacement's error rate and p99 for at least one traffic peak.\n- Compare response shapes on a sample of real requests.\n- If anything regresses, shift back. Shifting back is free and instant.\n\nThe two endpoints' weights should sum to 100 at every step. A step larger than\n50 points is rejected - it is the difference between a bad hour and a bad\nquarter.\n\n### 3. Retire\n\n**Only when the legacy endpoint serves 0% traffic may it be retired.** Retire it\nwith a second `endpoint` PR change (status `retired`) and deploy that change,\nstaging first, canary, promote.\n\n**CI blocks retiring an endpoint that is still serving traffic.** The check\nreads the production traffic weight for the endpoint and fails the run if it is\nnon-zero. This is not overridable; get the weight to 0 first.\n\n## Communication\n\n- Announce in `#eng` when the deprecation deploy lands.\n- Give external integrators a minimum 90-day sunset window from the date the\n `Sunset` header first ships.\n- Update the public API spec in the same sprint - see \"Public Orders API\".\n\n## Worked example\n\n`/v1/orders` to `/v2/orders`: deprecate `/v1/orders` and deploy; shift\n`/v1/orders` 100 to 50 while `/v2/orders` goes 0 to 50; soak; shift to 0/100;\nsoak; retire `/v1/orders` and deploy. Rationale in \"ADR-031: Versioned public\nAPI (/v1 to /v2 orders)\".\n"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"doc_id": 9609,
|
| 18 |
+
"kind": "runbook",
|
| 19 |
+
"title": "Security response",
|
| 20 |
+
"service": "",
|
| 21 |
+
"author": "Alex Osei",
|
| 22 |
+
"day": 263,
|
| 23 |
+
"body": "# Security response\n\nCovers dependency vulnerabilities reported by the scanner and secrets found in\nsource. Security tickets carry the `security` type and are prioritized above\nfeature work.\n\n## Vulnerable dependency\n\nOrdered steps:\n\n1. **Patch the vulnerable dependency.** Bump to the fixed version named in the\n finding via a PR with a `dependency` change. Do not jump several major\n versions to \"get ahead\" - patch to the fixed version, then plan the upgrade\n separately.\n2. **Deploy staging, then production.** Staging-first per the \"Deployment\n policy\". Tier-1 services canary at `canary_percent <= 25`, `assess_canary`,\n then `promote_canary`.\n3. **Verify the scanner shows the finding remediated.** Re-run the scan against\n the deployed service and confirm the vulnerability status is no longer\n `open`. A merged PR is not remediation; a deployed and re-scanned service is.\n4. **Post an audit summary to `#security` referencing the CVE id.** State the\n CVE, the service, the old and new versions, and when production was patched.\n Auditors read this channel; the CVE id must appear literally.\n5. **Close the security ticket.**\n\nTimelines by severity, measured from the finding appearing:\n\n| Severity | Production patched within |\n| -------- | ------------------------- |\n| critical | 48 hours |\n| high | 7 days |\n| medium | 30 days |\n| low | next maintenance window |\n\n## Secrets in code\n\nIf a credential, API key, or token is found in source, config, or CI logs:\n\n1. **Move it to the secret manager.** Set config key\n `use_secret_manager=true` for the service and reference the secret by name;\n the value never appears in the repo again.\n2. **Rotate the credential.** Assume it is compromised the moment it was\n committed - git history is forever and the repo is mirrored to CI. Rotation\n is not optional even if the repo is private.\n3. Deploy staging then production, verify the service still authenticates, and\n post the summary to `#security`.\n\nDo not \"delete the line and force-push\". The old blob is still reachable and the\ncredential is still live.\n\n## Escalation\n\nAnything involving customer data exposure, an actively exploited vulnerability,\nor credential misuse in production is a sev1 - open an incident and follow\n\"Incident response\" in parallel with this runbook.\n\n## Related\n\n- \"ADR-027: Move partner credentials to the secret manager\".\n"
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"doc_id": 9610,
|
| 27 |
+
"kind": "runbook",
|
| 28 |
+
"title": "Flaky tests",
|
| 29 |
+
"service": "",
|
| 30 |
+
"author": "Diego Ramos",
|
| 31 |
+
"day": 244,
|
| 32 |
+
"body": "# Flaky tests\n\nA flaky test is a test that passes and fails without the code changing. It is\nworse than a failing test, because it teaches the team to ignore red builds.\n\n## Diagnose from CI history\n\nStart with `list_ci_runs` for the service. You are looking for the same test\nname alternating between `passed` and `failed` across runs on the same commit or\nadjacent commits. The CI detail line usually names it:\n\n```\nintermittent failure: test_checkout_idempotency (rerun may pass)\n```\n\nCommon root causes, roughly in order of how often we hit them:\n\n1. **Shared mutable fixture state** - two tests write the same row, key, or temp\n file, and ordering decides who wins. The `test_checkout_idempotency` flake was\n a nondeterministic idempotency-key collision in the fixture.\n2. **Time and timezone** - `now()` at a boundary, tests that assume ordering by\n second-resolution timestamps.\n3. **Unseeded randomness** - random ids that occasionally collide.\n4. **Real sleeps and races** - `sleep(0.1)` standing in for a synchronization\n point.\n5. **Network or clock dependence** - a test that quietly reaches a real service.\n\n## Fix the root cause\n\nShip the fix as a PR containing a `test_fix` change with **action `fix`**. The\nchange should make the test deterministic: seed the randomness, isolate the\nfixture per test, inject the clock, replace sleeps with explicit waits.\n\n**Quarantine is a last resort.** A `test_fix` change with action `quarantine`\nstops the test from blocking CI, but it **does not close the ticket** - the\nticket stays open until an action `fix` change lands. Quarantine is for\nunblocking a release train at 2am, not for closing your backlog. Quarantined\ntests are reviewed weekly and anything quarantined for more than two weeks is\nescalated to the owning team's lead.\n\n## Prove stability\n\nAfter merging, demonstrate stability with **3 consecutive green main-branch\nruns**: `run_ci(service=...)` three times, all `passed`, with no other change in\nbetween. One green run proves nothing about a test that fails half the time -\nthree consecutive greens give roughly 87% confidence for a 50% flake and much\nmore for the typical 10-20% flake.\n\nOnly then close the ticket.\n\n## Prevention\n\n- No shared fixtures across test files; build state per test.\n- Inject the clock, never call `now()` directly in application code under test.\n- Seed every random source in the test harness.\n- If a test needs a real dependency, it is an integration test - label it and\n run it in the integration stage.\n"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"doc_id": 9611,
|
| 36 |
+
"kind": "runbook",
|
| 37 |
+
"title": "Connection pool sizing",
|
| 38 |
+
"service": "",
|
| 39 |
+
"author": "Priya Nair",
|
| 40 |
+
"day": 236,
|
| 41 |
+
"body": "# Connection pool sizing\n\nApplies to every service holding a database connection pool. The relevant config\nkey is `db_pool_size`.\n\n## The rule\n\n`db_pool_size` must be **at least 20** for tier-1 and tier-2 services. Below\nthat, requests queue and time out under normal traffic - not peak traffic,\nnormal traffic.\n\n## Why 20\n\nThe pool is the number of database connections a single service instance may\nhold concurrently. When every connection is checked out, the next request waits\non the pool's acquire queue. That wait is invisible in database metrics - the\ndatabase looks idle and healthy - and shows up only as application latency and\ntimeouts. It is one of the most consistently misdiagnosed failures we have.\n\nRough sizing arithmetic: a service handling 200 requests per second per instance\nwith a 40ms mean query time needs about `200 * 0.04 = 8` connections just to\nkeep up in steady state. Traffic is bursty, queries are not uniform, and one\nslow query holds a connection for its full duration, so we take a 2-3x headroom\nfactor. Twenty is the resulting floor for anything customer-facing.\n\n## Symptoms of an undersized pool\n\n- Application p99 climbs while the database's own p99 is flat.\n- Errors are `TimeoutError` on acquire, not on query execution.\n- Latency is highly sensitive to a small change in traffic - a 10% traffic\n increase doubles p99. Queueing systems behave like this near saturation.\n- Restarting the service \"fixes\" it for a few minutes.\n\n## Upper bound\n\nBigger is not automatically better. Total connections to the primary is\n`instances * db_pool_size` and the database has a hard `max_connections`. Past\nthat ceiling, connection attempts are refused outright, which is a far worse\nfailure than queueing. Before raising a pool above 50 per instance, check the\ninstance count and the database limit, and consider a connection proxy instead.\n\n## Interaction with timeouts\n\nPool sizing and the \"Retry and timeout standard\" are the same problem seen from\ntwo directions. A downstream call with a 30000ms timeout holds its request\nworker - and any connection that worker checked out - for thirty seconds. A\nhandful of those exhausts a 20-connection pool. Keeping\n`<downstream>_timeout_ms` at or below 2000 is part of pool hygiene.\n\n## Changing it\n\n`db_pool_size` is repo config: PR with a `config` change, CI, merge, deploy\nstaging then production. Measure p99 and the acquire-wait metric before and\nafter; if p99 did not move, the pool was not the bottleneck and you should look\nat query performance instead (see \"Catalog pricing performance\" for the classic\nN+1 case).\n"
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"doc_id": 9612,
|
| 45 |
+
"kind": "runbook",
|
| 46 |
+
"title": "Queue consumer tuning",
|
| 47 |
+
"service": "notifications",
|
| 48 |
+
"author": "Priya Nair",
|
| 49 |
+
"day": 226,
|
| 50 |
+
"body": "# Queue consumer tuning\n\nOwner: platform. Primary consumer service: `notifications` (tier 2), which\ndrains the email, SMS, and push delivery queues. The same rules apply to any\nservice that consumes from the message broker.\n\n## The rule\n\n`prefetch_count` must be a **bounded** value. **Recommended: 50.**\n\n`prefetch_count=0` means **unlimited prefetch** and is the single worst setting\nin this runbook.\n\n## What prefetch does\n\nPrefetch is the number of unacknowledged messages the broker will push to a\nsingle consumer. With `prefetch_count=50`, a consumer holds at most 50\nin-flight messages; the broker will not send a 51st until one is acknowledged.\nThis is the backpressure mechanism - it is what lets a slow consumer tell the\nbroker to slow down.\n\nWith `prefetch_count=0` there is no backpressure. The broker pushes the entire\nbacklog to whichever consumer connects first. Consequences, all of which we have\nseen in `notifications`:\n\n- **Memory pressure.** A 400k-message backlog lands in one process's heap. RSS\n climbs until the container hits its memory limit.\n- **Consumer restarts.** The container is OOM-killed, the unacknowledged\n messages are redelivered, the restarted consumer grabs them all again, and it\n is killed again. A restart loop that looks like a broker problem and is not.\n- **Terrible load distribution.** One consumer holds everything while its\n siblings sit idle, so scaling out does nothing.\n- **Head-of-line latency.** A high-priority message sits behind 400k others.\n\n## Sizing\n\n| Message profile | prefetch_count |\n| ------------------------------ | -------------- |\n| Fast, uniform (a few ms each) | 100-200 |\n| Standard delivery work | **50** |\n| Slow or variable (seconds) | 5-10 |\n| Long-running jobs (minutes) | 1 |\n\nRule of thumb: `prefetch_count` should be roughly the number of messages a\nconsumer can process in one to two seconds. Start at 50 and adjust with\nevidence.\n\n## Related settings\n\n- `smtp_pool` on `notifications` bounds concurrent SMTP connections. Prefetch\n above the SMTP concurrency just buys queueing inside the process.\n- Ack **after** the work is done, never on receipt. Acking on receipt turns a\n crash into silent message loss.\n- Dead-letter after 5 delivery attempts so a poison message cannot loop forever.\n\n## Changing it\n\nRepo config: PR with a `config` change, CI, merge, staging, production.\n`notifications` is tier 2 - straight 100% deploy after staging. Watch consumer\nmemory and queue depth for one full peak after the change.\n"
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"doc_id": 9614,
|
| 54 |
+
"kind": "design_doc",
|
| 55 |
+
"title": "Checkout architecture",
|
| 56 |
+
"service": "checkout",
|
| 57 |
+
"author": "Diego Ramos",
|
| 58 |
+
"day": 198,
|
| 59 |
+
"body": "# Checkout architecture\n\nService: `checkout` (tier 1, python, commerce). Owns the cart and the checkout\norchestration state machine. SLOs: `error_rate_pct < 1.0`,\n`latency_p99_ms < 400`.\n\n## Responsibilities\n\n`checkout` owns the transition from \"a cart exists\" to \"an order exists and is\npaid\". It does not own money movement (that is `payments`), product data (that\nis `catalog`), or customer notification (that is `notifications`). It owns the\nsequencing and the guarantee that the sequence happens exactly once.\n\nModules: `cart`, `checkout_flow`, and - once the loyalty program ships -\n`loyalty_redeem`.\n\n## The state machine\n\nEvery checkout session is a row with an explicit state:\n\n```\ncart_open -> pricing_locked -> payment_pending -> paid -> order_created\n | |\n +-> abandoned +-> payment_failed\n```\n\nTransitions are append-only and each is stamped with the idempotency key of the\nrequest that caused it. Replaying a request that has already produced a\ntransition returns the existing result rather than performing it again. This is\nwhat makes the checkout endpoint safe to retry, which matters because clients\nretry aggressively on mobile networks.\n\n## Dependencies\n\n| Downstream | Call | Timeout budget |\n| --------------- | ------------------------ | ------------------------- |\n| `catalog` | price and availability | `<= 2000ms`, 3 attempts |\n| `payments` | authorize and capture | `payment_timeout_ms` |\n| `notifications` | order confirmation | async, fire-and-forget |\n\nAll synchronous calls follow the \"Retry and timeout standard\": three attempts,\ntimeout at or below 2000ms. The `notifications` call is deliberately\nasynchronous - a confirmation email must never be able to fail an order.\n\n## Pricing lock\n\nAt `pricing_locked` we snapshot the price, the promotion, and the tax\ncomputation into the session row. From that point the customer pays the price\nthey were shown even if `catalog` changes underneath. The lock expires after 20\nminutes, after which the session re-prices.\n\n## Failure handling\n\n- `payments` timeout: the session stays `payment_pending` and a reconciliation\n job asks `payments` for the authoritative status. We never assume a timeout\n means \"did not happen\".\n- `catalog` unavailable: fail closed. We do not sell at a guessed price.\n- Partial capture: not supported; a capture is all-or-nothing per order.\n\n## Feature flags\n\nCheckout-adjacent behavior ships behind flags - `instant_refunds`,\n`express_checkout`. Per the \"Feature flags\" runbook, the code deploys first and\nthe flag is enabled afterwards at no more than 10%. `instant_refunds` is the\ncautionary tale: ramped to 100% in production, it took `error_rate_pct` from\n0.3% to 5.5% via a nil-pointer panic in the refund worker.\n\n## Open questions\n\n- Should the pricing lock move into `catalog` so `search` can honor it too?\n- Cart merge on login is still last-write-wins; it should be a real merge.\n"
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"doc_id": 9615,
|
| 63 |
+
"kind": "design_doc",
|
| 64 |
+
"title": "Payments settlement pipeline",
|
| 65 |
+
"service": "payments",
|
| 66 |
+
"author": "Diego Ramos",
|
| 67 |
+
"day": 205,
|
| 68 |
+
"body": "# Payments settlement pipeline\n\nService: `payments` (tier 1, python, commerce). Owns capture, refunds, and daily\nsettlement against the processor. SLOs: `error_rate_pct < 1.0`,\n`latency_p99_ms < 200`.\n\n## Ledger first\n\nEverything in `payments` is derived from an append-only ledger. A capture is not\n\"a field set to captured\" - it is a sequence of ledger entries that must balance.\nNothing is ever updated in place; corrections are compensating entries. This is\nwhat makes settlement reconcilable at all.\n\nEntry kinds: `authorization`, `capture`, `refund`, `chargeback`, `fee`,\n`payout`. Each carries the processor reference id, the currency, the minor-unit\namount, and the order id.\n\n## Synchronous path\n\n1. `checkout` calls authorize with an idempotency key.\n2. `payments` writes an `authorization` entry and calls the processor through\n `libpayproc`.\n3. On success, capture is either immediate or deferred to fulfilment depending\n on the merchant configuration.\n4. `payments` emits an event; `notifications` sends the receipt.\n\nThe call to `notifications` is where this service has historically hurt itself.\nIt must run with `notifications_retry_max_attempts=3` and\n`notifications_timeout_ms` at or below 2000, per the \"Retry and timeout\nstandard\". Running with retries at 0 and a 30000ms timeout produced\n`ConnectionTimeout` errors that permanently failed the request and marked orders\nfailed, pushing `error_rate_pct` from a 0.4% baseline to 3.8%.\n\n## Nightly settlement\n\nAt 02:00 UTC the settlement job:\n\n1. Freezes the ledger cursor for the previous day.\n2. Fetches the processor's settlement file.\n3. Matches each processor line to a ledger entry by reference id.\n4. Writes `fee` and `payout` entries for matched lines.\n5. Files unmatched lines into an exceptions queue for manual review.\n\nThe exceptions queue is expected to be small but never empty - a handful of\ncross-midnight captures land there daily and clear the next run.\n\n## Invariants\n\n- Sum of `capture` minus `refund` minus `chargeback` per order is never\n negative.\n- No order has a `capture` without a preceding `authorization`.\n- Every `payout` reconciles to a processor settlement line.\n\nThese are asserted by a checker that runs after settlement; a violation pages\ncommerce immediately.\n\n## Pool and dependencies\n\n`db_pool_size` is 20 (the floor from \"Connection pool sizing\"). `libpayproc` is\npinned and patched promptly - it is the highest-value dependency in the fleet\nfor an attacker, and CVE handling follows \"Security response\".\n\n## Open questions\n\n- Multi-currency payouts still net in the merchant's home currency only.\n- Chargeback ingestion is a daily poll; a webhook would cut the delay to minutes.\n"
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"doc_id": 9616,
|
| 72 |
+
"kind": "design_doc",
|
| 73 |
+
"title": "Search indexing pipeline",
|
| 74 |
+
"service": "search",
|
| 75 |
+
"author": "Mei Tanaka",
|
| 76 |
+
"day": 212,
|
| 77 |
+
"body": "# Search indexing pipeline\n\nService: `search` (tier 2, python, growth). Owns the product index, the query\npath, and ranking. SLO: `latency_p99_ms < 300`.\n\n## Two paths\n\n**Ingest** takes product changes from `catalog` and turns them into index\ndocuments. **Query** turns a user's text into a ranked result set. They share\nnothing but the index itself, and they are deliberately allowed to fail\nindependently: a stalled ingest means stale results, not an outage.\n\n## Ingest\n\n`catalog` emits product-changed events. The indexer consumes them, hydrates the\nfull product (title, description, attributes, category path, price band,\navailability), and writes into the index across `index_shards=4` shards, keyed\nby product id so a product always lands on the same shard.\n\nTwo modes:\n\n- **Incremental** - the steady state. Event to searchable in under 30 seconds at\n p95.\n- **Full rebuild** - triggered by a mapping change or an analyzer change. Builds\n into a new index alias and swaps atomically. A rebuild takes about 40 minutes\n for the current catalog size.\n\nA rebuild swap invalidates the query cache. That is the dangerous moment; see\n\"Postmortem: search cache stampede after index rebuild\" and the warm-up\nprocedure it produced.\n\n## Query\n\n1. Normalize and analyze the query text.\n2. Check the query cache (`cache_enabled`, `cache_ttl_s=300`).\n3. On miss, fan out to all four shards, gather, and merge.\n4. Rank, apply availability filtering, paginate.\n5. Populate the cache, return.\n\nThe cache is not optional. It absorbs roughly 75% of index load, and running\nwith `cache_enabled=false` moves p99 from ~210ms to ~640ms. See the \"Search\ncaching\" runbook - that document is the operational contract for this design.\n\n## Ranking\n\nScore is a weighted blend: BM25 text relevance, a popularity signal from 30-day\nconversions, availability (out-of-stock items are demoted, not hidden), and a\nsmall merchandising boost that category managers control. Weights are versioned\nalongside the index mapping so a ranking change and a mapping change move\ntogether.\n\n## Shard sizing\n\nFour shards is a capacity decision, not a default. Each shard is roughly 6GB and\ncomfortably fits in page cache on the current instance type. Changing\n`index_shards` requires a full rebuild and a capacity review - it is not a\nconfig tweak you ship on a Friday.\n\n## UI\n\nThe redesigned results page ships behind the `new_search_ui` flag, enabled in\nstaging and dark in production, per the \"Feature flags\" runbook.\n\n## Open questions\n\n- Vector recall for long-tail queries: promising offline, unproven on latency.\n- Per-locale analyzers currently force a full rebuild per locale.\n"
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"doc_id": 9617,
|
| 81 |
+
"kind": "design_doc",
|
| 82 |
+
"title": "Loyalty points program",
|
| 83 |
+
"service": "",
|
| 84 |
+
"author": "Diego Ramos",
|
| 85 |
+
"day": 288,
|
| 86 |
+
"body": "# Loyalty points program\n\nCross-service feature spanning `catalog`, `checkout`, and `storefront-web`.\nCustomers earn points on purchases and redeem them for order discounts.\n\n## Modules and ownership\n\n| Module | Service | Responsibility |\n| ----------------- | ----------------- | ------------------------------------- |\n| `loyalty_accrual` | `catalog` | Points-earning rules per product |\n| `loyalty_redeem` | `checkout` | Applying points as an order discount |\n| `loyalty_widget` | `storefront-web` | Balance display and redeem affordance |\n\nEach module ships in **its own PR against its own service**. There is no shared\nlibrary; the contract between them is the points-rate field on the product\npayload and the redeem call on the checkout API.\n\n## Why this split\n\nAccrual rules are product data - they vary per product and per category, they\nchange with merchandising campaigns, and they belong next to pricing. Redemption\nis an order-level money decision and belongs in the checkout state machine.\nDisplay is display. Putting accrual in `checkout` would have meant `checkout`\nreading the product rules table, which is exactly the coupling we spent last\nyear removing.\n\n## Rollout order\n\nDeployment order matters and is not negotiable:\n\n**`catalog` - then `checkout` - then `storefront-web`.**\n\nThe reasoning is a strict data dependency chain:\n\n1. `catalog` must be emitting a points rate on the product payload before\n `checkout` can compute a balance to redeem against. If `checkout` ships\n first, every redeem attempt reads a missing field and either errors or\n silently computes zero.\n2. `checkout` must expose the redeem endpoint and be live before\n `storefront-web` renders a redeem button. If the widget ships first,\n customers see a button that 404s - a visible, embarrassing failure on the\n busiest page we have.\n\n`catalog` is tier 2 (straight production deploy after staging). `checkout` and\n`storefront-web` are tier 1, so each is staging-first, then a production canary\nat `canary_percent <= 25`, `assess_canary`, then `promote_canary` - see\n\"Deployment policy\". Do not begin the next service's production deploy until the\nprevious one is fully promoted.\n\n## Points model\n\nBalances live in an append-only ledger, mirroring the approach in \"Payments\nsettlement pipeline\": `earn`, `redeem`, `expire`, `adjust`. Balance is the sum,\nnever a stored counter. Redemption is authorized at `pricing_locked` and\ncommitted at `paid`; an abandoned cart releases the hold after 20 minutes.\n\nDefault rate is 1 point per whole currency unit, 100 points equals one currency\nunit of discount, points expire 12 months after earning. Maximum redemption is\n50% of order subtotal.\n\n## Risks\n\n- Double-redeem across concurrent sessions. Mitigated by the hold and by the\n idempotency key on the checkout transition.\n- Accrual rule changes retroactively altering historical balances. The ledger\n stamps the rate version at earn time.\n"
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
"doc_id": 9620,
|
| 90 |
+
"kind": "adr",
|
| 91 |
+
"title": "ADR-027: Move partner credentials to the secret manager",
|
| 92 |
+
"service": "payments",
|
| 93 |
+
"author": "Alex Osei",
|
| 94 |
+
"day": 191,
|
| 95 |
+
"body": "# ADR-027: Move partner credentials to the secret manager\n\n**Status:** Accepted\n**Date:** day 191\n**Deciders:** security, platform, commerce\n\n## Context\n\nPartner credentials - the payment processor API key, the shipping carrier\ntokens, the SMTP credentials used by `notifications`, and the analytics\nwrite key - were stored as plain config values in each service's repo config\nand injected as environment variables at deploy time.\n\nThree problems made this untenable:\n\n1. **Git history is permanent.** Every credential ever committed remains in\n history, in every clone, and in every CI cache. Removing the line does not\n remove the secret.\n2. **Rotation was a deploy.** Rotating the processor key meant a PR, CI, staging,\n canary, promote - per service. So rotation happened roughly never, and the\n processor key in production had been unchanged for over a year.\n3. **No access audit.** We could not answer \"who read this value, and when\",\n which is a direct finding in the annual audit.\n\nThe trigger was a scanner hit: a carrier token visible in a config file in a\nrepo that four teams could read.\n\n## Decision\n\nAll partner credentials move to the managed **secret manager**. Each service\nopts in with the config key **`use_secret_manager=true`** and references secrets\nby name rather than value. The application resolves secrets at startup and on a\nrefresh interval; the plaintext never appears in the repo, in a PR diff, or in a\ndeploy artifact.\n\nEvery credential moved is **rotated as part of the move**, on the assumption\nthat anything previously in the repo is compromised.\n\nRollout order: `payments` first (highest value), then `notifications`, then the\nremaining services.\n\n## Alternatives considered\n\n**Encrypted secrets committed to the repo (sealed values).** Rejected: it solves\nplaintext exposure but not rotation-as-a-deploy, and the decryption key becomes\nthe new committed secret.\n\n**Environment variables set manually on hosts.** Rejected: unauditable,\ndrift-prone, and impossible to reproduce.\n\n**Do nothing, tighten repo permissions.** Rejected: it does not address history,\nrotation, or audit.\n\n## Consequences\n\nPositive: rotation is an operation, not a release; access is logged per read;\nsecret scanning in CI becomes a hard gate rather than advisory.\n\nNegative: a new startup-time dependency. If the secret manager is unreachable a\nservice cannot start, so we cache the last successful resolution on disk,\nencrypted, with a short TTL, to survive a brief outage.\n\nOperational procedure for a leaked credential is in the \"Security response\"\nrunbook: move to the secret manager, **rotate**, deploy, verify, post to\n`#security`.\n"
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"doc_id": 9622,
|
| 99 |
+
"kind": "postmortem",
|
| 100 |
+
"title": "Postmortem: search cache stampede after index rebuild",
|
| 101 |
+
"service": "search",
|
| 102 |
+
"author": "Mei Tanaka",
|
| 103 |
+
"day": 183,
|
| 104 |
+
"body": "# Postmortem: search cache stampede after index rebuild\n\n**Severity:** sev2\n**Service:** `search`\n**Duration:** 34 minutes of degraded search\n**Author:** Mei Tanaka\n**Status:** action items complete\n\n## Summary\n\nA planned index rebuild swapped the search index alias at a moderate traffic\nhour. The alias swap invalidated the entire query cache. Every in-flight query\nmissed simultaneously and hit the primary index, driving `latency_p99_ms` from\n~210ms to a peak of 2100ms and firing the `search latency_p99_ms` alert against\nits 300ms SLO. Search was slow, not down; conversion on search-originated\nsessions dropped an estimated 18% for the duration.\n\n## Timeline (UTC)\n\n- **14:02** Engineer starts a full index rebuild for an analyzer change. Routine;\n done a dozen times before.\n- **14:41** Rebuild completes. Alias swaps to the new index. Query cache keys are\n namespaced by index generation, so the swap invalidates 100% of the cache.\n- **14:42** `latency_p99_ms` crosses 300ms. Alert fires, `medium`.\n- **14:44** On-call acknowledges. Initial hypothesis: the new analyzer is slow.\n- **14:51** Index CPU is pegged; per-query cost is unchanged from before the\n rebuild. Hypothesis discarded - it is volume, not per-query cost.\n- **14:58** Cache hit ratio confirmed at 3%, against a normal 76%. Root cause\n identified.\n- **15:06** Traffic to search temporarily shed at the gateway by 30% to let the\n cache refill.\n- **15:16** Hit ratio back above 60%; p99 at 340ms and falling.\n- **15:22** Shedding removed. p99 at 215ms.\n- **15:26** Alert resolved, incident resolved, update posted in `#incidents`.\n\n## Root cause\n\nThe query cache is namespaced by index generation. An alias swap therefore\nperforms a **complete, instantaneous cache flush** with no warm-up. Because the\ncache normally absorbs about **75% of index load**, the index was asked to serve\nroughly 4x its steady-state query volume within one second. Requests queued,\nlatency rose, clients retried, and the retries added load - a classic stampede\nwith a positive feedback loop.\n\n## Contributing factors\n\n- No warm-up step in the rebuild procedure. The runbook ended at \"swap alias\".\n- Rebuild was run at 14:00 local, in the daily traffic ramp, because the job\n takes 40 minutes and nobody wanted to babysit it at night.\n- Single-flight coalescing existed for identical concurrent queries but the\n stampede was across *thousands of distinct* queries, so coalescing did nothing.\n- No alert on cache hit ratio, so the actual signal was invisible for 14 minutes.\n\n## What went well\n\n- Alerting fired within a minute of the SLO breach.\n- Load shedding at the gateway was the correct blunt instrument and worked.\n\n## Action items\n\n1. Add a **warm-up phase** to the rebuild: replay the top 5000 queries against\n the new index before swapping the alias. **Done.**\n2. Add **+/-10% TTL jitter** to `cache_ttl_s=300` so natural expiry never\n synchronizes. **Done.**\n3. Alert on **cache hit ratio below 50%** for 5 minutes. **Done.**\n4. Move scheduled rebuilds to 03:00-05:00 UTC. **Done.**\n5. Document the stampede risk in the \"Search caching\" runbook. **Done.**\n"
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"doc_id": 9623,
|
| 108 |
+
"kind": "postmortem",
|
| 109 |
+
"title": "Postmortem: catalog migration 0043 forced a rollback",
|
| 110 |
+
"service": "catalog",
|
| 111 |
+
"author": "Diego Ramos",
|
| 112 |
+
"day": 202,
|
| 113 |
+
"body": "# Postmortem: catalog migration 0043 forced a rollback\n\n**Severity:** sev1\n**Service:** `catalog` (with knock-on impact to `checkout` and `storefront-web`)\n**Duration:** 22 minutes of failed product-detail pages\n**Author:** Diego Ramos\n**Status:** action items complete\n\n## Summary\n\nMigration `0043_rename_price_column` renamed `catalog_products.price_cents` to\n`price_minor_units` in a single step, and the matching code version `v1.8.0` was\ndeployed immediately after. The migration was applied to production before the\ndeploy, as policy requires - but the migration was **not backwards compatible**\nwith the code version already running. Between the migration completing and the\nnew version being fully rolled out, the running `v1.7.6` instances queried a\ncolumn that no longer existed. Product-detail and category pages returned 500s;\n`checkout` fell back to failing closed on pricing, per its design.\n\n## Timeline (UTC)\n\n- **09:12** `apply_migration(catalog, production, 0043)` starts.\n- **09:13** Migration completes. Column renamed.\n- **09:13** `v1.7.6` instances begin throwing\n `UndefinedColumn: price_cents` on every pricing query.\n- **09:14** `catalog` error rate goes vertical. `checkout` starts failing closed.\n Two alerts fire.\n- **09:15** Deploy of `v1.8.0` starts, as planned, but rolls instance by instance.\n- **09:17** On-call acknowledges, declares sev1.\n- **09:19** Commander recognizes the pattern: schema ahead of code, partial fleet.\n- **09:21** Decision: do **not** attempt to reverse the migration. Accelerate the\n `v1.8.0` rollout instead.\n- **09:31** Rollout complete on all instances. Errors stop.\n- **09:34** Metrics confirmed recovered; alerts resolved; incident resolved.\n- **09:40** Update posted in `#incidents`; status page updated and cleared.\n- Later that day: `v1.8.0` was rolled back for an unrelated defect found in\n review, which is when the second lesson landed - the rolled-back `v1.7.6` code\n could not read the renamed column either, and a hotfix `v1.8.1` had to be cut\n because **migrations are forward-only** and there was no going back.\n\n## Root cause\n\nA **destructive, non-backwards-compatible schema change shipped in one step**. A\ncolumn rename is two incompatible states with no overlap: code that knows the old\nname and code that knows the new name cannot both work against the same schema.\nAny window in which both code versions run - and a rolling deploy guarantees such\na window - is an outage.\n\n## Contributing factors\n\n- The \"migration before code\" rule was followed correctly, and following it\n correctly was *insufficient*. The rule says nothing about compatibility with\n the code already running.\n- The migration had one reviewer, from the authoring team.\n- Rolling deploys were assumed to be fast enough not to matter. They are not.\n- `catalog` is tier 2, so there was no canary to catch it at 25%.\n\n## What went well\n\n- Nobody tried to hand-write a reverse migration under pressure. Rolling forward\n was the right call and it was made in six minutes.\n- `checkout` failing closed on pricing prevented selling at a wrong price.\n\n## Action items\n\n1. Write the **N-1 rule** into the \"Database migration policy\": every migration\n must leave the schema usable by the currently deployed code. **Done.**\n2. Mandate the **expand/contract** pattern for renames: add column, dual-write,\n backfill, switch reads, drop in a later migration. **Done.**\n3. Require a **second reviewer from platform** for migrations on tables above ten\n million rows. **Done.**\n4. Add a CI check that flags `DROP COLUMN`, `RENAME COLUMN`, and new `NOT NULL`\n constraints for explicit sign-off. **Done.**\n"
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"doc_id": 9625,
|
| 117 |
+
"kind": "onboarding",
|
| 118 |
+
"title": "Engineering onboarding: how we ship",
|
| 119 |
+
"service": "",
|
| 120 |
+
"author": "Priya Nair",
|
| 121 |
+
"day": 290,
|
| 122 |
+
"body": "# Engineering onboarding: how we ship\n\nRead this first. It is the whole workflow end to end; the runbooks it points at\nhave the detail.\n\n## The path\n\n**ticket - PR with structured changes - CI - merge - staging - canary - promote -\nverify - close**\n\n### 1. Ticket\n\nAll work starts from a ticket. It carries the type (`bug`, `feature`,\n`incident`, `security`, `postmortem`), the priority, and the owning service. If\nyou are doing work with no ticket, you are doing work nobody can find later.\n\n### 2. PR with structured changes\n\nA pull request is linked to its ticket and carries **structured changes**, not\njust prose. Change types:\n\n| Change type | Use for |\n| ------------ | ---------------------------------------------- |\n| `config` | A config key and value in the service repo |\n| `module` | Adding or removing a code module |\n| `dependency` | Upgrading a library (see \"Security response\") |\n| `endpoint` | Adding, deprecating, or retiring an endpoint |\n| `flag` | Defining a feature flag |\n| `test_fix` | Fixing (`fix`) or quarantining a flaky test |\n\nStructured changes are what make a PR mechanically checkable and what the deploy\ntooling reads. One concern per PR.\n\n### 3. CI\n\nCI runs four stages in order: **build - unit - integration - regression**. A\nfailing stage stops the run. Some checks are hard gates: retiring an endpoint\nthat still serves traffic fails CI, and so does a secret detected in the diff.\n\n### 4. Merge\n\nMerging cuts a version for the service. The version is the unit that gets\ndeployed; nothing reaches an environment except as a version.\n\n### 5. Staging\n\n`deploy_service(service, \"staging\", version)`. **Every production deploy must\nfirst succeed on staging with the same version** - see \"Deployment policy\". If\nthe change needs a schema migration, `apply_migration` runs against staging\n*before* this deploy - see \"Database migration policy\".\n\n### 6. Canary\n\nFor tier-1 services (`storefront-web`, `api-gateway`, `checkout`, `payments`),\nthe production deploy starts as a canary: `deploy_service` with\n`canary_percent <= 25`. Tier-2 services (`catalog`, `notifications`, `search`)\ndeploy at 100%.\n\n### 7. Promote\n\nRun `assess_canary`. Only when it reports **healthy** do you `promote_canary`.\nAn unhealthy canary is rolled back, not promoted.\n\n### 8. Verify\n\nRead the metric you were trying to move. Confirm it is inside its SLO. If an\nalert was firing, resolve it only after the metric has actually recovered.\n\n### 9. Close\n\nClose the ticket. If it was an incident, follow \"Incident response\" for the\nalert, incident, `#incidents` update, status page, and - for sev1 - the\npostmortem ticket.\n\n## Things new engineers get wrong\n\n- Enabling a feature flag before the guarded code is deployed. Deploy first, then\n enable, at no more than 10%.\n- Skipping staging for \"a one-line config change\". There are no exceptions.\n- Promoting a canary because it \"looked fine\" instead of assessing it.\n- Resolving an alert before verifying recovery.\n- Quarantining a flaky test and closing the ticket. It does not close the ticket.\n\n## Where to look next\n\n\"Deployment policy\", \"Database migration policy\", \"Incident response\",\n\"Feature flags\", \"Retry and timeout standard\", \"Service catalog and service\ntiers\".\n"
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"doc_id": 9626,
|
| 126 |
+
"kind": "runbook",
|
| 127 |
+
"title": "On-call and alert triage",
|
| 128 |
+
"service": "",
|
| 129 |
+
"author": "Alex Osei",
|
| 130 |
+
"day": 257,
|
| 131 |
+
"body": "# On-call and alert triage\n\nOne rotation per team, weekly, handing over on Monday. Current primaries:\nplatform - Priya Nair; commerce - Diego Ramos; growth - Mei Tanaka; SRE -\nAlex Osei.\n\n## Expectations\n\n- Acknowledge a `critical` page within 5 minutes, `high` within 15, `medium`\n within 60 during working hours.\n- You are expected to mitigate, not to fix. Handing a well-mitigated problem to\n the owning team in the morning is a success, not a failure.\n- If you are stuck for 15 minutes on a customer-impacting issue, escalate. There\n is no prize for solo debugging during an outage.\n\n## Triage order\n\n1. **Is it customer-visible?** Money path or storefront - sev1 or sev2 and you\n follow \"Incident response\" immediately. Internal only - triage calmly.\n2. **Did something change?** Check recent deploys, canary promotions, feature\n flag toggles, and config changes for the service and its dependencies, in that\n order. The overwhelming majority of incidents follow a change within the last\n hour.\n3. **Is it this service or a dependency?** A spike in `checkout` errors with a\n simultaneous spike in `payments` latency is one incident, not two. Follow the\n dependency graph down before paging sideways.\n4. **Mitigate** with the cheapest reversible lever: flag kill switch, then\n rollback, then config change.\n\n## Reading an alert\n\nAn alert names the service, the metric, the observed value, and the SLO:\n\n```\npayments error_rate_pct 4.2 exceeds SLO 1.0\n```\n\nThree questions, in order: when did it start; what changed at that time; is the\nvalue still moving. A metric that is still climbing needs mitigation now. A\nmetric that stepped once and is flat is usually a config or flag state, not a\ndegradation in progress.\n\n## Severity mapping\n\n| Condition | Severity |\n| ----------------------------------------------- | -------- |\n| Orders cannot be placed or paid | sev1 |\n| Storefront down or unusable | sev1 |\n| Degraded but working, bounded revenue impact | sev2 |\n| Internal tooling, no customer impact | sev3 |\n\n## Handover\n\nAt the end of a shift, post in `#incidents`: what fired, what is still open,\nwhat is deliberately being watched, and any change freeze in effect. An\nunrecorded \"I'm keeping an eye on it\" dies with the shift.\n\n## Alert hygiene\n\nAn alert that fires and is resolved with no action taken twice in a month is a\nbad alert. Fix the threshold or delete it. Alert fatigue is how a real page gets\nignored. See \"Observability, SLOs, and alerting\" for how thresholds are set.\n"
|
| 132 |
+
},
|
| 133 |
+
{
|
| 134 |
+
"doc_id": 9627,
|
| 135 |
+
"kind": "policy",
|
| 136 |
+
"title": "Observability, SLOs, and alerting",
|
| 137 |
+
"service": "",
|
| 138 |
+
"author": "Alex Osei",
|
| 139 |
+
"day": 250,
|
| 140 |
+
"body": "# Observability, SLOs, and alerting\n\nEvery service in the fleet publishes the same core metrics, has explicit SLOs,\nand alerts only on SLO breaches. This document defines what \"instrumented\" means\nbefore a service may take production traffic.\n\n## Required metrics\n\nEvery service emits, at minimum:\n\n- `error_rate_pct` - percentage of requests failing, per minute.\n- `latency_p99_ms` - 99th percentile request latency.\n\nTier-1 services additionally emit saturation signals: connection pool\nutilization, queue depth where applicable, and canary-vs-stable splits for both\ncore metrics so `assess_canary` has something to compare.\n\n## Current SLOs\n\n| Service | Metric | Threshold |\n| -------------- | ----------------- | --------- |\n| `payments` | `error_rate_pct` | 1.0 |\n| `payments` | `latency_p99_ms` | 200 |\n| `checkout` | `error_rate_pct` | 1.0 |\n| `checkout` | `latency_p99_ms` | 400 |\n| `api-gateway` | `latency_p99_ms` | 250 |\n| `search` | `latency_p99_ms` | 300 |\n\nAn SLO is a promise about customer experience, not a description of current\nbehavior. We do not raise an SLO because we are breaching it; we fix the service\nor we explicitly and publicly re-scope the promise with product sign-off.\n\n## Alerting rules\n\n1. **Alert on SLO breach, not on causes.** No alerts on CPU, memory, or pod\n restarts. Those are dashboard signals for a human already investigating.\n2. **One alert per user-visible symptom.** Do not alert on a metric and its\n derivative.\n3. **Every alert names the service, metric, observed value, and threshold**, so\n the responder can triage from the message alone.\n4. Severity follows blast radius: money path breaks are `critical`, degradation\n is `high` or `medium`.\n\n## Instrumentation before traffic\n\nA service does not take production traffic until it emits both core metrics, has\nat least one SLO, and has a runbook entry naming its owner. This is checked at\nservice registration, not left to good intentions.\n\n## Dashboards\n\nEach service has one dashboard with a fixed top row: the two core metrics with\ntheir SLO lines drawn on them, deploy markers, and flag-change markers. Deploy\nand flag markers on the same timeline are the fastest correlation tool we have -\nmost incidents are diagnosed by seeing a metric step exactly at a marker.\n\n## Reviews\n\nSLOs are reviewed quarterly. A service that has not breached its SLO in two\nquarters is either genuinely reliable or has a threshold set too loosely;\nwe check which. Error-budget burn is reviewed monthly alongside the deployment\nscore described in the \"Deployment policy\".\n"
|
| 141 |
+
},
|
| 142 |
+
{
|
| 143 |
+
"doc_id": 9629,
|
| 144 |
+
"kind": "design_doc",
|
| 145 |
+
"title": "API gateway: routing, traffic weights, and rate limiting",
|
| 146 |
+
"service": "api-gateway",
|
| 147 |
+
"author": "Priya Nair",
|
| 148 |
+
"day": 209,
|
| 149 |
+
"body": "# API gateway: routing, traffic weights, and rate limiting\n\nService: `api-gateway` (tier 1, go, platform). The single public entry point for\npartner and storefront traffic. SLO: `latency_p99_ms < 250`.\n\n## Responsibilities\n\n1. **Routing** - map a public path to an internal service.\n2. **Authentication** - validate partner bearer tokens and storefront sessions;\n reject unauthenticated requests before they reach any backend.\n3. **Rate limiting** - `rate_limit_rps` per partner token.\n4. **Traffic weighting** - split traffic between endpoint versions during a\n migration.\n\nDeliberately *not* responsibilities: business logic, response transformation\nbeyond version adaptation, and caching. The gateway must stay boring, because\neverything is behind it.\n\n## Endpoint registry\n\nEndpoints live in the repo with a status: `active`, `deprecated`, or `retired`.\nStatus is a code change and ships through the normal PR-CI-deploy path. Current\npublic surface includes `/v1/orders`, `/v2/orders`, and `/v1/checkout`;\n`/internal/debug` exists and should not - it is unauthenticated and is being\nretired.\n\n## Traffic weights\n\nWeights are **production runtime state**, not repo config. Each endpoint carries\na weight from 0 to 100, and weights for a path family sum to 100. Changing a\nweight takes effect immediately without a deploy - the same property that makes\nfeature flags useful mitigation tools.\n\nWeight changes move in steps of **at most 50 percentage points**, and an\nendpoint may only be retired at 0% - both enforced per the \"API deprecation\"\nrunbook, the second one as a hard CI gate.\n\n## Rate limiting\n\n`rate_limit_rps=500` per partner token by default, token-bucket with a 2x burst\nallowance. Over-limit requests get `429` with `Retry-After`. Limits are per token\nand not per IP; partners behind a NAT would otherwise share a bucket. Storefront\nsession traffic uses a separate, looser bucket keyed by session.\n\n## Connection pooling\n\nThe gateway holds an upstream connection pool per backend service. This is the\nmost performance-sensitive component in the fleet and the source of our worst\nrecent incident: a connection-pool rewrite in `v5.1.0` leaked a goroutine per\nrequest, and p99 went from ~120ms to ~1030ms - 4x the 250ms SLO. The defect is\npresent in `v5.1.0` and in anything cut on top of it; recovery required a\nrollback to `v5.0.9`. See \"Rollback and recovery\".\n\nUpstream calls follow the \"Retry and timeout standard\": three attempts, timeout\nat or below 2000ms.\n\n## Deployment\n\nTier 1: staging first, production canary at `canary_percent <= 25`,\n`assess_canary`, then `promote_canary`. Because every request in the company\npasses through this service, canary discipline here is not negotiable.\n\n## Open questions\n\n- Per-endpoint rate limits, not just per-token.\n- Move token validation to an edge cache to shave ~8ms off p50.\n"
|
| 150 |
+
},
|
| 151 |
+
{
|
| 152 |
+
"doc_id": 9630,
|
| 153 |
+
"kind": "onboarding",
|
| 154 |
+
"title": "Service catalog and service tiers",
|
| 155 |
+
"service": "",
|
| 156 |
+
"author": "Mei Tanaka",
|
| 157 |
+
"day": 285,
|
| 158 |
+
"body": "# Service catalog and service tiers\n\nThe full NovaCart fleet, who owns what, and what tier means operationally.\n\n## The fleet\n\n| Service | Team | Tier | Language | Purpose |\n| ---------------- | --------- | ---- | ---------- | -------------------------------------------- |\n| `storefront-web` | growth | 1 | typescript | Customer-facing web storefront (Next.js) |\n| `api-gateway` | platform | 1 | go | Public API edge: routing, auth, rate limits |\n| `checkout` | commerce | 1 | python | Cart and checkout orchestration |\n| `payments` | commerce | 1 | python | Payment capture, refunds, settlement |\n| `catalog` | commerce | 2 | python | Product catalog and pricing |\n| `notifications` | platform | 2 | python | Email, SMS, and push delivery |\n| `search` | growth | 2 | python | Product search and ranking |\n\nOn-call primaries: platform - Priya Nair; commerce - Diego Ramos; growth -\nMei Tanaka; SRE - Alex Osei.\n\n## What tier means\n\n**Tier 1** - a failure directly costs money or breaks the storefront.\n\n- Production deploys must be canaries: `canary_percent <= 25`, then\n `assess_canary`, then `promote_canary`.\n- Paged 24/7 on SLO breach.\n- `db_pool_size >= 20`.\n- Changes require a reviewer outside the authoring pair.\n\n**Tier 2** - a failure degrades the experience but orders still complete.\n\n- Production deploys go straight to 100% after a successful staging deploy.\n- Paged during working hours; critical alerts page out of hours.\n- `db_pool_size >= 20` still applies.\n\nBoth tiers are staging-first without exception. Tier is a property of blast\nradius, not of team seniority or code quality.\n\n## Dependency shape\n\n```\nstorefront-web -> api-gateway -> checkout -> payments -> notifications\n -> search -> catalog\n catalog <- checkout (pricing)\n```\n\nRead it as: a failure in `catalog` shows up as a `checkout` and `search`\nproblem, and a failure in `notifications` should show up nowhere at all, because\ncallers treat it as best-effort. When it does show up in `payments`, that is a\nretry and timeout misconfiguration, not a `notifications` outage - see \"Retry\nand timeout standard\".\n\n## Environments\n\nTwo: `staging` and `production`. Staging carries a sampled copy of production\ncatalog data and synthetic orders. It is not a traffic-realistic environment,\nwhich is exactly why tier-1 services canary in production - see \"ADR-021:\nStandardize on staged canary deploys\".\n\n## Channels\n\n- `#incidents` - incident coordination and status updates.\n- `#security` - advisories and audit notes, CVE ids referenced literally.\n- `#eng` - everything else.\n\n## Adding a service\n\nRegister it with a team, a tier, an owner, both core metrics, at least one SLO,\nand a runbook entry before it takes traffic. See \"Observability, SLOs, and\nalerting\".\n"
|
| 159 |
+
}
|
| 160 |
+
]
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
## confluence_pages (4 rows)
|
| 164 |
+
|
| 165 |
+
```json
|
| 166 |
+
[
|
| 167 |
+
{
|
| 168 |
+
"page_id": 8001,
|
| 169 |
+
"space": "ENG",
|
| 170 |
+
"title": "Checkout Platform \u2014 architecture",
|
| 171 |
+
"body": "Checkout Platform is owned by the Commerce Platform team. It calls payments and inventory synchronously. Escalate via #commerce.",
|
| 172 |
+
"last_updated_day": 372,
|
| 173 |
+
"stale": 0
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"page_id": 8002,
|
| 177 |
+
"space": "ENG",
|
| 178 |
+
"title": "Gateway runbook (legacy)",
|
| 179 |
+
"body": "The Edge Team owns the gateway. Page the Edge Team rota for any 5xx spike. Restart procedure targets host gw-prod-03.",
|
| 180 |
+
"last_updated_day": 181,
|
| 181 |
+
"stale": 1
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"page_id": 8003,
|
| 185 |
+
"space": "ENG",
|
| 186 |
+
"title": "Weekly reporting conventions",
|
| 187 |
+
"body": "Engineering weekly reports run Monday to Sunday, ISO-8601 week numbering, in UTC. Note that the service-owner spreadsheet uses a Sunday start and will disagree by one day at the boundary.",
|
| 188 |
+
"last_updated_day": 401,
|
| 189 |
+
"stale": 0
|
| 190 |
+
},
|
| 191 |
+
{
|
| 192 |
+
"page_id": 8004,
|
| 193 |
+
"space": "ENG",
|
| 194 |
+
"title": "Incident severity ladder",
|
| 195 |
+
"body": "P1 = customer-facing outage, P2 = degraded customer experience, P3 = internal only, P4 = cosmetic. Customer-facing status is recorded on the public status page, not on the incident.",
|
| 196 |
+
"last_updated_day": 395,
|
| 197 |
+
"stale": 0
|
| 198 |
+
}
|
| 199 |
+
]
|
| 200 |
+
```
|
task_files/dob100-037-port-copy-priority-issues/12-chat-and-status.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"message_id",
|
| 6 |
+
"channel",
|
| 7 |
+
"author",
|
| 8 |
+
"body"
|
| 9 |
+
],
|
| 10 |
+
"row_count": 6,
|
| 11 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 12 |
+
"table": "messages",
|
| 13 |
+
"task_relevant_rows": [
|
| 14 |
+
{
|
| 15 |
+
"author": "Mei Tanaka",
|
| 16 |
+
"body": "Reminder: deployment policy = staging first; tier-1 canary at 25% then promote.",
|
| 17 |
+
"channel": "#eng",
|
| 18 |
+
"message_id": 4
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"author": "Jordan Blake",
|
| 22 |
+
"body": "Scanner run complete: 3 open findings across payments, checkout, catalog.",
|
| 23 |
+
"channel": "#security",
|
| 24 |
+
"message_id": 6
|
| 25 |
+
}
|
| 26 |
+
]
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"columns": [
|
| 30 |
+
"channel",
|
| 31 |
+
"purpose"
|
| 32 |
+
],
|
| 33 |
+
"row_count": 4,
|
| 34 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 35 |
+
"table": "channels",
|
| 36 |
+
"task_relevant_rows": [
|
| 37 |
+
{
|
| 38 |
+
"channel": "#eng",
|
| 39 |
+
"purpose": "General engineering."
|
| 40 |
+
}
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"columns": [
|
| 45 |
+
"post_id",
|
| 46 |
+
"state",
|
| 47 |
+
"title",
|
| 48 |
+
"body"
|
| 49 |
+
],
|
| 50 |
+
"row_count": 1,
|
| 51 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 52 |
+
"table": "status_page",
|
| 53 |
+
"task_relevant_rows": [
|
| 54 |
+
{
|
| 55 |
+
"body": "Catalog read replica maintenance completed with no customer impact.",
|
| 56 |
+
"post_id": 1,
|
| 57 |
+
"state": "resolved",
|
| 58 |
+
"title": "Scheduled maintenance completed"
|
| 59 |
+
}
|
| 60 |
+
]
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"columns": [
|
| 64 |
+
"post_id",
|
| 65 |
+
"title",
|
| 66 |
+
"impact",
|
| 67 |
+
"state",
|
| 68 |
+
"published_day",
|
| 69 |
+
"linked_incident"
|
| 70 |
+
],
|
| 71 |
+
"row_count": 3,
|
| 72 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 73 |
+
"table": "status_page_posts",
|
| 74 |
+
"task_relevant_rows": [
|
| 75 |
+
{
|
| 76 |
+
"impact": "major",
|
| 77 |
+
"linked_incident": 5101,
|
| 78 |
+
"post_id": 7001,
|
| 79 |
+
"published_day": 412,
|
| 80 |
+
"state": "resolved",
|
| 81 |
+
"title": "Degraded checkout performance"
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"impact": "minor",
|
| 85 |
+
"linked_incident": 5102,
|
| 86 |
+
"post_id": 7002,
|
| 87 |
+
"published_day": 415,
|
| 88 |
+
"state": "monitoring",
|
| 89 |
+
"title": "Elevated error rates on payments"
|
| 90 |
+
},
|
| 91 |
+
{
|
| 92 |
+
"impact": "major",
|
| 93 |
+
"linked_incident": 5103,
|
| 94 |
+
"post_id": 7003,
|
| 95 |
+
"published_day": 417,
|
| 96 |
+
"state": "resolved",
|
| 97 |
+
"title": "API latency affecting some customers"
|
| 98 |
+
}
|
| 99 |
+
]
|
| 100 |
+
}
|
| 101 |
+
]
|
| 102 |
+
}
|
task_files/dob100-037-port-copy-priority-issues/13-approval-and-ownership.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 13 Approval And Ownership
|
| 2 |
+
|
| 3 |
+
## approval_policy (5 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"policy_id": 502,
|
| 9 |
+
"action": "retire_endpoint_with_live_traffic",
|
| 10 |
+
"approver_role": "service-owner",
|
| 11 |
+
"rationale": "drops in-flight customer requests; cannot be undone once clients fail"
|
| 12 |
+
}
|
| 13 |
+
]
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
## owner_spreadsheet (5 rows)
|
| 17 |
+
|
| 18 |
+
```json
|
| 19 |
+
[
|
| 20 |
+
{
|
| 21 |
+
"row_id": 1,
|
| 22 |
+
"service_label": "Checkout (commerce)",
|
| 23 |
+
"owning_team": "Commerce Platform",
|
| 24 |
+
"slack_channel": "#commerce",
|
| 25 |
+
"last_reviewed_day": 340,
|
| 26 |
+
"week_start": "sunday"
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"row_id": 2,
|
| 30 |
+
"service_label": "Payments (commerce)",
|
| 31 |
+
"owning_team": "Commerce Platform",
|
| 32 |
+
"slack_channel": "#commerce",
|
| 33 |
+
"last_reviewed_day": 340,
|
| 34 |
+
"week_start": "sunday"
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"row_id": 3,
|
| 38 |
+
"service_label": "Search (growth)",
|
| 39 |
+
"owning_team": "Discovery Squad",
|
| 40 |
+
"slack_channel": "#growth",
|
| 41 |
+
"last_reviewed_day": 210,
|
| 42 |
+
"week_start": "sunday"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"row_id": 4,
|
| 46 |
+
"service_label": "Gateway (platform)",
|
| 47 |
+
"owning_team": "Edge Team",
|
| 48 |
+
"slack_channel": "#edge",
|
| 49 |
+
"last_reviewed_day": 180,
|
| 50 |
+
"week_start": "sunday"
|
| 51 |
+
}
|
| 52 |
+
]
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## oncall (4 rows)
|
| 56 |
+
|
| 57 |
+
```json
|
| 58 |
+
[
|
| 59 |
+
{
|
| 60 |
+
"team": "platform",
|
| 61 |
+
"engineer": "Priya Nair"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"team": "commerce",
|
| 65 |
+
"engineer": "Diego Ramos"
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"team": "growth",
|
| 69 |
+
"engineer": "Mei Tanaka"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"team": "sre",
|
| 73 |
+
"engineer": "Alex Osei"
|
| 74 |
+
}
|
| 75 |
+
]
|
| 76 |
+
```
|
task_files/dob100-037-port-copy-priority-issues/14-tool-contracts.json
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"note": "These are the exact sandbox schemas used by this task; first-party NovaCart tools and vendor-shaped adapters are labeled as such in their descriptions.",
|
| 3 |
+
"tools": [
|
| 4 |
+
{
|
| 5 |
+
"description": "Create a ticket. Returns the generated key.",
|
| 6 |
+
"json_schema": {
|
| 7 |
+
"description": "Create a ticket. Returns the generated key.",
|
| 8 |
+
"name": "create_ticket",
|
| 9 |
+
"parameters": {
|
| 10 |
+
"properties": {
|
| 11 |
+
"description": {
|
| 12 |
+
"description": "description",
|
| 13 |
+
"type": "string"
|
| 14 |
+
},
|
| 15 |
+
"priority": {
|
| 16 |
+
"description": "priority",
|
| 17 |
+
"type": "string"
|
| 18 |
+
},
|
| 19 |
+
"service": {
|
| 20 |
+
"description": "service",
|
| 21 |
+
"type": "string"
|
| 22 |
+
},
|
| 23 |
+
"ticket_type": {
|
| 24 |
+
"description": "task|bug|feature|security|incident|postmortem",
|
| 25 |
+
"enum": [
|
| 26 |
+
"task",
|
| 27 |
+
"bug",
|
| 28 |
+
"feature",
|
| 29 |
+
"security",
|
| 30 |
+
"incident",
|
| 31 |
+
"postmortem"
|
| 32 |
+
],
|
| 33 |
+
"type": "string"
|
| 34 |
+
},
|
| 35 |
+
"title": {
|
| 36 |
+
"description": "title",
|
| 37 |
+
"type": "string"
|
| 38 |
+
}
|
| 39 |
+
},
|
| 40 |
+
"required": [
|
| 41 |
+
"title"
|
| 42 |
+
],
|
| 43 |
+
"type": "object"
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"name": "create_ticket",
|
| 47 |
+
"parameters": [
|
| 48 |
+
{
|
| 49 |
+
"default": null,
|
| 50 |
+
"description": "title",
|
| 51 |
+
"name": "title",
|
| 52 |
+
"required": true,
|
| 53 |
+
"type": "str"
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"default": "",
|
| 57 |
+
"description": "description",
|
| 58 |
+
"name": "description",
|
| 59 |
+
"required": false,
|
| 60 |
+
"type": "str"
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"default": "task",
|
| 64 |
+
"description": "task|bug|feature|security|incident|postmortem",
|
| 65 |
+
"name": "ticket_type",
|
| 66 |
+
"required": false,
|
| 67 |
+
"type": "str"
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"default": "",
|
| 71 |
+
"description": "service",
|
| 72 |
+
"name": "service",
|
| 73 |
+
"required": false,
|
| 74 |
+
"type": "str"
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"default": "medium",
|
| 78 |
+
"description": "priority",
|
| 79 |
+
"name": "priority",
|
| 80 |
+
"required": false,
|
| 81 |
+
"type": "str"
|
| 82 |
+
}
|
| 83 |
+
],
|
| 84 |
+
"read_tables": [
|
| 85 |
+
"services"
|
| 86 |
+
],
|
| 87 |
+
"return_type": "dict",
|
| 88 |
+
"source_code": "def create_ticket(db_path=None, title=None, description='', ticket_type='task', service='', priority='medium'):\n \"\"\"Create a ticket. Returns the generated key.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('create_ticket',)); conn.commit()\n except Exception:\n pass\n if title is None:\n return {'ok': False, 'error': 'missing required parameter: title'}\n def _audit(conn, _tool, _svc, _detail):\n conn.execute('INSERT INTO audit_events(tool, service, detail) VALUES (?,?,?)', (_tool, _svc, _json.dumps(_detail)))\n if ticket_type not in ('task', 'bug', 'feature', 'security', 'incident', 'postmortem'):\n return {'ok': False, 'error': 'invalid ticket_type: ' + str(ticket_type)}\n if service and conn.execute('SELECT 1 FROM services WHERE name=?', (service,)).fetchone() is None:\n return {'ok': False, 'error': 'unknown service: ' + str(service)}\n cur = conn.execute('INSERT INTO tickets(key, type, title, description, status, priority, service) VALUES (?,?,?,?,?,?,?)',\n ('', ticket_type, title, description, 'open', priority, service))\n tid = cur.lastrowid\n key = 'TKT-' + str(tid)\n conn.execute('UPDATE tickets SET key=? WHERE ticket_id=?', (key, tid))\n _audit(conn, 'create_ticket', service, {'key': key, 'type': ticket_type, 'title': title})\n conn.commit()\n return {'ok': True, 'key': key, 'ticket_id': tid, 'status': 'open'}\n finally:\n conn.close()\n",
|
| 89 |
+
"tool_id": "tool_create_ticket",
|
| 90 |
+
"write_tables": [
|
| 91 |
+
"audit_events",
|
| 92 |
+
"tickets"
|
| 93 |
+
]
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"description": "Fetch one ticket by key (e.g. ENG-2101).",
|
| 97 |
+
"json_schema": {
|
| 98 |
+
"description": "Fetch one ticket by key (e.g. ENG-2101).",
|
| 99 |
+
"name": "get_ticket",
|
| 100 |
+
"parameters": {
|
| 101 |
+
"properties": {
|
| 102 |
+
"key": {
|
| 103 |
+
"description": "key",
|
| 104 |
+
"type": "string"
|
| 105 |
+
}
|
| 106 |
+
},
|
| 107 |
+
"required": [
|
| 108 |
+
"key"
|
| 109 |
+
],
|
| 110 |
+
"type": "object"
|
| 111 |
+
}
|
| 112 |
+
},
|
| 113 |
+
"name": "get_ticket",
|
| 114 |
+
"parameters": [
|
| 115 |
+
{
|
| 116 |
+
"default": null,
|
| 117 |
+
"description": "key",
|
| 118 |
+
"name": "key",
|
| 119 |
+
"required": true,
|
| 120 |
+
"type": "str"
|
| 121 |
+
}
|
| 122 |
+
],
|
| 123 |
+
"read_tables": [
|
| 124 |
+
"tickets"
|
| 125 |
+
],
|
| 126 |
+
"return_type": "dict",
|
| 127 |
+
"source_code": "def get_ticket(db_path=None, key=None):\n \"\"\"Fetch one ticket by key (e.g. ENG-2101).\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('get_ticket',)); conn.commit()\n except Exception:\n pass\n if key is None:\n return {'ok': False, 'error': 'missing required parameter: key'}\n row = conn.execute('SELECT * FROM tickets WHERE key=?', (key,)).fetchone()\n if row is None:\n return {'ok': False, 'error': 'no such ticket: ' + str(key)}\n return dict(row)\n finally:\n conn.close()\n",
|
| 128 |
+
"tool_id": "tool_get_ticket",
|
| 129 |
+
"write_tables": []
|
| 130 |
+
},
|
| 131 |
+
{
|
| 132 |
+
"description": "List GitHub issues. GitHub has only state=open|closed; severity lives in labels if anywhere.",
|
| 133 |
+
"json_schema": {
|
| 134 |
+
"description": "List GitHub issues. GitHub has only state=open|closed; severity lives in labels if anywhere.",
|
| 135 |
+
"name": "github_list_issues",
|
| 136 |
+
"parameters": {
|
| 137 |
+
"properties": {
|
| 138 |
+
"label": {
|
| 139 |
+
"description": "label",
|
| 140 |
+
"type": "string"
|
| 141 |
+
},
|
| 142 |
+
"repo": {
|
| 143 |
+
"description": "repo",
|
| 144 |
+
"type": "string"
|
| 145 |
+
},
|
| 146 |
+
"state": {
|
| 147 |
+
"description": "state",
|
| 148 |
+
"type": "string"
|
| 149 |
+
}
|
| 150 |
+
},
|
| 151 |
+
"required": [],
|
| 152 |
+
"type": "object"
|
| 153 |
+
}
|
| 154 |
+
},
|
| 155 |
+
"name": "github_list_issues",
|
| 156 |
+
"parameters": [
|
| 157 |
+
{
|
| 158 |
+
"default": "None",
|
| 159 |
+
"description": "repo",
|
| 160 |
+
"name": "repo",
|
| 161 |
+
"required": false,
|
| 162 |
+
"type": "str"
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"default": "None",
|
| 166 |
+
"description": "state",
|
| 167 |
+
"name": "state",
|
| 168 |
+
"required": false,
|
| 169 |
+
"type": "str"
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"default": "None",
|
| 173 |
+
"description": "label",
|
| 174 |
+
"name": "label",
|
| 175 |
+
"required": false,
|
| 176 |
+
"type": "str"
|
| 177 |
+
}
|
| 178 |
+
],
|
| 179 |
+
"read_tables": [
|
| 180 |
+
"github_issues"
|
| 181 |
+
],
|
| 182 |
+
"return_type": "list[dict]",
|
| 183 |
+
"source_code": "def github_list_issues(db_path=None, repo=None, state=None, label=None):\n \"\"\"List GitHub issues. GitHub has only state=open|closed; severity lives in labels if anywhere.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('github_list_issues',)); conn.commit()\n except Exception:\n pass\n sql = 'SELECT * FROM github_issues'\n conds, args = [], []\n if repo:\n conds.append('repo=?'); args.append(repo)\n if state:\n conds.append('state=?'); args.append(state)\n if label:\n conds.append('labels LIKE ?'); args.append('%' + str(label) + '%')\n if conds:\n sql += ' WHERE ' + ' AND '.join(conds)\n return [dict(r) for r in conn.execute(sql + ' ORDER BY number', args).fetchall()]\n finally:\n conn.close()\n",
|
| 184 |
+
"tool_id": "tool_github_list_issues",
|
| 185 |
+
"write_tables": []
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"description": "Post a message to a chat channel.",
|
| 189 |
+
"json_schema": {
|
| 190 |
+
"description": "Post a message to a chat channel.",
|
| 191 |
+
"name": "post_message",
|
| 192 |
+
"parameters": {
|
| 193 |
+
"properties": {
|
| 194 |
+
"body": {
|
| 195 |
+
"description": "body",
|
| 196 |
+
"type": "string"
|
| 197 |
+
},
|
| 198 |
+
"channel": {
|
| 199 |
+
"description": "channel",
|
| 200 |
+
"type": "string"
|
| 201 |
+
}
|
| 202 |
+
},
|
| 203 |
+
"required": [
|
| 204 |
+
"channel",
|
| 205 |
+
"body"
|
| 206 |
+
],
|
| 207 |
+
"type": "object"
|
| 208 |
+
}
|
| 209 |
+
},
|
| 210 |
+
"name": "post_message",
|
| 211 |
+
"parameters": [
|
| 212 |
+
{
|
| 213 |
+
"default": null,
|
| 214 |
+
"description": "channel",
|
| 215 |
+
"name": "channel",
|
| 216 |
+
"required": true,
|
| 217 |
+
"type": "str"
|
| 218 |
+
},
|
| 219 |
+
{
|
| 220 |
+
"default": null,
|
| 221 |
+
"description": "body",
|
| 222 |
+
"name": "body",
|
| 223 |
+
"required": true,
|
| 224 |
+
"type": "str"
|
| 225 |
+
}
|
| 226 |
+
],
|
| 227 |
+
"read_tables": [
|
| 228 |
+
"channels"
|
| 229 |
+
],
|
| 230 |
+
"return_type": "dict",
|
| 231 |
+
"source_code": "def post_message(db_path=None, channel=None, body=None):\n \"\"\"Post a message to a chat channel.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('post_message',)); conn.commit()\n except Exception:\n pass\n if channel is None:\n return {'ok': False, 'error': 'missing required parameter: channel'}\n if body is None:\n return {'ok': False, 'error': 'missing required parameter: body'}\n def _audit(conn, _tool, _svc, _detail):\n conn.execute('INSERT INTO audit_events(tool, service, detail) VALUES (?,?,?)', (_tool, _svc, _json.dumps(_detail)))\n if conn.execute('SELECT 1 FROM channels WHERE channel=?', (channel,)).fetchone() is None:\n rows = [r[0] for r in conn.execute('SELECT channel FROM channels ORDER BY channel').fetchall()]\n return {'ok': False, 'error': 'unknown channel ' + str(channel) + '; valid: ' + ', '.join(rows)}\n if not str(body).strip():\n return {'ok': False, 'error': 'body must not be empty'}\n cur = conn.execute('INSERT INTO messages(channel, author, body) VALUES (?,?,?)', (channel, 'agent', str(body)))\n _audit(conn, 'post_message', '', {'channel': channel, 'message_id': cur.lastrowid})\n conn.commit()\n return {'ok': True, 'message_id': cur.lastrowid, 'channel': channel}\n finally:\n conn.close()\n",
|
| 232 |
+
"tool_id": "tool_post_message",
|
| 233 |
+
"write_tables": [
|
| 234 |
+
"audit_events",
|
| 235 |
+
"messages"
|
| 236 |
+
]
|
| 237 |
+
},
|
| 238 |
+
{
|
| 239 |
+
"description": "Update a ticket's status and/or assignee.",
|
| 240 |
+
"json_schema": {
|
| 241 |
+
"description": "Update a ticket's status and/or assignee.",
|
| 242 |
+
"name": "update_ticket",
|
| 243 |
+
"parameters": {
|
| 244 |
+
"properties": {
|
| 245 |
+
"assignee": {
|
| 246 |
+
"description": "assignee",
|
| 247 |
+
"type": "string"
|
| 248 |
+
},
|
| 249 |
+
"key": {
|
| 250 |
+
"description": "key",
|
| 251 |
+
"type": "string"
|
| 252 |
+
},
|
| 253 |
+
"status": {
|
| 254 |
+
"description": "open|in_progress|in_review|done",
|
| 255 |
+
"enum": [
|
| 256 |
+
"open",
|
| 257 |
+
"in_progress",
|
| 258 |
+
"in_review",
|
| 259 |
+
"done"
|
| 260 |
+
],
|
| 261 |
+
"type": "string"
|
| 262 |
+
}
|
| 263 |
+
},
|
| 264 |
+
"required": [
|
| 265 |
+
"key"
|
| 266 |
+
],
|
| 267 |
+
"type": "object"
|
| 268 |
+
}
|
| 269 |
+
},
|
| 270 |
+
"name": "update_ticket",
|
| 271 |
+
"parameters": [
|
| 272 |
+
{
|
| 273 |
+
"default": null,
|
| 274 |
+
"description": "key",
|
| 275 |
+
"name": "key",
|
| 276 |
+
"required": true,
|
| 277 |
+
"type": "str"
|
| 278 |
+
},
|
| 279 |
+
{
|
| 280 |
+
"default": "None",
|
| 281 |
+
"description": "open|in_progress|in_review|done",
|
| 282 |
+
"name": "status",
|
| 283 |
+
"required": false,
|
| 284 |
+
"type": "str"
|
| 285 |
+
},
|
| 286 |
+
{
|
| 287 |
+
"default": "None",
|
| 288 |
+
"description": "assignee",
|
| 289 |
+
"name": "assignee",
|
| 290 |
+
"required": false,
|
| 291 |
+
"type": "str"
|
| 292 |
+
}
|
| 293 |
+
],
|
| 294 |
+
"read_tables": [
|
| 295 |
+
"tickets"
|
| 296 |
+
],
|
| 297 |
+
"return_type": "dict",
|
| 298 |
+
"source_code": "def update_ticket(db_path=None, key=None, status=None, assignee=None):\n \"\"\"Update a ticket's status and/or assignee.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('update_ticket',)); conn.commit()\n except Exception:\n pass\n if key is None:\n return {'ok': False, 'error': 'missing required parameter: key'}\n def _audit(conn, _tool, _svc, _detail):\n conn.execute('INSERT INTO audit_events(tool, service, detail) VALUES (?,?,?)', (_tool, _svc, _json.dumps(_detail)))\n row = conn.execute('SELECT * FROM tickets WHERE key=?', (key,)).fetchone()\n if row is None:\n return {'ok': False, 'error': 'no such ticket: ' + str(key)}\n if status is None and assignee is None:\n return {'ok': False, 'error': 'provide status and/or assignee'}\n if status is not None and status not in ('open', 'in_progress', 'in_review', 'done'):\n return {'ok': False, 'error': 'invalid status: ' + str(status)}\n ns = row['status'] if status is None else status\n na = row['assignee'] if assignee is None else assignee\n conn.execute('UPDATE tickets SET status=?, assignee=? WHERE key=?', (ns, na, key))\n _audit(conn, 'update_ticket', row['service'], {'key': key, 'status': ns})\n conn.commit()\n return {'ok': True, 'key': key, 'status': ns, 'assignee': na}\n finally:\n conn.close()\n",
|
| 299 |
+
"tool_id": "tool_update_ticket",
|
| 300 |
+
"write_tables": [
|
| 301 |
+
"audit_events",
|
| 302 |
+
"tickets"
|
| 303 |
+
]
|
| 304 |
+
}
|
| 305 |
+
]
|
| 306 |
+
}
|
task_files/dob100-038-port-count-inflight-work/01-work-ticket.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 01 Work Ticket
|
| 2 |
+
|
| 3 |
+
## tickets (187 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"ticket_id": 9183,
|
| 9 |
+
"key": "ENG-2802",
|
| 10 |
+
"type": "task",
|
| 11 |
+
"title": "Chase the recent high-priority issues in #eng",
|
| 12 |
+
"description": "",
|
| 13 |
+
"status": "open",
|
| 14 |
+
"priority": "high",
|
| 15 |
+
"assignee": "",
|
| 16 |
+
"service": ""
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"ticket_id": 9189,
|
| 20 |
+
"key": "ENG-2808",
|
| 21 |
+
"type": "task",
|
| 22 |
+
"title": "How much high-priority work is in flight?",
|
| 23 |
+
"description": "",
|
| 24 |
+
"status": "open",
|
| 25 |
+
"priority": "hard",
|
| 26 |
+
"assignee": "",
|
| 27 |
+
"service": ""
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"ticket_id": 9212,
|
| 31 |
+
"key": "SEC-908",
|
| 32 |
+
"type": "security",
|
| 33 |
+
"title": "Rotate the exposed partner API credential",
|
| 34 |
+
"description": "The partner API key was committed to the monorepo, so it must be treated as compromised and rotated in production. Rotation invalidates every existing partner session immediately and cannot be undone - a mistake locks partners out of production until a new key is issued.",
|
| 35 |
+
"status": "open",
|
| 36 |
+
"priority": "critical",
|
| 37 |
+
"assignee": "",
|
| 38 |
+
"service": "checkout"
|
| 39 |
+
}
|
| 40 |
+
]
|
| 41 |
+
```
|
task_files/dob100-038-port-count-inflight-work/02-service-catalog.csv
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_table,depends_on,description,environment,key,kind,language,name,repo_version,service,service_id,team,tier,value
|
| 2 |
+
services,,"Customer-facing storefront (Next.js): browse, cart, checkout UI.",,,frontend,typescript,storefront-web,v3.2.4,,9001,growth,1,
|
| 3 |
+
services,,"Public API edge: routing, auth, rate limiting, traffic weighting.",,,backend,go,api-gateway,v5.1.0,,9002,platform,1,
|
| 4 |
+
services,,"Product catalog, pricing, and merchandising.",,,backend,python,catalog,v1.9.2,,9003,commerce,2,
|
| 5 |
+
services,,Cart and checkout orchestration.,,,backend,python,checkout,v2.6.3,,9004,commerce,1,
|
| 6 |
+
service_dependencies,api-gateway,,,,http,,,,storefront-web,,,,
|
| 7 |
+
service_dependencies,cdn-edge,,,,cdn,,,,storefront-web,,,,
|
| 8 |
+
service_dependencies,checkout,,,,http,,,,api-gateway,,,,
|
| 9 |
+
service_dependencies,catalog,,,,http,,,,api-gateway,,,,
|
| 10 |
+
env_state,,,staging,ab_test_bucket,config,,,,storefront-web,,,,b
|
| 11 |
+
env_state,,,production,ab_test_bucket,config,,,,storefront-web,,,,b
|
| 12 |
+
env_state,,,staging,bundle_analyzer,config,,,,storefront-web,,,,false
|
| 13 |
+
env_state,,,production,bundle_analyzer,config,,,,storefront-web,,,,false
|
task_files/dob100-038-port-count-inflight-work/03-observability.log
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"environment": "production", "metric": "error_rate_pct", "service": "payments", "source_table": "service_metrics", "value": 4.2}
|
| 2 |
+
{"environment": "production", "metric": "latency_p99_ms", "service": "search", "source_table": "service_metrics", "value": 850.0}
|
| 3 |
+
{"environment": "production", "metric": "error_rate_pct", "service": "checkout", "source_table": "service_metrics", "value": 5.5}
|
| 4 |
+
{"environment": "production", "metric": "latency_p99_ms", "service": "api-gateway", "source_table": "service_metrics", "value": 1030.0}
|
| 5 |
+
{"environment": "production", "level": "ERROR", "log_id": 9010, "message": "ConnectionTimeout calling notifications after 30000ms - request failed permanently (notifications_retry_max_attempts=0, no retry attempted); order marked failed", "service": "payments", "source_table": "logs"}
|
| 6 |
+
{"environment": "production", "level": "ERROR", "log_id": 9011, "message": "ConnectionTimeout calling notifications after 30000ms - request failed permanently (notifications_retry_max_attempts=0, no retry attempted); order marked failed", "service": "payments", "source_table": "logs"}
|
| 7 |
+
{"environment": "production", "level": "INFO", "log_id": 9012, "message": "startup config: notifications_retry_max_attempts=0 notifications_timeout_ms=30000 db_pool_size=20", "service": "payments", "source_table": "logs"}
|
| 8 |
+
{"environment": "production", "level": "WARN", "log_id": 9013, "message": "query cache disabled (cache_enabled=false); every request is hitting the primary index", "service": "search", "source_table": "logs"}
|
| 9 |
+
{"culprit": "src/payments/notify_client.py in send_receipt", "event_id": 1, "events": 18422, "fingerprint": "pay-timeout-01", "service": "payments", "source_table": "error_events", "status": "unresolved", "title": "ConnectionTimeout: notifications call exceeded 30000ms"}
|
| 10 |
+
{"culprit": "src/checkout/refunds.py in instant_refund", "event_id": 2, "events": 9310, "fingerprint": "chk-nil-refund", "service": "checkout", "source_table": "error_events", "status": "unresolved", "title": "TypeError: NoneType has no attribute 'amount'"}
|
| 11 |
+
{"culprit": "internal/proxy/pool.go in Acquire", "event_id": 3, "events": 24187, "fingerprint": "gw-pool-exhaust", "service": "api-gateway", "source_table": "error_events", "status": "unresolved", "title": "dial tcp: connection pool exhausted"}
|
| 12 |
+
{"culprit": "StockRepository.reserve", "event_id": 4, "events": 7740, "fingerprint": "inv-pool-wait", "service": "inventory", "source_table": "error_events", "status": "unresolved", "title": "SQLTimeoutException: connection wait timeout"}
|
| 13 |
+
{"counter_reset": 0, "day": 418, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 1, "source_table": "prom_series", "value": 138.0}
|
| 14 |
+
{"counter_reset": 0, "day": 419, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 2, "source_table": "prom_series", "value": 141.0}
|
| 15 |
+
{"counter_reset": 0, "day": 420, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 3, "source_table": "prom_series", "value": 139.0}
|
| 16 |
+
{"counter_reset": 0, "day": 418, "label_env": "production", "label_service": "checkout_service", "metric": "http_errors_total:rate5m", "series_id": 4, "source_table": "prom_series", "value": 7.6}
|
| 17 |
+
{"events": 2317, "first_seen_day": 410, "issue_id": "CHECKOUT-1A", "last_seen_day": 420, "level": "error", "project_slug": "checkout-web", "source_table": "sentry_issues", "status": "unresolved", "title": "TypeError: NoneType has no attribute 'amount'", "users_affected": 890}
|
| 18 |
+
{"events": 1904, "first_seen_day": 409, "issue_id": "CHECKOUT-2B", "last_seen_day": 420, "level": "error", "project_slug": "checkout-web", "source_table": "sentry_issues", "status": "unresolved", "title": "TimeoutError: payments call exceeded 8000ms", "users_affected": 1502}
|
| 19 |
+
{"events": 18422, "first_seen_day": 405, "issue_id": "PAY-9C", "last_seen_day": 420, "level": "error", "project_slug": "payments-backend", "source_table": "sentry_issues", "status": "unresolved", "title": "ConnectionTimeout: notifications call exceeded 30000ms", "users_affected": 6210}
|
| 20 |
+
{"events": 640, "first_seen_day": 414, "issue_id": "SRCH-3D", "last_seen_day": 419, "level": "warning", "project_slug": "search", "source_table": "sentry_issues", "status": "resolved", "title": "IndexRefreshTimeout", "users_affected": 210}
|
task_files/dob100-038-port-count-inflight-work/04-incident-room.json
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"incident_id",
|
| 6 |
+
"severity",
|
| 7 |
+
"title",
|
| 8 |
+
"service",
|
| 9 |
+
"status",
|
| 10 |
+
"commander"
|
| 11 |
+
],
|
| 12 |
+
"row_count": 3,
|
| 13 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 14 |
+
"table": "incidents",
|
| 15 |
+
"task_relevant_rows": [
|
| 16 |
+
{
|
| 17 |
+
"commander": "",
|
| 18 |
+
"incident_id": 9701,
|
| 19 |
+
"service": "api-gateway",
|
| 20 |
+
"severity": "sev1",
|
| 21 |
+
"status": "open",
|
| 22 |
+
"title": "API gateway latency surge after v5.1.0 rollout"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"commander": "",
|
| 26 |
+
"incident_id": 9702,
|
| 27 |
+
"service": "checkout",
|
| 28 |
+
"severity": "sev2",
|
| 29 |
+
"status": "open",
|
| 30 |
+
"title": "Checkout error spike since instant_refunds ramp"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"commander": "",
|
| 34 |
+
"incident_id": 9703,
|
| 35 |
+
"service": "inventory",
|
| 36 |
+
"severity": "sev2",
|
| 37 |
+
"status": "open",
|
| 38 |
+
"title": "Inventory reservation failures during peak"
|
| 39 |
+
}
|
| 40 |
+
]
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"columns": [
|
| 44 |
+
"alert_id",
|
| 45 |
+
"service",
|
| 46 |
+
"metric",
|
| 47 |
+
"severity",
|
| 48 |
+
"status",
|
| 49 |
+
"message"
|
| 50 |
+
],
|
| 51 |
+
"row_count": 10,
|
| 52 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 53 |
+
"table": "alerts",
|
| 54 |
+
"task_relevant_rows": [
|
| 55 |
+
{
|
| 56 |
+
"alert_id": 9601,
|
| 57 |
+
"message": "payments error_rate_pct 4.2 exceeds SLO 1.0",
|
| 58 |
+
"metric": "error_rate_pct",
|
| 59 |
+
"service": "payments",
|
| 60 |
+
"severity": "high",
|
| 61 |
+
"status": "firing"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"alert_id": 9602,
|
| 65 |
+
"message": "search latency_p99_ms 850.0 exceeds SLO 300.0",
|
| 66 |
+
"metric": "latency_p99_ms",
|
| 67 |
+
"service": "search",
|
| 68 |
+
"severity": "medium",
|
| 69 |
+
"status": "firing"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"alert_id": 9603,
|
| 73 |
+
"message": "checkout error_rate_pct 5.5 exceeds SLO 1.0",
|
| 74 |
+
"metric": "error_rate_pct",
|
| 75 |
+
"service": "checkout",
|
| 76 |
+
"severity": "high",
|
| 77 |
+
"status": "firing"
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"alert_id": 9604,
|
| 81 |
+
"message": "api-gateway latency_p99_ms 1030.0 exceeds SLO 250.0",
|
| 82 |
+
"metric": "latency_p99_ms",
|
| 83 |
+
"service": "api-gateway",
|
| 84 |
+
"severity": "critical",
|
| 85 |
+
"status": "firing"
|
| 86 |
+
}
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"columns": [
|
| 91 |
+
"incident_number",
|
| 92 |
+
"title",
|
| 93 |
+
"pd_service_id",
|
| 94 |
+
"urgency",
|
| 95 |
+
"priority",
|
| 96 |
+
"status",
|
| 97 |
+
"created_day",
|
| 98 |
+
"resolved_day"
|
| 99 |
+
],
|
| 100 |
+
"row_count": 7,
|
| 101 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 102 |
+
"table": "pd_incidents",
|
| 103 |
+
"task_relevant_rows": [
|
| 104 |
+
{
|
| 105 |
+
"created_day": 411,
|
| 106 |
+
"incident_number": 5101,
|
| 107 |
+
"pd_service_id": "PSVC001",
|
| 108 |
+
"priority": "P2",
|
| 109 |
+
"resolved_day": 412,
|
| 110 |
+
"status": "resolved",
|
| 111 |
+
"title": "Elevated checkout latency",
|
| 112 |
+
"urgency": "high"
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
"created_day": 414,
|
| 116 |
+
"incident_number": 5102,
|
| 117 |
+
"pd_service_id": "PSVC002",
|
| 118 |
+
"priority": "P1",
|
| 119 |
+
"resolved_day": null,
|
| 120 |
+
"status": "triggered",
|
| 121 |
+
"title": "Payments error rate above SLO",
|
| 122 |
+
"urgency": "high"
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"created_day": 416,
|
| 126 |
+
"incident_number": 5103,
|
| 127 |
+
"pd_service_id": "PSVC003",
|
| 128 |
+
"priority": "P1",
|
| 129 |
+
"resolved_day": null,
|
| 130 |
+
"status": "acknowledged",
|
| 131 |
+
"title": "Gateway latency surge after release",
|
| 132 |
+
"urgency": "high"
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"created_day": 414,
|
| 136 |
+
"incident_number": 5104,
|
| 137 |
+
"pd_service_id": "PSVC004",
|
| 138 |
+
"priority": "P4",
|
| 139 |
+
"resolved_day": 415,
|
| 140 |
+
"status": "resolved",
|
| 141 |
+
"title": "Search index refresh lag",
|
| 142 |
+
"urgency": "low"
|
| 143 |
+
}
|
| 144 |
+
]
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"columns": [
|
| 148 |
+
"pd_service_id",
|
| 149 |
+
"name",
|
| 150 |
+
"escalation_policy",
|
| 151 |
+
"status"
|
| 152 |
+
],
|
| 153 |
+
"row_count": 5,
|
| 154 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 155 |
+
"table": "pd_services",
|
| 156 |
+
"task_relevant_rows": [
|
| 157 |
+
{
|
| 158 |
+
"escalation_policy": "EP-Commerce",
|
| 159 |
+
"name": "checkout-api",
|
| 160 |
+
"pd_service_id": "PSVC001",
|
| 161 |
+
"status": "active"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"escalation_policy": "EP-Commerce",
|
| 165 |
+
"name": "payments-api",
|
| 166 |
+
"pd_service_id": "PSVC002",
|
| 167 |
+
"status": "active"
|
| 168 |
+
},
|
| 169 |
+
{
|
| 170 |
+
"escalation_policy": "EP-Platform",
|
| 171 |
+
"name": "edge-gateway",
|
| 172 |
+
"pd_service_id": "PSVC003",
|
| 173 |
+
"status": "active"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"escalation_policy": "EP-Growth",
|
| 177 |
+
"name": "search-svc",
|
| 178 |
+
"pd_service_id": "PSVC004",
|
| 179 |
+
"status": "active"
|
| 180 |
+
}
|
| 181 |
+
]
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"columns": [
|
| 185 |
+
"schedule_id",
|
| 186 |
+
"schedule_name",
|
| 187 |
+
"escalation_policy",
|
| 188 |
+
"user_name",
|
| 189 |
+
"day"
|
| 190 |
+
],
|
| 191 |
+
"row_count": 4,
|
| 192 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 193 |
+
"table": "pd_oncall",
|
| 194 |
+
"task_relevant_rows": [
|
| 195 |
+
{
|
| 196 |
+
"day": 418,
|
| 197 |
+
"escalation_policy": "EP-Commerce",
|
| 198 |
+
"schedule_id": "SCHED-COM",
|
| 199 |
+
"schedule_name": "Commerce primary",
|
| 200 |
+
"user_name": "Diego Ramos"
|
| 201 |
+
},
|
| 202 |
+
{
|
| 203 |
+
"day": 419,
|
| 204 |
+
"escalation_policy": "EP-Commerce",
|
| 205 |
+
"schedule_id": "SCHED-COM",
|
| 206 |
+
"schedule_name": "Commerce primary",
|
| 207 |
+
"user_name": "Diego Ramos"
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"day": 419,
|
| 211 |
+
"escalation_policy": "EP-Platform",
|
| 212 |
+
"schedule_id": "SCHED-PLT",
|
| 213 |
+
"schedule_name": "Platform primary",
|
| 214 |
+
"user_name": "Priya Nair"
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
"day": 419,
|
| 218 |
+
"escalation_policy": "EP-Growth",
|
| 219 |
+
"schedule_id": "SCHED-GRW",
|
| 220 |
+
"schedule_name": "Growth primary",
|
| 221 |
+
"user_name": "Mei Tanaka"
|
| 222 |
+
}
|
| 223 |
+
]
|
| 224 |
+
}
|
| 225 |
+
]
|
| 226 |
+
}
|
task_files/dob100-038-port-count-inflight-work/05-deployment-state.json
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"deployment_id",
|
| 6 |
+
"service",
|
| 7 |
+
"environment",
|
| 8 |
+
"version",
|
| 9 |
+
"status",
|
| 10 |
+
"canary_percent"
|
| 11 |
+
],
|
| 12 |
+
"row_count": 22,
|
| 13 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 14 |
+
"table": "deployments",
|
| 15 |
+
"task_relevant_rows": [
|
| 16 |
+
{
|
| 17 |
+
"canary_percent": 100,
|
| 18 |
+
"deployment_id": 9251,
|
| 19 |
+
"environment": "staging",
|
| 20 |
+
"service": "storefront-web",
|
| 21 |
+
"status": "succeeded",
|
| 22 |
+
"version": "v3.2.4"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"canary_percent": 100,
|
| 26 |
+
"deployment_id": 9252,
|
| 27 |
+
"environment": "production",
|
| 28 |
+
"service": "storefront-web",
|
| 29 |
+
"status": "succeeded",
|
| 30 |
+
"version": "v3.2.4"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"canary_percent": 100,
|
| 34 |
+
"deployment_id": 9253,
|
| 35 |
+
"environment": "staging",
|
| 36 |
+
"service": "api-gateway",
|
| 37 |
+
"status": "succeeded",
|
| 38 |
+
"version": "v5.0.9"
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"canary_percent": 100,
|
| 42 |
+
"deployment_id": 9254,
|
| 43 |
+
"environment": "production",
|
| 44 |
+
"service": "api-gateway",
|
| 45 |
+
"status": "succeeded",
|
| 46 |
+
"version": "v5.0.9"
|
| 47 |
+
}
|
| 48 |
+
]
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"columns": [
|
| 52 |
+
"route_id",
|
| 53 |
+
"service",
|
| 54 |
+
"route",
|
| 55 |
+
"rps",
|
| 56 |
+
"share_pct"
|
| 57 |
+
],
|
| 58 |
+
"row_count": 13,
|
| 59 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 60 |
+
"table": "traffic_profile",
|
| 61 |
+
"task_relevant_rows": [
|
| 62 |
+
{
|
| 63 |
+
"route": "GET /",
|
| 64 |
+
"route_id": 9201,
|
| 65 |
+
"rps": 420,
|
| 66 |
+
"service": "storefront-web",
|
| 67 |
+
"share_pct": 100
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"route": "GET /product/:id",
|
| 71 |
+
"route_id": 9202,
|
| 72 |
+
"rps": 310,
|
| 73 |
+
"service": "storefront-web",
|
| 74 |
+
"share_pct": 100
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"route": "POST /v1/orders",
|
| 78 |
+
"route_id": 9203,
|
| 79 |
+
"rps": 145,
|
| 80 |
+
"service": "api-gateway",
|
| 81 |
+
"share_pct": 100
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"route": "POST /v2/orders",
|
| 85 |
+
"route_id": 9204,
|
| 86 |
+
"rps": 0,
|
| 87 |
+
"service": "api-gateway",
|
| 88 |
+
"share_pct": 0
|
| 89 |
+
}
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"columns": [
|
| 94 |
+
"service",
|
| 95 |
+
"desired_replicas",
|
| 96 |
+
"ready_replicas",
|
| 97 |
+
"strategy",
|
| 98 |
+
"storage_class"
|
| 99 |
+
],
|
| 100 |
+
"row_count": 10,
|
| 101 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 102 |
+
"table": "k8s_deployments",
|
| 103 |
+
"task_relevant_rows": [
|
| 104 |
+
{
|
| 105 |
+
"desired_replicas": 2,
|
| 106 |
+
"ready_replicas": 1,
|
| 107 |
+
"service": "analytics-worker",
|
| 108 |
+
"storage_class": "standard",
|
| 109 |
+
"strategy": "RollingUpdate"
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"desired_replicas": 3,
|
| 113 |
+
"ready_replicas": 3,
|
| 114 |
+
"service": "api-gateway",
|
| 115 |
+
"storage_class": "standard",
|
| 116 |
+
"strategy": "RollingUpdate"
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"desired_replicas": 3,
|
| 120 |
+
"ready_replicas": 3,
|
| 121 |
+
"service": "catalog",
|
| 122 |
+
"storage_class": "standard",
|
| 123 |
+
"strategy": "RollingUpdate"
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"desired_replicas": 64,
|
| 127 |
+
"ready_replicas": 6,
|
| 128 |
+
"service": "checkout",
|
| 129 |
+
"storage_class": "standard",
|
| 130 |
+
"strategy": "RollingUpdate"
|
| 131 |
+
}
|
| 132 |
+
]
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"columns": [
|
| 136 |
+
"pod",
|
| 137 |
+
"namespace",
|
| 138 |
+
"service",
|
| 139 |
+
"image_tag",
|
| 140 |
+
"phase",
|
| 141 |
+
"restarts",
|
| 142 |
+
"memory_limit_mb",
|
| 143 |
+
"memory_usage_mb",
|
| 144 |
+
"node",
|
| 145 |
+
"pending_reason"
|
| 146 |
+
],
|
| 147 |
+
"row_count": 14,
|
| 148 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 149 |
+
"table": "k8s_pods",
|
| 150 |
+
"task_relevant_rows": [
|
| 151 |
+
{
|
| 152 |
+
"image_tag": "v2.1.7",
|
| 153 |
+
"memory_limit_mb": 512,
|
| 154 |
+
"memory_usage_mb": 511,
|
| 155 |
+
"namespace": "production",
|
| 156 |
+
"node": "node-a1",
|
| 157 |
+
"pending_reason": "",
|
| 158 |
+
"phase": "CrashLoopBackOff",
|
| 159 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 160 |
+
"restarts": 47,
|
| 161 |
+
"service": "analytics-worker"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"image_tag": "v2.1.7",
|
| 165 |
+
"memory_limit_mb": 512,
|
| 166 |
+
"memory_usage_mb": 498,
|
| 167 |
+
"namespace": "production",
|
| 168 |
+
"node": "node-a1",
|
| 169 |
+
"pending_reason": "",
|
| 170 |
+
"phase": "Running",
|
| 171 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 172 |
+
"restarts": 39,
|
| 173 |
+
"service": "analytics-worker"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"image_tag": "v2.6.3",
|
| 177 |
+
"memory_limit_mb": 2048,
|
| 178 |
+
"memory_usage_mb": 890,
|
| 179 |
+
"namespace": "production",
|
| 180 |
+
"node": "node-a1",
|
| 181 |
+
"pending_reason": "",
|
| 182 |
+
"phase": "Running",
|
| 183 |
+
"pod": "checkout-5b8c-aa10",
|
| 184 |
+
"restarts": 0,
|
| 185 |
+
"service": "checkout"
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"image_tag": "v2.7.0",
|
| 189 |
+
"memory_limit_mb": 2048,
|
| 190 |
+
"memory_usage_mb": 1120,
|
| 191 |
+
"namespace": "production",
|
| 192 |
+
"node": "node-a2",
|
| 193 |
+
"pending_reason": "",
|
| 194 |
+
"phase": "Running",
|
| 195 |
+
"pod": "payments-6c1d-bb22",
|
| 196 |
+
"restarts": 0,
|
| 197 |
+
"service": "payments"
|
| 198 |
+
}
|
| 199 |
+
]
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"columns": [
|
| 203 |
+
"event_id",
|
| 204 |
+
"namespace",
|
| 205 |
+
"pod",
|
| 206 |
+
"reason",
|
| 207 |
+
"message",
|
| 208 |
+
"count",
|
| 209 |
+
"day"
|
| 210 |
+
],
|
| 211 |
+
"row_count": 8,
|
| 212 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 213 |
+
"table": "k8s_events",
|
| 214 |
+
"task_relevant_rows": [
|
| 215 |
+
{
|
| 216 |
+
"count": 47,
|
| 217 |
+
"day": 419,
|
| 218 |
+
"event_id": 9001,
|
| 219 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 220 |
+
"namespace": "production",
|
| 221 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 222 |
+
"reason": "OOMKilled"
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"count": 47,
|
| 226 |
+
"day": 419,
|
| 227 |
+
"event_id": 9002,
|
| 228 |
+
"message": "Back-off restarting failed container analytics",
|
| 229 |
+
"namespace": "production",
|
| 230 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 231 |
+
"reason": "CrashLoopBackOff"
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"count": 39,
|
| 235 |
+
"day": 420,
|
| 236 |
+
"event_id": 9003,
|
| 237 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 238 |
+
"namespace": "production",
|
| 239 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 240 |
+
"reason": "OOMKilled"
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"count": 1,
|
| 244 |
+
"day": 417,
|
| 245 |
+
"event_id": 9004,
|
| 246 |
+
"message": "Stopping container gateway for rollout",
|
| 247 |
+
"namespace": "production",
|
| 248 |
+
"pod": "api-gateway-9f2e-cc33",
|
| 249 |
+
"reason": "Killing"
|
| 250 |
+
}
|
| 251 |
+
]
|
| 252 |
+
}
|
| 253 |
+
]
|
| 254 |
+
}
|
task_files/dob100-038-port-count-inflight-work/06-repository-context.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"content": "// Package proxy manages upstream connections for the API gateway.\n//\n// Rewritten in v5.1.0: every route now gets its own transport so per-route TLS\n// material and per-route timeouts are honoured.\npackage proxy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/novacart/api-gateway/internal/config\"\n\t\"github.com/novacart/api-gateway/internal/log\"\n)\n\nconst (\n\tdialTimeout = 2 * time.Second\n\tidleConnTimeout = 90 * time.Second\n\tmaxIdlePerHost = 64\n\thealthCheckEvery = 15 * time.Second\n)\n\n// Conn wraps a transport dedicated to a single upstream.\ntype Conn struct {\n\tUpstream string\n\tTransport *http.Transport\n\tclient *http.Client\n\tdone chan struct{}\n\tcreatedAt time.Time\n}\n\n// Pool hands out upstream connections.\ntype Pool struct {\n\tcfg *config.Upstreams\n\tinFlight int64\n}\n\nfunc NewPool(cfg *config.Upstreams) *Pool { return &Pool{cfg: cfg} }\n\n// Acquire builds a connection for the given upstream. Building a transport is\n// cheap, so v5.1.0 does it per request rather than keeping long-lived ones.\nfunc (p *Pool) Acquire(ctx context.Context, upstream string) (*Conn, error) {\n\tif upstream == \"\" {\n\t\treturn nil, fmt.Errorf(\"proxy: empty upstream\")\n\t}\n\tatomic.AddInt64(&p.inFlight, 1)\n\n\ttransport := &http.Transport{\n\t\tDialContext: (&net.Dialer{Timeout: dialTimeout}).DialContext,\n\t\tTLSClientConfig: p.cfg.TLSFor(upstream),\n\t\tMaxIdleConnsPerHost: maxIdlePerHost,\n\t\tIdleConnTimeout: idleConnTimeout,\n\t}\n\n\tc := &Conn{Upstream: upstream, Transport: transport, done: make(chan struct{}),\n\t\tclient: &http.Client{Transport: transport}, createdAt: time.Now()}\n\n\t// Watchdog: keep probing this upstream for as long as the connection lives.\n\tgo func() {\n\t\tticker := time.NewTicker(healthCheckEvery)\n\t\tdefer ticker.Stop()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ticker.C:\n\t\t\t\tp.probe(c)\n\t\t\tcase <-c.done:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\tlog.Debugf(\"acquired upstream=%s in_flight=%d\", upstream, atomic.LoadInt64(&p.inFlight))\n\treturn c, nil\n}\n\n// Release closes the transport and stops the watchdog goroutine.\n//\n// NOTE: the v5.1.0 rewrite dropped the call to Release from Do -- the handler\n// returns as soon as it has the response. Nothing else calls it, so every\n// request leaves behind an idle transport plus a live watchdog goroutine.\nfunc (p *Pool) Release(c *Conn) {\n\tclose(c.done)\n\tc.Transport.CloseIdleConnections()\n\tatomic.AddInt64(&p.inFlight, -1)\n\tlog.Debugf(\"released upstream=%s age=%s\", c.Upstream, time.Since(c.createdAt))\n}\n\nfunc (p *Pool) probe(c *Conn) {\n\treq, _ := http.NewRequest(http.MethodHead, \"http://\"+c.Upstream+\"/healthz\", nil)\n\tif resp, err := c.client.Do(req); err == nil {\n\t\t_ = resp.Body.Close()\n\t}\n}\n\n// Do proxies a single request to the named upstream.\nfunc (p *Pool) Do(ctx context.Context, upstream string, req *http.Request) (*http.Response, error) {\n\tc, err := p.Acquire(ctx, upstream)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"acquire %s: %w\", upstream, err)\n\t}\n\n\tresp, err := c.client.Do(req.WithContext(ctx))\n\tif err != nil {\n\t\tlog.Errorf(\"upstream=%s request failed: %v\", upstream, err)\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}\n", "file_id": 25, "language": "go", "loc": 111, "owner": "Priya Nair", "path": "internal/proxy/pool.go", "service": "api-gateway", "source_table": "repo_files"}
|
| 2 |
+
{"additions": 214, "author": "Priya Nair", "commit_id": 1, "day": 1, "deletions": 0, "files": "internal/router/routes.go,internal/config/config.go", "message": "api-gateway: initial edge skeleton with healthz and access log", "service": "api-gateway", "sha": "3f8a1c2", "source_table": "commits"}
|
| 3 |
+
{"additions": 96, "author": "Sam Whitfield", "commit_id": 2, "day": 2, "deletions": 0, "files": "src/catalog/models.py", "message": "catalog: define Product and Money value objects", "service": "catalog", "sha": "9d41b07", "source_table": "commits"}
|
| 4 |
+
{"additions": 74, "author": "Nina Kowalski", "commit_id": 3, "day": 3, "deletions": 0, "files": "src/checkout/config.py", "message": "checkout: bootstrap service package and settings module", "service": "checkout", "sha": "c72e5a9", "source_table": "commits"}
|
| 5 |
+
{"additions": 131, "author": "Diego Ramos", "commit_id": 4, "day": 4, "deletions": 0, "files": "src/payments/capture.py", "message": "payments: wire libpayproc client and capture happy path", "service": "payments", "sha": "18be6d4", "source_table": "commits"}
|
| 6 |
+
{"author": "Priya Nair", "body": "Perf: new upstream pool.", "merged_version": "v5.1.0", "number": 9201, "service": "api-gateway", "source_table": "pull_requests", "status": "merged", "ticket_key": "", "title": "Connection pool rewrite"}
|
| 7 |
+
{"author": "Diego Ramos", "body": "Draft, do not merge yet.", "merged_version": "", "number": 9202, "service": "catalog", "source_table": "pull_requests", "status": "open", "ticket_key": "", "title": "Price rounding cleanup"}
|
task_files/dob100-038-port-count-inflight-work/07-ci-and-tests.csv
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_table,detail,exercise_id,func,hidden_tests,name,path,pr_number,quarantined,run_id,service,spec,stage,stage_id,starter,status,suite,test_id,visible_tests
|
| 2 |
+
ci_runs,all checks passed,,,,,,9201,,1,api-gateway,,,,,passed,,,
|
| 3 |
+
ci_runs,intermittent failure: test_checkout_idempotency (rerun may pass),,,,,,,,2,checkout,,,,,failed,,,
|
| 4 |
+
ci_runs,all checks passed,,,,,,,,3,checkout,,,,,passed,,,
|
| 5 |
+
ci_runs,all checks passed,,,,,,,,4,payments,,,,,passed,,,
|
| 6 |
+
ci_stages,ok,,,,,,,,1,,,build,1,,passed,,,
|
| 7 |
+
ci_stages,ok,,,,,,,,1,,,unit,2,,passed,,,
|
| 8 |
+
ci_stages,ok,,,,,,,,1,,,integration,3,,passed,,,
|
| 9 |
+
ci_stages,ok,,,,,,,,1,,,regression,4,,passed,,,
|
| 10 |
+
tests_catalog,,,,,test_cart_totals,,,0,,checkout,,,,,passing,unit,9901,
|
| 11 |
+
tests_catalog,,,,,test_checkout_idempotency,,,0,,checkout,,,,,flaky,integration,9902,
|
| 12 |
+
tests_catalog,,,,,test_capture_retries,,,0,,payments,,,,,passing,unit,9903,
|
| 13 |
+
tests_catalog,,,,,test_ranking,,,0,,search,,,,,passing,unit,9904,
|
| 14 |
+
code_exercises,,9401,next_delay_ms,"[[""attempt 1 is base_ms, not double"", ""assert next_delay_ms(1, 100, 10000) == 100""], [""the cap is a ceiling on the value"", ""assert next_delay_ms(9, 100, 5000) == 5000""], [""the cap applies at the boundary"", ""assert next_delay_ms(6, 100, 3200) == 3200""], [""attempt below 1 is not a retry"", ""try:\n next_delay_ms(0, 100, 10000)\nexcept ValueError:\n pass\nelse:\n raise AssertionError('attempt 0 must raise ValueError')""]]",,src/payments/backoff.py,,,,payments,"Implement next_delay_ms(attempt, base_ms, max_ms).
|
| 15 |
+
|
| 16 |
+
Retries are numbered from 1: the delay before the FIRST retry is attempt=1.
|
| 17 |
+
The delay doubles with each attempt - base_ms for attempt 1, twice that for
|
| 18 |
+
attempt 2, four times for attempt 3 - and is capped at max_ms. The cap is a
|
| 19 |
+
ceiling on the returned value, not on the exponent.
|
| 20 |
+
|
| 21 |
+
attempt < 1 is not a retry and must raise ValueError.",,,"""""""Backoff schedule for the payments retry path.""""""
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def next_delay_ms(attempt, base_ms, max_ms):
|
| 25 |
+
""""""Delay before retry number `attempt`, capped at max_ms.""""""
|
| 26 |
+
raise NotImplementedError
|
| 27 |
+
",,,,"[[""the delay doubles"", ""assert next_delay_ms(3, 100, 10000) == 2 * next_delay_ms(2, 100, 10000)""], [""delays are positive"", ""assert next_delay_ms(2, 100, 10000) > 0""]]"
|
| 28 |
+
code_exercises,,9402,chunk,"[[""empty input produces no groups"", ""assert chunk([], 3) == []""], [""an exact multiple has no trailing empty group"", ""assert chunk([1, 2, 3, 4], 2) == [[1, 2], [3, 4]]""], [""order is preserved"", ""assert chunk(['a', 'b', 'c'], 1) == [['a'], ['b'], ['c']]""], [""a size below 1 is meaningless"", ""for bad in (0, -1):\n try:\n chunk([1, 2], bad)\n except ValueError:\n pass\n else:\n raise AssertionError('size %r must raise ValueError' % bad)""], [""an iterator is accepted, not just a list"", ""assert chunk(iter([1, 2, 3]), 2) == [[1, 2], [3]]""]]",,src/payments/chunking.py,,,,payments,"Implement chunk(items, size) returning a list of lists.
|
| 29 |
+
|
| 30 |
+
Settlement batches a day's captures so one long-tailed merchant cannot stall
|
| 31 |
+
the run. Split `items` into consecutive groups of at most `size`, preserving
|
| 32 |
+
order. The final group may be shorter. An empty input produces no groups at
|
| 33 |
+
all - not one empty group. A size below 1 is meaningless and must raise
|
| 34 |
+
ValueError.
|
| 35 |
+
|
| 36 |
+
`items` is whatever captures.list_settlable() returned, which is any iterable
|
| 37 |
+
and is sometimes a one-pass generator, so do not assume it can be indexed or
|
| 38 |
+
measured with len().",,,"""""""Batch chunking for nightly settlement.""""""
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def chunk(items, size):
|
| 42 |
+
""""""Split items into consecutive groups of at most `size`.""""""
|
| 43 |
+
raise NotImplementedError
|
| 44 |
+
",,,,"[[""splits with a remainder"", ""assert chunk([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]""]]"
|
| 45 |
+
code_exercises,,9403,cache_key,"[[""insertion order does not matter"", ""a = {}\na['q'] = 'shoes'\na['page'] = 1\nb = {}\nb['page'] = 1\nb['q'] = 'shoes'\nassert cache_key(a) == cache_key(b)""], [""different values differ"", ""assert cache_key({'q': 'shoes'}) != cache_key({'q': 'boots'})""], [""an explicit None is not an absent key"", ""assert cache_key({'q': 'shoes', 'filter': None}) != cache_key({'q': 'shoes'})""], [""keys and values cannot run together"", ""assert cache_key({'a': 'xb', 'b': ''}) != cache_key({'a': 'x', 'bb': ''})""]]",,src/search/cache_key.py,,,,search,"Implement cache_key(params) returning a string.
|
| 46 |
+
|
| 47 |
+
The search result cache is keyed on the query parameters. Two calls with the
|
| 48 |
+
same parameters must produce the same key regardless of the order the keys
|
| 49 |
+
were inserted into the dict, because callers build them in different orders
|
| 50 |
+
and a mismatch silently halves the hit rate.
|
| 51 |
+
|
| 52 |
+
Different parameters must produce different keys. A parameter explicitly set
|
| 53 |
+
to None is not the same request as one that was never supplied. Values may be
|
| 54 |
+
strings, numbers, booleans or None.",,,"""""""Cache key derivation for the search result cache.""""""
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def cache_key(params):
|
| 58 |
+
""""""A stable key for a parameter dict.""""""
|
| 59 |
+
raise NotImplementedError
|
| 60 |
+
",,,,"[[""identical dicts agree"", ""assert cache_key({'q': 'shoes', 'page': 1}) == cache_key({'q': 'shoes', 'page': 1})""]]"
|
| 61 |
+
code_exercises,,9404,TokenBucket,"[[""partial time is not discarded"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(500)\nassert b.allow(1000)""], [""the bucket never exceeds capacity"", ""b = TokenBucket(2, 100)\nassert b.allow(0) and b.allow(0)\nassert b.allow(10000) and b.allow(10000)\nassert not b.allow(10000)""], [""a backwards clock grants nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)""], [""a backwards clock does not wedge the bucket"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)\nassert b.allow(2000)""], [""a refused request consumes nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nfor _ in range(5):\n assert not b.allow(0)\nassert b.allow(1000)""]]",,src/gateway/token_bucket.py,,,,api-gateway,"Implement class TokenBucket(capacity, refill_per_sec) with one method,
|
| 62 |
+
allow(now_ms), returning True if a request may proceed and False otherwise.
|
| 63 |
+
|
| 64 |
+
A bucket starts full. Each allowed request consumes exactly one token; a
|
| 65 |
+
refused request consumes none. Tokens refill continuously at refill_per_sec
|
| 66 |
+
and the bucket never holds more than capacity.
|
| 67 |
+
|
| 68 |
+
Refill is continuous, not stepwise: two calls 500ms apart at 1 token/sec must
|
| 69 |
+
together restore one whole token, so partial time must not be discarded. The
|
| 70 |
+
first call establishes the clock and refills nothing.
|
| 71 |
+
|
| 72 |
+
now_ms comes from a wall clock that is occasionally stepped backwards by NTP.
|
| 73 |
+
A backwards jump must never grant tokens and must never make the bucket
|
| 74 |
+
permanently unable to refill: treat time as not having advanced, and take the
|
| 75 |
+
new reading as the current clock.",,,"""""""Per-client rate limiting at the API gateway edge.""""""
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
class TokenBucket:
|
| 79 |
+
def __init__(self, capacity, refill_per_sec):
|
| 80 |
+
raise NotImplementedError
|
| 81 |
+
|
| 82 |
+
def allow(self, now_ms):
|
| 83 |
+
""""""True if a request may proceed, consuming one token.""""""
|
| 84 |
+
raise NotImplementedError
|
| 85 |
+
",,,,"[[""a full bucket allows up to capacity"", ""b = TokenBucket(2, 1)\nassert b.allow(0) and b.allow(0) and not b.allow(0)""], [""waiting restores a token"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(0)\nassert b.allow(1000)""]]"
|
task_files/dob100-038-port-count-inflight-work/08-data-change-controls.sql
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
-- migrations: {"environment": "staging", "migration_id": 1, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 2 |
+
-- migrations: {"environment": "production", "migration_id": 2, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 3 |
+
-- migrations: {"environment": "staging", "migration_id": 3, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 4 |
+
-- migrations: {"environment": "production", "migration_id": 4, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 5 |
+
-- migration_requirements: {"migration_name": "0088_loyalty_ledger", "module": "loyalty_redeem", "req_id": 9151, "service": "checkout"}
|
| 6 |
+
-- migration_requirements: {"migration_name": "0123_loyalty_points", "module": "loyalty_accrual", "req_id": 9152, "service": "catalog"}
|
| 7 |
+
-- migration_requirements: {"migration_name": "0042_settlement_splits", "module": "split_settlement", "req_id": 9153, "service": "payments"}
|
| 8 |
+
-- migration_requirements: {"migration_name": "0034_backorders", "module": "backorder_queue", "req_id": 9154, "service": "inventory"}
|
| 9 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9901, "note": "", "role": "payments_rw", "service": "payments", "state": "active"}
|
| 10 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9902, "note": "", "role": "checkout_rw", "service": "checkout", "state": "active"}
|
| 11 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9903, "note": "", "role": "catalog_ro", "service": "catalog", "state": "active"}
|
| 12 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9904, "note": "", "role": "search_ro", "service": "search", "state": "active"}
|
task_files/dob100-038-port-count-inflight-work/09-feature-and-security.yaml
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"flag_id",
|
| 6 |
+
"key",
|
| 7 |
+
"service",
|
| 8 |
+
"description",
|
| 9 |
+
"environment",
|
| 10 |
+
"enabled",
|
| 11 |
+
"rollout_percent"
|
| 12 |
+
],
|
| 13 |
+
"row_count": 8,
|
| 14 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 15 |
+
"table": "feature_flags",
|
| 16 |
+
"task_relevant_rows": [
|
| 17 |
+
{
|
| 18 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 19 |
+
"enabled": 1,
|
| 20 |
+
"environment": "production",
|
| 21 |
+
"flag_id": 9301,
|
| 22 |
+
"key": "instant_refunds",
|
| 23 |
+
"rollout_percent": 100,
|
| 24 |
+
"service": "checkout"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 28 |
+
"enabled": 1,
|
| 29 |
+
"environment": "staging",
|
| 30 |
+
"flag_id": 9302,
|
| 31 |
+
"key": "instant_refunds",
|
| 32 |
+
"rollout_percent": 100,
|
| 33 |
+
"service": "checkout"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"description": "Redesigned search results page.",
|
| 37 |
+
"enabled": 0,
|
| 38 |
+
"environment": "production",
|
| 39 |
+
"flag_id": 9303,
|
| 40 |
+
"key": "new_search_ui",
|
| 41 |
+
"rollout_percent": 0,
|
| 42 |
+
"service": "search"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"description": "Redesigned search results page.",
|
| 46 |
+
"enabled": 1,
|
| 47 |
+
"environment": "staging",
|
| 48 |
+
"flag_id": 9304,
|
| 49 |
+
"key": "new_search_ui",
|
| 50 |
+
"rollout_percent": 100,
|
| 51 |
+
"service": "search"
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"columns": [
|
| 57 |
+
"vuln_id",
|
| 58 |
+
"cve",
|
| 59 |
+
"package",
|
| 60 |
+
"service",
|
| 61 |
+
"severity",
|
| 62 |
+
"fixed_version",
|
| 63 |
+
"status"
|
| 64 |
+
],
|
| 65 |
+
"row_count": 4,
|
| 66 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 67 |
+
"table": "vulnerabilities",
|
| 68 |
+
"task_relevant_rows": [
|
| 69 |
+
{
|
| 70 |
+
"cve": "CVE-2026-31337",
|
| 71 |
+
"fixed_version": "2.4.0",
|
| 72 |
+
"package": "libpayproc",
|
| 73 |
+
"service": "payments",
|
| 74 |
+
"severity": "critical",
|
| 75 |
+
"status": "open",
|
| 76 |
+
"vuln_id": 9801
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"cve": "CVE-2026-40881",
|
| 80 |
+
"fixed_version": "11.4.0",
|
| 81 |
+
"package": "stripe-sdk",
|
| 82 |
+
"service": "checkout",
|
| 83 |
+
"severity": "high",
|
| 84 |
+
"status": "open",
|
| 85 |
+
"vuln_id": 9802
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"cve": "CVE-2026-22190",
|
| 89 |
+
"fixed_version": "2.11.0",
|
| 90 |
+
"package": "pydantic",
|
| 91 |
+
"service": "catalog",
|
| 92 |
+
"severity": "medium",
|
| 93 |
+
"status": "remediated",
|
| 94 |
+
"vuln_id": 9803
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"cve": "CVE-2026-51002",
|
| 98 |
+
"fixed_version": "2.33.0",
|
| 99 |
+
"package": "requests",
|
| 100 |
+
"service": "payments",
|
| 101 |
+
"severity": "high",
|
| 102 |
+
"status": "open",
|
| 103 |
+
"vuln_id": 9804
|
| 104 |
+
}
|
| 105 |
+
]
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"columns": [
|
| 109 |
+
"rule_id",
|
| 110 |
+
"name",
|
| 111 |
+
"service_label",
|
| 112 |
+
"expr",
|
| 113 |
+
"severity",
|
| 114 |
+
"group_by",
|
| 115 |
+
"routes_to"
|
| 116 |
+
],
|
| 117 |
+
"row_count": 5,
|
| 118 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 119 |
+
"table": "alert_rules",
|
| 120 |
+
"task_relevant_rows": [
|
| 121 |
+
{
|
| 122 |
+
"expr": "histogram_quantile(0.99, gateway_latency) > 250",
|
| 123 |
+
"group_by": "service",
|
| 124 |
+
"name": "GatewayHighLatency",
|
| 125 |
+
"routes_to": "EP-Platform",
|
| 126 |
+
"rule_id": 601,
|
| 127 |
+
"service_label": "gateway_service",
|
| 128 |
+
"severity": "critical"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"expr": "rate(gateway_errors[5m]) > 0.01",
|
| 132 |
+
"group_by": "service",
|
| 133 |
+
"name": "GatewayErrorRate",
|
| 134 |
+
"routes_to": "EP-Platform",
|
| 135 |
+
"rule_id": 602,
|
| 136 |
+
"service_label": "gateway_service",
|
| 137 |
+
"severity": "high"
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"expr": "avg(latency) by (cluster) > 400",
|
| 141 |
+
"group_by": "cluster",
|
| 142 |
+
"name": "ClusterWideLatency",
|
| 143 |
+
"routes_to": "EP-Platform",
|
| 144 |
+
"rule_id": 603,
|
| 145 |
+
"service_label": "",
|
| 146 |
+
"severity": "critical"
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"expr": "cache_hit_ratio{tier=\"gateway-edge\"} < 0.8",
|
| 150 |
+
"group_by": "service",
|
| 151 |
+
"name": "EdgeCacheHitRate",
|
| 152 |
+
"routes_to": "EP-Platform",
|
| 153 |
+
"rule_id": 604,
|
| 154 |
+
"service_label": "edge_cache_service",
|
| 155 |
+
"severity": "medium"
|
| 156 |
+
}
|
| 157 |
+
]
|
| 158 |
+
},
|
| 159 |
+
{
|
| 160 |
+
"columns": [
|
| 161 |
+
"silence_id",
|
| 162 |
+
"matcher",
|
| 163 |
+
"created_by",
|
| 164 |
+
"reason",
|
| 165 |
+
"expires_day"
|
| 166 |
+
],
|
| 167 |
+
"row_count": 1,
|
| 168 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 169 |
+
"table": "alert_silences",
|
| 170 |
+
"task_relevant_rows": [
|
| 171 |
+
{
|
| 172 |
+
"created_by": "Sam Whitfield",
|
| 173 |
+
"expires_day": 402,
|
| 174 |
+
"matcher": "alertname=\"EdgeCacheHitRate\"",
|
| 175 |
+
"reason": "muted during the CDN migration, never lifted",
|
| 176 |
+
"silence_id": 801
|
| 177 |
+
}
|
| 178 |
+
]
|
| 179 |
+
}
|
| 180 |
+
]
|
| 181 |
+
}
|
task_files/dob100-038-port-count-inflight-work/10-vendor-trackers.json
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"key",
|
| 6 |
+
"project",
|
| 7 |
+
"summary",
|
| 8 |
+
"issue_type",
|
| 9 |
+
"status",
|
| 10 |
+
"resolution",
|
| 11 |
+
"priority",
|
| 12 |
+
"component",
|
| 13 |
+
"assignee",
|
| 14 |
+
"created_day",
|
| 15 |
+
"updated_day"
|
| 16 |
+
],
|
| 17 |
+
"row_count": 11,
|
| 18 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 19 |
+
"table": "jira_issues",
|
| 20 |
+
"task_relevant_rows": [
|
| 21 |
+
{
|
| 22 |
+
"assignee": "Diego Ramos",
|
| 23 |
+
"component": "payments",
|
| 24 |
+
"created_day": 402,
|
| 25 |
+
"issue_type": "Bug",
|
| 26 |
+
"key": "ENG-3002",
|
| 27 |
+
"priority": "High",
|
| 28 |
+
"project": "ENG",
|
| 29 |
+
"resolution": "Fixed",
|
| 30 |
+
"status": "Done",
|
| 31 |
+
"summary": "Duplicate charge on retried payment",
|
| 32 |
+
"updated_day": 409
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"assignee": "",
|
| 36 |
+
"component": "checkout",
|
| 37 |
+
"created_day": 396,
|
| 38 |
+
"issue_type": "Bug",
|
| 39 |
+
"key": "ENG-3004",
|
| 40 |
+
"priority": "Low",
|
| 41 |
+
"project": "ENG",
|
| 42 |
+
"resolution": "Won't Do",
|
| 43 |
+
"status": "Done",
|
| 44 |
+
"summary": "Cart total rounds incorrectly for multi-currency",
|
| 45 |
+
"updated_day": 404
|
| 46 |
+
}
|
| 47 |
+
]
|
| 48 |
+
},
|
| 49 |
+
{
|
| 50 |
+
"columns": [
|
| 51 |
+
"identifier",
|
| 52 |
+
"team",
|
| 53 |
+
"title",
|
| 54 |
+
"state",
|
| 55 |
+
"priority",
|
| 56 |
+
"label",
|
| 57 |
+
"created_day"
|
| 58 |
+
],
|
| 59 |
+
"row_count": 4,
|
| 60 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 61 |
+
"table": "linear_issues",
|
| 62 |
+
"task_relevant_rows": [
|
| 63 |
+
{
|
| 64 |
+
"created_day": 411,
|
| 65 |
+
"identifier": "GRW-88",
|
| 66 |
+
"label": "bug",
|
| 67 |
+
"priority": 1,
|
| 68 |
+
"state": "In Progress",
|
| 69 |
+
"team": "Growth",
|
| 70 |
+
"title": "Checkout slow at peak \u2014 customers dropping off"
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"created_day": 408,
|
| 74 |
+
"identifier": "GRW-91",
|
| 75 |
+
"label": "bug",
|
| 76 |
+
"priority": 3,
|
| 77 |
+
"state": "Todo",
|
| 78 |
+
"team": "Growth",
|
| 79 |
+
"title": "Search shows stale products after reindex"
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"created_day": 417,
|
| 83 |
+
"identifier": "GRW-95",
|
| 84 |
+
"label": "bug",
|
| 85 |
+
"priority": 4,
|
| 86 |
+
"state": "Todo",
|
| 87 |
+
"team": "Growth",
|
| 88 |
+
"title": "Autocomplete flickers on slow connections"
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"created_day": 416,
|
| 92 |
+
"identifier": "GRW-97",
|
| 93 |
+
"label": "bug,performance",
|
| 94 |
+
"priority": 2,
|
| 95 |
+
"state": "In Progress",
|
| 96 |
+
"team": "Growth",
|
| 97 |
+
"title": "Product images load from origin, not CDN"
|
| 98 |
+
}
|
| 99 |
+
]
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"columns": [
|
| 103 |
+
"number",
|
| 104 |
+
"repo",
|
| 105 |
+
"title",
|
| 106 |
+
"state",
|
| 107 |
+
"labels",
|
| 108 |
+
"created_day"
|
| 109 |
+
],
|
| 110 |
+
"row_count": 28,
|
| 111 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 112 |
+
"table": "github_issues",
|
| 113 |
+
"task_relevant_rows": [
|
| 114 |
+
{
|
| 115 |
+
"created_day": 396,
|
| 116 |
+
"labels": "bug",
|
| 117 |
+
"number": 4404,
|
| 118 |
+
"repo": "novacart/storefront",
|
| 119 |
+
"state": "closed",
|
| 120 |
+
"title": "Rate limiter allows bursts above the configured ceiling"
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"created_day": 403,
|
| 124 |
+
"labels": "bug,priority",
|
| 125 |
+
"number": 4407,
|
| 126 |
+
"repo": "novacart/platform",
|
| 127 |
+
"state": "open",
|
| 128 |
+
"title": "Refund webhook retried indefinitely on 4xx"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"created_day": 410,
|
| 132 |
+
"labels": "bug,customer-report",
|
| 133 |
+
"number": 4409,
|
| 134 |
+
"repo": "novacart/commerce",
|
| 135 |
+
"state": "open",
|
| 136 |
+
"title": "Dark mode toggle resets on navigation"
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"created_day": 417,
|
| 140 |
+
"labels": "enhancement",
|
| 141 |
+
"number": 4411,
|
| 142 |
+
"repo": "novacart/growth",
|
| 143 |
+
"state": "open",
|
| 144 |
+
"title": "Checkout page hangs before redirect"
|
| 145 |
+
}
|
| 146 |
+
]
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"columns": [
|
| 150 |
+
"source",
|
| 151 |
+
"target",
|
| 152 |
+
"kind"
|
| 153 |
+
],
|
| 154 |
+
"row_count": 4,
|
| 155 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 156 |
+
"table": "issue_links",
|
| 157 |
+
"task_relevant_rows": [
|
| 158 |
+
{
|
| 159 |
+
"kind": "duplicates",
|
| 160 |
+
"source": "ENG-3001",
|
| 161 |
+
"target": "GRW-88"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"kind": "duplicates",
|
| 165 |
+
"source": "ENG-3001",
|
| 166 |
+
"target": "4412"
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"kind": "duplicates",
|
| 170 |
+
"source": "ENG-3003",
|
| 171 |
+
"target": "GRW-91"
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"kind": "duplicates",
|
| 175 |
+
"source": "ENG-3003",
|
| 176 |
+
"target": "4402"
|
| 177 |
+
}
|
| 178 |
+
]
|
| 179 |
+
}
|
| 180 |
+
]
|
| 181 |
+
}
|
task_files/dob100-038-port-count-inflight-work/11-knowledge-base.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 11 Knowledge Base
|
| 2 |
+
|
| 3 |
+
## documents (30 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"doc_id": 9612,
|
| 9 |
+
"kind": "runbook",
|
| 10 |
+
"title": "Queue consumer tuning",
|
| 11 |
+
"service": "notifications",
|
| 12 |
+
"author": "Priya Nair",
|
| 13 |
+
"day": 226,
|
| 14 |
+
"body": "# Queue consumer tuning\n\nOwner: platform. Primary consumer service: `notifications` (tier 2), which\ndrains the email, SMS, and push delivery queues. The same rules apply to any\nservice that consumes from the message broker.\n\n## The rule\n\n`prefetch_count` must be a **bounded** value. **Recommended: 50.**\n\n`prefetch_count=0` means **unlimited prefetch** and is the single worst setting\nin this runbook.\n\n## What prefetch does\n\nPrefetch is the number of unacknowledged messages the broker will push to a\nsingle consumer. With `prefetch_count=50`, a consumer holds at most 50\nin-flight messages; the broker will not send a 51st until one is acknowledged.\nThis is the backpressure mechanism - it is what lets a slow consumer tell the\nbroker to slow down.\n\nWith `prefetch_count=0` there is no backpressure. The broker pushes the entire\nbacklog to whichever consumer connects first. Consequences, all of which we have\nseen in `notifications`:\n\n- **Memory pressure.** A 400k-message backlog lands in one process's heap. RSS\n climbs until the container hits its memory limit.\n- **Consumer restarts.** The container is OOM-killed, the unacknowledged\n messages are redelivered, the restarted consumer grabs them all again, and it\n is killed again. A restart loop that looks like a broker problem and is not.\n- **Terrible load distribution.** One consumer holds everything while its\n siblings sit idle, so scaling out does nothing.\n- **Head-of-line latency.** A high-priority message sits behind 400k others.\n\n## Sizing\n\n| Message profile | prefetch_count |\n| ------------------------------ | -------------- |\n| Fast, uniform (a few ms each) | 100-200 |\n| Standard delivery work | **50** |\n| Slow or variable (seconds) | 5-10 |\n| Long-running jobs (minutes) | 1 |\n\nRule of thumb: `prefetch_count` should be roughly the number of messages a\nconsumer can process in one to two seconds. Start at 50 and adjust with\nevidence.\n\n## Related settings\n\n- `smtp_pool` on `notifications` bounds concurrent SMTP connections. Prefetch\n above the SMTP concurrency just buys queueing inside the process.\n- Ack **after** the work is done, never on receipt. Acking on receipt turns a\n crash into silent message loss.\n- Dead-letter after 5 delivery attempts so a poison message cannot loop forever.\n\n## Changing it\n\nRepo config: PR with a `config` change, CI, merge, staging, production.\n`notifications` is tier 2 - straight 100% deploy after staging. Watch consumer\nmemory and queue depth for one full peak after the change.\n"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"doc_id": 9614,
|
| 18 |
+
"kind": "design_doc",
|
| 19 |
+
"title": "Checkout architecture",
|
| 20 |
+
"service": "checkout",
|
| 21 |
+
"author": "Diego Ramos",
|
| 22 |
+
"day": 198,
|
| 23 |
+
"body": "# Checkout architecture\n\nService: `checkout` (tier 1, python, commerce). Owns the cart and the checkout\norchestration state machine. SLOs: `error_rate_pct < 1.0`,\n`latency_p99_ms < 400`.\n\n## Responsibilities\n\n`checkout` owns the transition from \"a cart exists\" to \"an order exists and is\npaid\". It does not own money movement (that is `payments`), product data (that\nis `catalog`), or customer notification (that is `notifications`). It owns the\nsequencing and the guarantee that the sequence happens exactly once.\n\nModules: `cart`, `checkout_flow`, and - once the loyalty program ships -\n`loyalty_redeem`.\n\n## The state machine\n\nEvery checkout session is a row with an explicit state:\n\n```\ncart_open -> pricing_locked -> payment_pending -> paid -> order_created\n | |\n +-> abandoned +-> payment_failed\n```\n\nTransitions are append-only and each is stamped with the idempotency key of the\nrequest that caused it. Replaying a request that has already produced a\ntransition returns the existing result rather than performing it again. This is\nwhat makes the checkout endpoint safe to retry, which matters because clients\nretry aggressively on mobile networks.\n\n## Dependencies\n\n| Downstream | Call | Timeout budget |\n| --------------- | ------------------------ | ------------------------- |\n| `catalog` | price and availability | `<= 2000ms`, 3 attempts |\n| `payments` | authorize and capture | `payment_timeout_ms` |\n| `notifications` | order confirmation | async, fire-and-forget |\n\nAll synchronous calls follow the \"Retry and timeout standard\": three attempts,\ntimeout at or below 2000ms. The `notifications` call is deliberately\nasynchronous - a confirmation email must never be able to fail an order.\n\n## Pricing lock\n\nAt `pricing_locked` we snapshot the price, the promotion, and the tax\ncomputation into the session row. From that point the customer pays the price\nthey were shown even if `catalog` changes underneath. The lock expires after 20\nminutes, after which the session re-prices.\n\n## Failure handling\n\n- `payments` timeout: the session stays `payment_pending` and a reconciliation\n job asks `payments` for the authoritative status. We never assume a timeout\n means \"did not happen\".\n- `catalog` unavailable: fail closed. We do not sell at a guessed price.\n- Partial capture: not supported; a capture is all-or-nothing per order.\n\n## Feature flags\n\nCheckout-adjacent behavior ships behind flags - `instant_refunds`,\n`express_checkout`. Per the \"Feature flags\" runbook, the code deploys first and\nthe flag is enabled afterwards at no more than 10%. `instant_refunds` is the\ncautionary tale: ramped to 100% in production, it took `error_rate_pct` from\n0.3% to 5.5% via a nil-pointer panic in the refund worker.\n\n## Open questions\n\n- Should the pricing lock move into `catalog` so `search` can honor it too?\n- Cart merge on login is still last-write-wins; it should be a real merge.\n"
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"doc_id": 9617,
|
| 27 |
+
"kind": "design_doc",
|
| 28 |
+
"title": "Loyalty points program",
|
| 29 |
+
"service": "",
|
| 30 |
+
"author": "Diego Ramos",
|
| 31 |
+
"day": 288,
|
| 32 |
+
"body": "# Loyalty points program\n\nCross-service feature spanning `catalog`, `checkout`, and `storefront-web`.\nCustomers earn points on purchases and redeem them for order discounts.\n\n## Modules and ownership\n\n| Module | Service | Responsibility |\n| ----------------- | ----------------- | ------------------------------------- |\n| `loyalty_accrual` | `catalog` | Points-earning rules per product |\n| `loyalty_redeem` | `checkout` | Applying points as an order discount |\n| `loyalty_widget` | `storefront-web` | Balance display and redeem affordance |\n\nEach module ships in **its own PR against its own service**. There is no shared\nlibrary; the contract between them is the points-rate field on the product\npayload and the redeem call on the checkout API.\n\n## Why this split\n\nAccrual rules are product data - they vary per product and per category, they\nchange with merchandising campaigns, and they belong next to pricing. Redemption\nis an order-level money decision and belongs in the checkout state machine.\nDisplay is display. Putting accrual in `checkout` would have meant `checkout`\nreading the product rules table, which is exactly the coupling we spent last\nyear removing.\n\n## Rollout order\n\nDeployment order matters and is not negotiable:\n\n**`catalog` - then `checkout` - then `storefront-web`.**\n\nThe reasoning is a strict data dependency chain:\n\n1. `catalog` must be emitting a points rate on the product payload before\n `checkout` can compute a balance to redeem against. If `checkout` ships\n first, every redeem attempt reads a missing field and either errors or\n silently computes zero.\n2. `checkout` must expose the redeem endpoint and be live before\n `storefront-web` renders a redeem button. If the widget ships first,\n customers see a button that 404s - a visible, embarrassing failure on the\n busiest page we have.\n\n`catalog` is tier 2 (straight production deploy after staging). `checkout` and\n`storefront-web` are tier 1, so each is staging-first, then a production canary\nat `canary_percent <= 25`, `assess_canary`, then `promote_canary` - see\n\"Deployment policy\". Do not begin the next service's production deploy until the\nprevious one is fully promoted.\n\n## Points model\n\nBalances live in an append-only ledger, mirroring the approach in \"Payments\nsettlement pipeline\": `earn`, `redeem`, `expire`, `adjust`. Balance is the sum,\nnever a stored counter. Redemption is authorized at `pricing_locked` and\ncommitted at `paid`; an abandoned cart releases the hold after 20 minutes.\n\nDefault rate is 1 point per whole currency unit, 100 points equals one currency\nunit of discount, points expire 12 months after earning. Maximum redemption is\n50% of order subtotal.\n\n## Risks\n\n- Double-redeem across concurrent sessions. Mitigated by the hold and by the\n idempotency key on the checkout transition.\n- Accrual rule changes retroactively altering historical balances. The ledger\n stamps the rate version at earn time.\n"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"doc_id": 9622,
|
| 36 |
+
"kind": "postmortem",
|
| 37 |
+
"title": "Postmortem: search cache stampede after index rebuild",
|
| 38 |
+
"service": "search",
|
| 39 |
+
"author": "Mei Tanaka",
|
| 40 |
+
"day": 183,
|
| 41 |
+
"body": "# Postmortem: search cache stampede after index rebuild\n\n**Severity:** sev2\n**Service:** `search`\n**Duration:** 34 minutes of degraded search\n**Author:** Mei Tanaka\n**Status:** action items complete\n\n## Summary\n\nA planned index rebuild swapped the search index alias at a moderate traffic\nhour. The alias swap invalidated the entire query cache. Every in-flight query\nmissed simultaneously and hit the primary index, driving `latency_p99_ms` from\n~210ms to a peak of 2100ms and firing the `search latency_p99_ms` alert against\nits 300ms SLO. Search was slow, not down; conversion on search-originated\nsessions dropped an estimated 18% for the duration.\n\n## Timeline (UTC)\n\n- **14:02** Engineer starts a full index rebuild for an analyzer change. Routine;\n done a dozen times before.\n- **14:41** Rebuild completes. Alias swaps to the new index. Query cache keys are\n namespaced by index generation, so the swap invalidates 100% of the cache.\n- **14:42** `latency_p99_ms` crosses 300ms. Alert fires, `medium`.\n- **14:44** On-call acknowledges. Initial hypothesis: the new analyzer is slow.\n- **14:51** Index CPU is pegged; per-query cost is unchanged from before the\n rebuild. Hypothesis discarded - it is volume, not per-query cost.\n- **14:58** Cache hit ratio confirmed at 3%, against a normal 76%. Root cause\n identified.\n- **15:06** Traffic to search temporarily shed at the gateway by 30% to let the\n cache refill.\n- **15:16** Hit ratio back above 60%; p99 at 340ms and falling.\n- **15:22** Shedding removed. p99 at 215ms.\n- **15:26** Alert resolved, incident resolved, update posted in `#incidents`.\n\n## Root cause\n\nThe query cache is namespaced by index generation. An alias swap therefore\nperforms a **complete, instantaneous cache flush** with no warm-up. Because the\ncache normally absorbs about **75% of index load**, the index was asked to serve\nroughly 4x its steady-state query volume within one second. Requests queued,\nlatency rose, clients retried, and the retries added load - a classic stampede\nwith a positive feedback loop.\n\n## Contributing factors\n\n- No warm-up step in the rebuild procedure. The runbook ended at \"swap alias\".\n- Rebuild was run at 14:00 local, in the daily traffic ramp, because the job\n takes 40 minutes and nobody wanted to babysit it at night.\n- Single-flight coalescing existed for identical concurrent queries but the\n stampede was across *thousands of distinct* queries, so coalescing did nothing.\n- No alert on cache hit ratio, so the actual signal was invisible for 14 minutes.\n\n## What went well\n\n- Alerting fired within a minute of the SLO breach.\n- Load shedding at the gateway was the correct blunt instrument and worked.\n\n## Action items\n\n1. Add a **warm-up phase** to the rebuild: replay the top 5000 queries against\n the new index before swapping the alias. **Done.**\n2. Add **+/-10% TTL jitter** to `cache_ttl_s=300` so natural expiry never\n synchronizes. **Done.**\n3. Alert on **cache hit ratio below 50%** for 5 minutes. **Done.**\n4. Move scheduled rebuilds to 03:00-05:00 UTC. **Done.**\n5. Document the stampede risk in the \"Search caching\" runbook. **Done.**\n"
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"doc_id": 9623,
|
| 45 |
+
"kind": "postmortem",
|
| 46 |
+
"title": "Postmortem: catalog migration 0043 forced a rollback",
|
| 47 |
+
"service": "catalog",
|
| 48 |
+
"author": "Diego Ramos",
|
| 49 |
+
"day": 202,
|
| 50 |
+
"body": "# Postmortem: catalog migration 0043 forced a rollback\n\n**Severity:** sev1\n**Service:** `catalog` (with knock-on impact to `checkout` and `storefront-web`)\n**Duration:** 22 minutes of failed product-detail pages\n**Author:** Diego Ramos\n**Status:** action items complete\n\n## Summary\n\nMigration `0043_rename_price_column` renamed `catalog_products.price_cents` to\n`price_minor_units` in a single step, and the matching code version `v1.8.0` was\ndeployed immediately after. The migration was applied to production before the\ndeploy, as policy requires - but the migration was **not backwards compatible**\nwith the code version already running. Between the migration completing and the\nnew version being fully rolled out, the running `v1.7.6` instances queried a\ncolumn that no longer existed. Product-detail and category pages returned 500s;\n`checkout` fell back to failing closed on pricing, per its design.\n\n## Timeline (UTC)\n\n- **09:12** `apply_migration(catalog, production, 0043)` starts.\n- **09:13** Migration completes. Column renamed.\n- **09:13** `v1.7.6` instances begin throwing\n `UndefinedColumn: price_cents` on every pricing query.\n- **09:14** `catalog` error rate goes vertical. `checkout` starts failing closed.\n Two alerts fire.\n- **09:15** Deploy of `v1.8.0` starts, as planned, but rolls instance by instance.\n- **09:17** On-call acknowledges, declares sev1.\n- **09:19** Commander recognizes the pattern: schema ahead of code, partial fleet.\n- **09:21** Decision: do **not** attempt to reverse the migration. Accelerate the\n `v1.8.0` rollout instead.\n- **09:31** Rollout complete on all instances. Errors stop.\n- **09:34** Metrics confirmed recovered; alerts resolved; incident resolved.\n- **09:40** Update posted in `#incidents`; status page updated and cleared.\n- Later that day: `v1.8.0` was rolled back for an unrelated defect found in\n review, which is when the second lesson landed - the rolled-back `v1.7.6` code\n could not read the renamed column either, and a hotfix `v1.8.1` had to be cut\n because **migrations are forward-only** and there was no going back.\n\n## Root cause\n\nA **destructive, non-backwards-compatible schema change shipped in one step**. A\ncolumn rename is two incompatible states with no overlap: code that knows the old\nname and code that knows the new name cannot both work against the same schema.\nAny window in which both code versions run - and a rolling deploy guarantees such\na window - is an outage.\n\n## Contributing factors\n\n- The \"migration before code\" rule was followed correctly, and following it\n correctly was *insufficient*. The rule says nothing about compatibility with\n the code already running.\n- The migration had one reviewer, from the authoring team.\n- Rolling deploys were assumed to be fast enough not to matter. They are not.\n- `catalog` is tier 2, so there was no canary to catch it at 25%.\n\n## What went well\n\n- Nobody tried to hand-write a reverse migration under pressure. Rolling forward\n was the right call and it was made in six minutes.\n- `checkout` failing closed on pricing prevented selling at a wrong price.\n\n## Action items\n\n1. Write the **N-1 rule** into the \"Database migration policy\": every migration\n must leave the schema usable by the currently deployed code. **Done.**\n2. Mandate the **expand/contract** pattern for renames: add column, dual-write,\n backfill, switch reads, drop in a later migration. **Done.**\n3. Require a **second reviewer from platform** for migrations on tables above ten\n million rows. **Done.**\n4. Add a CI check that flags `DROP COLUMN`, `RENAME COLUMN`, and new `NOT NULL`\n constraints for explicit sign-off. **Done.**\n"
|
| 51 |
+
}
|
| 52 |
+
]
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## confluence_pages (4 rows)
|
| 56 |
+
|
| 57 |
+
```json
|
| 58 |
+
[
|
| 59 |
+
{
|
| 60 |
+
"page_id": 8001,
|
| 61 |
+
"space": "ENG",
|
| 62 |
+
"title": "Checkout Platform \u2014 architecture",
|
| 63 |
+
"body": "Checkout Platform is owned by the Commerce Platform team. It calls payments and inventory synchronously. Escalate via #commerce.",
|
| 64 |
+
"last_updated_day": 372,
|
| 65 |
+
"stale": 0
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"page_id": 8002,
|
| 69 |
+
"space": "ENG",
|
| 70 |
+
"title": "Gateway runbook (legacy)",
|
| 71 |
+
"body": "The Edge Team owns the gateway. Page the Edge Team rota for any 5xx spike. Restart procedure targets host gw-prod-03.",
|
| 72 |
+
"last_updated_day": 181,
|
| 73 |
+
"stale": 1
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"page_id": 8003,
|
| 77 |
+
"space": "ENG",
|
| 78 |
+
"title": "Weekly reporting conventions",
|
| 79 |
+
"body": "Engineering weekly reports run Monday to Sunday, ISO-8601 week numbering, in UTC. Note that the service-owner spreadsheet uses a Sunday start and will disagree by one day at the boundary.",
|
| 80 |
+
"last_updated_day": 401,
|
| 81 |
+
"stale": 0
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"page_id": 8004,
|
| 85 |
+
"space": "ENG",
|
| 86 |
+
"title": "Incident severity ladder",
|
| 87 |
+
"body": "P1 = customer-facing outage, P2 = degraded customer experience, P3 = internal only, P4 = cosmetic. Customer-facing status is recorded on the public status page, not on the incident.",
|
| 88 |
+
"last_updated_day": 395,
|
| 89 |
+
"stale": 0
|
| 90 |
+
}
|
| 91 |
+
]
|
| 92 |
+
```
|
task_files/dob100-038-port-count-inflight-work/12-chat-and-status.json
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"message_id",
|
| 6 |
+
"channel",
|
| 7 |
+
"author",
|
| 8 |
+
"body"
|
| 9 |
+
],
|
| 10 |
+
"row_count": 6,
|
| 11 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 12 |
+
"table": "messages",
|
| 13 |
+
"task_relevant_rows": [
|
| 14 |
+
{
|
| 15 |
+
"author": "Priya Nair",
|
| 16 |
+
"body": "Declared incident 9701 (sev1): api-gateway p99 through the roof since the v5.1.0 promote.",
|
| 17 |
+
"channel": "#incidents",
|
| 18 |
+
"message_id": 1
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"author": "Diego Ramos",
|
| 22 |
+
"body": "Incident 9702 (sev2): checkout error rate tracks the instant_refunds ramp exactly.",
|
| 23 |
+
"channel": "#incidents",
|
| 24 |
+
"message_id": 2
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"author": "Alex Osei",
|
| 28 |
+
"body": "Incident 9703 (sev2): inventory reservations timing out at peak; pool looks undersized.",
|
| 29 |
+
"channel": "#incidents",
|
| 30 |
+
"message_id": 3
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"author": "Mei Tanaka",
|
| 34 |
+
"body": "Reminder: deployment policy = staging first; tier-1 canary at 25% then promote.",
|
| 35 |
+
"channel": "#eng",
|
| 36 |
+
"message_id": 4
|
| 37 |
+
}
|
| 38 |
+
]
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"columns": [
|
| 42 |
+
"channel",
|
| 43 |
+
"purpose"
|
| 44 |
+
],
|
| 45 |
+
"row_count": 4,
|
| 46 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 47 |
+
"table": "channels",
|
| 48 |
+
"task_relevant_rows": [
|
| 49 |
+
{
|
| 50 |
+
"channel": "#incidents",
|
| 51 |
+
"purpose": "Incident coordination and status updates."
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"channel": "#security",
|
| 55 |
+
"purpose": "Security advisories and audit notes."
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"channel": "#eng",
|
| 59 |
+
"purpose": "General engineering."
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"channel": "#deploys",
|
| 63 |
+
"purpose": "Deployment announcements."
|
| 64 |
+
}
|
| 65 |
+
]
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"columns": [
|
| 69 |
+
"post_id",
|
| 70 |
+
"state",
|
| 71 |
+
"title",
|
| 72 |
+
"body"
|
| 73 |
+
],
|
| 74 |
+
"row_count": 1,
|
| 75 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 76 |
+
"table": "status_page",
|
| 77 |
+
"task_relevant_rows": [
|
| 78 |
+
{
|
| 79 |
+
"body": "Catalog read replica maintenance completed with no customer impact.",
|
| 80 |
+
"post_id": 1,
|
| 81 |
+
"state": "resolved",
|
| 82 |
+
"title": "Scheduled maintenance completed"
|
| 83 |
+
}
|
| 84 |
+
]
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"columns": [
|
| 88 |
+
"post_id",
|
| 89 |
+
"title",
|
| 90 |
+
"impact",
|
| 91 |
+
"state",
|
| 92 |
+
"published_day",
|
| 93 |
+
"linked_incident"
|
| 94 |
+
],
|
| 95 |
+
"row_count": 3,
|
| 96 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 97 |
+
"table": "status_page_posts",
|
| 98 |
+
"task_relevant_rows": [
|
| 99 |
+
{
|
| 100 |
+
"impact": "major",
|
| 101 |
+
"linked_incident": 5101,
|
| 102 |
+
"post_id": 7001,
|
| 103 |
+
"published_day": 412,
|
| 104 |
+
"state": "resolved",
|
| 105 |
+
"title": "Degraded checkout performance"
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"impact": "minor",
|
| 109 |
+
"linked_incident": 5102,
|
| 110 |
+
"post_id": 7002,
|
| 111 |
+
"published_day": 415,
|
| 112 |
+
"state": "monitoring",
|
| 113 |
+
"title": "Elevated error rates on payments"
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"impact": "major",
|
| 117 |
+
"linked_incident": 5103,
|
| 118 |
+
"post_id": 7003,
|
| 119 |
+
"published_day": 417,
|
| 120 |
+
"state": "resolved",
|
| 121 |
+
"title": "API latency affecting some customers"
|
| 122 |
+
}
|
| 123 |
+
]
|
| 124 |
+
}
|
| 125 |
+
]
|
| 126 |
+
}
|
task_files/dob100-038-port-count-inflight-work/13-approval-and-ownership.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 13 Approval And Ownership
|
| 2 |
+
|
| 3 |
+
## approval_policy (5 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"policy_id": 502,
|
| 9 |
+
"action": "retire_endpoint_with_live_traffic",
|
| 10 |
+
"approver_role": "service-owner",
|
| 11 |
+
"rationale": "drops in-flight customer requests; cannot be undone once clients fail"
|
| 12 |
+
}
|
| 13 |
+
]
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
## owner_spreadsheet (5 rows)
|
| 17 |
+
|
| 18 |
+
```json
|
| 19 |
+
[
|
| 20 |
+
{
|
| 21 |
+
"row_id": 1,
|
| 22 |
+
"service_label": "Checkout (commerce)",
|
| 23 |
+
"owning_team": "Commerce Platform",
|
| 24 |
+
"slack_channel": "#commerce",
|
| 25 |
+
"last_reviewed_day": 340,
|
| 26 |
+
"week_start": "sunday"
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"row_id": 2,
|
| 30 |
+
"service_label": "Payments (commerce)",
|
| 31 |
+
"owning_team": "Commerce Platform",
|
| 32 |
+
"slack_channel": "#commerce",
|
| 33 |
+
"last_reviewed_day": 340,
|
| 34 |
+
"week_start": "sunday"
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"row_id": 3,
|
| 38 |
+
"service_label": "Search (growth)",
|
| 39 |
+
"owning_team": "Discovery Squad",
|
| 40 |
+
"slack_channel": "#growth",
|
| 41 |
+
"last_reviewed_day": 210,
|
| 42 |
+
"week_start": "sunday"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"row_id": 4,
|
| 46 |
+
"service_label": "Gateway (platform)",
|
| 47 |
+
"owning_team": "Edge Team",
|
| 48 |
+
"slack_channel": "#edge",
|
| 49 |
+
"last_reviewed_day": 180,
|
| 50 |
+
"week_start": "sunday"
|
| 51 |
+
}
|
| 52 |
+
]
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## oncall (4 rows)
|
| 56 |
+
|
| 57 |
+
```json
|
| 58 |
+
[
|
| 59 |
+
{
|
| 60 |
+
"team": "platform",
|
| 61 |
+
"engineer": "Priya Nair"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"team": "commerce",
|
| 65 |
+
"engineer": "Diego Ramos"
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"team": "growth",
|
| 69 |
+
"engineer": "Mei Tanaka"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"team": "sre",
|
| 73 |
+
"engineer": "Alex Osei"
|
| 74 |
+
}
|
| 75 |
+
]
|
| 76 |
+
```
|
task_files/dob100-038-port-count-inflight-work/14-tool-contracts.json
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"note": "These are the exact sandbox schemas used by this task; first-party NovaCart tools and vendor-shaped adapters are labeled as such in their descriptions.",
|
| 3 |
+
"tools": [
|
| 4 |
+
{
|
| 5 |
+
"description": "Fetch one ticket by key (e.g. ENG-2101).",
|
| 6 |
+
"json_schema": {
|
| 7 |
+
"description": "Fetch one ticket by key (e.g. ENG-2101).",
|
| 8 |
+
"name": "get_ticket",
|
| 9 |
+
"parameters": {
|
| 10 |
+
"properties": {
|
| 11 |
+
"key": {
|
| 12 |
+
"description": "key",
|
| 13 |
+
"type": "string"
|
| 14 |
+
}
|
| 15 |
+
},
|
| 16 |
+
"required": [
|
| 17 |
+
"key"
|
| 18 |
+
],
|
| 19 |
+
"type": "object"
|
| 20 |
+
}
|
| 21 |
+
},
|
| 22 |
+
"name": "get_ticket",
|
| 23 |
+
"parameters": [
|
| 24 |
+
{
|
| 25 |
+
"default": null,
|
| 26 |
+
"description": "key",
|
| 27 |
+
"name": "key",
|
| 28 |
+
"required": true,
|
| 29 |
+
"type": "str"
|
| 30 |
+
}
|
| 31 |
+
],
|
| 32 |
+
"read_tables": [
|
| 33 |
+
"tickets"
|
| 34 |
+
],
|
| 35 |
+
"return_type": "dict",
|
| 36 |
+
"source_code": "def get_ticket(db_path=None, key=None):\n \"\"\"Fetch one ticket by key (e.g. ENG-2101).\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('get_ticket',)); conn.commit()\n except Exception:\n pass\n if key is None:\n return {'ok': False, 'error': 'missing required parameter: key'}\n row = conn.execute('SELECT * FROM tickets WHERE key=?', (key,)).fetchone()\n if row is None:\n return {'ok': False, 'error': 'no such ticket: ' + str(key)}\n return dict(row)\n finally:\n conn.close()\n",
|
| 37 |
+
"tool_id": "tool_get_ticket",
|
| 38 |
+
"write_tables": []
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"description": "Search Jira issues. Jira status is a per-project workflow, not open/closed: a resolved issue has status='Done' AND a resolution set. Filter by project, status, issue_type, component or priority.",
|
| 42 |
+
"json_schema": {
|
| 43 |
+
"description": "Search Jira issues. Jira status is a per-project workflow, not open/closed: a resolved issue has status='Done' AND a resolution set. Filter by project, status, issue_type, component or priority.",
|
| 44 |
+
"name": "jira_search",
|
| 45 |
+
"parameters": {
|
| 46 |
+
"properties": {
|
| 47 |
+
"component": {
|
| 48 |
+
"description": "component",
|
| 49 |
+
"type": "string"
|
| 50 |
+
},
|
| 51 |
+
"issue_type": {
|
| 52 |
+
"description": "issue_type",
|
| 53 |
+
"type": "string"
|
| 54 |
+
},
|
| 55 |
+
"limit": {
|
| 56 |
+
"description": "limit",
|
| 57 |
+
"type": "integer"
|
| 58 |
+
},
|
| 59 |
+
"project": {
|
| 60 |
+
"description": "project",
|
| 61 |
+
"type": "string"
|
| 62 |
+
},
|
| 63 |
+
"status": {
|
| 64 |
+
"description": "status",
|
| 65 |
+
"type": "string"
|
| 66 |
+
}
|
| 67 |
+
},
|
| 68 |
+
"required": [],
|
| 69 |
+
"type": "object"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"name": "jira_search",
|
| 73 |
+
"parameters": [
|
| 74 |
+
{
|
| 75 |
+
"default": "None",
|
| 76 |
+
"description": "project",
|
| 77 |
+
"name": "project",
|
| 78 |
+
"required": false,
|
| 79 |
+
"type": "str"
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"default": "None",
|
| 83 |
+
"description": "status",
|
| 84 |
+
"name": "status",
|
| 85 |
+
"required": false,
|
| 86 |
+
"type": "str"
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
"default": "None",
|
| 90 |
+
"description": "issue_type",
|
| 91 |
+
"name": "issue_type",
|
| 92 |
+
"required": false,
|
| 93 |
+
"type": "str"
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"default": "None",
|
| 97 |
+
"description": "component",
|
| 98 |
+
"name": "component",
|
| 99 |
+
"required": false,
|
| 100 |
+
"type": "str"
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"default": "50",
|
| 104 |
+
"description": "limit",
|
| 105 |
+
"name": "limit",
|
| 106 |
+
"required": false,
|
| 107 |
+
"type": "int"
|
| 108 |
+
}
|
| 109 |
+
],
|
| 110 |
+
"read_tables": [
|
| 111 |
+
"jira_issues"
|
| 112 |
+
],
|
| 113 |
+
"return_type": "list[dict]",
|
| 114 |
+
"source_code": "def jira_search(db_path=None, project=None, status=None, issue_type=None, component=None, limit=50):\n \"\"\"Search Jira issues. Jira status is a per-project workflow, not open/closed: a resolved issue has status='Done' AND a resolution set. Filter by project, status, issue_type, component or priority.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('jira_search',)); conn.commit()\n except Exception:\n pass\n sql = 'SELECT * FROM jira_issues'\n conds, args = [], []\n for col, val in (('project', project), ('status', status), ('issue_type', issue_type),\n ('component', component)):\n if val:\n conds.append(col + '=?'); args.append(val)\n if conds:\n sql += ' WHERE ' + ' AND '.join(conds)\n return [dict(r) for r in conn.execute(sql + ' ORDER BY key LIMIT ?', args + [int(limit)]).fetchall()]\n finally:\n conn.close()\n",
|
| 115 |
+
"tool_id": "tool_jira_search",
|
| 116 |
+
"write_tables": []
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"description": "Submit the answer to a reconciliation question. `sources` must list every system you actually consulted (e.g. pd_incidents, status_page_posts). `assumptions` is where you record any judgement you had to make - a week boundary, whether rollbacks count, which of two disagreeing numbers you trusted and why. An answer with no stated assumption on an ambiguous question is not a complete answer.",
|
| 120 |
+
"json_schema": {
|
| 121 |
+
"description": "Submit the answer to a reconciliation question. `sources` must list every system you actually consulted (e.g. pd_incidents, status_page_posts). `assumptions` is where you record any judgement you had to make - a week boundary, whether rollbacks count, which of two disagreeing numbers you trusted and why. An answer with no stated assumption on an ambiguous question is not a complete answer.",
|
| 122 |
+
"name": "submit_answer",
|
| 123 |
+
"parameters": {
|
| 124 |
+
"properties": {
|
| 125 |
+
"answer": {
|
| 126 |
+
"description": "answer",
|
| 127 |
+
"type": "string"
|
| 128 |
+
},
|
| 129 |
+
"assumptions": {
|
| 130 |
+
"description": "assumptions",
|
| 131 |
+
"type": "string"
|
| 132 |
+
},
|
| 133 |
+
"question_id": {
|
| 134 |
+
"description": "question_id",
|
| 135 |
+
"type": "string"
|
| 136 |
+
},
|
| 137 |
+
"sources": {
|
| 138 |
+
"description": "systems consulted",
|
| 139 |
+
"items": {
|
| 140 |
+
"type": "string"
|
| 141 |
+
},
|
| 142 |
+
"type": "array"
|
| 143 |
+
}
|
| 144 |
+
},
|
| 145 |
+
"required": [
|
| 146 |
+
"question_id",
|
| 147 |
+
"answer"
|
| 148 |
+
],
|
| 149 |
+
"type": "object"
|
| 150 |
+
}
|
| 151 |
+
},
|
| 152 |
+
"name": "submit_answer",
|
| 153 |
+
"parameters": [
|
| 154 |
+
{
|
| 155 |
+
"default": null,
|
| 156 |
+
"description": "question_id",
|
| 157 |
+
"name": "question_id",
|
| 158 |
+
"required": true,
|
| 159 |
+
"type": "str"
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"default": null,
|
| 163 |
+
"description": "answer",
|
| 164 |
+
"name": "answer",
|
| 165 |
+
"required": true,
|
| 166 |
+
"type": "str"
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"default": "None",
|
| 170 |
+
"description": "systems consulted",
|
| 171 |
+
"name": "sources",
|
| 172 |
+
"required": false,
|
| 173 |
+
"type": "list"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"default": "",
|
| 177 |
+
"description": "assumptions",
|
| 178 |
+
"name": "assumptions",
|
| 179 |
+
"required": false,
|
| 180 |
+
"type": "str"
|
| 181 |
+
}
|
| 182 |
+
],
|
| 183 |
+
"read_tables": [],
|
| 184 |
+
"return_type": "dict",
|
| 185 |
+
"source_code": "def submit_answer(db_path=None, question_id=None, answer=None, sources=None, assumptions=''):\n \"\"\"Submit the answer to a reconciliation question. `sources` must list every system you actually consulted (e.g. pd_incidents, status_page_posts). `assumptions` is where you record any judgement you had to make - a week boundary, whether rollbacks count, which of two disagreeing numbers you trusted and why. An answer with no stated assumption on an ambiguous question is not a complete answer.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('submit_answer',)); conn.commit()\n except Exception:\n pass\n if question_id is None:\n return {'ok': False, 'error': 'missing required parameter: question_id'}\n if answer is None:\n return {'ok': False, 'error': 'missing required parameter: answer'}\n def _audit(conn, _tool, _svc, _detail):\n conn.execute('INSERT INTO audit_events(tool, service, detail) VALUES (?,?,?)', (_tool, _svc, _json.dumps(_detail)))\n if isinstance(sources, str):\n try:\n sources = _json.loads(sources)\n except Exception:\n sources = [x.strip() for x in sources.split(',') if x.strip()]\n sources = sources or []\n if not isinstance(sources, list):\n return {'ok': False, 'error': 'sources must be a list of system names'}\n cur = conn.execute('INSERT INTO answers(question_id, answer, sources, assumptions) '\n 'VALUES (?,?,?,?)',\n (str(question_id), str(answer), _json.dumps(sorted(str(x) for x in sources)),\n str(assumptions or '')))\n _audit(conn, 'submit_answer', '', {'question_id': str(question_id), 'answer': str(answer),\n 'source_count': len(sources)})\n conn.commit()\n return {'ok': True, 'answer_id': cur.lastrowid, 'question_id': str(question_id),\n 'answer': str(answer), 'sources': sorted(str(x) for x in sources)}\n finally:\n conn.close()\n",
|
| 186 |
+
"tool_id": "tool_submit_answer",
|
| 187 |
+
"write_tables": [
|
| 188 |
+
"answers",
|
| 189 |
+
"audit_events"
|
| 190 |
+
]
|
| 191 |
+
},
|
| 192 |
+
{
|
| 193 |
+
"description": "Update a ticket's status and/or assignee.",
|
| 194 |
+
"json_schema": {
|
| 195 |
+
"description": "Update a ticket's status and/or assignee.",
|
| 196 |
+
"name": "update_ticket",
|
| 197 |
+
"parameters": {
|
| 198 |
+
"properties": {
|
| 199 |
+
"assignee": {
|
| 200 |
+
"description": "assignee",
|
| 201 |
+
"type": "string"
|
| 202 |
+
},
|
| 203 |
+
"key": {
|
| 204 |
+
"description": "key",
|
| 205 |
+
"type": "string"
|
| 206 |
+
},
|
| 207 |
+
"status": {
|
| 208 |
+
"description": "open|in_progress|in_review|done",
|
| 209 |
+
"enum": [
|
| 210 |
+
"open",
|
| 211 |
+
"in_progress",
|
| 212 |
+
"in_review",
|
| 213 |
+
"done"
|
| 214 |
+
],
|
| 215 |
+
"type": "string"
|
| 216 |
+
}
|
| 217 |
+
},
|
| 218 |
+
"required": [
|
| 219 |
+
"key"
|
| 220 |
+
],
|
| 221 |
+
"type": "object"
|
| 222 |
+
}
|
| 223 |
+
},
|
| 224 |
+
"name": "update_ticket",
|
| 225 |
+
"parameters": [
|
| 226 |
+
{
|
| 227 |
+
"default": null,
|
| 228 |
+
"description": "key",
|
| 229 |
+
"name": "key",
|
| 230 |
+
"required": true,
|
| 231 |
+
"type": "str"
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"default": "None",
|
| 235 |
+
"description": "open|in_progress|in_review|done",
|
| 236 |
+
"name": "status",
|
| 237 |
+
"required": false,
|
| 238 |
+
"type": "str"
|
| 239 |
+
},
|
| 240 |
+
{
|
| 241 |
+
"default": "None",
|
| 242 |
+
"description": "assignee",
|
| 243 |
+
"name": "assignee",
|
| 244 |
+
"required": false,
|
| 245 |
+
"type": "str"
|
| 246 |
+
}
|
| 247 |
+
],
|
| 248 |
+
"read_tables": [
|
| 249 |
+
"tickets"
|
| 250 |
+
],
|
| 251 |
+
"return_type": "dict",
|
| 252 |
+
"source_code": "def update_ticket(db_path=None, key=None, status=None, assignee=None):\n \"\"\"Update a ticket's status and/or assignee.\"\"\"\n import sqlite3 as _sq\n import json as _json\n if db_path:\n conn = _sq.connect(db_path)\n else:\n conn = get_db()\n conn.row_factory = _sq.Row\n try:\n try:\n conn.execute('INSERT INTO tool_calls(tool) VALUES (?)', ('update_ticket',)); conn.commit()\n except Exception:\n pass\n if key is None:\n return {'ok': False, 'error': 'missing required parameter: key'}\n def _audit(conn, _tool, _svc, _detail):\n conn.execute('INSERT INTO audit_events(tool, service, detail) VALUES (?,?,?)', (_tool, _svc, _json.dumps(_detail)))\n row = conn.execute('SELECT * FROM tickets WHERE key=?', (key,)).fetchone()\n if row is None:\n return {'ok': False, 'error': 'no such ticket: ' + str(key)}\n if status is None and assignee is None:\n return {'ok': False, 'error': 'provide status and/or assignee'}\n if status is not None and status not in ('open', 'in_progress', 'in_review', 'done'):\n return {'ok': False, 'error': 'invalid status: ' + str(status)}\n ns = row['status'] if status is None else status\n na = row['assignee'] if assignee is None else assignee\n conn.execute('UPDATE tickets SET status=?, assignee=? WHERE key=?', (ns, na, key))\n _audit(conn, 'update_ticket', row['service'], {'key': key, 'status': ns})\n conn.commit()\n return {'ok': True, 'key': key, 'status': ns, 'assignee': na}\n finally:\n conn.close()\n",
|
| 253 |
+
"tool_id": "tool_update_ticket",
|
| 254 |
+
"write_tables": [
|
| 255 |
+
"audit_events",
|
| 256 |
+
"tickets"
|
| 257 |
+
]
|
| 258 |
+
}
|
| 259 |
+
]
|
| 260 |
+
}
|
task_files/dob100-039-port-count-unowned-work/01-work-ticket.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 01 Work Ticket
|
| 2 |
+
|
| 3 |
+
## tickets (187 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"ticket_id": 9191,
|
| 9 |
+
"key": "ENG-2810",
|
| 10 |
+
"type": "task",
|
| 11 |
+
"title": "How much unassigned work is still live?",
|
| 12 |
+
"description": "",
|
| 13 |
+
"status": "open",
|
| 14 |
+
"priority": "high",
|
| 15 |
+
"assignee": "",
|
| 16 |
+
"service": ""
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"ticket_id": 9212,
|
| 20 |
+
"key": "SEC-908",
|
| 21 |
+
"type": "security",
|
| 22 |
+
"title": "Rotate the exposed partner API credential",
|
| 23 |
+
"description": "The partner API key was committed to the monorepo, so it must be treated as compromised and rotated in production. Rotation invalidates every existing partner session immediately and cannot be undone - a mistake locks partners out of production until a new key is issued.",
|
| 24 |
+
"status": "open",
|
| 25 |
+
"priority": "critical",
|
| 26 |
+
"assignee": "",
|
| 27 |
+
"service": "checkout"
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
```
|
task_files/dob100-039-port-count-unowned-work/02-service-catalog.csv
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_table,depends_on,description,environment,key,kind,language,name,repo_version,service,service_id,team,tier,value
|
| 2 |
+
services,,"Customer-facing storefront (Next.js): browse, cart, checkout UI.",,,frontend,typescript,storefront-web,v3.2.4,,9001,growth,1,
|
| 3 |
+
services,,"Public API edge: routing, auth, rate limiting, traffic weighting.",,,backend,go,api-gateway,v5.1.0,,9002,platform,1,
|
| 4 |
+
services,,"Product catalog, pricing, and merchandising.",,,backend,python,catalog,v1.9.2,,9003,commerce,2,
|
| 5 |
+
services,,Cart and checkout orchestration.,,,backend,python,checkout,v2.6.3,,9004,commerce,1,
|
| 6 |
+
service_dependencies,api-gateway,,,,http,,,,storefront-web,,,,
|
| 7 |
+
service_dependencies,cdn-edge,,,,cdn,,,,storefront-web,,,,
|
| 8 |
+
service_dependencies,checkout,,,,http,,,,api-gateway,,,,
|
| 9 |
+
service_dependencies,catalog,,,,http,,,,api-gateway,,,,
|
| 10 |
+
env_state,,,staging,ab_test_bucket,config,,,,storefront-web,,,,b
|
| 11 |
+
env_state,,,production,ab_test_bucket,config,,,,storefront-web,,,,b
|
| 12 |
+
env_state,,,staging,bundle_analyzer,config,,,,storefront-web,,,,false
|
| 13 |
+
env_state,,,production,bundle_analyzer,config,,,,storefront-web,,,,false
|
task_files/dob100-039-port-count-unowned-work/03-observability.log
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"environment": "production", "metric": "error_rate_pct", "service": "payments", "source_table": "service_metrics", "value": 4.2}
|
| 2 |
+
{"environment": "production", "metric": "latency_p99_ms", "service": "search", "source_table": "service_metrics", "value": 850.0}
|
| 3 |
+
{"environment": "production", "metric": "error_rate_pct", "service": "checkout", "source_table": "service_metrics", "value": 5.5}
|
| 4 |
+
{"environment": "production", "metric": "latency_p99_ms", "service": "api-gateway", "source_table": "service_metrics", "value": 1030.0}
|
| 5 |
+
{"environment": "production", "level": "ERROR", "log_id": 9010, "message": "ConnectionTimeout calling notifications after 30000ms - request failed permanently (notifications_retry_max_attempts=0, no retry attempted); order marked failed", "service": "payments", "source_table": "logs"}
|
| 6 |
+
{"environment": "production", "level": "ERROR", "log_id": 9011, "message": "ConnectionTimeout calling notifications after 30000ms - request failed permanently (notifications_retry_max_attempts=0, no retry attempted); order marked failed", "service": "payments", "source_table": "logs"}
|
| 7 |
+
{"environment": "production", "level": "INFO", "log_id": 9012, "message": "startup config: notifications_retry_max_attempts=0 notifications_timeout_ms=30000 db_pool_size=20", "service": "payments", "source_table": "logs"}
|
| 8 |
+
{"environment": "production", "level": "WARN", "log_id": 9013, "message": "query cache disabled (cache_enabled=false); every request is hitting the primary index", "service": "search", "source_table": "logs"}
|
| 9 |
+
{"culprit": "src/payments/notify_client.py in send_receipt", "event_id": 1, "events": 18422, "fingerprint": "pay-timeout-01", "service": "payments", "source_table": "error_events", "status": "unresolved", "title": "ConnectionTimeout: notifications call exceeded 30000ms"}
|
| 10 |
+
{"culprit": "src/checkout/refunds.py in instant_refund", "event_id": 2, "events": 9310, "fingerprint": "chk-nil-refund", "service": "checkout", "source_table": "error_events", "status": "unresolved", "title": "TypeError: NoneType has no attribute 'amount'"}
|
| 11 |
+
{"culprit": "internal/proxy/pool.go in Acquire", "event_id": 3, "events": 24187, "fingerprint": "gw-pool-exhaust", "service": "api-gateway", "source_table": "error_events", "status": "unresolved", "title": "dial tcp: connection pool exhausted"}
|
| 12 |
+
{"culprit": "StockRepository.reserve", "event_id": 4, "events": 7740, "fingerprint": "inv-pool-wait", "service": "inventory", "source_table": "error_events", "status": "unresolved", "title": "SQLTimeoutException: connection wait timeout"}
|
| 13 |
+
{"counter_reset": 0, "day": 418, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 1, "source_table": "prom_series", "value": 138.0}
|
| 14 |
+
{"counter_reset": 0, "day": 419, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 2, "source_table": "prom_series", "value": 141.0}
|
| 15 |
+
{"counter_reset": 0, "day": 420, "label_env": "production", "label_service": "checkout_service", "metric": "http_requests_total:rate5m", "series_id": 3, "source_table": "prom_series", "value": 139.0}
|
| 16 |
+
{"counter_reset": 0, "day": 418, "label_env": "production", "label_service": "checkout_service", "metric": "http_errors_total:rate5m", "series_id": 4, "source_table": "prom_series", "value": 7.6}
|
| 17 |
+
{"events": 2317, "first_seen_day": 410, "issue_id": "CHECKOUT-1A", "last_seen_day": 420, "level": "error", "project_slug": "checkout-web", "source_table": "sentry_issues", "status": "unresolved", "title": "TypeError: NoneType has no attribute 'amount'", "users_affected": 890}
|
| 18 |
+
{"events": 1904, "first_seen_day": 409, "issue_id": "CHECKOUT-2B", "last_seen_day": 420, "level": "error", "project_slug": "checkout-web", "source_table": "sentry_issues", "status": "unresolved", "title": "TimeoutError: payments call exceeded 8000ms", "users_affected": 1502}
|
| 19 |
+
{"events": 18422, "first_seen_day": 405, "issue_id": "PAY-9C", "last_seen_day": 420, "level": "error", "project_slug": "payments-backend", "source_table": "sentry_issues", "status": "unresolved", "title": "ConnectionTimeout: notifications call exceeded 30000ms", "users_affected": 6210}
|
| 20 |
+
{"events": 640, "first_seen_day": 414, "issue_id": "SRCH-3D", "last_seen_day": 419, "level": "warning", "project_slug": "search", "source_table": "sentry_issues", "status": "resolved", "title": "IndexRefreshTimeout", "users_affected": 210}
|
task_files/dob100-039-port-count-unowned-work/04-incident-room.json
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"incident_id",
|
| 6 |
+
"severity",
|
| 7 |
+
"title",
|
| 8 |
+
"service",
|
| 9 |
+
"status",
|
| 10 |
+
"commander"
|
| 11 |
+
],
|
| 12 |
+
"row_count": 3,
|
| 13 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 14 |
+
"table": "incidents",
|
| 15 |
+
"task_relevant_rows": [
|
| 16 |
+
{
|
| 17 |
+
"commander": "",
|
| 18 |
+
"incident_id": 9701,
|
| 19 |
+
"service": "api-gateway",
|
| 20 |
+
"severity": "sev1",
|
| 21 |
+
"status": "open",
|
| 22 |
+
"title": "API gateway latency surge after v5.1.0 rollout"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"commander": "",
|
| 26 |
+
"incident_id": 9702,
|
| 27 |
+
"service": "checkout",
|
| 28 |
+
"severity": "sev2",
|
| 29 |
+
"status": "open",
|
| 30 |
+
"title": "Checkout error spike since instant_refunds ramp"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"commander": "",
|
| 34 |
+
"incident_id": 9703,
|
| 35 |
+
"service": "inventory",
|
| 36 |
+
"severity": "sev2",
|
| 37 |
+
"status": "open",
|
| 38 |
+
"title": "Inventory reservation failures during peak"
|
| 39 |
+
}
|
| 40 |
+
]
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"columns": [
|
| 44 |
+
"alert_id",
|
| 45 |
+
"service",
|
| 46 |
+
"metric",
|
| 47 |
+
"severity",
|
| 48 |
+
"status",
|
| 49 |
+
"message"
|
| 50 |
+
],
|
| 51 |
+
"row_count": 10,
|
| 52 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 53 |
+
"table": "alerts",
|
| 54 |
+
"task_relevant_rows": [
|
| 55 |
+
{
|
| 56 |
+
"alert_id": 9601,
|
| 57 |
+
"message": "payments error_rate_pct 4.2 exceeds SLO 1.0",
|
| 58 |
+
"metric": "error_rate_pct",
|
| 59 |
+
"service": "payments",
|
| 60 |
+
"severity": "high",
|
| 61 |
+
"status": "firing"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"alert_id": 9602,
|
| 65 |
+
"message": "search latency_p99_ms 850.0 exceeds SLO 300.0",
|
| 66 |
+
"metric": "latency_p99_ms",
|
| 67 |
+
"service": "search",
|
| 68 |
+
"severity": "medium",
|
| 69 |
+
"status": "firing"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"alert_id": 9603,
|
| 73 |
+
"message": "checkout error_rate_pct 5.5 exceeds SLO 1.0",
|
| 74 |
+
"metric": "error_rate_pct",
|
| 75 |
+
"service": "checkout",
|
| 76 |
+
"severity": "high",
|
| 77 |
+
"status": "firing"
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"alert_id": 9604,
|
| 81 |
+
"message": "api-gateway latency_p99_ms 1030.0 exceeds SLO 250.0",
|
| 82 |
+
"metric": "latency_p99_ms",
|
| 83 |
+
"service": "api-gateway",
|
| 84 |
+
"severity": "critical",
|
| 85 |
+
"status": "firing"
|
| 86 |
+
}
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"columns": [
|
| 91 |
+
"incident_number",
|
| 92 |
+
"title",
|
| 93 |
+
"pd_service_id",
|
| 94 |
+
"urgency",
|
| 95 |
+
"priority",
|
| 96 |
+
"status",
|
| 97 |
+
"created_day",
|
| 98 |
+
"resolved_day"
|
| 99 |
+
],
|
| 100 |
+
"row_count": 7,
|
| 101 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 102 |
+
"table": "pd_incidents",
|
| 103 |
+
"task_relevant_rows": [
|
| 104 |
+
{
|
| 105 |
+
"created_day": 411,
|
| 106 |
+
"incident_number": 5101,
|
| 107 |
+
"pd_service_id": "PSVC001",
|
| 108 |
+
"priority": "P2",
|
| 109 |
+
"resolved_day": 412,
|
| 110 |
+
"status": "resolved",
|
| 111 |
+
"title": "Elevated checkout latency",
|
| 112 |
+
"urgency": "high"
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
"created_day": 414,
|
| 116 |
+
"incident_number": 5102,
|
| 117 |
+
"pd_service_id": "PSVC002",
|
| 118 |
+
"priority": "P1",
|
| 119 |
+
"resolved_day": null,
|
| 120 |
+
"status": "triggered",
|
| 121 |
+
"title": "Payments error rate above SLO",
|
| 122 |
+
"urgency": "high"
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"created_day": 416,
|
| 126 |
+
"incident_number": 5103,
|
| 127 |
+
"pd_service_id": "PSVC003",
|
| 128 |
+
"priority": "P1",
|
| 129 |
+
"resolved_day": null,
|
| 130 |
+
"status": "acknowledged",
|
| 131 |
+
"title": "Gateway latency surge after release",
|
| 132 |
+
"urgency": "high"
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"created_day": 414,
|
| 136 |
+
"incident_number": 5104,
|
| 137 |
+
"pd_service_id": "PSVC004",
|
| 138 |
+
"priority": "P4",
|
| 139 |
+
"resolved_day": 415,
|
| 140 |
+
"status": "resolved",
|
| 141 |
+
"title": "Search index refresh lag",
|
| 142 |
+
"urgency": "low"
|
| 143 |
+
}
|
| 144 |
+
]
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"columns": [
|
| 148 |
+
"pd_service_id",
|
| 149 |
+
"name",
|
| 150 |
+
"escalation_policy",
|
| 151 |
+
"status"
|
| 152 |
+
],
|
| 153 |
+
"row_count": 5,
|
| 154 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 155 |
+
"table": "pd_services",
|
| 156 |
+
"task_relevant_rows": [
|
| 157 |
+
{
|
| 158 |
+
"escalation_policy": "EP-Commerce",
|
| 159 |
+
"name": "checkout-api",
|
| 160 |
+
"pd_service_id": "PSVC001",
|
| 161 |
+
"status": "active"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"escalation_policy": "EP-Commerce",
|
| 165 |
+
"name": "payments-api",
|
| 166 |
+
"pd_service_id": "PSVC002",
|
| 167 |
+
"status": "active"
|
| 168 |
+
},
|
| 169 |
+
{
|
| 170 |
+
"escalation_policy": "EP-Platform",
|
| 171 |
+
"name": "edge-gateway",
|
| 172 |
+
"pd_service_id": "PSVC003",
|
| 173 |
+
"status": "active"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"escalation_policy": "EP-Growth",
|
| 177 |
+
"name": "search-svc",
|
| 178 |
+
"pd_service_id": "PSVC004",
|
| 179 |
+
"status": "active"
|
| 180 |
+
}
|
| 181 |
+
]
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"columns": [
|
| 185 |
+
"schedule_id",
|
| 186 |
+
"schedule_name",
|
| 187 |
+
"escalation_policy",
|
| 188 |
+
"user_name",
|
| 189 |
+
"day"
|
| 190 |
+
],
|
| 191 |
+
"row_count": 4,
|
| 192 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 193 |
+
"table": "pd_oncall",
|
| 194 |
+
"task_relevant_rows": [
|
| 195 |
+
{
|
| 196 |
+
"day": 418,
|
| 197 |
+
"escalation_policy": "EP-Commerce",
|
| 198 |
+
"schedule_id": "SCHED-COM",
|
| 199 |
+
"schedule_name": "Commerce primary",
|
| 200 |
+
"user_name": "Diego Ramos"
|
| 201 |
+
},
|
| 202 |
+
{
|
| 203 |
+
"day": 419,
|
| 204 |
+
"escalation_policy": "EP-Commerce",
|
| 205 |
+
"schedule_id": "SCHED-COM",
|
| 206 |
+
"schedule_name": "Commerce primary",
|
| 207 |
+
"user_name": "Diego Ramos"
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"day": 419,
|
| 211 |
+
"escalation_policy": "EP-Platform",
|
| 212 |
+
"schedule_id": "SCHED-PLT",
|
| 213 |
+
"schedule_name": "Platform primary",
|
| 214 |
+
"user_name": "Priya Nair"
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
"day": 419,
|
| 218 |
+
"escalation_policy": "EP-Growth",
|
| 219 |
+
"schedule_id": "SCHED-GRW",
|
| 220 |
+
"schedule_name": "Growth primary",
|
| 221 |
+
"user_name": "Mei Tanaka"
|
| 222 |
+
}
|
| 223 |
+
]
|
| 224 |
+
}
|
| 225 |
+
]
|
| 226 |
+
}
|
task_files/dob100-039-port-count-unowned-work/05-deployment-state.json
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"deployment_id",
|
| 6 |
+
"service",
|
| 7 |
+
"environment",
|
| 8 |
+
"version",
|
| 9 |
+
"status",
|
| 10 |
+
"canary_percent"
|
| 11 |
+
],
|
| 12 |
+
"row_count": 22,
|
| 13 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 14 |
+
"table": "deployments",
|
| 15 |
+
"task_relevant_rows": [
|
| 16 |
+
{
|
| 17 |
+
"canary_percent": 100,
|
| 18 |
+
"deployment_id": 9251,
|
| 19 |
+
"environment": "staging",
|
| 20 |
+
"service": "storefront-web",
|
| 21 |
+
"status": "succeeded",
|
| 22 |
+
"version": "v3.2.4"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"canary_percent": 100,
|
| 26 |
+
"deployment_id": 9252,
|
| 27 |
+
"environment": "production",
|
| 28 |
+
"service": "storefront-web",
|
| 29 |
+
"status": "succeeded",
|
| 30 |
+
"version": "v3.2.4"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"canary_percent": 100,
|
| 34 |
+
"deployment_id": 9253,
|
| 35 |
+
"environment": "staging",
|
| 36 |
+
"service": "api-gateway",
|
| 37 |
+
"status": "succeeded",
|
| 38 |
+
"version": "v5.0.9"
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"canary_percent": 100,
|
| 42 |
+
"deployment_id": 9254,
|
| 43 |
+
"environment": "production",
|
| 44 |
+
"service": "api-gateway",
|
| 45 |
+
"status": "succeeded",
|
| 46 |
+
"version": "v5.0.9"
|
| 47 |
+
}
|
| 48 |
+
]
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"columns": [
|
| 52 |
+
"route_id",
|
| 53 |
+
"service",
|
| 54 |
+
"route",
|
| 55 |
+
"rps",
|
| 56 |
+
"share_pct"
|
| 57 |
+
],
|
| 58 |
+
"row_count": 13,
|
| 59 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 60 |
+
"table": "traffic_profile",
|
| 61 |
+
"task_relevant_rows": [
|
| 62 |
+
{
|
| 63 |
+
"route": "GET /",
|
| 64 |
+
"route_id": 9201,
|
| 65 |
+
"rps": 420,
|
| 66 |
+
"service": "storefront-web",
|
| 67 |
+
"share_pct": 100
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"route": "GET /product/:id",
|
| 71 |
+
"route_id": 9202,
|
| 72 |
+
"rps": 310,
|
| 73 |
+
"service": "storefront-web",
|
| 74 |
+
"share_pct": 100
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"route": "POST /v1/orders",
|
| 78 |
+
"route_id": 9203,
|
| 79 |
+
"rps": 145,
|
| 80 |
+
"service": "api-gateway",
|
| 81 |
+
"share_pct": 100
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"route": "POST /v2/orders",
|
| 85 |
+
"route_id": 9204,
|
| 86 |
+
"rps": 0,
|
| 87 |
+
"service": "api-gateway",
|
| 88 |
+
"share_pct": 0
|
| 89 |
+
}
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"columns": [
|
| 94 |
+
"service",
|
| 95 |
+
"desired_replicas",
|
| 96 |
+
"ready_replicas",
|
| 97 |
+
"strategy",
|
| 98 |
+
"storage_class"
|
| 99 |
+
],
|
| 100 |
+
"row_count": 10,
|
| 101 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 102 |
+
"table": "k8s_deployments",
|
| 103 |
+
"task_relevant_rows": [
|
| 104 |
+
{
|
| 105 |
+
"desired_replicas": 2,
|
| 106 |
+
"ready_replicas": 1,
|
| 107 |
+
"service": "analytics-worker",
|
| 108 |
+
"storage_class": "standard",
|
| 109 |
+
"strategy": "RollingUpdate"
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"desired_replicas": 3,
|
| 113 |
+
"ready_replicas": 3,
|
| 114 |
+
"service": "api-gateway",
|
| 115 |
+
"storage_class": "standard",
|
| 116 |
+
"strategy": "RollingUpdate"
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"desired_replicas": 3,
|
| 120 |
+
"ready_replicas": 3,
|
| 121 |
+
"service": "catalog",
|
| 122 |
+
"storage_class": "standard",
|
| 123 |
+
"strategy": "RollingUpdate"
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"desired_replicas": 64,
|
| 127 |
+
"ready_replicas": 6,
|
| 128 |
+
"service": "checkout",
|
| 129 |
+
"storage_class": "standard",
|
| 130 |
+
"strategy": "RollingUpdate"
|
| 131 |
+
}
|
| 132 |
+
]
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"columns": [
|
| 136 |
+
"pod",
|
| 137 |
+
"namespace",
|
| 138 |
+
"service",
|
| 139 |
+
"image_tag",
|
| 140 |
+
"phase",
|
| 141 |
+
"restarts",
|
| 142 |
+
"memory_limit_mb",
|
| 143 |
+
"memory_usage_mb",
|
| 144 |
+
"node",
|
| 145 |
+
"pending_reason"
|
| 146 |
+
],
|
| 147 |
+
"row_count": 14,
|
| 148 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 149 |
+
"table": "k8s_pods",
|
| 150 |
+
"task_relevant_rows": [
|
| 151 |
+
{
|
| 152 |
+
"image_tag": "v2.1.7",
|
| 153 |
+
"memory_limit_mb": 512,
|
| 154 |
+
"memory_usage_mb": 511,
|
| 155 |
+
"namespace": "production",
|
| 156 |
+
"node": "node-a1",
|
| 157 |
+
"pending_reason": "",
|
| 158 |
+
"phase": "CrashLoopBackOff",
|
| 159 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 160 |
+
"restarts": 47,
|
| 161 |
+
"service": "analytics-worker"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"image_tag": "v2.1.7",
|
| 165 |
+
"memory_limit_mb": 512,
|
| 166 |
+
"memory_usage_mb": 498,
|
| 167 |
+
"namespace": "production",
|
| 168 |
+
"node": "node-a1",
|
| 169 |
+
"pending_reason": "",
|
| 170 |
+
"phase": "Running",
|
| 171 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 172 |
+
"restarts": 39,
|
| 173 |
+
"service": "analytics-worker"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"image_tag": "v2.6.3",
|
| 177 |
+
"memory_limit_mb": 2048,
|
| 178 |
+
"memory_usage_mb": 890,
|
| 179 |
+
"namespace": "production",
|
| 180 |
+
"node": "node-a1",
|
| 181 |
+
"pending_reason": "",
|
| 182 |
+
"phase": "Running",
|
| 183 |
+
"pod": "checkout-5b8c-aa10",
|
| 184 |
+
"restarts": 0,
|
| 185 |
+
"service": "checkout"
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"image_tag": "v2.7.0",
|
| 189 |
+
"memory_limit_mb": 2048,
|
| 190 |
+
"memory_usage_mb": 1120,
|
| 191 |
+
"namespace": "production",
|
| 192 |
+
"node": "node-a2",
|
| 193 |
+
"pending_reason": "",
|
| 194 |
+
"phase": "Running",
|
| 195 |
+
"pod": "payments-6c1d-bb22",
|
| 196 |
+
"restarts": 0,
|
| 197 |
+
"service": "payments"
|
| 198 |
+
}
|
| 199 |
+
]
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"columns": [
|
| 203 |
+
"event_id",
|
| 204 |
+
"namespace",
|
| 205 |
+
"pod",
|
| 206 |
+
"reason",
|
| 207 |
+
"message",
|
| 208 |
+
"count",
|
| 209 |
+
"day"
|
| 210 |
+
],
|
| 211 |
+
"row_count": 8,
|
| 212 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 213 |
+
"table": "k8s_events",
|
| 214 |
+
"task_relevant_rows": [
|
| 215 |
+
{
|
| 216 |
+
"count": 47,
|
| 217 |
+
"day": 419,
|
| 218 |
+
"event_id": 9001,
|
| 219 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 220 |
+
"namespace": "production",
|
| 221 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 222 |
+
"reason": "OOMKilled"
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"count": 47,
|
| 226 |
+
"day": 419,
|
| 227 |
+
"event_id": 9002,
|
| 228 |
+
"message": "Back-off restarting failed container analytics",
|
| 229 |
+
"namespace": "production",
|
| 230 |
+
"pod": "analytics-worker-7d9f-x2k1",
|
| 231 |
+
"reason": "CrashLoopBackOff"
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"count": 39,
|
| 235 |
+
"day": 420,
|
| 236 |
+
"event_id": 9003,
|
| 237 |
+
"message": "Container analytics exceeded its memory limit of 512Mi and was killed",
|
| 238 |
+
"namespace": "production",
|
| 239 |
+
"pod": "analytics-worker-7d9f-m4p8",
|
| 240 |
+
"reason": "OOMKilled"
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"count": 1,
|
| 244 |
+
"day": 417,
|
| 245 |
+
"event_id": 9004,
|
| 246 |
+
"message": "Stopping container gateway for rollout",
|
| 247 |
+
"namespace": "production",
|
| 248 |
+
"pod": "api-gateway-9f2e-cc33",
|
| 249 |
+
"reason": "Killing"
|
| 250 |
+
}
|
| 251 |
+
]
|
| 252 |
+
}
|
| 253 |
+
]
|
| 254 |
+
}
|
task_files/dob100-039-port-count-unowned-work/06-repository-context.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"content": "// Package proxy manages upstream connections for the API gateway.\n//\n// Rewritten in v5.1.0: every route now gets its own transport so per-route TLS\n// material and per-route timeouts are honoured.\npackage proxy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/novacart/api-gateway/internal/config\"\n\t\"github.com/novacart/api-gateway/internal/log\"\n)\n\nconst (\n\tdialTimeout = 2 * time.Second\n\tidleConnTimeout = 90 * time.Second\n\tmaxIdlePerHost = 64\n\thealthCheckEvery = 15 * time.Second\n)\n\n// Conn wraps a transport dedicated to a single upstream.\ntype Conn struct {\n\tUpstream string\n\tTransport *http.Transport\n\tclient *http.Client\n\tdone chan struct{}\n\tcreatedAt time.Time\n}\n\n// Pool hands out upstream connections.\ntype Pool struct {\n\tcfg *config.Upstreams\n\tinFlight int64\n}\n\nfunc NewPool(cfg *config.Upstreams) *Pool { return &Pool{cfg: cfg} }\n\n// Acquire builds a connection for the given upstream. Building a transport is\n// cheap, so v5.1.0 does it per request rather than keeping long-lived ones.\nfunc (p *Pool) Acquire(ctx context.Context, upstream string) (*Conn, error) {\n\tif upstream == \"\" {\n\t\treturn nil, fmt.Errorf(\"proxy: empty upstream\")\n\t}\n\tatomic.AddInt64(&p.inFlight, 1)\n\n\ttransport := &http.Transport{\n\t\tDialContext: (&net.Dialer{Timeout: dialTimeout}).DialContext,\n\t\tTLSClientConfig: p.cfg.TLSFor(upstream),\n\t\tMaxIdleConnsPerHost: maxIdlePerHost,\n\t\tIdleConnTimeout: idleConnTimeout,\n\t}\n\n\tc := &Conn{Upstream: upstream, Transport: transport, done: make(chan struct{}),\n\t\tclient: &http.Client{Transport: transport}, createdAt: time.Now()}\n\n\t// Watchdog: keep probing this upstream for as long as the connection lives.\n\tgo func() {\n\t\tticker := time.NewTicker(healthCheckEvery)\n\t\tdefer ticker.Stop()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ticker.C:\n\t\t\t\tp.probe(c)\n\t\t\tcase <-c.done:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\tlog.Debugf(\"acquired upstream=%s in_flight=%d\", upstream, atomic.LoadInt64(&p.inFlight))\n\treturn c, nil\n}\n\n// Release closes the transport and stops the watchdog goroutine.\n//\n// NOTE: the v5.1.0 rewrite dropped the call to Release from Do -- the handler\n// returns as soon as it has the response. Nothing else calls it, so every\n// request leaves behind an idle transport plus a live watchdog goroutine.\nfunc (p *Pool) Release(c *Conn) {\n\tclose(c.done)\n\tc.Transport.CloseIdleConnections()\n\tatomic.AddInt64(&p.inFlight, -1)\n\tlog.Debugf(\"released upstream=%s age=%s\", c.Upstream, time.Since(c.createdAt))\n}\n\nfunc (p *Pool) probe(c *Conn) {\n\treq, _ := http.NewRequest(http.MethodHead, \"http://\"+c.Upstream+\"/healthz\", nil)\n\tif resp, err := c.client.Do(req); err == nil {\n\t\t_ = resp.Body.Close()\n\t}\n}\n\n// Do proxies a single request to the named upstream.\nfunc (p *Pool) Do(ctx context.Context, upstream string, req *http.Request) (*http.Response, error) {\n\tc, err := p.Acquire(ctx, upstream)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"acquire %s: %w\", upstream, err)\n\t}\n\n\tresp, err := c.client.Do(req.WithContext(ctx))\n\tif err != nil {\n\t\tlog.Errorf(\"upstream=%s request failed: %v\", upstream, err)\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}\n", "file_id": 25, "language": "go", "loc": 111, "owner": "Priya Nair", "path": "internal/proxy/pool.go", "service": "api-gateway", "source_table": "repo_files"}
|
| 2 |
+
{"additions": 214, "author": "Priya Nair", "commit_id": 1, "day": 1, "deletions": 0, "files": "internal/router/routes.go,internal/config/config.go", "message": "api-gateway: initial edge skeleton with healthz and access log", "service": "api-gateway", "sha": "3f8a1c2", "source_table": "commits"}
|
| 3 |
+
{"additions": 96, "author": "Sam Whitfield", "commit_id": 2, "day": 2, "deletions": 0, "files": "src/catalog/models.py", "message": "catalog: define Product and Money value objects", "service": "catalog", "sha": "9d41b07", "source_table": "commits"}
|
| 4 |
+
{"additions": 74, "author": "Nina Kowalski", "commit_id": 3, "day": 3, "deletions": 0, "files": "src/checkout/config.py", "message": "checkout: bootstrap service package and settings module", "service": "checkout", "sha": "c72e5a9", "source_table": "commits"}
|
| 5 |
+
{"additions": 131, "author": "Diego Ramos", "commit_id": 4, "day": 4, "deletions": 0, "files": "src/payments/capture.py", "message": "payments: wire libpayproc client and capture happy path", "service": "payments", "sha": "18be6d4", "source_table": "commits"}
|
| 6 |
+
{"author": "Priya Nair", "body": "Perf: new upstream pool.", "merged_version": "v5.1.0", "number": 9201, "service": "api-gateway", "source_table": "pull_requests", "status": "merged", "ticket_key": "", "title": "Connection pool rewrite"}
|
| 7 |
+
{"author": "Diego Ramos", "body": "Draft, do not merge yet.", "merged_version": "", "number": 9202, "service": "catalog", "source_table": "pull_requests", "status": "open", "ticket_key": "", "title": "Price rounding cleanup"}
|
task_files/dob100-039-port-count-unowned-work/07-ci-and-tests.csv
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
source_table,detail,exercise_id,func,hidden_tests,name,path,pr_number,quarantined,run_id,service,spec,stage,stage_id,starter,status,suite,test_id,visible_tests
|
| 2 |
+
ci_runs,all checks passed,,,,,,9201,,1,api-gateway,,,,,passed,,,
|
| 3 |
+
ci_runs,intermittent failure: test_checkout_idempotency (rerun may pass),,,,,,,,2,checkout,,,,,failed,,,
|
| 4 |
+
ci_runs,all checks passed,,,,,,,,3,checkout,,,,,passed,,,
|
| 5 |
+
ci_runs,all checks passed,,,,,,,,4,payments,,,,,passed,,,
|
| 6 |
+
ci_stages,ok,,,,,,,,1,,,build,1,,passed,,,
|
| 7 |
+
ci_stages,ok,,,,,,,,1,,,unit,2,,passed,,,
|
| 8 |
+
ci_stages,ok,,,,,,,,1,,,integration,3,,passed,,,
|
| 9 |
+
ci_stages,ok,,,,,,,,1,,,regression,4,,passed,,,
|
| 10 |
+
tests_catalog,,,,,test_cart_totals,,,0,,checkout,,,,,passing,unit,9901,
|
| 11 |
+
tests_catalog,,,,,test_checkout_idempotency,,,0,,checkout,,,,,flaky,integration,9902,
|
| 12 |
+
tests_catalog,,,,,test_capture_retries,,,0,,payments,,,,,passing,unit,9903,
|
| 13 |
+
tests_catalog,,,,,test_ranking,,,0,,search,,,,,passing,unit,9904,
|
| 14 |
+
code_exercises,,9401,next_delay_ms,"[[""attempt 1 is base_ms, not double"", ""assert next_delay_ms(1, 100, 10000) == 100""], [""the cap is a ceiling on the value"", ""assert next_delay_ms(9, 100, 5000) == 5000""], [""the cap applies at the boundary"", ""assert next_delay_ms(6, 100, 3200) == 3200""], [""attempt below 1 is not a retry"", ""try:\n next_delay_ms(0, 100, 10000)\nexcept ValueError:\n pass\nelse:\n raise AssertionError('attempt 0 must raise ValueError')""]]",,src/payments/backoff.py,,,,payments,"Implement next_delay_ms(attempt, base_ms, max_ms).
|
| 15 |
+
|
| 16 |
+
Retries are numbered from 1: the delay before the FIRST retry is attempt=1.
|
| 17 |
+
The delay doubles with each attempt - base_ms for attempt 1, twice that for
|
| 18 |
+
attempt 2, four times for attempt 3 - and is capped at max_ms. The cap is a
|
| 19 |
+
ceiling on the returned value, not on the exponent.
|
| 20 |
+
|
| 21 |
+
attempt < 1 is not a retry and must raise ValueError.",,,"""""""Backoff schedule for the payments retry path.""""""
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def next_delay_ms(attempt, base_ms, max_ms):
|
| 25 |
+
""""""Delay before retry number `attempt`, capped at max_ms.""""""
|
| 26 |
+
raise NotImplementedError
|
| 27 |
+
",,,,"[[""the delay doubles"", ""assert next_delay_ms(3, 100, 10000) == 2 * next_delay_ms(2, 100, 10000)""], [""delays are positive"", ""assert next_delay_ms(2, 100, 10000) > 0""]]"
|
| 28 |
+
code_exercises,,9402,chunk,"[[""empty input produces no groups"", ""assert chunk([], 3) == []""], [""an exact multiple has no trailing empty group"", ""assert chunk([1, 2, 3, 4], 2) == [[1, 2], [3, 4]]""], [""order is preserved"", ""assert chunk(['a', 'b', 'c'], 1) == [['a'], ['b'], ['c']]""], [""a size below 1 is meaningless"", ""for bad in (0, -1):\n try:\n chunk([1, 2], bad)\n except ValueError:\n pass\n else:\n raise AssertionError('size %r must raise ValueError' % bad)""], [""an iterator is accepted, not just a list"", ""assert chunk(iter([1, 2, 3]), 2) == [[1, 2], [3]]""]]",,src/payments/chunking.py,,,,payments,"Implement chunk(items, size) returning a list of lists.
|
| 29 |
+
|
| 30 |
+
Settlement batches a day's captures so one long-tailed merchant cannot stall
|
| 31 |
+
the run. Split `items` into consecutive groups of at most `size`, preserving
|
| 32 |
+
order. The final group may be shorter. An empty input produces no groups at
|
| 33 |
+
all - not one empty group. A size below 1 is meaningless and must raise
|
| 34 |
+
ValueError.
|
| 35 |
+
|
| 36 |
+
`items` is whatever captures.list_settlable() returned, which is any iterable
|
| 37 |
+
and is sometimes a one-pass generator, so do not assume it can be indexed or
|
| 38 |
+
measured with len().",,,"""""""Batch chunking for nightly settlement.""""""
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def chunk(items, size):
|
| 42 |
+
""""""Split items into consecutive groups of at most `size`.""""""
|
| 43 |
+
raise NotImplementedError
|
| 44 |
+
",,,,"[[""splits with a remainder"", ""assert chunk([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]""]]"
|
| 45 |
+
code_exercises,,9403,cache_key,"[[""insertion order does not matter"", ""a = {}\na['q'] = 'shoes'\na['page'] = 1\nb = {}\nb['page'] = 1\nb['q'] = 'shoes'\nassert cache_key(a) == cache_key(b)""], [""different values differ"", ""assert cache_key({'q': 'shoes'}) != cache_key({'q': 'boots'})""], [""an explicit None is not an absent key"", ""assert cache_key({'q': 'shoes', 'filter': None}) != cache_key({'q': 'shoes'})""], [""keys and values cannot run together"", ""assert cache_key({'a': 'xb', 'b': ''}) != cache_key({'a': 'x', 'bb': ''})""]]",,src/search/cache_key.py,,,,search,"Implement cache_key(params) returning a string.
|
| 46 |
+
|
| 47 |
+
The search result cache is keyed on the query parameters. Two calls with the
|
| 48 |
+
same parameters must produce the same key regardless of the order the keys
|
| 49 |
+
were inserted into the dict, because callers build them in different orders
|
| 50 |
+
and a mismatch silently halves the hit rate.
|
| 51 |
+
|
| 52 |
+
Different parameters must produce different keys. A parameter explicitly set
|
| 53 |
+
to None is not the same request as one that was never supplied. Values may be
|
| 54 |
+
strings, numbers, booleans or None.",,,"""""""Cache key derivation for the search result cache.""""""
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def cache_key(params):
|
| 58 |
+
""""""A stable key for a parameter dict.""""""
|
| 59 |
+
raise NotImplementedError
|
| 60 |
+
",,,,"[[""identical dicts agree"", ""assert cache_key({'q': 'shoes', 'page': 1}) == cache_key({'q': 'shoes', 'page': 1})""]]"
|
| 61 |
+
code_exercises,,9404,TokenBucket,"[[""partial time is not discarded"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(500)\nassert b.allow(1000)""], [""the bucket never exceeds capacity"", ""b = TokenBucket(2, 100)\nassert b.allow(0) and b.allow(0)\nassert b.allow(10000) and b.allow(10000)\nassert not b.allow(10000)""], [""a backwards clock grants nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)""], [""a backwards clock does not wedge the bucket"", ""b = TokenBucket(1, 1)\nassert b.allow(5000)\nassert not b.allow(1000)\nassert b.allow(2000)""], [""a refused request consumes nothing"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nfor _ in range(5):\n assert not b.allow(0)\nassert b.allow(1000)""]]",,src/gateway/token_bucket.py,,,,api-gateway,"Implement class TokenBucket(capacity, refill_per_sec) with one method,
|
| 62 |
+
allow(now_ms), returning True if a request may proceed and False otherwise.
|
| 63 |
+
|
| 64 |
+
A bucket starts full. Each allowed request consumes exactly one token; a
|
| 65 |
+
refused request consumes none. Tokens refill continuously at refill_per_sec
|
| 66 |
+
and the bucket never holds more than capacity.
|
| 67 |
+
|
| 68 |
+
Refill is continuous, not stepwise: two calls 500ms apart at 1 token/sec must
|
| 69 |
+
together restore one whole token, so partial time must not be discarded. The
|
| 70 |
+
first call establishes the clock and refills nothing.
|
| 71 |
+
|
| 72 |
+
now_ms comes from a wall clock that is occasionally stepped backwards by NTP.
|
| 73 |
+
A backwards jump must never grant tokens and must never make the bucket
|
| 74 |
+
permanently unable to refill: treat time as not having advanced, and take the
|
| 75 |
+
new reading as the current clock.",,,"""""""Per-client rate limiting at the API gateway edge.""""""
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
class TokenBucket:
|
| 79 |
+
def __init__(self, capacity, refill_per_sec):
|
| 80 |
+
raise NotImplementedError
|
| 81 |
+
|
| 82 |
+
def allow(self, now_ms):
|
| 83 |
+
""""""True if a request may proceed, consuming one token.""""""
|
| 84 |
+
raise NotImplementedError
|
| 85 |
+
",,,,"[[""a full bucket allows up to capacity"", ""b = TokenBucket(2, 1)\nassert b.allow(0) and b.allow(0) and not b.allow(0)""], [""waiting restores a token"", ""b = TokenBucket(1, 1)\nassert b.allow(0)\nassert not b.allow(0)\nassert b.allow(1000)""]]"
|
task_files/dob100-039-port-count-unowned-work/08-data-change-controls.sql
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
-- migrations: {"environment": "staging", "migration_id": 1, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 2 |
+
-- migrations: {"environment": "production", "migration_id": 2, "name": "0041_settlement_batches", "service": "payments", "status": "applied"}
|
| 3 |
+
-- migrations: {"environment": "staging", "migration_id": 3, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 4 |
+
-- migrations: {"environment": "production", "migration_id": 4, "name": "0087_cart_line_discounts", "service": "checkout", "status": "applied"}
|
| 5 |
+
-- migration_requirements: {"migration_name": "0088_loyalty_ledger", "module": "loyalty_redeem", "req_id": 9151, "service": "checkout"}
|
| 6 |
+
-- migration_requirements: {"migration_name": "0123_loyalty_points", "module": "loyalty_accrual", "req_id": 9152, "service": "catalog"}
|
| 7 |
+
-- migration_requirements: {"migration_name": "0042_settlement_splits", "module": "split_settlement", "req_id": 9153, "service": "payments"}
|
| 8 |
+
-- migration_requirements: {"migration_name": "0034_backorders", "module": "backorder_queue", "req_id": 9154, "service": "inventory"}
|
| 9 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9901, "note": "", "role": "payments_rw", "service": "payments", "state": "active"}
|
| 10 |
+
-- db_grants: {"changed_day": 390, "component": "pg-primary", "grant_id": 9902, "note": "", "role": "checkout_rw", "service": "checkout", "state": "active"}
|
| 11 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9903, "note": "", "role": "catalog_ro", "service": "catalog", "state": "active"}
|
| 12 |
+
-- db_grants: {"changed_day": 390, "component": "pg-replica", "grant_id": 9904, "note": "", "role": "search_ro", "service": "search", "state": "active"}
|
task_files/dob100-039-port-count-unowned-work/09-feature-and-security.yaml
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"flag_id",
|
| 6 |
+
"key",
|
| 7 |
+
"service",
|
| 8 |
+
"description",
|
| 9 |
+
"environment",
|
| 10 |
+
"enabled",
|
| 11 |
+
"rollout_percent"
|
| 12 |
+
],
|
| 13 |
+
"row_count": 8,
|
| 14 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 15 |
+
"table": "feature_flags",
|
| 16 |
+
"task_relevant_rows": [
|
| 17 |
+
{
|
| 18 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 19 |
+
"enabled": 1,
|
| 20 |
+
"environment": "production",
|
| 21 |
+
"flag_id": 9301,
|
| 22 |
+
"key": "instant_refunds",
|
| 23 |
+
"rollout_percent": 100,
|
| 24 |
+
"service": "checkout"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"description": "Pilot: refund immediately at checkout instead of async batch.",
|
| 28 |
+
"enabled": 1,
|
| 29 |
+
"environment": "staging",
|
| 30 |
+
"flag_id": 9302,
|
| 31 |
+
"key": "instant_refunds",
|
| 32 |
+
"rollout_percent": 100,
|
| 33 |
+
"service": "checkout"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"description": "Redesigned search results page.",
|
| 37 |
+
"enabled": 0,
|
| 38 |
+
"environment": "production",
|
| 39 |
+
"flag_id": 9303,
|
| 40 |
+
"key": "new_search_ui",
|
| 41 |
+
"rollout_percent": 0,
|
| 42 |
+
"service": "search"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"description": "Redesigned search results page.",
|
| 46 |
+
"enabled": 1,
|
| 47 |
+
"environment": "staging",
|
| 48 |
+
"flag_id": 9304,
|
| 49 |
+
"key": "new_search_ui",
|
| 50 |
+
"rollout_percent": 100,
|
| 51 |
+
"service": "search"
|
| 52 |
+
}
|
| 53 |
+
]
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"columns": [
|
| 57 |
+
"vuln_id",
|
| 58 |
+
"cve",
|
| 59 |
+
"package",
|
| 60 |
+
"service",
|
| 61 |
+
"severity",
|
| 62 |
+
"fixed_version",
|
| 63 |
+
"status"
|
| 64 |
+
],
|
| 65 |
+
"row_count": 4,
|
| 66 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 67 |
+
"table": "vulnerabilities",
|
| 68 |
+
"task_relevant_rows": [
|
| 69 |
+
{
|
| 70 |
+
"cve": "CVE-2026-31337",
|
| 71 |
+
"fixed_version": "2.4.0",
|
| 72 |
+
"package": "libpayproc",
|
| 73 |
+
"service": "payments",
|
| 74 |
+
"severity": "critical",
|
| 75 |
+
"status": "open",
|
| 76 |
+
"vuln_id": 9801
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"cve": "CVE-2026-40881",
|
| 80 |
+
"fixed_version": "11.4.0",
|
| 81 |
+
"package": "stripe-sdk",
|
| 82 |
+
"service": "checkout",
|
| 83 |
+
"severity": "high",
|
| 84 |
+
"status": "open",
|
| 85 |
+
"vuln_id": 9802
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"cve": "CVE-2026-22190",
|
| 89 |
+
"fixed_version": "2.11.0",
|
| 90 |
+
"package": "pydantic",
|
| 91 |
+
"service": "catalog",
|
| 92 |
+
"severity": "medium",
|
| 93 |
+
"status": "remediated",
|
| 94 |
+
"vuln_id": 9803
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"cve": "CVE-2026-51002",
|
| 98 |
+
"fixed_version": "2.33.0",
|
| 99 |
+
"package": "requests",
|
| 100 |
+
"service": "payments",
|
| 101 |
+
"severity": "high",
|
| 102 |
+
"status": "open",
|
| 103 |
+
"vuln_id": 9804
|
| 104 |
+
}
|
| 105 |
+
]
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"columns": [
|
| 109 |
+
"rule_id",
|
| 110 |
+
"name",
|
| 111 |
+
"service_label",
|
| 112 |
+
"expr",
|
| 113 |
+
"severity",
|
| 114 |
+
"group_by",
|
| 115 |
+
"routes_to"
|
| 116 |
+
],
|
| 117 |
+
"row_count": 5,
|
| 118 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 119 |
+
"table": "alert_rules",
|
| 120 |
+
"task_relevant_rows": [
|
| 121 |
+
{
|
| 122 |
+
"expr": "histogram_quantile(0.99, gateway_latency) > 250",
|
| 123 |
+
"group_by": "service",
|
| 124 |
+
"name": "GatewayHighLatency",
|
| 125 |
+
"routes_to": "EP-Platform",
|
| 126 |
+
"rule_id": 601,
|
| 127 |
+
"service_label": "gateway_service",
|
| 128 |
+
"severity": "critical"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"expr": "rate(gateway_errors[5m]) > 0.01",
|
| 132 |
+
"group_by": "service",
|
| 133 |
+
"name": "GatewayErrorRate",
|
| 134 |
+
"routes_to": "EP-Platform",
|
| 135 |
+
"rule_id": 602,
|
| 136 |
+
"service_label": "gateway_service",
|
| 137 |
+
"severity": "high"
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"expr": "avg(latency) by (cluster) > 400",
|
| 141 |
+
"group_by": "cluster",
|
| 142 |
+
"name": "ClusterWideLatency",
|
| 143 |
+
"routes_to": "EP-Platform",
|
| 144 |
+
"rule_id": 603,
|
| 145 |
+
"service_label": "",
|
| 146 |
+
"severity": "critical"
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"expr": "cache_hit_ratio{tier=\"gateway-edge\"} < 0.8",
|
| 150 |
+
"group_by": "service",
|
| 151 |
+
"name": "EdgeCacheHitRate",
|
| 152 |
+
"routes_to": "EP-Platform",
|
| 153 |
+
"rule_id": 604,
|
| 154 |
+
"service_label": "edge_cache_service",
|
| 155 |
+
"severity": "medium"
|
| 156 |
+
}
|
| 157 |
+
]
|
| 158 |
+
},
|
| 159 |
+
{
|
| 160 |
+
"columns": [
|
| 161 |
+
"silence_id",
|
| 162 |
+
"matcher",
|
| 163 |
+
"created_by",
|
| 164 |
+
"reason",
|
| 165 |
+
"expires_day"
|
| 166 |
+
],
|
| 167 |
+
"row_count": 1,
|
| 168 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 169 |
+
"table": "alert_silences",
|
| 170 |
+
"task_relevant_rows": [
|
| 171 |
+
{
|
| 172 |
+
"created_by": "Sam Whitfield",
|
| 173 |
+
"expires_day": 402,
|
| 174 |
+
"matcher": "alertname=\"EdgeCacheHitRate\"",
|
| 175 |
+
"reason": "muted during the CDN migration, never lifted",
|
| 176 |
+
"silence_id": 801
|
| 177 |
+
}
|
| 178 |
+
]
|
| 179 |
+
}
|
| 180 |
+
]
|
| 181 |
+
}
|
task_files/dob100-039-port-count-unowned-work/10-vendor-trackers.json
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"key",
|
| 6 |
+
"project",
|
| 7 |
+
"summary",
|
| 8 |
+
"issue_type",
|
| 9 |
+
"status",
|
| 10 |
+
"resolution",
|
| 11 |
+
"priority",
|
| 12 |
+
"component",
|
| 13 |
+
"assignee",
|
| 14 |
+
"created_day",
|
| 15 |
+
"updated_day"
|
| 16 |
+
],
|
| 17 |
+
"row_count": 11,
|
| 18 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 19 |
+
"table": "jira_issues",
|
| 20 |
+
"task_relevant_rows": [
|
| 21 |
+
{
|
| 22 |
+
"assignee": "Diego Ramos",
|
| 23 |
+
"component": "payments",
|
| 24 |
+
"created_day": 402,
|
| 25 |
+
"issue_type": "Bug",
|
| 26 |
+
"key": "ENG-3002",
|
| 27 |
+
"priority": "High",
|
| 28 |
+
"project": "ENG",
|
| 29 |
+
"resolution": "Fixed",
|
| 30 |
+
"status": "Done",
|
| 31 |
+
"summary": "Duplicate charge on retried payment",
|
| 32 |
+
"updated_day": 409
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"assignee": "",
|
| 36 |
+
"component": "checkout",
|
| 37 |
+
"created_day": 396,
|
| 38 |
+
"issue_type": "Bug",
|
| 39 |
+
"key": "ENG-3004",
|
| 40 |
+
"priority": "Low",
|
| 41 |
+
"project": "ENG",
|
| 42 |
+
"resolution": "Won't Do",
|
| 43 |
+
"status": "Done",
|
| 44 |
+
"summary": "Cart total rounds incorrectly for multi-currency",
|
| 45 |
+
"updated_day": 404
|
| 46 |
+
}
|
| 47 |
+
]
|
| 48 |
+
},
|
| 49 |
+
{
|
| 50 |
+
"columns": [
|
| 51 |
+
"identifier",
|
| 52 |
+
"team",
|
| 53 |
+
"title",
|
| 54 |
+
"state",
|
| 55 |
+
"priority",
|
| 56 |
+
"label",
|
| 57 |
+
"created_day"
|
| 58 |
+
],
|
| 59 |
+
"row_count": 4,
|
| 60 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 61 |
+
"table": "linear_issues",
|
| 62 |
+
"task_relevant_rows": [
|
| 63 |
+
{
|
| 64 |
+
"created_day": 411,
|
| 65 |
+
"identifier": "GRW-88",
|
| 66 |
+
"label": "bug",
|
| 67 |
+
"priority": 1,
|
| 68 |
+
"state": "In Progress",
|
| 69 |
+
"team": "Growth",
|
| 70 |
+
"title": "Checkout slow at peak \u2014 customers dropping off"
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"created_day": 408,
|
| 74 |
+
"identifier": "GRW-91",
|
| 75 |
+
"label": "bug",
|
| 76 |
+
"priority": 3,
|
| 77 |
+
"state": "Todo",
|
| 78 |
+
"team": "Growth",
|
| 79 |
+
"title": "Search shows stale products after reindex"
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"created_day": 417,
|
| 83 |
+
"identifier": "GRW-95",
|
| 84 |
+
"label": "bug",
|
| 85 |
+
"priority": 4,
|
| 86 |
+
"state": "Todo",
|
| 87 |
+
"team": "Growth",
|
| 88 |
+
"title": "Autocomplete flickers on slow connections"
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"created_day": 416,
|
| 92 |
+
"identifier": "GRW-97",
|
| 93 |
+
"label": "bug,performance",
|
| 94 |
+
"priority": 2,
|
| 95 |
+
"state": "In Progress",
|
| 96 |
+
"team": "Growth",
|
| 97 |
+
"title": "Product images load from origin, not CDN"
|
| 98 |
+
}
|
| 99 |
+
]
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"columns": [
|
| 103 |
+
"number",
|
| 104 |
+
"repo",
|
| 105 |
+
"title",
|
| 106 |
+
"state",
|
| 107 |
+
"labels",
|
| 108 |
+
"created_day"
|
| 109 |
+
],
|
| 110 |
+
"row_count": 28,
|
| 111 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 112 |
+
"table": "github_issues",
|
| 113 |
+
"task_relevant_rows": [
|
| 114 |
+
{
|
| 115 |
+
"created_day": 396,
|
| 116 |
+
"labels": "bug",
|
| 117 |
+
"number": 4404,
|
| 118 |
+
"repo": "novacart/storefront",
|
| 119 |
+
"state": "closed",
|
| 120 |
+
"title": "Rate limiter allows bursts above the configured ceiling"
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"created_day": 403,
|
| 124 |
+
"labels": "bug,priority",
|
| 125 |
+
"number": 4407,
|
| 126 |
+
"repo": "novacart/platform",
|
| 127 |
+
"state": "open",
|
| 128 |
+
"title": "Refund webhook retried indefinitely on 4xx"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"created_day": 410,
|
| 132 |
+
"labels": "bug,customer-report",
|
| 133 |
+
"number": 4409,
|
| 134 |
+
"repo": "novacart/commerce",
|
| 135 |
+
"state": "open",
|
| 136 |
+
"title": "Dark mode toggle resets on navigation"
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"created_day": 417,
|
| 140 |
+
"labels": "enhancement",
|
| 141 |
+
"number": 4411,
|
| 142 |
+
"repo": "novacart/growth",
|
| 143 |
+
"state": "open",
|
| 144 |
+
"title": "Checkout page hangs before redirect"
|
| 145 |
+
}
|
| 146 |
+
]
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"columns": [
|
| 150 |
+
"source",
|
| 151 |
+
"target",
|
| 152 |
+
"kind"
|
| 153 |
+
],
|
| 154 |
+
"row_count": 4,
|
| 155 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 156 |
+
"table": "issue_links",
|
| 157 |
+
"task_relevant_rows": [
|
| 158 |
+
{
|
| 159 |
+
"kind": "duplicates",
|
| 160 |
+
"source": "ENG-3001",
|
| 161 |
+
"target": "GRW-88"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"kind": "duplicates",
|
| 165 |
+
"source": "ENG-3001",
|
| 166 |
+
"target": "4412"
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"kind": "duplicates",
|
| 170 |
+
"source": "ENG-3003",
|
| 171 |
+
"target": "GRW-91"
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"kind": "duplicates",
|
| 175 |
+
"source": "ENG-3003",
|
| 176 |
+
"target": "4402"
|
| 177 |
+
}
|
| 178 |
+
]
|
| 179 |
+
}
|
| 180 |
+
]
|
| 181 |
+
}
|
task_files/dob100-039-port-count-unowned-work/11-knowledge-base.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 11 Knowledge Base
|
| 2 |
+
|
| 3 |
+
## documents (30 rows)
|
| 4 |
+
|
| 5 |
+
```json
|
| 6 |
+
[
|
| 7 |
+
{
|
| 8 |
+
"doc_id": 9612,
|
| 9 |
+
"kind": "runbook",
|
| 10 |
+
"title": "Queue consumer tuning",
|
| 11 |
+
"service": "notifications",
|
| 12 |
+
"author": "Priya Nair",
|
| 13 |
+
"day": 226,
|
| 14 |
+
"body": "# Queue consumer tuning\n\nOwner: platform. Primary consumer service: `notifications` (tier 2), which\ndrains the email, SMS, and push delivery queues. The same rules apply to any\nservice that consumes from the message broker.\n\n## The rule\n\n`prefetch_count` must be a **bounded** value. **Recommended: 50.**\n\n`prefetch_count=0` means **unlimited prefetch** and is the single worst setting\nin this runbook.\n\n## What prefetch does\n\nPrefetch is the number of unacknowledged messages the broker will push to a\nsingle consumer. With `prefetch_count=50`, a consumer holds at most 50\nin-flight messages; the broker will not send a 51st until one is acknowledged.\nThis is the backpressure mechanism - it is what lets a slow consumer tell the\nbroker to slow down.\n\nWith `prefetch_count=0` there is no backpressure. The broker pushes the entire\nbacklog to whichever consumer connects first. Consequences, all of which we have\nseen in `notifications`:\n\n- **Memory pressure.** A 400k-message backlog lands in one process's heap. RSS\n climbs until the container hits its memory limit.\n- **Consumer restarts.** The container is OOM-killed, the unacknowledged\n messages are redelivered, the restarted consumer grabs them all again, and it\n is killed again. A restart loop that looks like a broker problem and is not.\n- **Terrible load distribution.** One consumer holds everything while its\n siblings sit idle, so scaling out does nothing.\n- **Head-of-line latency.** A high-priority message sits behind 400k others.\n\n## Sizing\n\n| Message profile | prefetch_count |\n| ------------------------------ | -------------- |\n| Fast, uniform (a few ms each) | 100-200 |\n| Standard delivery work | **50** |\n| Slow or variable (seconds) | 5-10 |\n| Long-running jobs (minutes) | 1 |\n\nRule of thumb: `prefetch_count` should be roughly the number of messages a\nconsumer can process in one to two seconds. Start at 50 and adjust with\nevidence.\n\n## Related settings\n\n- `smtp_pool` on `notifications` bounds concurrent SMTP connections. Prefetch\n above the SMTP concurrency just buys queueing inside the process.\n- Ack **after** the work is done, never on receipt. Acking on receipt turns a\n crash into silent message loss.\n- Dead-letter after 5 delivery attempts so a poison message cannot loop forever.\n\n## Changing it\n\nRepo config: PR with a `config` change, CI, merge, staging, production.\n`notifications` is tier 2 - straight 100% deploy after staging. Watch consumer\nmemory and queue depth for one full peak after the change.\n"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"doc_id": 9614,
|
| 18 |
+
"kind": "design_doc",
|
| 19 |
+
"title": "Checkout architecture",
|
| 20 |
+
"service": "checkout",
|
| 21 |
+
"author": "Diego Ramos",
|
| 22 |
+
"day": 198,
|
| 23 |
+
"body": "# Checkout architecture\n\nService: `checkout` (tier 1, python, commerce). Owns the cart and the checkout\norchestration state machine. SLOs: `error_rate_pct < 1.0`,\n`latency_p99_ms < 400`.\n\n## Responsibilities\n\n`checkout` owns the transition from \"a cart exists\" to \"an order exists and is\npaid\". It does not own money movement (that is `payments`), product data (that\nis `catalog`), or customer notification (that is `notifications`). It owns the\nsequencing and the guarantee that the sequence happens exactly once.\n\nModules: `cart`, `checkout_flow`, and - once the loyalty program ships -\n`loyalty_redeem`.\n\n## The state machine\n\nEvery checkout session is a row with an explicit state:\n\n```\ncart_open -> pricing_locked -> payment_pending -> paid -> order_created\n | |\n +-> abandoned +-> payment_failed\n```\n\nTransitions are append-only and each is stamped with the idempotency key of the\nrequest that caused it. Replaying a request that has already produced a\ntransition returns the existing result rather than performing it again. This is\nwhat makes the checkout endpoint safe to retry, which matters because clients\nretry aggressively on mobile networks.\n\n## Dependencies\n\n| Downstream | Call | Timeout budget |\n| --------------- | ------------------------ | ------------------------- |\n| `catalog` | price and availability | `<= 2000ms`, 3 attempts |\n| `payments` | authorize and capture | `payment_timeout_ms` |\n| `notifications` | order confirmation | async, fire-and-forget |\n\nAll synchronous calls follow the \"Retry and timeout standard\": three attempts,\ntimeout at or below 2000ms. The `notifications` call is deliberately\nasynchronous - a confirmation email must never be able to fail an order.\n\n## Pricing lock\n\nAt `pricing_locked` we snapshot the price, the promotion, and the tax\ncomputation into the session row. From that point the customer pays the price\nthey were shown even if `catalog` changes underneath. The lock expires after 20\nminutes, after which the session re-prices.\n\n## Failure handling\n\n- `payments` timeout: the session stays `payment_pending` and a reconciliation\n job asks `payments` for the authoritative status. We never assume a timeout\n means \"did not happen\".\n- `catalog` unavailable: fail closed. We do not sell at a guessed price.\n- Partial capture: not supported; a capture is all-or-nothing per order.\n\n## Feature flags\n\nCheckout-adjacent behavior ships behind flags - `instant_refunds`,\n`express_checkout`. Per the \"Feature flags\" runbook, the code deploys first and\nthe flag is enabled afterwards at no more than 10%. `instant_refunds` is the\ncautionary tale: ramped to 100% in production, it took `error_rate_pct` from\n0.3% to 5.5% via a nil-pointer panic in the refund worker.\n\n## Open questions\n\n- Should the pricing lock move into `catalog` so `search` can honor it too?\n- Cart merge on login is still last-write-wins; it should be a real merge.\n"
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"doc_id": 9617,
|
| 27 |
+
"kind": "design_doc",
|
| 28 |
+
"title": "Loyalty points program",
|
| 29 |
+
"service": "",
|
| 30 |
+
"author": "Diego Ramos",
|
| 31 |
+
"day": 288,
|
| 32 |
+
"body": "# Loyalty points program\n\nCross-service feature spanning `catalog`, `checkout`, and `storefront-web`.\nCustomers earn points on purchases and redeem them for order discounts.\n\n## Modules and ownership\n\n| Module | Service | Responsibility |\n| ----------------- | ----------------- | ------------------------------------- |\n| `loyalty_accrual` | `catalog` | Points-earning rules per product |\n| `loyalty_redeem` | `checkout` | Applying points as an order discount |\n| `loyalty_widget` | `storefront-web` | Balance display and redeem affordance |\n\nEach module ships in **its own PR against its own service**. There is no shared\nlibrary; the contract between them is the points-rate field on the product\npayload and the redeem call on the checkout API.\n\n## Why this split\n\nAccrual rules are product data - they vary per product and per category, they\nchange with merchandising campaigns, and they belong next to pricing. Redemption\nis an order-level money decision and belongs in the checkout state machine.\nDisplay is display. Putting accrual in `checkout` would have meant `checkout`\nreading the product rules table, which is exactly the coupling we spent last\nyear removing.\n\n## Rollout order\n\nDeployment order matters and is not negotiable:\n\n**`catalog` - then `checkout` - then `storefront-web`.**\n\nThe reasoning is a strict data dependency chain:\n\n1. `catalog` must be emitting a points rate on the product payload before\n `checkout` can compute a balance to redeem against. If `checkout` ships\n first, every redeem attempt reads a missing field and either errors or\n silently computes zero.\n2. `checkout` must expose the redeem endpoint and be live before\n `storefront-web` renders a redeem button. If the widget ships first,\n customers see a button that 404s - a visible, embarrassing failure on the\n busiest page we have.\n\n`catalog` is tier 2 (straight production deploy after staging). `checkout` and\n`storefront-web` are tier 1, so each is staging-first, then a production canary\nat `canary_percent <= 25`, `assess_canary`, then `promote_canary` - see\n\"Deployment policy\". Do not begin the next service's production deploy until the\nprevious one is fully promoted.\n\n## Points model\n\nBalances live in an append-only ledger, mirroring the approach in \"Payments\nsettlement pipeline\": `earn`, `redeem`, `expire`, `adjust`. Balance is the sum,\nnever a stored counter. Redemption is authorized at `pricing_locked` and\ncommitted at `paid`; an abandoned cart releases the hold after 20 minutes.\n\nDefault rate is 1 point per whole currency unit, 100 points equals one currency\nunit of discount, points expire 12 months after earning. Maximum redemption is\n50% of order subtotal.\n\n## Risks\n\n- Double-redeem across concurrent sessions. Mitigated by the hold and by the\n idempotency key on the checkout transition.\n- Accrual rule changes retroactively altering historical balances. The ledger\n stamps the rate version at earn time.\n"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"doc_id": 9622,
|
| 36 |
+
"kind": "postmortem",
|
| 37 |
+
"title": "Postmortem: search cache stampede after index rebuild",
|
| 38 |
+
"service": "search",
|
| 39 |
+
"author": "Mei Tanaka",
|
| 40 |
+
"day": 183,
|
| 41 |
+
"body": "# Postmortem: search cache stampede after index rebuild\n\n**Severity:** sev2\n**Service:** `search`\n**Duration:** 34 minutes of degraded search\n**Author:** Mei Tanaka\n**Status:** action items complete\n\n## Summary\n\nA planned index rebuild swapped the search index alias at a moderate traffic\nhour. The alias swap invalidated the entire query cache. Every in-flight query\nmissed simultaneously and hit the primary index, driving `latency_p99_ms` from\n~210ms to a peak of 2100ms and firing the `search latency_p99_ms` alert against\nits 300ms SLO. Search was slow, not down; conversion on search-originated\nsessions dropped an estimated 18% for the duration.\n\n## Timeline (UTC)\n\n- **14:02** Engineer starts a full index rebuild for an analyzer change. Routine;\n done a dozen times before.\n- **14:41** Rebuild completes. Alias swaps to the new index. Query cache keys are\n namespaced by index generation, so the swap invalidates 100% of the cache.\n- **14:42** `latency_p99_ms` crosses 300ms. Alert fires, `medium`.\n- **14:44** On-call acknowledges. Initial hypothesis: the new analyzer is slow.\n- **14:51** Index CPU is pegged; per-query cost is unchanged from before the\n rebuild. Hypothesis discarded - it is volume, not per-query cost.\n- **14:58** Cache hit ratio confirmed at 3%, against a normal 76%. Root cause\n identified.\n- **15:06** Traffic to search temporarily shed at the gateway by 30% to let the\n cache refill.\n- **15:16** Hit ratio back above 60%; p99 at 340ms and falling.\n- **15:22** Shedding removed. p99 at 215ms.\n- **15:26** Alert resolved, incident resolved, update posted in `#incidents`.\n\n## Root cause\n\nThe query cache is namespaced by index generation. An alias swap therefore\nperforms a **complete, instantaneous cache flush** with no warm-up. Because the\ncache normally absorbs about **75% of index load**, the index was asked to serve\nroughly 4x its steady-state query volume within one second. Requests queued,\nlatency rose, clients retried, and the retries added load - a classic stampede\nwith a positive feedback loop.\n\n## Contributing factors\n\n- No warm-up step in the rebuild procedure. The runbook ended at \"swap alias\".\n- Rebuild was run at 14:00 local, in the daily traffic ramp, because the job\n takes 40 minutes and nobody wanted to babysit it at night.\n- Single-flight coalescing existed for identical concurrent queries but the\n stampede was across *thousands of distinct* queries, so coalescing did nothing.\n- No alert on cache hit ratio, so the actual signal was invisible for 14 minutes.\n\n## What went well\n\n- Alerting fired within a minute of the SLO breach.\n- Load shedding at the gateway was the correct blunt instrument and worked.\n\n## Action items\n\n1. Add a **warm-up phase** to the rebuild: replay the top 5000 queries against\n the new index before swapping the alias. **Done.**\n2. Add **+/-10% TTL jitter** to `cache_ttl_s=300` so natural expiry never\n synchronizes. **Done.**\n3. Alert on **cache hit ratio below 50%** for 5 minutes. **Done.**\n4. Move scheduled rebuilds to 03:00-05:00 UTC. **Done.**\n5. Document the stampede risk in the \"Search caching\" runbook. **Done.**\n"
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"doc_id": 9623,
|
| 45 |
+
"kind": "postmortem",
|
| 46 |
+
"title": "Postmortem: catalog migration 0043 forced a rollback",
|
| 47 |
+
"service": "catalog",
|
| 48 |
+
"author": "Diego Ramos",
|
| 49 |
+
"day": 202,
|
| 50 |
+
"body": "# Postmortem: catalog migration 0043 forced a rollback\n\n**Severity:** sev1\n**Service:** `catalog` (with knock-on impact to `checkout` and `storefront-web`)\n**Duration:** 22 minutes of failed product-detail pages\n**Author:** Diego Ramos\n**Status:** action items complete\n\n## Summary\n\nMigration `0043_rename_price_column` renamed `catalog_products.price_cents` to\n`price_minor_units` in a single step, and the matching code version `v1.8.0` was\ndeployed immediately after. The migration was applied to production before the\ndeploy, as policy requires - but the migration was **not backwards compatible**\nwith the code version already running. Between the migration completing and the\nnew version being fully rolled out, the running `v1.7.6` instances queried a\ncolumn that no longer existed. Product-detail and category pages returned 500s;\n`checkout` fell back to failing closed on pricing, per its design.\n\n## Timeline (UTC)\n\n- **09:12** `apply_migration(catalog, production, 0043)` starts.\n- **09:13** Migration completes. Column renamed.\n- **09:13** `v1.7.6` instances begin throwing\n `UndefinedColumn: price_cents` on every pricing query.\n- **09:14** `catalog` error rate goes vertical. `checkout` starts failing closed.\n Two alerts fire.\n- **09:15** Deploy of `v1.8.0` starts, as planned, but rolls instance by instance.\n- **09:17** On-call acknowledges, declares sev1.\n- **09:19** Commander recognizes the pattern: schema ahead of code, partial fleet.\n- **09:21** Decision: do **not** attempt to reverse the migration. Accelerate the\n `v1.8.0` rollout instead.\n- **09:31** Rollout complete on all instances. Errors stop.\n- **09:34** Metrics confirmed recovered; alerts resolved; incident resolved.\n- **09:40** Update posted in `#incidents`; status page updated and cleared.\n- Later that day: `v1.8.0` was rolled back for an unrelated defect found in\n review, which is when the second lesson landed - the rolled-back `v1.7.6` code\n could not read the renamed column either, and a hotfix `v1.8.1` had to be cut\n because **migrations are forward-only** and there was no going back.\n\n## Root cause\n\nA **destructive, non-backwards-compatible schema change shipped in one step**. A\ncolumn rename is two incompatible states with no overlap: code that knows the old\nname and code that knows the new name cannot both work against the same schema.\nAny window in which both code versions run - and a rolling deploy guarantees such\na window - is an outage.\n\n## Contributing factors\n\n- The \"migration before code\" rule was followed correctly, and following it\n correctly was *insufficient*. The rule says nothing about compatibility with\n the code already running.\n- The migration had one reviewer, from the authoring team.\n- Rolling deploys were assumed to be fast enough not to matter. They are not.\n- `catalog` is tier 2, so there was no canary to catch it at 25%.\n\n## What went well\n\n- Nobody tried to hand-write a reverse migration under pressure. Rolling forward\n was the right call and it was made in six minutes.\n- `checkout` failing closed on pricing prevented selling at a wrong price.\n\n## Action items\n\n1. Write the **N-1 rule** into the \"Database migration policy\": every migration\n must leave the schema usable by the currently deployed code. **Done.**\n2. Mandate the **expand/contract** pattern for renames: add column, dual-write,\n backfill, switch reads, drop in a later migration. **Done.**\n3. Require a **second reviewer from platform** for migrations on tables above ten\n million rows. **Done.**\n4. Add a CI check that flags `DROP COLUMN`, `RENAME COLUMN`, and new `NOT NULL`\n constraints for explicit sign-off. **Done.**\n"
|
| 51 |
+
}
|
| 52 |
+
]
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## confluence_pages (4 rows)
|
| 56 |
+
|
| 57 |
+
```json
|
| 58 |
+
[
|
| 59 |
+
{
|
| 60 |
+
"page_id": 8001,
|
| 61 |
+
"space": "ENG",
|
| 62 |
+
"title": "Checkout Platform \u2014 architecture",
|
| 63 |
+
"body": "Checkout Platform is owned by the Commerce Platform team. It calls payments and inventory synchronously. Escalate via #commerce.",
|
| 64 |
+
"last_updated_day": 372,
|
| 65 |
+
"stale": 0
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"page_id": 8002,
|
| 69 |
+
"space": "ENG",
|
| 70 |
+
"title": "Gateway runbook (legacy)",
|
| 71 |
+
"body": "The Edge Team owns the gateway. Page the Edge Team rota for any 5xx spike. Restart procedure targets host gw-prod-03.",
|
| 72 |
+
"last_updated_day": 181,
|
| 73 |
+
"stale": 1
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"page_id": 8003,
|
| 77 |
+
"space": "ENG",
|
| 78 |
+
"title": "Weekly reporting conventions",
|
| 79 |
+
"body": "Engineering weekly reports run Monday to Sunday, ISO-8601 week numbering, in UTC. Note that the service-owner spreadsheet uses a Sunday start and will disagree by one day at the boundary.",
|
| 80 |
+
"last_updated_day": 401,
|
| 81 |
+
"stale": 0
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"page_id": 8004,
|
| 85 |
+
"space": "ENG",
|
| 86 |
+
"title": "Incident severity ladder",
|
| 87 |
+
"body": "P1 = customer-facing outage, P2 = degraded customer experience, P3 = internal only, P4 = cosmetic. Customer-facing status is recorded on the public status page, not on the incident.",
|
| 88 |
+
"last_updated_day": 395,
|
| 89 |
+
"stale": 0
|
| 90 |
+
}
|
| 91 |
+
]
|
| 92 |
+
```
|
task_files/dob100-039-port-count-unowned-work/12-chat-and-status.json
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sources": [
|
| 3 |
+
{
|
| 4 |
+
"columns": [
|
| 5 |
+
"message_id",
|
| 6 |
+
"channel",
|
| 7 |
+
"author",
|
| 8 |
+
"body"
|
| 9 |
+
],
|
| 10 |
+
"row_count": 6,
|
| 11 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 12 |
+
"table": "messages",
|
| 13 |
+
"task_relevant_rows": [
|
| 14 |
+
{
|
| 15 |
+
"author": "Priya Nair",
|
| 16 |
+
"body": "Declared incident 9701 (sev1): api-gateway p99 through the roof since the v5.1.0 promote.",
|
| 17 |
+
"channel": "#incidents",
|
| 18 |
+
"message_id": 1
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"author": "Diego Ramos",
|
| 22 |
+
"body": "Incident 9702 (sev2): checkout error rate tracks the instant_refunds ramp exactly.",
|
| 23 |
+
"channel": "#incidents",
|
| 24 |
+
"message_id": 2
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"author": "Alex Osei",
|
| 28 |
+
"body": "Incident 9703 (sev2): inventory reservations timing out at peak; pool looks undersized.",
|
| 29 |
+
"channel": "#incidents",
|
| 30 |
+
"message_id": 3
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"author": "Mei Tanaka",
|
| 34 |
+
"body": "Reminder: deployment policy = staging first; tier-1 canary at 25% then promote.",
|
| 35 |
+
"channel": "#eng",
|
| 36 |
+
"message_id": 4
|
| 37 |
+
}
|
| 38 |
+
]
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"columns": [
|
| 42 |
+
"channel",
|
| 43 |
+
"purpose"
|
| 44 |
+
],
|
| 45 |
+
"row_count": 4,
|
| 46 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 47 |
+
"table": "channels",
|
| 48 |
+
"task_relevant_rows": [
|
| 49 |
+
{
|
| 50 |
+
"channel": "#incidents",
|
| 51 |
+
"purpose": "Incident coordination and status updates."
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"channel": "#security",
|
| 55 |
+
"purpose": "Security advisories and audit notes."
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"channel": "#eng",
|
| 59 |
+
"purpose": "General engineering."
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"channel": "#deploys",
|
| 63 |
+
"purpose": "Deployment announcements."
|
| 64 |
+
}
|
| 65 |
+
]
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"columns": [
|
| 69 |
+
"post_id",
|
| 70 |
+
"state",
|
| 71 |
+
"title",
|
| 72 |
+
"body"
|
| 73 |
+
],
|
| 74 |
+
"row_count": 1,
|
| 75 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 76 |
+
"table": "status_page",
|
| 77 |
+
"task_relevant_rows": [
|
| 78 |
+
{
|
| 79 |
+
"body": "Catalog read replica maintenance completed with no customer impact.",
|
| 80 |
+
"post_id": 1,
|
| 81 |
+
"state": "resolved",
|
| 82 |
+
"title": "Scheduled maintenance completed"
|
| 83 |
+
}
|
| 84 |
+
]
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"columns": [
|
| 88 |
+
"post_id",
|
| 89 |
+
"title",
|
| 90 |
+
"impact",
|
| 91 |
+
"state",
|
| 92 |
+
"published_day",
|
| 93 |
+
"linked_incident"
|
| 94 |
+
],
|
| 95 |
+
"row_count": 3,
|
| 96 |
+
"selection_note": "Rows matching task identifiers are shown; a small source sample is shown when no identifier matches.",
|
| 97 |
+
"table": "status_page_posts",
|
| 98 |
+
"task_relevant_rows": [
|
| 99 |
+
{
|
| 100 |
+
"impact": "major",
|
| 101 |
+
"linked_incident": 5101,
|
| 102 |
+
"post_id": 7001,
|
| 103 |
+
"published_day": 412,
|
| 104 |
+
"state": "resolved",
|
| 105 |
+
"title": "Degraded checkout performance"
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"impact": "minor",
|
| 109 |
+
"linked_incident": 5102,
|
| 110 |
+
"post_id": 7002,
|
| 111 |
+
"published_day": 415,
|
| 112 |
+
"state": "monitoring",
|
| 113 |
+
"title": "Elevated error rates on payments"
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"impact": "major",
|
| 117 |
+
"linked_incident": 5103,
|
| 118 |
+
"post_id": 7003,
|
| 119 |
+
"published_day": 417,
|
| 120 |
+
"state": "resolved",
|
| 121 |
+
"title": "API latency affecting some customers"
|
| 122 |
+
}
|
| 123 |
+
]
|
| 124 |
+
}
|
| 125 |
+
]
|
| 126 |
+
}
|