Skip to content

fix: give public boundary errors a stable standard contract - #331

Open
seonghobae wants to merge 2 commits into
mainfrom
fix/public-error-display
Open

seonghobae wants to merge 2 commits into
mainfrom
fix/public-error-display

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • cargo test --offline -p originweave-core --test origin_error_contract --test action_intent_error_contract --test extension_id_error_contract
  • cargo test --offline -p originweave-evidence --test evidence_error_contract
  • Exact-head GitHub checks on this pull request

Summary by CodeRabbit

  • 기능 개선
    • 핵심 오류 유형에 구체적인 설명이 추가되고 표준 오류로 사용할 수 있습니다.
    • 숫자로만 구성된 SHA-256 해시도 유효한 것으로 확인되며, 입력한 해시 값이 그대로 보존됩니다. 기존 동작을 확인한 변경입니다.
  • 테스트
    • 오류 메시지와 표준 오류 계약, 숫자만으로 구성된 SHA-256 해시의 수용 및 보존을 검증하는 테스트가 추가되었습니다.
  • 문서
    • 해시 검증과 보존에 관한 테스트 전략 및 동작 설명이 보강되었습니다.

Numeric provenance successor — published 2026-10-05 KST

Current head b14493be78fd020ce23f28aebcb1a123dabdaec1 follows 3247c31bcd47498533faf87c35798de5c4c54052, reviewed tree c4c3718c4e50451ab27b086a7bfde082c99b1693. Independent complete original-base-to-final SOURCE report SHA-256 016e37898ea143cb56b76e8d54301ed97583e925e7e5551415f7f8ab2cde532f covers all nine changed paths and218 source files, including the inherited core/evidence Display/Error implementations. Only evidence.rs, TEST_STRATEGY and CHANGELOG changed in this increment. Inherited production error behavior is preserved; the latest increment is test-only.

Numeric-only SHA-256 construction and exact source_hash retention are now asserted with the original64-digit positive. Existing mixed-hex positives, malformed hash/URL/locator negatives and error contracts remain unchanged. First-GREEN characterizes correct existing production; two isolated mutations (requiring a hex letter or truncating only numeric hashes) each retain all seven old controls while failing the new assertion, then all seven tests pass after exact restoration. No ordinal enum or additional policy contract was introduced. The independent suggestion for future failing fmt::Write sink controls was not folded into these reviewed bytes.

Actual adopted checkout formatting and8 focused tests passed before a normal commit. Fresh exact committed-head nine gates passed: Rust280/Python152, failedignored0, strict rustdoc, functions525/525, lines4448/4448, regions5385/5385, branches654/654, all100%. Committed coverage SHA-256 f5436854168b5bc386216ca8199c91c55de20f43e6c975b66316cb97db4fb1c3 is separate from private-candidate coverage. Initial fulltest hit350seconds after compilation consumed346seconds; actual exit-15/timed_outtrue/groupempty and partial log are retained. Only that incomplete gate was repeated with unchanged source/target/command/350-second child deadline and a distinct log; full PASS followed. The private author’s earlier UNKNOWN child exit remains historical and is not retroactively repaired.

One normal non-force push through the existing verified same-identity personal S1 route succeeded after bundle1717B/hash/parent/tree/increment/source218 verification. Sixteen stage logs and owned-group settlement are bound. Initial PR-ref propagation lag was retained; authenticated PRhead and branch/PRrefs then matched without another push. Credential transfer, persistent helper/configuration, billing, group/ACL, workflow/protection, readiness, rerun and merge changes are zero.

Actual new-head runs37237503344 jobs111539462286/111539462419, MV337237503348 job111539462234 and managed37237501081 job111539458704 all have runner_id0/steps[] and explicit billing startup/not-started annotations. These are not executed test/coverage/browser/scanner failures. Current non-Draft status is preserved. CodeRabbit pending/Devin SUCCESS are not counted current-head approval. Hosted acceptance, any required eligible approval, ordinary protected merge and the original Goal remain incomplete.

Origin, action-intent digest, extension identifier, and evidence
failures now implement Display and std::error::Error. Each typed
variant keeps one stable message, and the error carries no source
that could widen the failure into another authority.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12d0929c-b375-4711-bca4-63a3f4fca540
📥 Commits

Reviewing files that changed from the base of the PR and between 87c4daa and b14493b.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • crates/originweave-core/src/lib.rs
  • crates/originweave-core/tests/action_intent_error_contract.rs
  • crates/originweave-core/tests/extension_id_error_contract.rs
  • crates/originweave-core/tests/origin_error_contract.rs
  • crates/originweave-evidence/src/lib.rs
  • crates/originweave-evidence/tests/evidence.rs
  • crates/originweave-evidence/tests/evidence_error_contract.rs
  • docs/TEST_STRATEGY.md

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


📝 Walkthrough

Walkthrough

