toga-ai 1.0.104 → 1.0.106

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.
@@ -3,7 +3,7 @@
3
3
  | Doc | Summary | Files |
4
4
  |-----|---------|-------|
5
5
  | [_underscore Framework Architecture](architecture.md) | `_underscore` is the shared PHP backend framework for **all 2.0 applications**. | _underscore/_underscore.php, _underscore/Loader.php, _underscore/Framework.php, _underscore/Model.php, _underscore/Database.php, _underscore/Query.php, _underscore/Route.php, _underscore/Component.php |
6
- | [Carrier Shipping Labels (UPS/FedEx) & NetSuite Item Fulfillment](features/carrier-shipping-labels.md) | Backend mechanics behind TOGa Supply's Fulfill & Ship: buying a carrier label (UPS/FedEx), persisting it, and creating the NetSuite Item Fulfillment with tracki | _underscore/Model/Client/ItemFulfillment.php, _underscore/Component/Library/Carriers/Ups/Ups.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Trait/Netsuite/SalesOrder.php, _underscore/Component/Library/NetSuite/NetSuite.php, _underscore/Model/Client/TrackingNumber.php, _underscore/Model/Client/ShippingMethod.php, _underscore/Model.php, _underscore/Cloud.php |
6
+ | [Carrier Shipping Labels (UPS/FedEx) & NetSuite Item Fulfillment](features/carrier-shipping-labels.md) | Backend mechanics behind TOGa Supply's Fulfill & Ship: buying a carrier label (UPS/FedEx), persisting it, and creating the NetSuite Item Fulfillment with tracki | _underscore/Model/Client/ItemFulfillment.php, _underscore/Model/Client/ItemFulfillments/TrackingNumber.php, _underscore/Component/Library/Carriers/Ups/Ups.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Trait/Netsuite/SalesOrder.php, _underscore/Component/Library/NetSuite/NetSuite.php, _underscore/Model/Client/TrackingNumber.php, _underscore/Model/Client/ShippingMethod.php, _underscore/Model.php, _underscore/Cloud.php |
7
7
  | [Client Email Template Sending](features/email-template-sending.md) | `_Model_Client_EmailTemplate` sends a stored, client-defined email template by UUID. | _underscore/Model/Client/EmailTemplate.php, _underscore/Model/Client/EmailTemplateOutgoingEmailAddress.php, _underscore/Email.php |
8
8
  | [Recursive Item Fulfillments (upstream mirroring)](features/recursive-item-fulfillments.md) | In a multi-tier supply chain a sales order (SO) spawns a purchase order (PO) that becomes another SO downstream, and so on. | _underscore/Model/Client/ItemFulfillment.php, _underscore/Model/Client/ItemFulfillmentItem.php, _underscore/Model/Client/ItemFulfillmentItemUnit.php, _underscore/Model/Client/ItemFulfillmentPackage.php, _underscore/Model/Compass/AdvanceShippingNotice.php, dbchanges2/Core/2026-02-13 - 75601 - RecursiveItemFulfillmentCreation.sql, dbchanges2/Core/2026-06-04 - RecursiveItemFulfillmentPut.sql |
9
9
  | [Tracking-Number Bridge Migration (ASN / Item Fulfillment / Item Receipt)](features/tracking-number-bridges.md) | Shipment tracking numbers used to live as **scalar FK columns** (`trackingNumberId`, `returnTrackingNumberId`) directly on the lowest-level "unit"/"item" tables | api2/Component/Api/V2/V2.php, _underscore/Model/Client/AdvanceShippingNoticeItemUnit.php, _underscore/Model/Client/AdvanceShippingNoticeItemUnits/TrackingNumber.php, _underscore/Model/Client/ItemFulfillmentItemUnits/TrackingNumber.php, _underscore/Model/Client/ItemFulfillment.php, _underscore/Model/Prudential/AdvanceShippingNotice.php, _underscore/Model/Compass/AdvanceShippingNotice.php, _underscore/Trait/Netsuite/ItemFulfillment.php, api2/Component/Api/Cxml/Cxml.php, dbchanges2/Client/2026-06-10 - TrackingNumberBridges.sql, dbchanges2/Core/2026-06-10 - TrackingNumberBridges.sql |
@@ -6,10 +6,11 @@ project: _Underscore
6
6
  client: shared
7
7
  type: feature
8
8
  status: active
