toga-ai 1.0.442 → 1.0.443
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: session
|
|
3
3
|
slug: true-79533-pin-depth
|
|
4
|
-
title: TRUE-79533 WH service-address pin blocked by depth=-1
|
|
4
|
+
title: TRUE-79533 WH service-address pin — SHIPPED & verified on beta (was blocked by depth=-1)
|
|
5
5
|
author: mhammontree
|
|
6
6
|
repos: [_underscore, dbchanges2, toga2-view]
|
|
7
7
|
framework: "2.0"
|
|
@@ -14,60 +14,61 @@ updated: 2026-07-27
|
|
|
14
14
|
# Session: true-79533-pin-depth
|
|
15
15
|
**Date:** 2026-07-27
|
|
16
16
|
**Project/Repo:** _underscore / dbchanges2 / toga2-view (2.0, client Rate)
|
|
17
|
-
**Task:**
|
|
17
|
+
**Task:** Pin the validated Whole Home Warranty service address (`Entitlements.serviceAddressId`) and render it on beta. **DONE + verified on beta 2026-07-27.** The blocker was the purchase POST sending `depth=-1`, which starved the `postPost` interceptor of the created address id; the front-end dropped `depth` and it now works. Remaining = deploy/merge close-out + knowledge captured.
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
## What WORKED
|
|
22
22
|
<!-- Include specific file paths and evidence -->
|
|
23
|
-
- **
|
|
24
|
-
-
|
|
25
|
-
- **
|
|
26
|
-
-
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
-
|
|
30
|
-
- **Interceptor config (Rohan-confirmed):** `ApiPayloadInterceptors
|
|
23
|
+
- **END-TO-END VERIFIED ON BETA (2026-07-27):** after Tanner removed `depth` from the FE purchase call, both post-fix purchases pinned on their own, no backfill — ET100068 (`serviceAddressId=67` → 233 S WACKER DR, `isValidated=1`) and ET100067 (`serviceAddressId=66` → 1864 HIGH GROVE LN STE 1900, `isValidated=1`). Everything before the FE deploy is still null (clean cutoff). Paulina is PM-testing beta.
|
|
24
|
+
- **FE fix = drop the `depth` param** at `toga2-view/src/pages/CheckOut/api/checkoutApi.ts` (`createService` no longer sends `{depth:-1}`). Deployed to beta. This reproduces the proven-good no-depth config (ET100057 had pinned the same way pre-fix).
|
|
25
|
+
- **Backend pin** in `_underscore/Model/Rate/Entitlement.php` `postPost`→`persistWarrantyServiceAddress`: reads the created address id from the in-memory hydrated payload (`$payload->contact->primaryContactAddress->address->id`), sets `Addresses.isValidated=1` + `Entitlements.serviceAddressId`. Committed `dff1fb5e`. Already live on beta (that's why ET100057/67/68 pinned).
|
|
26
|
+
- **`serviceAddressId` = STANDARD FK field** on base `_underscore/Model/Client/Entitlement.php:20`.
|
|
27
|
+
- **Display EZ-2 fixed**: `dbchanges2/Client_Rate/2026-07-24a - AddressIdFieldPermission.sql` grants read on `Addresses.id` (roles 1/2/3). Committed `ea1e0fb`; applied+verified on beta.
|
|
28
|
+
- **Hard-blocks → HTTP 400** via `_Exception_Validation` (committed `41a5dc1a`), mapped by `api2/Controller/Index.php:204-222`. (On `TRUE-79533`, NOT yet on beta — see blockers.)
|
|
29
|
+
- **Root cause proven via `Logs_Rate.Api`**: local-FE and beta-FE calls hit the SAME beta instance (`i-0ce5624547cfecc93`); only the request `depth` differed (no-depth → 64 KB deep → pins; `depth=-1` → 644 B shallow, `calcDepth 1`, no `address` node → starved). The `-1` came from the FE (`checkoutApi.ts`), not the interceptor.
|
|
30
|
+
- **Interceptor config (Rohan-confirmed):** `ApiPayloadInterceptors.minDepth` defaults to 3 (null); entitlements `postPost` = 5; `prePost`/sales-orders = null→3.
|
|
31
|
+
- **Knowledge CAPTURED + PUSHED (2026-07-27):** 9 docs — Rate WH guard (draft→active), service-card Addresses.id ACL, aig-contract standard-field correction, api2 EZ-2 (`id` case), and 5 elevated standards/architecture (depth-starvation + `_Exception_Validation` in `2.0/standards/backend-php.md`; uncommitted-nested-write in `_underscore/architecture.md`; `_sandbox-dev` branch map + `Logs.Api` in the api2 deploy workflow; committed-PAT security note in `api2/architecture.md`).
|
|
31
32
|
|
|
32
33
|
## What did NOT work — DO NOT RETRY THESE
|
|
33
34
|
<!-- Exact failure reasons — do not vague-ify -->
|
|
34
|
-
- **Forcing the write host inside `persistWarrantyServiceAddress`** (commit `7b63955d`, removed in `dff1fb5e`): NO EFFECT
|
|
35
|
-
- **The 3-table JOIN lookup** (`Entitlement → Contacts.primaryContactAddressId → ContactAddresses → addressId`) in postPost: returns 0 rows *in-request* even on the writer
|
|
36
|
-
- **Payload-based `$address->id`
|
|
37
|
-
- **Merging `_underscore` to `_beta
|
|
38
|
-
- **"Removed depth" curl test (earlier)**: the edited curl STILL had `depth=-1`
|
|
39
|
-
- **Single-host vs multi-host connection theory**: DISPROVEN — same beta instance both ways; the variable
|
|
35
|
+
- **Forcing the write host inside `persistWarrantyServiceAddress`** (commit `7b63955d`, removed in `dff1fb5e`): NO EFFECT — V2 already disables the read host for the whole create block (`V2.php:5024`).
|
|
36
|
+
- **The 3-table JOIN lookup** (`Entitlement → Contacts.primaryContactAddressId → ContactAddresses → addressId`) in postPost: returns 0 rows *in-request* even on the writer (resolves only post-commit). Superseded by the payload approach.
|
|
37
|
+
- **Payload-based `$address->id` while the FE sent `depth=-1`**: null — the shallow payload (`calcDepth 1`) has NO `contact.primaryContactAddress.address` node. Code was correct; depth was the cause.
|
|
38
|
+
- **Merging `_underscore` to `_beta`**: does NOT deploy to beta — API-Sandbox-Dev pulls `_underscore` from **`_sandbox-dev`** via `api2/.platform/hooks/prebuild/git.sh` + `.ebextensions/git.sandbox-dev.json`.
|
|
39
|
+
- **"Removed depth" curl test (earlier)**: the edited curl STILL had `depth=-1` in the logged query string — proved nothing.
|
|
40
|
+
- **Single-host vs multi-host connection theory**: DISPROVEN — same beta instance both ways; the variable was request `depth`.
|
|
41
|
+
- **Relying on `minDepth` to protect the interceptor**: it's set to 5 on the postPost row yet the payload still built at `calcDepth 1` for a `depth=-1` request — the clamp is a latent no-op (framework bug to ticket). The real fix was the FE dropping `depth`.
|
|
40
42
|
|
|
41
43
|
## Not tried yet (candidates for next session)
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
- Run `/capture`.
|
|
47
|
-
- File side tickets: (1) framework `minDepth`-clamp no-op for low/`-1` depth (starves ALL payload interceptors); (2) AIG contract block has the SAME `depth` starvation — silently skipped for beta-FE purchases; (3) SECURITY: plaintext GitHub PAT committed in `api2/.ebextensions/git.*.json` — rotate + move to env config.
|
|
44
|
+
- **Merge `_underscore` `TRUE-79533` → `_sandbox-dev` + deploy** — puts the `_Exception_Validation` 400-fix (`41a5dc1a`) on beta so Paulina's *blocked-purchase* testing (duplicate / unverifiable address) shows a clean 400 toaster instead of a 500 + stack trace. Do this before she hits those paths.
|
|
45
|
+
- **Merge `dbchanges2` `TRUE-79533`** to its deploy branch for prod parity (beta already has the migrations applied).
|
|
46
|
+
- **File the framework ticket:** `ApiPayloadInterceptors.minDepth` clamp does not deepen the built payload for a `depth=-1` request (WO-1 says "raised to 5" but `calcDepth` stays 1) — starves ANY payload interceptor. Plus: AIG contract block had the same starvation; and the committed GitHub PAT in `api2/.ebextensions/git.*.json` needs rotating + moving to SSM.
|
|
47
|
+
- Optionally credit Tanner as an `owners` on the FE-touching Rate doc once his kb-username is known.
|
|
48
48
|
|
|
49
49
|
## Current file state
|
|
50
50
|
| File | Status | Notes |
|
|
51
51
|
|------|--------|-------|
|
|
52
|
-
| `
|
|
52
|
+
| `toga2-view/src/pages/CheckOut/api/checkoutApi.ts` | **FIXED + deployed to beta (Tanner)** | dropped `{depth:-1}` → deep payload reaches `postPost`. THE unblocker; pin now works. |
|
|
53
|
+
| `_underscore/Model/Rate/Entitlement.php` | Committed on `TRUE-79533` (HEAD `41a5dc1a`) | payload pin (`dff1fb5e`, already on beta) + dedup write-host + `_Exception_Validation` (`41a5dc1a`, NOT yet on beta). |
|
|
53
54
|
| `_underscore/Model/Client/Entitlement.php` | Committed | `serviceAddressId` standard FK (line 20). |
|
|
54
|
-
| `dbchanges2/Client_Rate/2026-07-24a - AddressIdFieldPermission.sql` | Committed (`ea1e0fb`) |
|
|
55
|
-
| `dbchanges2` serviceAddressId col + `Core` field + ACL
|
|
56
|
-
|
|
|
57
|
-
| `test/@Mark/Rate/verify_wholehome_per_address_guard.php` | Updated (personal, not in a repo) |
|
|
55
|
+
| `dbchanges2/Client_Rate/2026-07-24a - AddressIdFieldPermission.sql` | Committed (`ea1e0fb`) | Applied on beta. Needs branch merge for prod. |
|
|
56
|
+
| `dbchanges2` serviceAddressId col + `Core` field + ACL | Committed on `TRUE-79533` | Applied on beta manually; needs merge for prod. |
|
|
57
|
+
| team KB (`~/toga-tech/knowledge/…`) | **9 docs published to `_main` (capture)** | Rate WH guard active + 5 elevated standards/arch docs. |
|
|
58
|
+
| `test/@Mark/Rate/verify_wholehome_per_address_guard.php` | Updated (personal, not in a repo) | Not team knowledge. |
|
|
58
59
|
|
|
59
60
|
## Decisions made
|
|
60
|
-
- **Fix depth on the FRONT-END (drop the `depth` param)** rather than bumping the interceptor `minDepth`. Rationale:
|
|
61
|
-
- **Pin from the in-memory hydrated payload, not a DB read-back** (in-request reads can't see uncommitted nested writes
|
|
61
|
+
- **Fix depth on the FRONT-END (drop the `depth` param)** rather than bumping the interceptor `minDepth`. Rationale: reproduces the proven ET100057 no-depth config, no DB config change, and un-starves the AIG block too. Verified working on beta. `minDepth` bump remains the fallback / the systemic guardrail (whose clamp bug is now a separate ticket).
|
|
62
|
+
- **Pin from the in-memory hydrated payload, not a DB read-back** (in-request reads can't see the txn's own uncommitted nested writes).
|
|
62
63
|
- **`serviceAddressId` = STANDARD field** (per Jeff), not `c_serviceAddressId`.
|
|
63
|
-
- **Hard-blocks throw `_Exception_Validation`** → HTTP 400 +
|
|
64
|
+
- **Hard-blocks throw `_Exception_Validation`** → HTTP 400 + message (FE expects 400).
|
|
64
65
|
|
|
65
66
|
## Blockers
|
|
66
|
-
- **
|
|
67
|
-
-
|
|
67
|
+
- **None blocking the pin** — it's verified working on beta.
|
|
68
|
+
- Soft/pending: the `_Exception_Validation` 400-fix (`41a5dc1a`) is not yet on beta (beta deploys `_underscore` from `_sandbox-dev`), so Paulina's blocked-purchase paths currently return 500 until the `_sandbox-dev` merge+deploy. Not a pin blocker.
|
|
68
69
|
|
|
69
70
|
## Exact next step
|
|
70
|
-
>
|
|
71
|
+
> Merge `_underscore` `TRUE-79533` → `_sandbox-dev` and deploy API-Sandbox-Dev (prebuild hook re-clones `_sandbox-dev`), so the `_Exception_Validation` hard-block 400s reach beta before Paulina tests duplicate/invalid-address rejections. Then merge `dbchanges2` `TRUE-79533` for prod parity, and file the framework `minDepth`-clamp-no-op ticket (+ AIG-starvation + committed-PAT follow-ups). Verify a deliberate duplicate-address purchase on beta returns HTTP 400 with the toaster message (not 500).
|
|
71
72
|
|
|
72
73
|
---
|
|
73
74
|
_Saved by /session-save on 2026-07-27_
|
package/package.json
CHANGED