Skip to content

feat(resource): record browser task runtime telemetry - #51

Open
seonghobae wants to merge 29 commits into
mainfrom
feat/browser-task-resource-telemetry
Open

feat(resource): record browser task runtime telemetry#51
seonghobae wants to merge 29 commits into
mainfrom
feat/browser-task-resource-telemetry

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Partial implementation of #28: a bounded browser/task telemetry value contract that feeds the existing resource governor.

Live exact state

  • Protected main: 542ca1e9c0a863595b8b6697790005d2471f5413;
  • current PR head: 744892c25fd584b061415863b3dbc12b24d7a75e;
  • base: main at 542ca1e9c0a863595b8b6697790005d2471f5413.

The branch validates caller-supplied browser/task RSS bytes, semantic-observation bytes, governed-action latency, and total task duration. RSS conversion is overflow-safe and conservatively rounded to MiB; the Linux VmRSS parser is bounded and rejects missing, duplicate, malformed, signed, trailing, unsupported-unit, and overflow forms. The branch does not claim independent browser-process provenance.

Exact-current review and checks

  • current inline review threads: none;
  • the historical OpenCode CHANGES_REQUESTED review is bound to predecessor head ed01297e5fd0e6a97336078e23f49206c0952ef3 and is not current-head evidence;
  • current code, security, SAST, coverage, Noema, and OpenCode check contexts are successful where exposed for this head;
  • no qualifying independent non-author APPROVED review is present.

Boundary

This is active-PR evidence, not protected-main shipment. It does not discover Chromium processes, aggregate process trees/cgroups, measure JS heap/GPU/VRAM, launch or control Chromium, provide BiDi/CDP transport, persist telemetry, or prove that a supplied PID belongs to the governed browser task.

The live CWL Central required workflows ruleset currently requires one approving review, resolved threads, and the configured required workflows. No self-approval, bypass, force-push, workflow/ruleset mutation, tag, release, or unsupported shipment claim is made.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dca42970-638f-4eb7-8cb8-c7e77b4f8b65

📥 Commits

Reviewing files that changed from the base of the PR and between cc6c330 and c2834d5.

📒 Files selected for processing (2)
  • crates/originweave-resource/src/lib.rs
  • crates/originweave-resource/tests/browser_task_telemetry.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/originweave-resource/tests/browser_task_telemetry.rs

📝 Walkthrough

Walkthrough

BrowserTaskTelemetry를 추가했습니다. 네 가지 작업 측정값을 검증하고 브라우저 RSS를 ResourceSnapshot의 MiB 값으로 변환합니다. Linux에서는 지정된 프로세스의 /proc/<pid>/status에서 RSS를 샘플링합니다. 관련 테스트와 변경 로그를 추가했습니다.

Changes

브라우저 작업 텔레메트리

Layer / File(s) Summary
텔레메트리 계약 및 검증
crates/originweave-resource/src/lib.rs, crates/originweave-resource/tests/browser_task_telemetry.rs, CHANGELOG.md
BrowserTaskTelemetry가 RSS, 관측 데이터 크기, 액션 지연 시간, 작업 지속 시간을 저장합니다. RSS와 작업 지속 시간은 0일 수 없습니다. 액션 지연 시간은 작업 지속 시간을 초과할 수 없습니다. 공개 getter, 오류 enum, 검증 테스트와 변경 로그를 추가했습니다.
리소스 스냅샷 통합
crates/originweave-resource/src/lib.rs, crates/originweave-resource/tests/browser_task_telemetry.rs
브라우저 RSS를 올림 방식으로 MiB로 변환해 ResourceSnapshotResourceGovernor 계획에 반영합니다. VRAM, 배치 크기, 모델 상태, 프레임 시간, CPU 사용량은 별도 인자로 유지합니다.
Linux RSS 파싱 및 샘플링
crates/originweave-resource/src/lib.rs, crates/originweave-resource/tests/browser_task_telemetry.rs
/proc/<pid>/status의 단일 VmRSS 항목을 검증하고 KiB를 바이트로 변환합니다. 누락, 중복, 형식 오류, 지원되지 않는 단위, 오버플로, 잘못된 프로세스 ID와 비Linux 플랫폼을 별도 오류로 처리합니다.

Estimated code review effort: 3 (Moderate) | ~25분

Mergeability Score: ⚪ Minimal · up to c2834

The PR adds bounded Linux process RSS sampling and telemetry validation without expanding into browser process discovery or attribution. No actionable merge-blocking risk remains at the current head after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant BrowserTask
  participant sample_linux_process_rss_bytes
  participant parse_linux_proc_status_rss_bytes
  participant ResourceSnapshot
  participant ResourceGovernor
  BrowserTask->>sample_linux_process_rss_bytes: 프로세스 ID로 RSS 샘플링
  sample_linux_process_rss_bytes->>parse_linux_proc_status_rss_bytes: /proc/<pid>/status 전달
  parse_linux_proc_status_rss_bytes-->>sample_linux_process_rss_bytes: 검증된 RSS 바이트 반환
  sample_linux_process_rss_bytes-->>BrowserTask: RSS 바이트 반환
  BrowserTask->>ResourceSnapshot: telemetry와 리소스 인자 전달
  ResourceSnapshot->>ResourceGovernor: 리소스 스냅샷 전달
  ResourceGovernor-->>BrowserTask: 리소스 계획 반환
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 브라우저 작업 런타임 텔레메트리 기록이라는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/browser-task-resource-telemetry

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as ready for review August 10, 2026 15:31
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head ed01297e5fd0e6a97336078e23f49206c0952ef3.

  • Head SHA: ed01297e5fd0e6a97336078e23f49206c0952ef3

  • Workflow run: 32081189934

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: 0105-resource-governor-priority.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: 0105-resource-governor-priority.md"]
  R2 --> V2["docs review"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: ed01297e5fd0e6a97336078e23f49206c0952ef3
  • Workflow run: 32081189934
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head ed01297e5fd0e6a97336078e23f49206c0952ef3.

  • Head SHA: ed01297e5fd0e6a97336078e23f49206c0952ef3

  • Workflow run: 32081189934

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: 0105-resource-governor-priority.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: 0105-resource-governor-priority.md"]
  R2 --> V2["docs review"]
Loading

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread crates/originweave-resource/src/lib.rs
@seonghobae

Copy link
Copy Markdown
Contributor Author

Verified against exact current head 744892c: the alleged missing kernel standards record is already in the current PR diff. docs/doctoring.md adds the “Linux process RSS measurement” decision trace and the APA 7 “Linux Kernel Documentation. (n.d.). The /proc filesystem” reference; CHANGELOG.md and ADR 0105 also retain the same boundary. No duplicate documentation change is warranted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant