Skip to content

feat(extension): bound native messaging host authority - #82

Open
seonghobae wants to merge 14 commits into
mainfrom
feat/native-messaging-host-authority
Open

feat(extension): bound native messaging host authority#82
seonghobae wants to merge 14 commits into
mainfrom
feat/native-messaging-host-authority

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Partial implementation of #27.

Buyer/security gap

Issue #27 requires native messaging only behind an explicit host-managed allow-list and process boundary. Protected main separates Chromium extension permission from OriginWeave Agent capability, but a future native-messaging adapter must not treat the manifest nativeMessaging permission or an arbitrary host-name string as OriginWeave authority.

Implemented production boundary

This PR provides a typed, deterministic Rust authority primitive for native-messaging host identity and exact extension-to-host grants:

  • Chromium-compatible host-name syntax: lowercase ASCII alphanumeric, underscore and dot only; no leading/trailing/consecutive dot; 256-byte maximum;
  • explicit exact extension-ID + host-name grant;
  • typed denial for missing grant, extension mismatch, or host mismatch;
  • public read-only identity getters on grants and requests so later process/framing adapters can compose authority without inspecting private representation; and
  • native-messaging permission remains separate from OriginWeave Agent capability.

The implementation deliberately does not launch a process, parse a host manifest, read registry/filesystem registration, communicate over stdio, parse JSON, expose secrets, grant Agent actions, or treat extension content as trusted instruction.

Primary platform contract

The boundary follows Chrome native-messaging semantics: registered host names are constrained identities, allowed_origins is an explicit extension allow-list without wildcards, and Chrome launches each native messaging host in a separate process. Process/stdio integration remains a separately reviewed boundary; this PR establishes only the Rust-side exact authority primitive.

Live protected-main alignment

Protected main is exact SHA 0841d2ab3d8b5e60a03c0a8e818cf438e2716829. Current exact branch head is c639cd78e3acad235be4cbbfdef67b84ce7ddbfa.

Fresh exact comparison reports this head 14 commits ahead and 0 behind protected main, with merge base exactly 0841d2ab3d8b5e60a03c0a8e818cf438e2716829. No predecessor-head evidence is transferred.

Test-first / current exact-head verification

The feature began from test-only head afea70bee5f479fc0b925be154fe79279fc34ae4. The current exact head additionally covers the public identity getters and standard error integration consumed by downstream native-messaging stacks.

On unchanged exact head c639cd78e3acad235be4cbbfdef67b84ce7ddbfa against exact protected main 0841d2ab3d8b5e60a03c0a8e818cf438e2716829:

  • CI run 32025752923: success;
    • Rust contracts job 95374690146: repository contracts, canonical formatting, locked workspace/all-target check, tests, strict Clippy, and rustdoc success;
    • Production coverage job 95374690171: exact owned production function/line/region/branch enforcement success;
  • Manifest V3 Compatibility run 32025752925: success;
  • Security Scan run 32025752960: success;
  • SAST Semgrep run 32025752970: success;
  • GitHub status context CodeRabbit: success, which is status-only evidence and not independent approval;
  • formal reviews returned by GitHub: none; and
  • inline review threads returned by GitHub: none.

A later CodeRabbit review attempt was rate-limited and generated no actionable comment; it is not promoted as approval or current-head proof. Central OpenCode/Noema/Strix evidence not returned for this exact head is absent rather than inferred from predecessor, comments, or status-only evidence. Skipped queue/cancel/manual-status helper jobs are not represented as passing evidence.

GitHub reports the PR open, mergeable, and Ready for review. Integration remains gated by the repository's counted independent approval and latest-push approval requirements; this scheduled actor does not merge or self-approve.

Truth boundary

This PR establishes only bounded Rust policy for native-messaging host identity and explicit extension-to-host authority. It does not validate installed host manifests, authenticate operating-system registration ownership, spawn/sandbox/supervise a native process, bound native-messaging framing/stdio, authorize arbitrary Agent actions, persist authority, handle credentials, or prove complete Chromium native-messaging integration. Those remain separately reviewed runtime boundaries under #27.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

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: c7b3b1c2-0feb-4ac1-82b1-082c58dc00db

📥 Commits

Reviewing files that changed from the base of the PR and between 1c32eff and 2d16411.

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

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Native-messaging 호스트 이름 검증 타입과 명시적 접근 grant 평가 API를 추가했습니다. 확장 ID와 호스트 이름이 모두 일치할 때만 접근을 허용합니다. 호스트 이름 경계와 확장 에이전트 capability 분리를 테스트합니다.

Changes

Native messaging 권한 경계

Layer / File(s) Summary
호스트 이름 및 접근 계약
crates/originweave-core/src/lib.rs
Chromium 문법에 맞는 NativeMessagingHostName 검증을 추가했습니다. 확장 ID와 호스트 이름을 포함하는 grant 및 접근 요청 타입을 추가했습니다. grant 누락, 확장 ID 불일치, 호스트 이름 불일치, 허용 결과를 구분합니다.
권한 평가 검증
crates/originweave-core/tests/native_messaging_authority.rs, crates/originweave-core/tests/native_messaging_host_bounds.rs
유효하지 않은 호스트 이름과 257자 호스트 이름을 거부하고 256자 호스트 이름을 허용하는 동작을 테스트합니다. grant가 정확히 일치할 때만 접근을 허용하고, 각 불일치 조건을 구분해 거부하는 동작을 검증합니다. 확장 에이전트 capability가 별도 grant 없이 허용되지 않는지 확인합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2d164

The PR adds a bounded native-messaging host identity and exact extension-to-host grant policy without launching processes or expanding agent capabilities; no actionable merge-blocking risk remains after normal checks and review.

🚥 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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/native-messaging-host-authority

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 draft August 14, 2026 00:36
@seonghobae
seonghobae marked this pull request as ready for review August 14, 2026 02:16
@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 c639cd78e3acad235be4cbbfdef67b84ce7ddbfa.

  • Head SHA: c639cd78e3acad235be4cbbfdef67b84ce7ddbfa

  • Workflow run: 32132787181

  • 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 (5 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (5 files)"]
  R1 --> V1["required checks"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: c639cd78e3acad235be4cbbfdef67b84ce7ddbfa
  • Workflow run: 32139252038
  • 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 c639cd78e3acad235be4cbbfdef67b84ce7ddbfa.

  • Head SHA: c639cd78e3acad235be4cbbfdef67b84ce7ddbfa

  • Workflow run: 32139252038

  • 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 (5 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (5 files)"]
  R1 --> V1["required checks"]
Loading

@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 c639cd78e3acad235be4cbbfdef67b84ce7ddbfa.

  • Head SHA: c639cd78e3acad235be4cbbfdef67b84ce7ddbfa

  • Workflow run: 32139252038

  • 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 (5 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (5 files)"]
  R1 --> V1["required checks"]
Loading

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