9
- updated: 2026-06-10
9
+ updated: 2026-06-16
10
10
  owners: [mhammontree]
11
11
  files:
12
12
  - _underscore/Model/Client/ItemFulfillment.php
13
+ - _underscore/Model/Client/ItemFulfillments/TrackingNumber.php
13
14
  - _underscore/Component/Library/Carriers/Ups/Ups.php
14
15
  - _underscore/Trait/Netsuite/ItemFulfillment.php
15
16
  - _underscore/Trait/Netsuite/SalesOrder.php
@@ -39,7 +40,10 @@ decision** (dev lead Jeff, June 2026) that supersedes what the code currently do
39
40
  the DB storage field, return `{ trackingNumber, pdfLabel, fileInternalId }` or
40
41
  `{ error, trackingNumber }`. UPS path now checks `$shipmentResponse->success` and
41
42
  fast-fails on an empty service code (it previously swallowed UPS errors and surfaced
42
- a misleading "Failed to save PDF to NetSuite").
43
+ a misleading "Failed to save PDF to NetSuite"). These methods (plus `fulfill` and
44
+ `createNetsuiteItemFulfillment`'s package-detail query) resolve the tracking record by
45
+ joining **`ItemFulfillments_TrackingNumbers`** (the bridge); they previously joined the
46
+ dropped `ItemFulfillmentPackages` table — see Gotchas.
43
47
  - `_Component_Library_Carriers_Ups::submitShipmentRequest`
44
48
  (`Component/Library/Carriers/Ups/Ups.php`): returns `{ success, errorMessage,
45
49
  trackingNumber, encodedLabel }`.
@@ -104,8 +108,20 @@ attempted.
104
108
  recommended: always scope `getInventoryNumberFromSerialNumber` by location.
105
109
  - `createNetsuiteItemFulfillment` doesn't set carrier/method on the NS IF — it defaults
106
110
  (can show FedEx for a UPS shipment). Open item.
111
+ - **Carrier-label queries joined the *dropped* `ItemFulfillmentPackages` table** (a
112
+ tracking-number-bridge migration write-back gap). `upsShipmentApi`, `fedexShipmentApi`,
113
+ `fulfill`, and `createNetsuiteItemFulfillment`'s package-detail query resolved the tracking
114
+ number by joining `ItemFulfillmentPackages` — retired by the bridge migration. Post-migration
115
+ that matched the **wrong/null** `TrackingNumbers` record, so the label + `number` saved to the
116
+ wrong row (the bridge-linked record's `labelPdfFile`/`number` stayed null → **reprint had no
117
+ label**) and the NS IF was built **without its tracking number**. **Fixed 2026-06-16** by
118
+ repointing all four joins to `ItemFulfillments_TrackingNumbers`. Diagnostic tell: the
119
+ bridge-linked `TrackingNumbers` row shows `number = NULL` after a "successful" ship. Backend
120
+ change — only effective once deployed to beta. Worth grepping `ItemFulfillmentPackage::TABLE`
121
+ across `_underscore`/`api2`/`library` for the same staleness elsewhere.
107
122
 
108
123
  ## Change history
124
+ - 2026-06-16 — Repointed the carrier-label/NS-IF tracking-number queries (`upsShipmentApi`, `fedexShipmentApi`, `fulfill`, `createNetsuiteItemFulfillment`) from the dropped `ItemFulfillmentPackages` table to the `ItemFulfillments_TrackingNumbers` bridge — they had been saving the label/`number` to the wrong/null record (reprint `labelPdfFile` null; NS IF missing tracking). Confirmed working on beta. (mhammontree)
109
125
  - 2026-06-10 — Documented carrier shipping label mechanics (UPS/FedEx) + the authoritative GIF label-storage decision and NetSuite IF attachment. (mhammontree)
110
126
 
111
127
  ## Related docs
@@ -135,6 +135,7 @@ returnTrackingNumber: {...} }]`, and an IFIU's as `itemFulfillmentItemUnitTracki
135
135
  **not** join `Records`. This gap belongs back in the migration (Core §7 + Client §6b + blank-client template).
136
136
 
137
137
  ## Change history
138
+ - 2026-06-16 — Caught a migration code-update miss: four queries in `Model/Client/ItemFulfillment.php` (`upsShipmentApi`, `fedexShipmentApi`, `fulfill`, `createNetsuiteItemFulfillment`) still joined the dropped `ItemFulfillmentPackages` table to resolve tracking — repointed to `ItemFulfillments_TrackingNumbers`. See the carrier-shipping-labels doc. (mhammontree)
138
139
  - 2026-06-16 — Found + documented the bridge ACL gap: the migration creates bridge `AclRecordPermissions` (317–322) but not their `AclLogicGroups`/`AclLogicGroupExpressions`/`AclRecordExpressions` chain → 403 "No ACL Logic Groups defined" for non-Super-User reads (confirmed prod + all clients). Recorded the `slug='all'`/`sqlExpression='1'` fix for Core + per-client, plus the Client-DB `Records`-table caveat. (mhammontree)
139
140
  - 2026-06-10 — Documented the tracking-number bridge migration: scalar FK columns → `*_TrackingNumbers` bridge tables across ASN/IF/IR, ASN unit table rename, packages-table consolidation. (jcardinal)
140
141
 
@@ -3,3 +3,4 @@
3
3
  | Doc | Summary | Files |
4
4
  |-----|---------|-------|
5
5
  | [API (api2 / TOGa API v2) Architecture](architecture.md) | `api2` is the backend powering the public **TOGa 2.0 API**. | api2/Controller/Index.php, api2/Component/Api/V2/V2.php, api2/Component/Api/Cxml/Cxml.php, api2/Component/Api/V2/Response/Response.php, api2/Config/ |
