Skip to main content

Accumulate CSVs Command

Roll a new month's merged transactions into the cumulative yearly dataset.

Arguments

  • $1: Month directory path

Input

  • New month's file: <month-dir>/agentic_merged_transactions.csv
  • Existing cumulative (if exists): <parent>/agentic_cumulative_dataset_<year>.csv

Output

  • Updated cumulative: <parent>/agentic_cumulative_dataset_<year>.csv

Accumulation Rules

First Month

If cumulative doesn't exist:

  1. Copy new month's merged transactions
  2. Create cumulative file

Subsequent Months

  1. Read existing cumulative
  2. Read new month's data
  3. Verify no date overlap
  4. Concatenate new data
  5. Sort by date descending
  6. Write updated cumulative

Validation

  • No date overlap between months
  • Warn if gap between months
  • Check for exact duplicates

Workflow

  1. Parse directory path from $1
  2. Read new month's agentic_merged_transactions.csv
  3. Check if cumulative exists in parent
  4. Merge with existing data
  5. Sort by date descending
  6. Write cumulative file
  7. Stop hook validates output

Usage

/finance-accumulate data/mock_dataset_feb_1st_2026/