Commit Graph

7 Commits

Author SHA1 Message Date
890f10cbab Catch order status changes via an open-order hot set
Hold/release rewrites OCRH.DCSTAT and DCHREA without touching any date
column, so no watermark could see it. A full-table row diff of LGDAT.OCRH
vs cms.ocrh (468,823 rows both sides) found 168 drifted rows, 0 missing,
0 extra -- and 159 of them changed with no date moving at all (checked
dcudat/dcodat/dccdat/dcmdat/dchdat/dcxdat/dcsdat/dcmxdt). 155 of the
drifts were DCSTAT, 4 DCHREA.

Every drifted row was still open (DCSTAT in A/N/H/B); none had reached
'C'. Only ~2,044 of 468,823 orders are open, so re-pulling the whole open
set each run is cheap and catches 100% of the observed drift. Applied to
ocrh and to the two modules that read its changed-set, ocri and ocrs.

Result: drift 168 -> 11 rows, DCSTAT 155 -> 3.

No invoice-driven branch: tested against LGDAT.OCRHT (CMS's header change
log, keyed DC3TMSP-leading via logical OCRHTX1) over the live watermark
window -- 1,107 headers changed, 65 missed by the date branches, 0 missed
by dates+open, and a 5- or 30-day invoiced-orders branch added exactly 0.
Closing an order writes dcudat/dccdat, so the date window covers the flip.

Also evaluated LGDAT.OCRIT (the order-line change log) as a replacement
for the open-order branch and rejected it: at the live 8-day watermark it
reports 0 changed orders not already caught, at ~12x the predicate cost,
and its lower row count means it declines to pull 18k lines the open set
would -- safe only if CMS's logging is complete, which is unverified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 11:02:57 -04:00
e5c1ed37f4 updates 2026-08-06 15:39:22 -04:00
560056c39c Add Bucket 2 CMS incremental modules (6 tables)
Watermarked incremental syncs for qcrh, qcri, qtnote, iprcct, icstt, methh,
ported from the legacy /opt/sync merge logic. Rows initially backfilled from
lgdat; columns match the cms.* dest (lgdat subset), pulled from DB2.

Merge keys: qcrh dcord#, qcri ddord#, qtnote ggkey, iprcct tadate,
icstt jhdate (legacy INSERT..ON CONFLICT -> keyed delete+insert),
methh composite anpart,anplnt (legacy DELETE WHERE EXISTS).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 22:17:39 -04:00
6a3ac0e436 Add Bucket 1 CMS→pipekit modules (41 tables)
Full-reload modules for the CMS/DB2 tables migrated off /opt/sync, landing
in cms.*. Columns introspected fresh from DB2 (QSYS2.SYSCOLUMNS). Three large
tables use incremental merge ported from the legacy sync instead of full
reload: iprcctn/iprccto (date watermark on t8date/t7date), ffpdglr1 (fiscal-
period watermark via rprh join, keyed on btid).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 12:33:48 -04:00
c073e70114 Fix _custom_sales_line_connector map: dest_names to match table
Five dest_names in the column map were junk from a crude source-name
sanitizer (ext._price, margin__, _hd_grower, ext._cost,
ext._margin_dollar) and didn't match the physical gp table's clean names
(ext_price, margin_pct, hd_grower, ext_cost, ext_margin_dollar). The load
is positional so this was harmless for years — until the new dest-table
preflight's name check started (correctly) flagging the drift and failing
the daily run. Align the map to the table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 10:09:52 -04:00
720ea52877 activate the ffsbglr1 2026-07-22 15:16:07 -04:00
dd9f89f4b5 feat: version-control pipeline definitions via export/apply
Add `pipekit export` / `pipekit apply` (pipekit/config_io.py) to serialise the
DB's config — drivers, connections, modules (+ columns, watermarks, hooks),
groups, schedules — to a git-trackable text tree under config/, and rehydrate
it. SQLite stays runtime state; definitions become diffable/reviewable/
revertible.

- config only: run_log/group_run/settings and per-run state columns excluded
- name-keyed refs (portable across databases); source_query in .sql sidecars;
  columns as real JSON arrays for line-by-line diffs
- newline-normalised so CRLF-vs-LF is never a spurious change
- apply is create/update by name; child collections fully synced; top-level
  deletes gated behind --prune; --dry-run prints the plan
- round-trip is identity (export -> apply --dry-run == nothing to do)

Commits the current config/ as the first baseline, capturing the freshly
populated columns_json for rm00101/rm00301/iv00101. Documented in SPEC.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 10:56:55 -04:00