6
+ | [AWS CodePipeline Deployment via CodeConnections (GitHub → Elastic Beanstalk)](workflows/codepipeline-codeconnections-deploy.md) | 2.0 apps (`api2`, `_underscore`) are deployed through **AWS CodePipeline**. | |
@@ -0,0 +1,88 @@
1
+ ---
2
+ title: AWS CodePipeline Deployment via CodeConnections (GitHub → Elastic Beanstalk)
3
+ framework: "2.0"
4
+ repo: api2
5
+ project: API
6
+ client: shared
7
+ type: workflow
8
+ status: active
9
+ updated: 2026-06-16
10
+ owners: ["jcardinal"]
11
+ files: []
12
+ related: []
13
+ ---
14
+
15
+ ## Summary
16
+ 2.0 apps (`api2`, `_underscore`) are deployed through **AWS CodePipeline**. The Source stage
17
+ pulls from GitHub via a **CodeConnections** connection (the modern replacement for
18
+ CodeStar Connections), backed by the **"AWS Connector for GitHub" GitHub App** installed on
19
+ the `agilantsolutions` org. A single pipeline can have multiple Source actions sharing one
20
+ connection (e.g. `agilantsolutions/api2` and `agilantsolutions/_underscore` on the same
21
+ connection ARN). Deployment target is Elastic Beanstalk.
22
+
23
+ ## Steps
24
+ 1. A push to the watched branch (e.g. `_stage`) triggers the pipeline.
25
+ 2. The Source stage uses `CodeStarSourceConnection` actions, each referencing:
26
+ - `ConnectionArn` — the CodeConnections connection
27
+ - `FullRepositoryId` — `owner/repo` (e.g. `agilantsolutions/api2`)
28
+ - `BranchName`
29
+ 3. The CodePipeline service role must allow `codeconnections:UseConnection` **and**
30
+ `codestar-connections:UseConnection` on that connection ARN.
31
+ 4. Source artifacts flow downstream to build/deploy stages → Elastic Beanstalk.
32
+
33
+ ## Systems involved
34
+ - AWS CodePipeline + CodeConnections (per-AWS-account; each account has its own connection
35
+ and its own GitHub App installation).
36
+ - GitHub org `agilantsolutions` + the "AWS Connector for GitHub" App.
37
+ - Elastic Beanstalk (deploy target); see `api2/.ebextensions/`.
38
+
39
+ ## Edge cases & escalation
40
+
41
+ ### Gotcha: "[GitHub] GitHub returned an Internal Error exception" at the Source step
42
+ This generic error is a **catch-all** CodePipeline shows for several distinct Source-stage
43
+ failures — it is usually **not** an actual GitHub outage. When it fails **immediately and
44
+ consistently** (not intermittently), and GitHub status is green, work through these in order:
45
+
46
+ 1. **Pending GitHub App access request (most common, and the root cause seen 2026-06-16).**
47
+ Even with the GitHub App set to **"All repositories"** and the connection showing
48
+ `AVAILABLE`, GitHub may have a **pending "review access request"** notification on the
49
+ AWS Connector App that an org owner must **approve**. Until approved, every Source action
50
+ fails with this exact error. Fix: GitHub → Org → Settings → GitHub Apps / installed apps
51
+ → AWS Connector for GitHub → approve the pending access request. No AWS-side change needed;
52
+ the pipeline works on the next run.
53
+ 2. **GitHub App not granted to the repo.** If the App is "Only select repositories," confirm
54
+ the repo(s) are in the list.
55
+ 3. **IAM.** The service role needs `codeconnections:UseConnection` + `codestar-connections:UseConnection`
56
+ on the **exact** connection ARN. A policy scoped to a different connection ARN denies the
57
+ pipeline and surfaces as the same generic GitHub error.
58
+ 4. **SAML SSO.** If the org enforces SSO, the App authorization may need re-authorizing.
59
+
60
+ **Key diagnostic insight:** `ConnectionStatus: AVAILABLE` only proves the initial OAuth
61
+ handshake completed once — it does **not** re-verify ongoing repo access or installation
62
+ health. A connection stays `AVAILABLE` while every source action fails. Also: if **all** repos
63
+ on one connection fail identically, the problem is the **connection / App installation**, not
64
+ anything repo-specific. The AWS CLI cannot introspect the GitHub App installation for
65
+ `ProviderType: GitHub` — that check must be done in the GitHub UI.
66
+
67
+ **Cross-account comparison is a fast triage:** the same repo working in a *different* AWS
68
+ account proves it is not a GitHub/repo/branch problem — connections and App installations are
69
+ per-account, so the fault is local to the failing account's connection.
70
+
71
+ ### CloudShell triage commands (read-only)
72
+ ```bash
73
+ PIPELINE="<pipeline-name>"; REGION="us-east-1"
74
+ EXEC_ID=$(aws codepipeline list-pipeline-executions --pipeline-name "$PIPELINE" --region "$REGION" \
75
+ --max-results 1 --query 'pipelineExecutionSummaries[0].pipelineExecutionId' --output text)
76
+ aws codepipeline list-action-executions --pipeline-name "$PIPELINE" --region "$REGION" \
77
+ --filter pipelineExecutionId="$EXEC_ID" \
78
+ --query 'actionExecutionDetails[?stageName==`Source`].{action:actionName,status:status,summary:output.executionResult.externalExecutionSummary}'
79
+ aws codepipeline get-pipeline --name "$PIPELINE" --region "$REGION" \
80
+ --query 'pipeline.stages[?name==`Source`].actions[].{name:name,config:configuration}'
81
+ aws codeconnections get-connection --connection-arn "<CONN_ARN>" --region "$REGION"
82
+ ```
83
+
84
+ ## Change history
85
+ - 2026-06-16 — Documented after a pipeline (API-QC-Security, account 975050298201) failed every
86
+ run at Source with "[GitHub] GitHub returned an Internal Error"; connection was AVAILABLE and
87
+ IAM was correct — root cause was a pending GitHub App access-request approval in the
88
+ `agilantsolutions` org. (jcardinal)
@@ -16,7 +16,7 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
16
16
 
17
17
  - **_underscore** (_Underscore) _(framework core)_ — 7 doc(s) → [2.0/apps/_underscore/INDEX.md](2.0/apps/_underscore/INDEX.md)
18
18
  - **worker2** (Worker) — 6 doc(s) → [2.0/apps/worker2/INDEX.md](2.0/apps/worker2/INDEX.md)
19
- - **api2** (API) — 1 doc(s) → [2.0/apps/api2/INDEX.md](2.0/apps/api2/INDEX.md)
19
+ - **api2** (API) — 2 doc(s) → [2.0/apps/api2/INDEX.md](2.0/apps/api2/INDEX.md)
20
20
  - **dbchanges2** (Database Changes) _(framework core)_ — 1 doc(s) → [2.0/apps/dbchanges2/INDEX.md](2.0/apps/dbchanges2/INDEX.md)
21
21
  - **toga2-supply** (TOGa Supply) — 2 doc(s) → [2.0/apps/toga2-supply/INDEX.md](2.0/apps/toga2-supply/INDEX.md)
22
22
  - **saml** (SAML SSO Gateway) — 2 doc(s) → [2.0/apps/saml/INDEX.md](2.0/apps/saml/INDEX.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.104",
3
+ "version": "1.0.106",
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",