Repository navigation
feat(telemetry): observe GitHub publication egress - #1140
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 8:39 AM ET / 12:39 UTC. ClawSweeper reviewWhat this changesAdds an observe-only wrapper around publication-time GitHub CLI calls, signed bounded telemetry rollups, and a read-only operator endpoint for GitHub egress diagnostics. Merge readinessKeep open for a release-owner decision: this is a meaningful new observer-only telemetry feature, not work already present on current main, and the supplied boundary proof is strong enough for maintainer review. Priority: P2 Review scores
Verification
How this fits togetherExact-review publication workflows call GitHub through the CLI to publish review results. This change observes those calls, sends sanitized aggregates to the queue Durable Object, and exposes rollups to operators without changing admission or retry policy. flowchart LR
A[Exact review queue] --> B[Publication workflows]
B --> C[GitHub CLI observer]
C --> D[GitHub API]
C --> E[Signed telemetry upload]
E --> F[Durable Object rollups]
F --> G[Read-only operator API]
Decision needed
Why: The PR body records separate Phase 0 authorization but expressly leaves merge and deployment unauthorized; that release decision cannot be inferred from code, tests, or proof. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Authorize only the Phase 0 observer rollout, monitor six complete production quota windows, and keep admission, circuit, permit, probe, and recovery enforcement out of scope until that evidence is reviewed. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this is a new telemetry capability, and the PR supplies a current-head real-boundary proof run for the proposed behavior. Is this the best way to solve the issue? Yes, conditionally: an observe-only, bounded, signed sidecar is the narrowest path to gather the denominator needed before any admission or retry policy change. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f0dd69f75573. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-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:
|
Summary
ghtransport while retaining the existing v1 request metricsRelated: CSW-123. This is the separate Phase 0 dependency for the future pool-coordinator work. It intentionally does not implement coordinator bindings, epochs, permits, blocked-until decisions, probes, recovery ramps, or any admission/retry enforcement.
Maintainer authorization: Martin explicitly authorized merging and automatically deploying this separate observe-only Phase 0 telemetry PR on 2026-08-12. Phase 1 remains explicitly out of scope.
Problem
Existing v1 metrics count logical request classes but cannot reliably distinguish one command from its paginated HTTP attempts, identify the credential pool actually selected, or preserve sanitized reset-authority evidence. That makes six-hour quota diagnosis underdetermined and leaves no trustworthy denominator for Phase 1.
Implementation
repository_actions,target_app, andpublic_read_fallbackfrom the credential actually chosen, never from generic rate-limit prose.retry_after/rate_limit_reset/absent/invalidcandidate provenance. They do not choose a shared reset policy.first_repeathas one exact meaning:firstwhenpublicationFailureAttempts == 0for the claimed durable item revision, andrepeatwhen that same revision already has at least one charged publication failure. It is not an HTTP retry, pagination page, batch membership, or claim-generation grouping.Validation
Current base:
f0dd69f75573e6ac592d5b8c218bbda245fc2b1aCurrent head:
41bdd3bd2ad97475ce36d63f975ee4adc03b8a43pnpm run check:staticpnpm run build:allpnpm run lintnode --test test/github-egress-telemetry.test.ts— 7/7node --test --test-name-pattern="exact-review lease competition" test/sweep-workflow.test.ts— 1/1node --test --test-name-pattern="github egress|exact-review queue" test/dashboard-worker-queue-runtime.test.ts— 45/45git diff --check origin/main...HEADorigin/mainscripts/github-egress-observer.sh: only SC2317 informational reports for trap-invoked functionscodex review --base origin/maincleanpnpm run review -- --local-range --target-repo openclaw/clawsweeper --base origin/main:decision=keep_open confidence=high action=kept_open; local-only, no GitHub mutationThe full native-Windows aggregate suite also reproduces current-main platform noise: hosted-Linux Bash tests cannot find WSL
/bin/bash, and unrelated concurrent temporary-root cleanup tests can fail withEPERM. No platform-policy or unrelated test-harness changes are included; the affected Linux surfaces pass in the container lane above.Real Behavior Proof
Claim
The production observation seam counts real GitHub CLI HTTP pages and attributes the actual selected credential pool without changing command behavior or exposing raw identifiers. Its signed aggregates survive Worker restart, dedupe replayed receipts, and fail open when parsing is unsafe or unavailable.
Exercised surface
41bdd3bd2ad97475ce36d63f975ee4adc03b8a43provider=local-container, leasecbx_a8d87f6084a7, Node 24 Bookworm, exit 0ExactReviewQueueDurable ObjectScenario and observed result
The fixture executed repository-Actions, target-App, and public-read-fallback calls; a three-page REST request; a 403 with
Retry-AfterandX-RateLimit-*; an unknown route; and an opaque artifact download. It then removed the rich parser and repeated a throttled command, including an unterminated ordinary-stderr case, and exercised an absent telemetry sink.repository_actions, 1target_app, 1public_read_fallbackProof package:
docs/proof/github-egress-telemetry/README.mdandrun-proof.sh. The exact-head run used a fresh clone of the pushed branch because Windows-to-local-container rsync failed before execution with code 12; Crabbox performed no local dirty-tree sync (syncSkipped=true) and verified the remote HEAD before running.Limits
gh run downloadremains intentionally opaque because binary redirects cannot be safely parsed from debug output.Risks and rollout
ghcalls; measured loopback overhead is bounded but production latency must be observed over six complete quota windows.Bay impact is observe-only: no queue, gate, schedule, hot cadence, batch size/concurrency, retry budget, credential, or production-state setting changes. After merge/deployment, collect six complete quota windows before authorizing Phase 1.
Rollback is a commit revert: remove the observer setup/upload steps and public route. Existing v1 metrics and publication behavior continue; retained v2 tables become inert and require no queue drain or data migration.
Release note
Internal operations telemetry only; no user-facing behavior change.