Skip to main content
Loading navigation
Back to prompt library

Build a Frictionless Evidence Ledger and Provenance Hasher — implementation

Linked challenge: Build a Frictionless Evidence Ledger and Provenance Hasher

Prompt source

implementation98 lines11 sectionsNo variables1 code block
## Build
Reconcile disparate investigator findings, transaction tracing sheets, and watchlist alerts into a unified case ledger. Track data provenance timestamps and explicit evidentiary gaps to prepare defensible case summaries.

## User
Lead Financial Crime Investigator

## Workflow
1. Ingest tabular transaction logs and evidentiary finding notes using Frictionless Data resource schemas.
2. Reconcile contradictory data points, such as conflicting counterparty names or overlapping transaction dates.
3. Assign verifiable provenance hashes and source URIs to every accepted evidence statement.
4. Synthesize a chronological evidence ledger detailing verified facts, source origins, and unresolved data quality issues.

## Interface
Audit ledger dashboard with side-by-side evidence source comparisons, data quality flags, and markdown export tools.

## Data
Synthesize normalized tabular CSV logs and accompanying Frictionless resource schema JSON descriptors stored locally.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Frictionless data validation](https://raw.githubusercontent.com/frictionlessdata/frictionless-py/main/README.md)
Uses Frictionless Data Python conventions to validate evidence tables, inspect field formats, and detect missing cells.

## Tools
langgraph, frictionless, pydantic.
LangGraph choreographs multi-stage evidentiary reconciliation, data quality gating, and provenance verification nodes.
Requires context analysis and discrepancy detection capabilities; hosted Claude or local Qwen 2.5.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Validates input transaction tables against Frictionless Data schema descriptors.
- Flags and isolates rows containing missing identifiers or unparseable timestamps.
- Attaches cryptographic hash provenance to each reconciled evidentiary line item.
- Produces a standardized audit-ready evidence ledger exportable in Markdown and JSON formats.

## Starter Examples
```json
[
  {
    "input": {
      "case_id": "INV-3301",
      "evidence_rows": [
        {
          "evidence_id": "E1",
          "date": "2023-08-01",
          "source": "Bank Statement A",
          "amount": 50000,
          "counterparty": "Apex Trading"
        },
        {
          "evidence_id": "E2",
          "date": "2023-08-01",
          "source": "SWIFT MT103",
          "amount": 50000,
          "counterparty": "Apex Trading LLC"
        }
      ]
    },
    "expected_output": {
      "reconciliation_status": "CONVERGENT",
      "reconciled_records": 1,
      "discrepancies": [],
      "provenance_hash": "a1b2c3d4e5f6",
      "summary": "Bank statement and SWIFT transmission agree on 50,000 USD transfer to Apex Trading LLC on 2023-08-01."
    }
  },
  {
    "input": {
      "case_id": "INV-3302",
      "evidence_rows": [
        {
          "evidence_id": "E3",
          "date": "2023-08-05",
          "source": "Bank Statement B",
          "amount": 12000,
          "counterparty": "Vanguard Logistics"
        },
        {
          "evidence_id": "E4",
          "date": "2023-08-06",
          "source": "Customs Declaration",
          "amount": 95000,
          "counterparty": "Vanguard Logistics"
        }
      ]
    },
    "expected_output": {
      "reconciliation_status": "DISCREPANT",
      "reconciled_records": 0,
      "discrepancies": [
        {
          "field": "amount",
          "diff": 83000,
          "note": "Substantial valuation variance between declared customs and settled payment."
        }
      ],
      "provenance_hash": "f6e5d4c3b2a1",
      "summary": "Unresolved valuation discrepancy between customs declaration (95,000) and settled bank payment (12,000)."
    }
  }
]
```

## Safety
Maintains an advisory case ledger; does not submit external Suspicious Activity Reports autonomously.
Use mock external writes. Require human review before any real deployment.