Skip to content

fix(core): expose standard origin error contract - #164

Draft
seonghobae wants to merge 7 commits into
mainfrom
fix/core-origin-error-contract
Draft

fix(core): expose standard origin error contract#164
seonghobae wants to merge 7 commits into
mainfrom
fix/core-origin-error-contract

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Buyer/API gap

Origin::parse is a foundational trust-boundary API, but protected main does not yet expose public OriginError through Rust's standard Display / std::error::Error contract. This PR adds exhaustive credential-free Display, std::error::Error, and focused regression coverage without changing origin parsing or authority semantics.

Test-first lineage

The original test-only head established the semantic RED: OriginError did not implement the standard error contract. Production then added deterministic messages for every existing variant and source() == None; formatting-only follow-up preserved canonical rustfmt. Historical checks/reviews remain predecessor evidence only.

Fresh protected-main adoption

Protected main is exact c789b802fc98a8d7fd8c09d9327f36828054d2a1. Previous contributor head b8ae750b0b6e5ba47b3f4312db4df6de6f22a7d9 targeted old main@542ca1e9c0a863595b8b6697790005d2471f5413; the two protected-main commits after that revision have no net file delta.

Commit 12438c3a9171f44c1b18219478a2ec367cb78696 adopts current protected main as a second parent while preserving the predecessor tree exactly. The branch advanced by normal non-force fast-forward. Fresh compare is 7 ahead / 0 behind, merge base exactly current protected main, and the semantic diff remains exactly three paths: CHANGELOG.md, crates/originweave-core/src/lib.rs, and crates/originweave-core/tests/origin_error_contract.rs. No parser, browser/network/policy authority, secret, dependency, workflow/ruleset, or coverage-denominator change is introduced.

Exact-current evidence

Current exact head is 12438c3a9171f44c1b18219478a2ec367cb78696; GitHub reports the PR open, Draft, and content-mergeable. Earlier Rust/coverage/MV3 successes and central review failures do not transfer after the legitimate head movement.

Fresh exact-head workflows are non-terminal:

  • CI 33778121402: queued;
  • Manifest V3 Compatibility 33778120403: queued;
  • SAST Semgrep 33778120546: queued;
  • Security Scan 33778120818: queued;
  • OSV-Scanner PR 33778130975: queued;
  • Scorecard PR 33778119977: queued; and
  • one-shot Materialize Rust nightly refresh once 33778120359: completed as skipped and is not product evidence.

No exact-current GREEN or qualifying independent approval is claimed. Keep Draft until repository contracts, strict Rust checks/rustdoc, exact 100% owned-production function/line/region/branch coverage, applicable security/review verdicts, and live governance execute on the unchanged head.

Protected-main AGENTS.md and live GitHub governance remain authoritative. This scheduled writer does not merge, self-approve, bypass, force-push, destructively rebase, alter workflows/rulesets/secrets, weaken checks, tag, release, or publish.

@coderabbitai

coderabbitai Bot commented Aug 15, 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: Team

Run ID: da15ac06-31c1-4168-8b94-9b767380c5ce

📥 Commits

Reviewing files that changed from the base of the PR and between 542ca1e and b8ae750.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • crates/originweave-core/src/lib.rs
  • crates/originweave-core/tests/origin_error_contract.rs

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


📝 Walkthrough

Walkthrough

OriginError에 사람이 읽을 수 있는 오류 메시지와 표준 오류 트레이트 구현을 추가했습니다. 아홉 가지 오류 변형의 문자열 출력과 source() 결과를 통합 테스트로 검증합니다. 변경 로그도 갱신했습니다.

Changes

OriginError 표준 오류 계약

Layer / File(s) Summary
오류 계약 구현 및 검증
crates/originweave-core/src/lib.rs, crates/originweave-core/tests/origin_error_contract.rs, CHANGELOG.md
OriginError의 아홉 가지 변형에 fmt::Display 메시지를 추가하고 std::error::Error를 구현했습니다. 각 변형의 to_string() 결과와 source() == None을 테스트합니다. 변경 로그에 오류 계약 범위를 반영했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 12438

This localized change adds standard error support and deterministic messages for existing origin-validation failures without changing parsing behavior. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 제목은 OriginError에 표준 오류 계약을 공개한다는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/core-origin-error-contract

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 15, 2026 00:51

@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 3172883992f1fd5d456a40e1a5b826fc67dc02c6.

  • Head SHA: 3172883992f1fd5d456a40e1a5b826fc67dc02c6

  • Workflow run: 32163664883

  • 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"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 3172883992f1fd5d456a40e1a5b826fc67dc02c6
  • Workflow run: 32163664883
  • 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 3172883992f1fd5d456a40e1a5b826fc67dc02c6.

  • Head SHA: 3172883992f1fd5d456a40e1a5b826fc67dc02c6

  • Workflow run: 32163664883

  • 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"]
Loading

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@seonghobae
seonghobae force-pushed the fix/core-origin-error-contract branch from 1cf12fa to 262d5a8 Compare August 27, 2026 05:27
@seonghobae seonghobae added the bug Something isn't working label Sep 2, 2026 — with ChatGPT Codex Connector
@seonghobae
seonghobae marked this pull request as draft September 3, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant