Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion crates/ethos-cli/tests/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, PathBuf); 4] = [
let cases: [(&str, Vec<String>, PathBuf); 5] = [
(
"native-grounded",
vec![
Expand Down Expand Up @@ -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![
Expand Down
11 changes: 11 additions & 0 deletions examples/verify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions examples/verify/check_verify_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
50 changes: 50 additions & 0 deletions examples/verify/goldens/native_split_quote_report.json
Original file line number Diff line number Diff line change
@@ -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": []
}
12 changes: 12 additions & 0 deletions examples/verify/native_split_quote_citations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"document_fingerprint": "sha256:abe9f7f8984c31ea2dc26f2e4a231330c7cd7caaa773210eb4ee0a4cc41e707d",
"claims": [
{
"kind": "quote",
"text": "The alpha trust loop verifies grounded evidence",
"citation": {
"element_id": "e000011"
}
}
]
}
109 changes: 109 additions & 0 deletions examples/verify/native_split_quote_document.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading