feat(bay): chart GitHub throttle history - #1174
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 5:22 AM ET / 09:22 UTC. ClawSweeper reviewWhat this changesAdds a bounded aggregate 403/429 GitHub-throttle history API projection and a read-only OpenClaw Bay card with 6-hour, 24-hour, and 7-day views. Merge readinessKeep this PR open for normal maintainer landing: the current head has no actionable correctness or security finding, and its exact-head browser proof addresses the prior stale-proof blocker. Priority: P3 Review scores
Verification
How this fits togetherGitHub publication egress is retained as bounded SQLite rollups and exposed through a fail-closed public observability projection. OpenClaw Bay fetches that projection and renders aggregate operator telemetry without controls or identifying request data. flowchart LR
A[GitHub egress observations] --> B[Bounded rollups]
B --> C[Closed throttle series]
C --> D[Public data validation]
D --> E[Bay range request]
E --> F[Read-only throttle chart]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the bounded aggregate-only projection, merge it only under the documented privacy approval, and verify the deployed read-only card against normal operational telemetry after rollout. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect report; the PR supplies an exact-head browser proof that exercises the real Bay route with deterministic redacted fixtures across all three ranges. Is this the best way to solve the issue? Yes. Reusing the existing bounded rollups and validating a narrow aggregate projection is the maintainable path; it avoids a parallel telemetry store and preserves the public privacy boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 61276c87cbb7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
b78f4d9 to
2b63d73
Compare
2b63d73 to
c805a36
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c0917b3 to
16d8243
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Problem and data semantics
The old Bay sentence summed legacy
publication.github_request_metrics.counterskeys containing:throttle:. That is a cumulative Durable Object/SQLite total with no public start timestamp or reset boundary. Receipt replay is deduplicated, but distinct retries, revisions, and pagination pages are distinct observations, so the number can grow through repeated real wire attempts. It does not represent a time window and must not be graphed as a rate.The replacement projection counts only complete, attempted
wire_attemptrollup rows withoutcome=throttleand exact status403or429. It excludes invocations, circuit skips, pre-wire deferrals, and avoided requests. Each response carries a closedpool_class; no pool identity, repository/item/workflow identity, URL, query, token, or request body is exposed.The store already retains five-minute rollups for 7 days and hourly rollups for 30 days.
throttle_seriesre-aggregates those rows into at most 1,344 entries (168 hourly buckets × four closed pool classes × two statuses). The current bucket is excluded. Missing/pre-instrumentation, retention, cap truncation, and incomplete attribution fail closed throughfirst_available_bucket_start,coverage_complete,rows_truncated,excluded_incomplete_count, andcomplete; the UI never invents zero history for an incomplete series. Coverage requires a retained bucket before the requested lower-bound bucket, so telemetry beginning partway through the boundary bucket remains explicitly incomplete.Raw sanitized rate-limit-header detail remains retained for 24 hours. A 7-day response therefore discloses that boundary and can have a complete throttle series while the overall raw-detail query is incomplete.
Implementation
hours=168throttle_seriesprojection from existing rollups, with explicit completeness and first-available boundariesapi.github.comhostname, with lookalike-host regression coverageValidation
pnpm run build:allnode --test test/openclaw-bay-proof-network.test.ts test/github-egress-telemetry.test.ts test/dashboard-public-observability.test.ts test/dashboard-worker-observability.test.ts test/dashboard-worker-bay-records-routes.test.ts— 90 passed, 0 failedpnpm run check:docspnpm run check:dashboard-strictgit diff --check origin/main...HEADorigin/main61276c87cbb73cfec39e9649cee6862cf84a935f: clean at exact headefbe0ac96a431889d4dcdf4a4028cd3aafd3ff8a; no actionable correctness findings. The final loop accepted and fixed two late findings: any incomplete closed egress observation now fails the throttle series closed, and reset-header detail is accurately labelled as retained403/429 observationsrather than implying that every recorded 403 was classified as a throttle.61276c87cbb73cfec39e9649cee6862cf84a935f/ headefbe0ac96a431889d4dcdf4a4028cd3aafd3ff8a; decisionkeep_open, confidence high, no actionable code finding. Its offline-only proof concern is resolved by the exact-head browser receipt below.Native Windows
pnpm run format:checkreports the checkout-wide CRLF mismatch, so no line-ending or platform-policy change is included. The authoritative clean Linux gate passed at exact head:pnpm install --frozen-lockfile && pnpm run check, Crabbox resolved provideraws,c7a.8xlarge, runrun_9fecc9c69bff, leasecbx_aa44306637df(amber-prawn-c221), exit 0 andleaseStopped=true. The full coverage lane reported 3,537 tests: 3,529 passed, 8 platform skips, 0 failed; aggregate coverage was 81.49% lines, 74.11% branches, and 87.35% functions.Real Behavior Proof
/bayWorker route and UI with the repository's deterministic, fully synthetic/redacted status and observability fixtures.repository_actions,target_app, andpublic_read_fallback; range controls fetch 6/24/168 hours; 7d omits raw header detail and states its 24h retention.local-container, targetlinux/amd64, imagemcr.microsoft.com/playwright:v1.60.0-noble, fresh PR checkout,--no-hydrate; exact headefbe0ac96a431889d4dcdf4a4028cd3aafd3ff8a; runrun_97017c5031cc; leasecbx_5bebead8cb6d(tidal-barnacle). The required-artifact contract matchedproof-summary.json,trace.zip, and the storyboard; the command receipt reportsrunStatus=succeeded,exitCode=0, andleaseStopped=true.run_97017c5031cc-artifacts.tgz(2,307,391 bytes), SHA-256986B2EE66524445AA92D8C7CD6CDE120E112289BDEE7FC1D1ECDE193EB417478;proof-summary.jsonSHA-256104BFCDF8E80DA70A6BE2079644B28A61DCFFAF081FFFE15FB8F1CFDE0CD70FE;trace.zipSHA-256179464FFA5360CDED46BBAA7F84817F2DB6986D85E9608A7173CD17708D9BF1F; storyboard SHA-25645AD73C778EF921E2B91AF918B03FB92DAB8880196AD56C935FC35325FAD29EB; 6h frame SHA-2569A42964B8802D8320C0B21E4233A4C2825055F33DFB9DD7FC250C0A843410502; 24h frame SHA-256A2BFFEDBF696240B764F0FEB3A1299524A297B957CF45242673B84D2250A6874; 7d frame SHA-25641E0961A88A36259B383DAF1377B857AF79719D463249656D9D8561AC9B7B19F.Privacy and overlap
43799a11fc2612df7d80918e0012d6f03b339747and is contained by the current base61276c87cbb73cfec39e9649cee6862cf84a935f. This PR adds only the bounded throttle projection after its strict public sanitizers. Reconciliation removed a State writer caller that would otherwise have reintroduced a surface fix: contain public worker status metadata #1171 withholds; no removed identity field or route returns.Risks, rollout, and rollback
Risk is limited to the public read-only telemetry projection and Bay presentation. Legacy cached v2 responses fall back to the detailed rows they already contain. The new projection is bounded and can fail closed independently of raw header-detail completeness.
Rollback is a normal revert of this commit: the underlying v2 rollups and retention remain unchanged. The final read-only pre-merge health check observed deployment SHA
61276c87cbb73cfec39e9649cee6862cf84a935f, matching the PR base; this PR does not claim that its head is deployed. It makes no deployment, schedule, capacity, queue, credential, DLQ, or Phase 1 change.