You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(showcase): add PocketBase D5 history analysis to DEBUGGING.md
Strategy 9: pull all D5 status records from PocketBase in one request,
categorize errors, cross-reference with deploy history, and compute
per-service flapping rates to distinguish real bugs from transient
production issues.
Missing `ANTHROPIC_BASE_URL` or `GOOGLE_GEMINI_BASE_URL` means the service bypasses aimock and hits the real API. This produces non-deterministic results that look like flapping. Local docker-compose sets ALL providers to aimock — production must match.
384
384
385
+
### Strategy 9: Pull PocketBase D5 history to distinguish bugs from flapping
386
+
387
+
**When**: Production shows blues (D4) but everything passes locally. You need to know if a feature is genuinely broken or just flapping from transient production conditions.
388
+
389
+
**Do**: Pull the current D5 status records from PocketBase in one request and categorize the errors. PocketBase stores ONE record per `d5:<slug>/<featureType>` key (upsert), with `fail_count` tracking consecutive failures.
390
+
391
+
```sh
392
+
# Get ALL currently-red D5 records with error details:
-`keyword missing` → aimock returned wrong fixture
418
+
-`auth: after clicking sign-out` → auth probe timing race
419
+
420
+
**Cross-reference with deploy history** to identify deploy churn:
421
+
```sh
422
+
gh run list --branch main --limit 10 -R CopilotKit/CopilotKit --workflow "Showcase: Build & Push"
423
+
```
424
+
425
+
If a feature flipped red right when a deploy happened and `fail_count=1`, it's deploy churn — the Railway service restarted mid-probe. Wait one cycle and re-check.
426
+
427
+
**Get per-service flapping rates** from the harness API (last 10 probe runs):
stats[slug]['green' if result == 'green' else 'red'] += 1
441
+
for slug in sorted(stats):
442
+
s = stats[slug]
443
+
rate = s['green'] / (s['green'] + s['red']) * 100
444
+
print(f'{slug:<25} {s[\"green\"]}/{s[\"green\"]+s[\"red\"]} green ({rate:.0f}%)')
445
+
"
446
+
```
447
+
448
+
**Key insight**: If ALL integrations flap at similar rates (50-70% green), the problem is systemic (probe infrastructure), not per-integration code bugs. If only one integration is consistently red while others are green, it's a real code bug in that integration.
0 commit comments