toga-ai 1.0.93 → 1.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,6 @@
4
4
  |-----|-----------|---------|-------|
5
5
  | [Compass ASN → ItemFulfillment Auto-Creation](features/asn-to-item-fulfillment.md) | 2.0 | For Compass USA, posting an AdvanceShippingNotice (ASN) auto-creates the ItemFulfillment (IF) on the upstream SalesOrder. | _underscore/Model/Compass/AdvanceShippingNotice.php, api2/Component/Api/Cxml/Cxml.php, dbchanges2/Client_Compass/2026-06-11 - AsnItemTrackingNumberAcl.sql, dbchanges2/Client_Compass/2026-06-15b - BackfillSA132781ItemFulfillmentTracking.sql |
6
6
  | [Compass: Item-Fulfillment TableViews (for-sales-order-items & for-sales-orders, tracking via bridge)](features/item-fulfillment-tracking-tableview.md) | 2.0 | Two sibling Compass TableViews in `Client_Compass` display fulfilled items in toga2-supply, both driven by `TableViews` / `TableViewJoins` / `TableViewFields` c | dbchanges2/Client_Compass/2026-06-10 - ItemFulfillmentsForSalesOrderItemsTableView.sql, dbchanges2/Client_Compass/2026-06-11 - ItemFulfillmentsForSalesOrdersTableView.sql, dbchanges2/Client_Compass/2026-06-15a - FixItemFulfillmentTrackingNumberJoins.sql |
7
- | [Compass MITS PO → SO Item Linking](features/mits-po-to-so-item-linking.md) | 2.0 | MITS sends Compass inbound Purchase Orders (`POST /v2/purchase-orders`) against a Sales Order (`mitsSalesOrder`). | _underscore/Model/Compass/PurchaseOrder.php |
7
+ | [Compass MITS PO → SO Item Linking](features/mits-po-to-so-item-linking.md) | 2.0 | MITS sends Compass inbound Purchase Orders (`POST /v2/purchase-orders`) against a Sales Order (`mitsSalesOrder`). | _underscore/Model/Compass/PurchaseOrder.php, worker/crons/toga2/compass/workflow/3a_import_office_depot_purchase_orders.php |
8
8
  | [Compass USA](profile.md) | 2.0 | Compass USA is a TOGA client running a multi-tier supply-chain commerce operation. | |
9
9
  | [Compass Order Lifecycle & Data-Integrity Invariants](workflows/order-lifecycle-and-data-integrity.md) | 2.0 | End-to-end map of how a Compass order flows through the `Client_Compass` (2.0) database and the **expected raw-data shape** at each link/ASN/IF level. | |
@@ -6,10 +6,11 @@ project: _Underscore
6
6
  client: compass-usa
7
7
  type: client-feature
8
8
  status: active
9
- updated: 2026-06-11
9
+ updated: 2026-06-16
10
10
  owners: ["jcardinal"]
11
11
  files:
12
12
  - _underscore/Model/Compass/PurchaseOrder.php
13
+ - worker/crons/toga2/compass/workflow/3a_import_office_depot_purchase_orders.php
13
14
  related:
14
15
  - asn-to-item-fulfillment.md
15
16
  ---
@@ -90,7 +91,34 @@ USA and Canada share the parent handler unchanged.
90
91
  other orders (e.g. SA114091 25→125) do not fit the split-PO 2× pattern and are a separate,
91
92
  uninvestigated cause.
92
93
 
94
+ - **SECOND, INDEPENDENT source of the same cross-part links — the Office Depot worker cron
95
+ (fixed 2026-06-16).** The 2026-06-11 fix above only covered the `_underscore`
96
+ `_Model_Compass_PurchaseOrder` path. Office-Depot-originated POs are imported by the **1.0
97
+ worker** cron `worker/crons/toga2/compass/workflow/3a_import_office_depot_purchase_orders.php`,
98
+ which had its **own** off-by-one. It creates the bridge twice: (A) correctly, inline in the
99
+ `/purchase-orders` POST payload via `$lookupSalesOrderItemUuidFromPurchaseOrderLine` (keyed by
100
+ the PO item's lineNumber); then (B) a redundant second loop that paired the **API-returned**
101
+ PO items to queued SO links **by array index** (`$queuedSoiPoiLinks[$indPurchaseOrderItem]`),
102
+ assuming the response lists PO items in submission order. When the SO carries a config-parent
103
+ line (line 1), the returned order is offset, so path B inserted an extra bridge row pointing
104
+ each PO item at the SO line **one above** its real line — the same wrong-part scramble, and
105
+ the same downstream tracking misattribution. **Confirmed on SA132763:** each part (9X3V1UT,
106
+ 920-012059) received its own tracking number plus a neighbor's, surfacing as duplicate IF
107
+ lines in NetSuite. **Fix:** path B now resolves each returned PO item's SOI by its own
108
+ `lineNumber` via the same `$lookupSalesOrderItemUuidFromPurchaseOrderLine`, and the dead
109
+ `$queuedSoiPoiLinks` is removed. The cleanup predicate is unchanged (`soi.itemId <> vi.itemId`
110
+ via `VendorItems`); for tracking, an item-level `ItemFulfillmentItems_TrackingNumbers` row is
111
+ spurious unless some ASN item carrying that tracking number maps (by actual item) to the IFI's
112
+ SOI — see `dbchanges2/Client_Compass/2026-06-16 - CleanupSA132763CrossLineTracking.sql`.
113
+ - **Scope still open:** ~116 PO items across other Compass orders still carry the consecutive
114
+ off-by-one bridge fingerprint (a `SalesOrderItems_PurchaseOrderItems` PO item linked to two
115
+ adjacent SO items). Only SA132763 was remediated; a broader reviewed backfill is pending.
116
+
93
117
  ## Change history
118
+ - 2026-06-16 — Found and fixed a SECOND source of cross-part bridge links: the Office Depot
119
+ worker cron `3a_import_office_depot_purchase_orders.php` paired API-returned PO items to SO
120
+ items by array index; now pairs by lineNumber. Remediated SA132763's spurious bridge +
121
+ cross-line tracking (dated dbchanges2 file). ~116 other orders still pending. (jcardinal)
94
122
  - 2026-06-11 — Documented the over-fulfillment symptom and the phantom-IFI cleanup predicate;
95
123
  remediated SA132657 and SA132641 (one dated dbchanges2 file each). (jcardinal)
96
124
  - 2026-06-11 — Guarded `postPost` SO↔PO item linking to MR orders only; SA links come solely
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.93",
3
+ "version": "1.0.94",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",