feat(evidence): keep embedded image URIs as positional non-lexical units - #58
Conversation
data:image/<type>;base64 payloads retain their original source span and media type. They cannot be used as lexical inference text. No new migration.
|
Warning Review limit reachedNext included review available in 13 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
Changes임베디드 이미지 지원
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🟡 Moderate · up to The change adds positional handling for embedded image URIs, but valid embedded image data may still be rejected as ordinary lexical text, causing supported evidence to be omitted or misclassified. This bounded correctness issue should be fixed or explicitly accepted before merge. Sequence Diagram(s)sequenceDiagram
participant Caller
participant embedded_image_units
participant EmbeddedImageUnit
participant EvidenceError
Caller->>embedded_image_units: DocumentRecord 전달
embedded_image_units->>embedded_image_units: data:image URI와 미디어 타입 검사
embedded_image_units->>EmbeddedImageUnit: 유효한 스팬과 미디어 타입 생성
embedded_image_units-->>Caller: Vec<EmbeddedImageUnit> 반환
embedded_image_units->>EvidenceError: 빈 입력 또는 비정상 타입 오류 반환
Caller->>refuse_base64_image_as_lexical_text: 텍스트 전달
refuse_base64_image_as_lexical_text->>EvidenceError: 이미지 URI lexical text 거부
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Self-review completed and draft converted to ready at exact head e60de27. evidence_core passes with pinned Rust 1.97.1 (4 unit, 1 crate, 2 embedded-image, 4 identifier, 11 records/spans, 9 wire, 4 wire-edge, all doctests), including exact URI source spans/media types and refusal of base64 payloads as lexical evidence. Python quality checks pass 11 tests; Rust docstrings, documentation validator, and git diff --check pass. OCR/object tags/image retrieval remain downstream consumers of this preserved unit, not fabricated in this slice. Please review only e60de27 and require protected Checks plus independent approval. |
|
Resolved the merge conflict and pushed exact head e98ada4.\n\n- Merged current protected main 7c29e7c normally and preserved the embedded-image contract, research note, traceability row, and documentation links alongside current main entries.\n- Verification on Rust 1.97.1: cargo fmt --all -- --check; cargo test --workspace --all-features --offline; cargo clippy --workspace --all-targets --all-features --offline -- -D warnings. Python quality (89 passed), docstring, workspace-contract, documentation, and diff checks passed.\n- The first full compile hit local disk exhaustion from concurrent generated targets; generated targets were cleaned and the complete rerun passed.\n\nPlease refresh current-head Checks and review this exact commit. |
|
Implemented and pushed the current-head repair for the embedded-image coverage gap.
Hosted checks have been re-triggered for this exact head; no qualifying independent approval is present yet. |
|
Exact-head review refresh for ebd4ebd. Hosted Checks are terminal-success; local workspace, Rust docstring, and diff checks pass. Re-review the positional embedded-image span contract and fail-closed validation on this exact SHA only. @opencode-agent @cwl-noema-review @coderabbitai |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='ebd4ebd080227c1faed72b04a24baf64b03b62be'
actual="$(git rev-parse HEAD)"
printf 'checked_out_head=%s\nexpected_head=%s\n' "$actual" "$expected"
printf '\n== Pull request metadata ==\n'
gh pr view 58 --repo ContextualWisdomLab/TEPP \
--json number,title,state,isDraft,headRefOid,reviewDecision,statusCheckRollup,reviews \
--jq '{number,title,state,isDraft,headRefOid,reviewDecision,statusCheckRollup:[.statusCheckRollup[]|{name,conclusion,status}],reviews:[.reviews[]|{author:.author.login,state,commitId}]}'
printf '\n== Exact-head diff summary ==\n'
git diff --stat "${expected}^" "$expected"
printf '\n== Exact-head changed files ==\n'
git diff --name-only "${expected}^" "$expected"
printf '\n== Rust source/test file map ==\n'
fd -t f -e rs . | sort | sed -n '1,240p'
printf '\n== Embedded image symbols and test assertions ==\n'
rg -n -C 5 --type rust \
'data:image|embedded.image|EmbeddedImage|media.type|media_type|base64|source.span|source_span|lexical' \
.
printf '\n== Exact-head patch ==\n'
git diff --find-renames --find-copies --unified=80 "${expected}^" "$expected" -- '*.rs' '*.md' '*.toml'Length of output: 84667 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== image_unit.rs, line-numbered =='
nl -ba crates/evidence_core/src/image_unit.rs | sed -n '1,180p'
printf '%s\n' '== SourceSpan constructor and validation =='
ast-grep outline crates/evidence_core/src/span.rs --items all --type function --match 'new|text' --view expanded
rg -n -A100 -B12 --type rust 'pub fn new\s*\(' crates/evidence_core/src/span.rs
printf '%s\n' '== Direct public API call sites outside tests =='
rg -n -C 4 --type rust \
'(embedded_image_units|refuse_base64_image_as_lexical_text)\s*\(' \
-g '!crates/evidence_core/src/image_unit.rs' \
-g '!**/tests/**' .
printf '%s\n' '== All media_type consumers =='
rg -n -C 4 --type rust '\.media_type\s*\(' .
printf '%s\n' '== PR merge base and full PR file changes =='
base="$(git merge-base origin/main HEAD)"
printf 'merge_base=%s\n' "$base"
git diff --name-status "$base" HEADLength of output: 1278 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== image_unit.rs, line-numbered =='
awk '{printf "%6d\t%s\n", NR, $0}' crates/evidence_core/src/image_unit.rs | sed -n '1,180p'
printf '%s\n' '== SourceSpan constructor and validation =='
ast-grep outline crates/evidence_core/src/span.rs --items all --type function --match 'new|text' --view expanded || true
rg -n -A100 -B12 --type rust 'pub fn new\s*\(' crates/evidence_core/src/span.rs
printf '%s\n' '== Direct public API call sites outside tests =='
rg -n -C 4 --type rust \
'(embedded_image_units|refuse_base64_image_as_lexical_text)\s*\(' \
-g '!crates/evidence_core/src/image_unit.rs' \
-g '!**/tests/**' . || true
printf '%s\n' '== All media_type consumers =='
rg -n -C 4 --type rust '\.media_type\s*\(' . || true
printf '%s\n' '== PR merge base and full PR file changes =='
base="$(git merge-base origin/main HEAD)"
printf 'merge_base=%s\n' "$base"
git diff --name-status "$base" HEADLength of output: 17196
I found one blocking issue.
Hosted checks are successful for this head. The exact positional-unit contract is not complete until this boundary case passes.
|
|
Exact-head review receipt: current protected main was merged normally and conflict repair was pushed at 05870ce. Local proof: Rust fmt, full offline workspace tests, workspace clippy -D warnings, documentation validator, workspace contract, git diff --check, CodeGraph sync, and CodeReviewGraph update. The prior embedded-image boundary review is covered by the exact positional-span and fail-closed tests. Please evaluate this exact SHA with independent Noema/OpenCode review; current-head required Checks remain authoritative before merge. @cwl-noema-review @opencode-agent |
Maintainer audit — exact head 431561a
|
…ed-image-units-working # Conflicts: # CHANGELOG.md # DOCUMENTATION.md # docs/TRACEABILITY.md # docs/adr/0009-purpose-bound-pii-governance.md # docs/adr/0010-adaptive-llm-orchestration.md # docs/adr/0011-standalone-modular-msa-boundary.md # docs/adr/0013-bitemporal-persistence-reproducibility-and-split-authority.md # docs/research/standards-and-literature.md # docs/validation/temporal-event-foundation.md
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
| fn is_image_media_type_token(media_type: &str) -> bool { | ||
| let Some(subtype) = base_media_type(media_type).strip_prefix("image/") else { | ||
| return false; | ||
| }; | ||
| !subtype.is_empty() | ||
| && subtype | ||
| .bytes() | ||
| .all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'.' | b'+' | b'-')) | ||
| } |
There was a problem hiding this comment.
📝 Info: Refusal and extraction classify media types differently
refuse_base64_image_as_lexical_text accepts any image/<token> subtype (is_image_media_type_token), while embedded_image_units restricts to the whitelist. The two functions therefore classify the same data:image/...;base64, input differently. Tests confirm this is intentional, refusal being deliberately broader.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
#37–#57 remain review-blocked (no independent APPROVE). #37 and #45 kept ready. Next no-0008 gap: embedded
data:imageunits in existingevidence_core(independent of #56).data:image/<type>;base64,...and keep the original source spanimage/pngfrom a known URITest plan
embedded_image_contractfailed withE0432/E0599cargo test -p evidence_core --offlinecargo clippy -p evidence_core --all-targets --offline -- -D warningspython3 scripts/validate_documentation.pyandcheck_docstrings.pyDo not self-approve or merge. Prefer merge #37 then #45 when eligible. Do not allocate 0008.
Summary by CodeRabbit
새 기능
data:imageURI를 감지하고 원본 위치와 미디어 유형을 보존합니다.버그 수정
문서