Skip to content

fix(telemetry): add a 15-minute egress window - #1142

Merged
brokemac79 merged 2 commits into
mainfrom
codex/csw-127-egress-window
Aug 12, 2026
Merged

brokemac79 merged 2 commits into
mainfrom
codex/csw-127-egress-window

Conversation

@brokemac79

Copy link
Copy Markdown
Contributor

Summary

  • add a read-only 15-minute (hours=0.25) GitHub-egress observability window
  • preserve the existing 1h, 6h, and 24h response contract and 2,000-row cap
  • extend deterministic and real-Worker proof to cover the smaller window

Related: CSW-127 and #1140.

This is a narrow Phase 0 follow-up. It does not implement Phase 1 coordination,
change publication scheduling, alter queue or retry behavior, increase the row
cap, or mutate credentials, gates, DLQs, or production state.

Problem

Post-merge observation found that organic high-cardinality publication traffic
can fill the public 2,000-row detail cap even for hours=1. The full-window
member/invocation/wire totals and reset observations remain usable, but
rows_truncated=true makes the per-route and per-stage breakdown incomplete.
Because one hour was the smallest accepted window, a 15-minute monitor could
not collect a smaller complete slice for local aggregation.

Implementation

  • accept hours=0.25 in the existing public observability store
  • retain five-minute bucket alignment and every existing completeness/privacy
    field
  • keep unsupported windows rejected and keep 1/6/24-hour behavior unchanged
  • document that the smaller view does not bypass the public cap and must still
    preserve truthful truncation flags
  • add a high-cardinality regression proving a one-hour query can truncate while
    the same store's 15-minute query remains complete
  • extend the real Worker/SQLite proof to query and privacy-scan the new window

OpenClaw Bay is unaffected: its compact six-hour summary and observer-only UI do
not change. The new surface is an optional query value on the existing API.

Validation

Exact base: ac340908bf694c902f5a673374be1639ef9f220f
Exact head: 3c47cda57d9dae56479dc71dbcdaca93b7788553

  • pnpm run build:all
  • node --test test/github-egress-telemetry.test.ts — 7/7
  • pnpm run lint
  • pnpm run check:docs
  • pnpm exec oxfmt --check dashboard/github-egress-telemetry.ts test/github-egress-telemetry.test.ts docs/proof/github-egress-telemetry/run-proof.mjs
  • git diff --check origin/main...HEAD
  • pnpm run codex:local:check
  • dirty-patch codex review --uncommitted: no actionable findings
  • committed codex review --base origin/main: no actionable findings
  • final committed codex review --base origin/main after proof-artifact assertion: no actionable findings
  • pnpm run review -- --local-range --target-repo openclaw/clawsweeper --base origin/main: decision=keep_open confidence=high action=kept_open; local-only, no GitHub mutation

The repository-wide Windows format:check reports the existing CRLF formatting
baseline across hundreds of untouched files. The changed TypeScript/JavaScript
files pass focused oxfmt --check, and git diff --check is clean. No platform
policy or unrelated formatting change is included.

Real Behavior Proof

Claim

The production read-only API accepts hours=0.25, preserves the Phase 0
privacy and completeness contract, and gives a 15-minute monitor a smaller
bounded detail slice without altering publication behavior.

Exercised surface

  • exact head 3c47cda57d9dae56479dc71dbcdaca93b7788553
  • Crabbox provider=local-container, lease cbx_ea87b5d56d48, image
    node:24-bookworm, exit 0
  • Node 24.19.0, GitHub CLI 2.88.1, Wrangler 4.107.0 local Worker
  • SQLite-backed ExactReviewQueue Durable Object
  • real loopback TLS GitHub CLI transport, signed upload, restart persistence,
    receipt deduplication, public query, and sentinel privacy scan

Scenario and observed result

The deterministic high-cardinality fixture inserted 2,001 distinct older
five-minute dimension rows plus one recent row. Its one-hour response was capped
at 2,000 with rows_truncated=true and query_complete=false; its 15-minute
response contained only the recent row and returned query_complete=true.

The exact-head Crabbox proof then exercised the real public Worker route:

  • hours=0.25 returned window.hours=0.25 and query_complete=true
  • 18 invocations conserved to 19 wire attempts and one durable member
  • pagination accounted for exactly three pages
  • one sanitized rate-limit observation survived Worker restart
  • duplicate receipt was deduplicated
  • stdout, ordinary stderr, and exit behavior were preserved
  • private/raw sentinel scan passed
  • production mutations: 0; OpenClaw Bay affected: false

The initial Windows-to-local-container sync attempt failed before execution with
rsync code 12. The successful proof used Crabbox --no-sync, cloned the pushed
branch inside the container, and verified the exact head before running. This is
the same bounded workaround used by the original Phase 0 proof.