core 및 evidence 오류 타입에 Display와 std::error::Error 구현 및 계약 테스트를 추가했습니다. 별도로 숫자만으로 된 SHA-256 식별자의 기존 수용과 원본 값 보존을 확인하는 특성화 테스트와 문서 기록을 추가했습니다.

Changes

표준 오류 계약

Layer / File(s) Summary
오류 타입 구현 및 계약 테스트
crates/originweave-core/src/lib.rs, crates/originweave-core/tests/*error_contract.rs, crates/originweave-evidence/src/lib.rs, crates/originweave-evidence/tests/evidence_error_contract.rs
OriginError, ActionIntentDigestError, ExtensionIdError, EvidenceError에 Display와 std::error::Error 구현을 추가했습니다. 테스트는 표시 문자열, 오류 원인 부재 및 표준 오류 타입 제약을 확인합니다.

SHA-256 provenance 특성화

Layer / File(s) Summary
숫자 전용 해시 수용 및 보존
crates/originweave-evidence/tests/evidence.rs, docs/TEST_STRATEGY.md, CHANGELOG.md
provenance 테스트에서 숫자만으로 된 소문자 SHA-256 해시의 생성 성공과 source_hash()의 원본 값 보존을 확인합니다. 테스트 전략과 변경 로그는 이를 제품 동작 변경이 아닌 특성화로 기록합니다.

Priority: ⬇️ Low

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

Change: Feature

Merge Risk: ⚪ Minimal · up to b1449

No actionable merge-blocking issue remains; merge after the pending exact-head checks complete.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to b1449

The new error interface exposes fixed category messages without underlying error chains. Validation and sensitive operations remain unchanged, and no material security risk introduced or worsened by this PR was found.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated change affects how library consumers represent existing failures, not the authority granted to callers. The added implementations format errors and provide trait compatibility; they do not add execution or sensitive-resource operations.

Trust Boundaries and Controls

  • observed — Existing validation remains responsible for admitting caller-controlled values. Origin parsing rejects user information, paths, unsupported schemes, and non-loopback HTTP; digest and extension parsing retain their format checks. The new error interfaces do not replace those controls.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 7 files. (2 skipped: … 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 제목은 공개 경계 오류에 안정적인 표준 계약을 추가하는 주요 변경 사항을 명확히 설명합니다.
Full details: Docstring Coverage

Explanation

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

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@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 reviewed the current-head product diff. Coverage is a separate gate.

Changed files

  • CHANGELOG.md — repository behavior
  • crates/originweave-core/src/lib.rs — Rust workspace crate API and tests
  • crates/originweave-core/tests/action_intent_error_contract.rs — Rust workspace crate API and tests
  • crates/originweave-core/tests/extension_id_error_contract.rs — Rust workspace crate API and tests
  • crates/originweave-core/tests/origin_error_contract.rs — Rust workspace crate API and tests
  • crates/originweave-evidence/src/lib.rs — Rust workspace crate API and tests
  • crates/originweave-evidence/tests/evidence_error_contract.rs — Rust workspace crate API and tests

Changed behavior

classDiagram
  class Origin
  class parse
  class as_str
  class scheme
  class host
  class OriginError
  class BrowserSessionId
  class BrowsingContextId
Loading

Changed API

  • Origin
  • parse
  • as_str
  • scheme
  • host
  • OriginError
  • BrowserSessionId
  • BrowsingContextId
  • DocumentEpoch
  • ObservedNodeHandle
  • new
  • validate_current
  • NodeHandleError
  • ActionIntentDigest
  • ActionIntentDigestError
  • SessionMode
  • ExecutionPurpose
  • InstructionSource
  • RobotsDecision
  • SecretDelivery
  • RiskClass
  • Capability
  • ActionKind
  • ApprovalScope
  • ApprovalEvidence
  • authorizes
  • ActionRequest
  • PolicyContext
  • set_approval
  • ExtensionId
  • ExtensionIdError
  • ExtensionAgentCapability
  • ExtensionAgentGrant
  • ExtensionAccessRequest
  • ExtensionAccessDecision
  • evaluate_extension_access
  • HttpMethod
  • EvidenceSourceKind
  • VerificationResult
  • EvidenceError
  • NetworkEvidence
  • capture
  • path
  • ProvenanceRecord
  • source_url
  • source_locator
  • source_hash

Findings

No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.

  • Head SHA: 3247c31bcd47498533faf87c35798de5c4c54052
  • Workflow run: 36422188944
  • Workflow attempt: 1
  • Coverage gate: failure

Review outcome

Coverage is a gate, not the review. This body reviews the changed product files.

Changed-File Evidence Map

classDiagram
  class Origin
  class parse
  class as_str
  class scheme
  class host
  class OriginError
  class BrowserSessionId
  class BrowsingContextId
Loading

@opencode-agent

opencode-agent Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

Coverage evidence did not pass, so approval is blocked. The formal pull-request review is the source-backed diff review, not this status comment.

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