Cumulative array aggregation in Postgres
You want to use window functions.

select data, array_agg(unnest) over (partition by data order by ordinality)
 from records, unnest(path) with ordinality 


In this case, the default "framing" does exactly what you want: from the beginning to the current row; so you don't have to include a framing clause.