From ce1686cb7d03a935ec08c88ab1c8888cbd35681b Mon Sep 17 00:00:00 2001 From: docushell-admin Date: Tue, 16 Jun 2026 18:08:33 +0530 Subject: [PATCH] Add split quote verify fixture Signed-off-by: docushell-admin --- crates/ethos-cli/tests/verify.rs | 16 ++- examples/verify/README.md | 11 ++ examples/verify/check_verify_alpha.py | 6 + .../goldens/native_split_quote_report.json | 50 ++++++++ .../verify/native_split_quote_citations.json | 12 ++ .../verify/native_split_quote_document.json | 109 ++++++++++++++++++ 6 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 examples/verify/goldens/native_split_quote_report.json create mode 100644 examples/verify/native_split_quote_citations.json create mode 100644 examples/verify/native_split_quote_document.json diff --git a/crates/ethos-cli/tests/verify.rs b/crates/ethos-cli/tests/verify.rs index 870854e..2ed574c 100644 --- a/crates/ethos-cli/tests/verify.rs +++ b/crates/ethos-cli/tests/verify.rs @@ -148,7 +148,7 @@ fn verify_alpha_schema_report_example_matches_cli_output() { #[test] fn verify_alpha_demo_reports_match_goldens() { let root = repo_root(); - let cases: [(&str, Vec, PathBuf); 4] = [ + let cases: [(&str, Vec, PathBuf); 5] = [ ( "native-grounded", vec![ @@ -179,6 +179,20 @@ fn verify_alpha_demo_reports_match_goldens() { ], root.join("examples/verify/goldens/opendataloader_grounded_report.json"), ), + ( + "native-split-quote", + vec![ + "verify".to_string(), + root.join("examples/verify/native_split_quote_document.json") + .display() + .to_string(), + "--citations".to_string(), + root.join("examples/verify/native_split_quote_citations.json") + .display() + .to_string(), + ], + root.join("examples/verify/goldens/native_split_quote_report.json"), + ), ( "native-stale", vec![ diff --git a/examples/verify/README.md b/examples/verify/README.md index 4bcb11b..53ef4c3 100644 --- a/examples/verify/README.md +++ b/examples/verify/README.md @@ -28,6 +28,17 @@ report warnings, non-grounded check reasons, and deterministic diagnostic lines. `make verify-alpha` also checks summary output for a native ungrounded citation set, including the non-grounded reason and diagnostic lines. +## Native Split Quote Grounding + +```bash +ethos verify examples/verify/native_split_quote_document.json \ + --citations examples/verify/native_split_quote_citations.json \ + --out verification_report.json +``` + +Expected result: `all_evidence_grounded: true`. The quote locator points at the second adjacent +text element, and the verifier grounds the claim only through the explicit adjacent-element rule. + ## Native Ethos Ungrounded Citations ```bash diff --git a/examples/verify/check_verify_alpha.py b/examples/verify/check_verify_alpha.py index ceba5bb..262bdfd 100644 --- a/examples/verify/check_verify_alpha.py +++ b/examples/verify/check_verify_alpha.py @@ -40,6 +40,12 @@ "citations": "examples/verify/opendataloader_grounded_citations.json", "golden": "examples/verify/goldens/opendataloader_grounded_report.json", }, + { + "name": "native-split-quote", + "input": "examples/verify/native_split_quote_document.json", + "citations": "examples/verify/native_split_quote_citations.json", + "golden": "examples/verify/goldens/native_split_quote_report.json", + }, { "name": "native-ungrounded", "input": "schemas/examples/document.example.json", diff --git a/examples/verify/goldens/native_split_quote_report.json b/examples/verify/goldens/native_split_quote_report.json new file mode 100644 index 0000000..544eb5b --- /dev/null +++ b/examples/verify/goldens/native_split_quote_report.json @@ -0,0 +1,50 @@ +{ + "all_evidence_grounded": true, + "capability_limits": [], + "checks": [ + { + "claim": { + "citation": { + "element_id": "e000011" + }, + "kind": "quote", + "text": "The alpha trust loop verifies grounded evidence" + }, + "evidence": { + "bbox": [ + 7200, + 10100, + 54000, + 11500 + ], + "page": "p0001", + "text": "The alpha trust loop verifies grounded evidence" + }, + "id": "v0001", + "match_method": "normalized_text_contains", + "semantic_unverified": false, + "status": "grounded", + "warnings": [] + } + ], + "document_fingerprint": "sha256:abe9f7f8984c31ea2dc26f2e4a231330c7cd7caaa773210eb4ee0a4cc41e707d", + "fingerprint_stale": false, + "grounding": { + "capabilities": { + "char_offsets": true, + "coordinate_origin": "top-left", + "crop_support": false, + "fingerprint": true, + "spans": true, + "tables": true + }, + "parser": { + "name": "ethos", + "version": "0.1.0" + } + }, + "schema_version": "1.0.0", + "unsupported_claim_kinds": [], + "verification_config_sha256": "4bb224166a04a25fed2dd3ecdb9638ddcc5b398658532b73f1c0547e4983d0b0", + "warnings": [] +} diff --git a/examples/verify/native_split_quote_citations.json b/examples/verify/native_split_quote_citations.json new file mode 100644 index 0000000..f45e2e3 --- /dev/null +++ b/examples/verify/native_split_quote_citations.json @@ -0,0 +1,12 @@ +{ + "document_fingerprint": "sha256:abe9f7f8984c31ea2dc26f2e4a231330c7cd7caaa773210eb4ee0a4cc41e707d", + "claims": [ + { + "kind": "quote", + "text": "The alpha trust loop verifies grounded evidence", + "citation": { + "element_id": "e000011" + } + } + ] +} diff --git a/examples/verify/native_split_quote_document.json b/examples/verify/native_split_quote_document.json new file mode 100644 index 0000000..e60119d --- /dev/null +++ b/examples/verify/native_split_quote_document.json @@ -0,0 +1,109 @@ +{ + "schema_version": "1.0.0", + "parser": { + "name": "ethos", + "version": "0.1.0" + }, + "profile": { + "id": "ethos-deterministic-v1", + "sha256": "d6145b9210845db39ad592ea549788432b52a649778c9947f5b2d91173e38070" + }, + "source": { + "fingerprint": "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", + "bytes": 48213 + }, + "config_sha256": "68cc61753d299917cc7773f069c18aca31c8ac68f43736a94cb57eee05144084", + "payload_sha256": "5eac07f431356ca1a1697cd971fdc3bc1f1404068c65a70e3e052e8f2abc8846", + "fingerprint": "sha256:abe9f7f8984c31ea2dc26f2e4a231330c7cd7caaa773210eb4ee0a4cc41e707d", + "payload": { + "coordinate_system": { + "origin": "top-left", + "unit": "quantum", + "quantum_per_point": 100 + }, + "pages": [ + { + "id": "p0001", + "index": 1, + "width": 61200, + "height": 79200, + "rotation": 0 + } + ], + "elements": [ + { + "id": "e000010", + "type": "text_block", + "page": "p0001", + "bbox": [ + 7200, + 10100, + 30600, + 11500 + ], + "text": "The alpha trust loop verifies" + }, + { + "id": "e000011", + "type": "text_block", + "page": "p0001", + "bbox": [ + 30600, + 10100, + 54000, + 11500 + ], + "text": "grounded evidence" + } + ], + "spans": [], + "tables": [], + "chunks": [ + { + "id": "c000010", + "text": "The alpha trust loop verifies grounded evidence", + "element_refs": [ + "e000010", + "e000011" + ], + "page_refs": [ + "p0001" + ], + "bboxes": [ + { + "page": "p0001", + "bbox": [ + 7200, + 10100, + 30600, + 11500 + ] + }, + { + "page": "p0001", + "bbox": [ + 30600, + 10100, + 54000, + 11500 + ] + } + ], + "token_estimate": { + "count": 7, + "estimator": "ethos-ws-heuristic@1", + "approximate": true + } + } + ], + "regions": [], + "security_warnings": [], + "parser_warnings": [] + }, + "diagnostics": { + "parse_ms": 14, + "peak_rss_bytes": 28311552, + "host": "example \u2014 excluded from canonical equality", + "source_path": "/tmp/q3-summary.pdf" + } +}