MEGAINFRA-WEBAPP/scripts
DEls 252dd7eb6a fix(dn): let staged ingestion run against the real PocketBase schema
Three faults stopped the staged pipeline from ingesting anything once it
met a live PocketBase rather than a test double.

PocketBase treats 0 as blank for a required number field, and two staged
fields legitimately hold zero: dn_batch_sources.ordinal is 0 for the
first source in a batch, and dn_batch_pages.region is 0 for a whole-page
read. Both creates were rejected with validation_required, so the first
file of every upload failed and no page ever persisted. The migration now
declares them optional, and pb-relax-dn-zero-fields.py relaxes instances
that already have them required.

The staged runner verifies its batch lease and commits the protected
write in one transaction, which needs PocketBase's batch API. That is off
by default, so the runner failed closed with
dn_pipeline_transactions_required and no deployment note explained why.
pb-enable-batch-api.py turns it on and raises the 3s transaction timeout,
which is tight for a commit carrying page images.

compare-dn-pipelines used top-level await while resolving as CJS, so the
command in the rollout runbook always failed to transform. Renamed .mts.

The tests missed all of this because they mock PocketBase, and the mock
accepts what the real server rejects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 23:49:58 +02:00
..
migrations feat(clock): add clock_events PocketBase collection 2026-09-12 00:14:13 +02:00
build-icons.mjs feat(clock): replace icon with clock-on-cube design + OG share preview 2026-09-13 21:55:40 +02:00
build-og-image.mjs
compare-dn-pipelines.mts fix(dn): let staged ingestion run against the real PocketBase schema 2026-09-20 23:49:58 +02:00
download-all-delivery-notes.py fix(dn-pipeline): enhance product resolution by incorporating article numbers 2026-09-17 22:59:09 +02:00
generate-plant-hours-template.ts
migrate-delivery-notes-ocr.py
migrate-dn-item-units.py chore: final review polish (trailing newlines, JSDoc, changelog tense) 2026-09-17 12:49:37 +02:00
migrate-plant-hours-backfill-vehicle.py
patch-next-dev-blocker.cjs
pb-add-dn-alias-keys.py fix(dn-pipeline): key aliases on what actually identifies a product 2026-09-17 22:47:55 +02:00
pb-add-dn-batch-uploaded-at.py fix(scripts): backfill uploaded_at from real sources, add a dry run 2026-09-17 21:25:33 +02:00
pb-add-dn-batches.py fix(dn-batches): heal created/updated fields on existing live collections 2026-09-17 15:17:17 +02:00
pb-add-dn-doc-type.py feat(dn-pipeline): classify document type instead of assuming delivery note 2026-09-17 21:45:08 +02:00
pb-add-dn-item-aliases.py feat(dn-pipeline): add the remembered product alias table 2026-09-17 21:34:37 +02:00
pb-add-dn-item-units.py feat(delivery-notes): add qty_raw/unit_raw/unit_converted to line items 2026-09-17 12:07:59 +02:00
pb-add-dn-note-dismissed.py feat(dn-batches): dismiss a single duplicate note, and stop erasing promoted counts 2026-09-18 00:44:57 +02:00
pb-add-dn-open-pages.py fix(delivery-notes): a stray page no longer condemns good notes 2026-09-17 21:49:16 +02:00
pb-add-dn-staged-ingestion.py fix(dn): let staged ingestion run against the real PocketBase schema 2026-09-20 23:49:58 +02:00
pb-add-fuel-prices.py
pb-add-site-coordinates.py
pb-add-site-job-start-date.py
pb-backup-collection.py
pb-bootstrap-schema.py feat(clock): add clock_events PocketBase collection 2026-09-12 00:14:13 +02:00
pb-delete-fixed-costs.py
pb-enable-batch-api.py fix(dn): let staged ingestion run against the real PocketBase schema 2026-09-20 23:49:58 +02:00
pb-relax-dn-zero-fields.py fix(dn): let staged ingestion run against the real PocketBase schema 2026-09-20 23:49:58 +02:00
pb-relax-rules.py feat(clock): add clock_events PocketBase collection 2026-09-12 00:14:13 +02:00
pb-show-fixed-costs.py
pb-show-sites.py
pb_env.py