wulf-pulse/.planning/phases/12-orders-invoices-company-matching/deferred-items.md
lorentz 0e8504c1c1 feat(12-05): live PAX8 orders/matching verification script + quantity fix
- scripts/verify-pax8-orders-matching.ts: runs a real Pax8SyncService.fullSync()
  twice, then asserts all four Phase 12 success criteria (order items
  populated with company id + billing period, confident auto-matches exist,
  no-match/ambiguous companies flagged for review, auto-match set stable
  across two syncs). Never logs secrets/tokens.
- migrations/094_pax8_order_items_quantity_numeric.sql (Rule 1 auto-fix):
  pax8_order_items.quantity was INTEGER but real PAX8 usage-based invoice
  items (e.g. Azure per-unit bandwidth overage) report fractional
  quantities, which aborted the entire orders/order_items sync loop on the
  first such row and silently truncated SC#1's item coverage to ~123 rows
  instead of the full ~56k-row history. Widened to NUMERIC(14,4); applied
  directly to the dev DB (existing volume, not a fresh init).
- deferred-items.md: logged pre-existing out-of-scope failures (appgate
  TS2307 type errors, itglue-search.test.ts) confirmed unchanged by this
  plan's files.
2026-07-10 23:10:44 -04:00

2.4 KiB

Deferred Items — Phase 12

Out-of-scope issues discovered during execution but not fixed (per Scope Boundary rule).

Plan 01

  • Pre-existing type-check failure, unrelated to this plan. lib/services/sync-scheduler.ts:446 and :450 reference @/lib/services/appgate-factory and @/lib/services/appgate-sync-service via dynamic import(), but neither file exists in this worktree/commit (they appear to be untracked WIP files from a separate, unrelated feature in the main checkout — not part of git history at the branch point this worktree was created from). Confirmed pre-existing via git stash before any Task 2 edits: the same two TS2307 errors reproduce with lib/types/pax8.ts reverted to its pre-plan state. Not touched by migrations/093 or lib/types/pax8.ts. Someone completing the appgate feature branch/commit should resolve this; out of scope for Phase 12.

Plan 02

  • Same pre-existing sync-scheduler.ts:446/:450 TS2307 errors reproduce unchanged after Task 1's pax8-client.ts edits (listAllInvoices / listAllInvoiceItems). Confirmed unrelated to this plan's files.

Plan 04

  • Same pre-existing sync-scheduler.ts:446/:450 TS2307 errors reproduce unchanged after this plan's pax8-sync-service.ts edits. Confirmed unrelated to this plan's files.
  • npm test full-suite run surfaces 2 pre-existing failures in lib/services/analyzer/itglue-search.test.ts ("tolerates per-call failures" tests, lines ~129/253) unrelated to this plan — that file was not touched by any Plan 04 task and not modified in the working tree. All PAX8-scoped suites (pax8-client.test.ts, pax8-company-matcher.test.ts, pax8-sync-service.test.ts, pax8-factory.test.ts) pass green (31/31).

Plan 05

  • Same pre-existing sync-scheduler.ts:446/:450 TS2307 @/lib/services/ appgate-factory / appgate-sync-service errors reproduce unchanged after Task 1's new scripts/verify-pax8-orders-matching.ts and migrations/094_pax8_order_items_quantity_numeric.sql. Confirmed via git status that neither appgate file is part of this worktree's tracked tree. Not touched by this plan.
  • Same 2 pre-existing itglue-search.test.ts failures reproduce unchanged (npm test: 214/216 passing, 1 unrelated file failing). Confirmed via git log that itglue-search.ts/.test.ts were last modified in an unrelated commit (a0a6e7f), well before this plan.