pf_app
Go to file
Paul Trowbridge b014f7815a Clone a version's definition without running it
A segment only existed once it had been loaded -- a pf.log entry with
forecast rows behind it -- so there was nowhere to hold "this is the cut I
want, but the dates need changing first", and rebuilding a scenario meant
retyping every segment by hand.

pf.load_plan is the definition on its own, with run_logid naming the log
entry it produced once it has been run. Not in pf.log deliberately: every
row there means a write happened, and unexecuted intent would cost that
table its meaning. The FK is ON DELETE SET NULL, so undoing a load returns
its plan to unrun rather than taking the definition with it.

POST /sources/:id/versions now takes clone_from: settings, version-scoped
layouts, and the segments as plans, running none of them. Plans are read
from the template's own pf.load_plan rows, or derived from its
baseline/reference log entries when it has none -- every version built
before this -- since params already stores the filters and the offset.

Adjustments are not copied in any form. A scale's target was sized against
the rows that were there.

Shift years exists because cloning a definition forward a year is the
reason to clone one, and doing it by hand across eight segments is where
the mistakes come from. Filter values only, and only a bare 20xx: a month
reads "04 - Sep" and a part number that looks like a year must not move.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 10:23:35 -04:00
lib Carry every date column through an adjustment 2026-09-21 09:19:09 -04:00
public Add UX mockup and update spec with navigation direction 2026-04-25 14:56:29 -04:00
routes Clone a version's definition without running it 2026-09-21 10:23:35 -04:00
setup_sql Clone a version's definition without running it 2026-09-21 10:23:35 -04:00
ui Clone a version's definition without running it 2026-09-21 10:23:35 -04:00
.env.example Put the app behind a login 2026-09-14 22:20:25 -04:00
.gitignore Refresh lockfiles and keep .env backups out of the tree 2026-09-16 17:45:58 -04:00
CLAUDE.md Clone a version's definition without running it 2026-09-21 10:23:35 -04:00
install.sh Put the app behind a login 2026-09-14 22:20:25 -04:00
package-lock.json Refresh lockfiles and keep .env backups out of the tree 2026-09-16 17:45:58 -04:00
package.json Put the app behind a login 2026-09-14 22:20:25 -04:00
PERSPECTIVE.md Filter aggregates with the rest of the layout 2026-09-19 14:43:00 -04:00
pf_perspective_options.md Record DuckDB virtual-server spike findings; choose display-grain pre-aggregation 2026-08-17 21:47:55 -04:00
pf_spec.md Merge feature/static-grain: display-grain pre-aggregation 2026-09-16 18:08:20 -04:00
pf.sh Fix the territory commands' success message and menu order 2026-09-18 11:47:02 -04:00
server.js Clone a version's definition without running it 2026-09-21 10:23:35 -04:00