-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/sync offline consistency #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
df67e9c
816d110
24b8356
eb06feb
5a6b396
0143b2e
565afce
6fb9f98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| "area": "evidence_attribution", | ||
| "cases": [ | ||
| { | ||
| "case_id": "attribution_case_late_payment", | ||
| "input_data": { | ||
| "query": "What is the interest rate on late payments?", | ||
| "answer": "The interest rate on late payments is 5% per annum." | ||
| }, | ||
| "expected_output": "Interest on late payments shall accrue at a rate of 5% per annum.", | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "document": "loan_agreement.txt" | ||
| } | ||
| }, | ||
| { | ||
| "case_id": "attribution_case_notices", | ||
| "input_data": { | ||
| "query": "Who is the main contact for notices?", | ||
| "answer": "Notices should be sent to John Doe." | ||
| }, | ||
| "expected_output": "All notices shall be sent to the attention of John Doe.", | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "document": "service_agreement.txt" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "area": "extraction", | ||
| "cases": [ | ||
| { | ||
| "case_id": "extraction_case_contract", | ||
| "input_data": { | ||
| "file_path": "fixtures/extraction/sample_contract.txt" | ||
| }, | ||
| "expected_output": { | ||
| "effective_date": "October 1, 2026", | ||
| "provider": "DevCorp Solutions", | ||
| "client": "MegaRetail Inc", | ||
| "monthly_fees": 15000.0, | ||
| "governing_law": "State of New York" | ||
| }, | ||
| "tolerance": 0.01, | ||
| "metadata": { | ||
| "document_type": "Software Services Agreement" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| SOFTWARE SERVICES AGREEMENT | ||
| Effective Date: October 1, 2026. | ||
| Provider: DevCorp Solutions. | ||
| Client: MegaRetail Inc. | ||
| Fees: $15000.00 USD per month. | ||
| Governing Law: State of New York. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "area": "graph_generation", | ||
| "cases": [ | ||
| { | ||
| "case_id": "graph_case_service_agreement", | ||
| "input_data": { | ||
| "document_id": "doc_001" | ||
| }, | ||
| "expected_output": { | ||
| "nodes": [ | ||
| {"id": "doc_001", "type": "document", "label": "Service Agreement"}, | ||
| {"id": "party_001", "type": "party", "label": "Acme Corp"}, | ||
| {"id": "party_002", "type": "party", "label": "Beta LLC"}, | ||
| {"id": "clause_001", "type": "clause", "label": "Termination Clause"} | ||
| ], | ||
| "edges": [ | ||
| {"source": "doc_001", "target": "party_001", "type": "HAS_SIGNATORY"}, | ||
| {"source": "doc_001", "target": "party_002", "type": "HAS_SIGNATORY"}, | ||
| {"source": "doc_001", "target": "clause_001", "type": "CONTAINS_CLAUSE"} | ||
| ] | ||
| }, | ||
| "tolerance": 0.2, | ||
| "metadata": { | ||
| "document_type": "Service Agreement" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "area": "ocr", | ||
| "cases": [ | ||
| { | ||
| "case_id": "ocr_case_agreement", | ||
| "input_data": { | ||
| "file_path": "fixtures/ocr/sample_agreement.txt" | ||
| }, | ||
| "expected_output": "NDA / CONFIDENTIALITY AGREEMENT\nThis Agreement is entered into on August 26, 2026, by and between:\n1. Party A: ACME Corporation, located at 123 Industrial Way,\n2. Party B: Beta LLC, located at 456 Tech Boulevard.\nThe parties agree to keep all shared information confidential.", | ||
| "tolerance": 0.05, | ||
| "metadata": { | ||
| "document_type": "NDA", | ||
| "length_chars": 268 | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| NDA / CONFIDENTIALITY AGREEMENT | ||
| This Agreement is entered into on August 26, 2026, by and between: | ||
| 1. Party A: ACME Corporation, located at 123 Industrial Way, | ||
| 2. Party B: Beta LLC, located at 456 Tech Boulevard. | ||
| The parties agree to keep all shared information confidential. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| { | ||
| "area": "offline_consistency", | ||
| "cases": [ | ||
| { | ||
| "case_id": "offline_consistency_merge_non_conflicting", | ||
| "input_data": { | ||
| "document_id": "doc_001", | ||
| "initial_state": { | ||
| "title": "Original Title", | ||
| "content": "Original Content" | ||
| }, | ||
| "client_1_offline_ops": [ | ||
| { | ||
| "op": "update", | ||
| "field": "title", | ||
| "value": "Client 1 Draft", | ||
| "timestamp": 1724670000 | ||
| } | ||
| ], | ||
| "client_2_offline_ops": [ | ||
| { | ||
| "op": "update", | ||
| "field": "content", | ||
| "value": "Client 2 Content", | ||
| "timestamp": 1724671000 | ||
| } | ||
| ] | ||
| }, | ||
| "expected_output": { | ||
| "state": { | ||
| "title": "Client 1 Draft", | ||
| "content": "Client 2 Content" | ||
| }, | ||
| "data_loss": false | ||
| }, | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "scenario": "Concurrent updates to different fields should merge successfully" | ||
| } | ||
| }, | ||
| { | ||
| "case_id": "offline_consistency_resolve_conflicting_lww", | ||
| "input_data": { | ||
| "document_id": "doc_002", | ||
| "initial_state": { | ||
| "title": "Original Title" | ||
| }, | ||
| "client_1_offline_ops": [ | ||
| { | ||
| "op": "update", | ||
| "field": "title", | ||
| "value": "Title A", | ||
| "timestamp": 1724670000 | ||
| } | ||
| ], | ||
| "client_2_offline_ops": [ | ||
| { | ||
| "op": "update", | ||
| "field": "title", | ||
| "value": "Title B", | ||
| "timestamp": 1724672000 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The LWW case works because client 2's timestamp is simply larger. The hard case for last-write-wins is the one where the client that wrote last has a slow clock, so the ordering by timestamp disagrees with the real ordering. A third case with client 1 writing later in real terms but carrying the smaller timestamp would tell you whether the server orders by its own receipt time or blindly trusts the client, which is the thing worth knowing here. |
||
| } | ||
| ] | ||
| }, | ||
| "expected_output": { | ||
| "state": { | ||
| "title": "Title B" | ||
| }, | ||
| "data_loss": false | ||
| }, | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "scenario": "Concurrent updates to same field should resolve using LWW without data loss" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| { | ||
| "area": "permissions", | ||
| "cases": [ | ||
| { | ||
| "case_id": "permissions_admin_same_org_write", | ||
| "input_data": { | ||
| "user_id": "user_admin_org_a", | ||
| "role": "admin", | ||
| "organization_id": "org_a", | ||
| "resource_id": "doc_org_a_001", | ||
| "action": "write" | ||
| }, | ||
| "expected_output": true, | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "scenario": "Admin of Org A writing to document in Org A" | ||
| } | ||
| }, | ||
| { | ||
| "case_id": "permissions_admin_cross_org_write", | ||
| "input_data": { | ||
| "user_id": "user_admin_org_a", | ||
| "role": "admin", | ||
| "organization_id": "org_a", | ||
| "resource_id": "doc_org_b_001", | ||
| "action": "write" | ||
| }, | ||
| "expected_output": false, | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "scenario": "Admin of Org A writing to document in Org B" | ||
| } | ||
| }, | ||
| { | ||
| "case_id": "permissions_viewer_same_org_read", | ||
| "input_data": { | ||
| "user_id": "user_viewer_org_a", | ||
| "role": "viewer", | ||
| "organization_id": "org_a", | ||
| "resource_id": "doc_org_a_001", | ||
| "action": "read" | ||
| }, | ||
| "expected_output": true, | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "scenario": "Viewer of Org A reading document in Org A" | ||
| } | ||
| }, | ||
| { | ||
| "case_id": "permissions_viewer_same_org_write", | ||
| "input_data": { | ||
| "user_id": "user_viewer_org_a", | ||
| "role": "viewer", | ||
| "organization_id": "org_a", | ||
| "resource_id": "doc_org_a_001", | ||
| "action": "write" | ||
| }, | ||
| "expected_output": false, | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "scenario": "Viewer of Org A writing to document in Org A" | ||
| } | ||
| }, | ||
| { | ||
| "case_id": "permissions_user_cross_org_read", | ||
| "input_data": { | ||
| "user_id": "user_member_org_a", | ||
| "role": "member", | ||
| "organization_id": "org_a", | ||
| "resource_id": "doc_org_b_001", | ||
| "action": "read" | ||
| }, | ||
| "expected_output": false, | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "scenario": "Member of Org A reading document in Org B" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "area": "retrieval", | ||
| "cases": [ | ||
| { | ||
| "case_id": "retrieval_case_billing", | ||
| "input_data": { | ||
| "query": "billing terms" | ||
| }, | ||
| "expected_output": [ | ||
| "doc_billing_001", | ||
| "doc_billing_002" | ||
| ], | ||
| "tolerance": 0.5, | ||
| "metadata": { | ||
| "domain": "finance" | ||
| } | ||
| }, | ||
| { | ||
| "case_id": "retrieval_case_termination", | ||
| "input_data": { | ||
| "query": "contract termination notice period" | ||
| }, | ||
| "expected_output": [ | ||
| "doc_termination_001" | ||
| ], | ||
| "tolerance": 0.0, | ||
| "metadata": { | ||
| "domain": "legal" | ||
| } | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both cases assert on the server's final state only. Convergence, meaning both clients end up seeing the same thing after they sync back, is the actual property this area is named for and nothing here checks it. Worth adding an expected per-client view to the case shape, even if it starts out identical to
state, so the fixture format can express it later.