Skip to main content
Loading navigation
Back to prompt library

Build a Frictionless Tabular Transaction Ledger Validator — implementation

Linked challenge: Build a Frictionless Tabular Transaction Ledger Validator

Prompt source

implementation99 lines11 sectionsNo variables1 code block
## Build
Validate investigative financial transaction spreadsheets using Frictionless Data schemas. Detect corrupted tabular headers, missing currency cell values, and out-of-bounds dates prior to ingestion.

## User
Financial intelligence unit case supervisor

## Workflow
1. Load raw financial transaction spreadsheets submitted by field investigators.
2. Apply a strict Frictionless Data schema to validate column headers, data types, and required fields.
3. Identify row-level errors such as blank currency cells or malformed ISO date strings.
4. Generate a structured validation report detailing tabular anomalies and necessary field corrections.

## Interface
Master case ledger view with side-by-side reconciliation panels, discrepancy flags, and narrative synthesis controls.

## Data
Construct synthetic multi-source case folders containing CSV transaction logs, JSON alerts, and markdown analyst notes.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Frictionless data validation](https://raw.githubusercontent.com/frictionlessdata/frictionless-py/main/README.md)
Applies Frictionless Data validation principles to audit tabular transaction logs and ensure schema compliance.

## Tools
mastra-ai, frictionless, pydantic-ai.
Coordinates asynchronous document ingestion, Frictionless table validation, and timeline generation tasks.
Context-aware LLM capable of chronologically resolving overlapping narrative notes and ledger records.

## 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 tabular transaction records against a strict Frictionless table schema.
- Highlights conflicting dates or amounts across disparate case documentation sources.
- Produces a chronological sequence of proven facts with supporting evidence IDs.
- Exports a defensible case handover ledger suitable for supervisory audit.

## Starter Examples
```json
[
  {
    "input": {
      "schema": {
        "fields": [
          {
            "name": "amount",
            "type": "number"
          },
          {
            "name": "date",
            "type": "date"
          }
        ]
      },
      "rows": [
        {
          "row_number": 2,
          "amount": null,
          "date": "2024-01-15"
        }
      ]
    },
    "expected_output": {
      "validation_passed": false,
      "error_count": 1,
      "errors": [
        {
          "row": 2,
          "field": "amount",
          "code": "missing-cell",
          "message": "Row 2 has a missing cell in field amount"
        }
      ]
    }
  },
  {
    "input": {
      "schema": {
        "fields": [
          {
            "name": "amount",
            "type": "number"
          },
          {
            "name": "date",
            "type": "date"
          }
        ]
      },
      "rows": [
        {
          "row_number": 3,
          "amount": 2500,
          "date": "2024-02-10"
        }
      ]
    },
    "expected_output": {
      "validation_passed": true,
      "error_count": 0,
      "errors": []
    }
  }
]
```

## Safety
Maintains an unalterable audit ledger without modifying underlying bank records or executing transactions.
Use mock external writes. Require human review before any real deployment.