Limits

  • A sufficiently high-cardinality 15-minute burst can still reach the cap; the
    existing flags remain authoritative and the collector must record that gap.
  • The proof uses deterministic loopback GitHub responses and does not consume
    or deliberately exhaust live quota.
  • This does not add pagination/cursors or Phase 1 admission, permits, shared
    circuits, probes, recovery ramps, or retry enforcement.

Risks and rollout

The change is additive and read-only. Existing callers using 1/6/24-hour
windows receive the same response shape and aggregation. The 2,000-row cap,
retention, privacy allowlists, and invalid-window behavior remain unchanged.

Rollback is a normal code revert removing 0.25 from the accepted window set
and its documentation/tests. It requires no queue drain, workflow change, gate
change, credential change, or state migration.

Release note

Internal operator telemetry: add a 15-minute GitHub-egress detail window for
high-volume monitoring.

@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 11:14 AM ET / 15:14 UTC.

ClawSweeper review

What this changes

This PR adds hours=0.25 to the public GitHub-egress observability API, documents its bounded semantics, and covers it in regression and Worker proof paths.

Merge readiness

✅ Ready for maintainer review

This PR is still necessary: current main rejects the requested 15-minute window, while the branch adds it with focused regression and Worker-proof coverage. No actionable correctness or security finding was identified.

Priority: P3
Reviewed head: 3c47cda57d9dae56479dc71dbcdaca93b7788553

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow, well-scoped API extension with strong current-head Worker proof and focused regression coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body records an exact-head Crabbox local-container run through the real local Worker and loopback GitHub CLI transport, with an observed 0.25-hour response, completeness assertion, and privacy scan.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body records an exact-head Crabbox local-container run through the real local Worker and loopback GitHub CLI transport, with an observed 0.25-hour response, completeness assertion, and privacy scan.
Evidence reviewed 5 items Current main lacks the requested window: The current allowlist accepts only 1, 6, and 24 hours, so a 0.25-hour request returns no observability result.
Existing API route preserves the narrow implementation boundary: The public Worker route forwards the numeric hours query directly to the telemetry store and returns a 400 only when that store rejects it.
Branch coverage exercises the complete-slice use case: The proposed test proves a one-hour query can truncate at 2,000 rows while the same store's 15-minute query is complete, and still rejects an unsupported 0.5-hour value.
Findings None None.
Security None None.

How this fits together

Publication activity is aggregated into sanitized GitHub-egress telemetry in the dashboard Worker. Operators query bounded windows from that store to inspect route-level detail while preserving completeness and privacy signals.

flowchart LR
A[Publication activity] --> B[Egress telemetry aggregation]
B --> C[Sanitized Durable Object store]
C --> D[Window selection]
D --> E[Public observability response]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

None.

Technical review

Best possible solution:

Land the additive 15-minute option while retaining the existing 2,000-row cap and authoritative truncation and completeness flags.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main's explicit allowlist accepts only 1, 6, and 24 hours, and the existing route turns an unsupported value into a 400 response.

Is this the best way to solve the issue?

Yes. Extending the existing allowlist preserves the established route, schema, five-minute bucket behavior, and privacy/completeness contract without adding a parallel telemetry surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ac340908bf69.

Labels

Label justifications:

  • P3: This is a bounded internal observability enhancement that preserves existing query behavior and delivery flows.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body records an exact-head Crabbox local-container run through the real local Worker and loopback GitHub CLI transport, with an observed 0.25-hour response, completeness assertion, and privacy scan.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an exact-head Crabbox local-container run through the real local Worker and loopback GitHub CLI transport, with an observed 0.25-hour response, completeness assertion, and privacy scan.

Evidence

What I checked:

Likely related people:

  • brokemac79: Authored the merged Phase 0 egress-telemetry PR and this focused follow-up. (role: original telemetry feature author and recent area contributor; confidence: high; commits: 41bdd3bd2ad9, b4249aa8ff28; files: dashboard/github-egress-telemetry.ts, test/github-egress-telemetry.test.ts)
  • Martin Cleary: Merged the current-main telemetry implementation that owns the accepted-window contract. (role: merger and current-main contributor; confidence: high; commits: ac340908bf69; files: dashboard/github-egress-telemetry.ts, dashboard/exact-review-queue.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-12T15:10:53.843Z sha 3c47cda :: needs maintainer review before merge. :: none

@brokemac79
brokemac79 marked this pull request as ready for review August 12, 2026 15:23
@brokemac79
brokemac79 merged commit 6ca63d9 into main Aug 12, 2026
17 checks passed
@brokemac79
brokemac79 deleted the codex/csw-127-egress-window branch August 12, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant