toga-ai 1.0.86 → 1.0.87

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.
@@ -57,9 +57,11 @@ Its output depends entirely on the trigger **context** (because it reads field v
57
57
  changed field on `context.newRecord` → `tranid`/entity/title read empty → 2493 falls back to
58
58
  `name = "OPP " + record.id` with empty descriptive/custom fields → the degenerate stub.
59
59
 
60
- The degenerate trigger is **scheduled script 2412 "Update Opp Status / % to Close / Presales Lead"**
60
+ The degenerate trigger was **scheduled script 2412 "Update Opp Status / % to Close / Presales Lead"**
61
61
  (deployment `customdeploy_update_opp_status_morning`, status SCHEDULED). It auto-assigns the Presales
62
- Lead via `submitFields` (NetSuite context `SCH`, user `-System-`), which fires 2493 in `xedit` → stub.
62
+ Lead (NetSuite context `SCH`, user `-System-`) — originally via `submitFields`, which fired 2493 in
63
+ `xedit` → stub. **Fixed 2026-06-15:** 2412 now does a full `record.load()`/`setValue()`/`save()`, so
64
+ the assignment fires 2493 in `edit` (full-record) context → proper name (see Gotchas → Fix).
63
65
 
64
66
  ## Data model
65
67
  - ClickUp Opportunities list `901111987449`; custom-item id `1009`.
@@ -85,17 +87,25 @@ None — single internal Agilant/True integration.
85
87
  June 1 edit added the Presales-Lead auto-assignment. **Precise failure condition:** only the
86
88
  *empty→set* transition fires it — a scheduled set to an already-present lead is a no-op (confirmed
87
89
  on opp 5483750, where a 07:02 `SCH` set produced no stub because the lead was already present).
88
- - **Fix options (NetSuite-side, in script 2493):**
89
- - *Preferred* `record.load({type, id: context.newRecord.id})` (or `search.lookupFields` for
90
- `tranid`/entity/title) before building `name`. Works for **every** trigger context; produces
91
- correct names instead of stubs-or-nothing.
92
- - *Alternative* skip on `xedit` (`if (context.type === context.UserEventType.XEDIT) return;`).
93
- Suppresses the stubs but **also drops** legitimate task creation from inline-grid edits, mass
94
- updates, and any other `submitFields` automation. Does **not** affect full-form saves, creates,
95
- or REST/SOAP edits (incl. the touch tool, which is `RWS`/full-edit). Trades a visible bug for a
96
- silent one only acceptable if presales leads are never set inline/in bulk.
97
- - *TOGA backstop (optional)* in `createTask()`, if `name` is empty or matches `^OPP \d+$`, look
98
- the opp up by internal id and rebuild the name before POSTing.
90
+ - **Fix applied in NetSuite prod 2026-06-15 (deployed; pending verification on next scheduled
91
+ run).** In scheduled script **2412**, the presales-lead assignment was changed from
92
+ `record.submitFields({type, id, values:{custbody_ctc_solution_architect: employeeId}, ...})` to a
93
+ full `record.load()` `setValue('custbody_ctc_solution_architect', employeeId)` →
94
+ `record.save({ignoreMandatoryFields:true})`. A full `save()` fires 2493 with `context.type='edit'`
95
+ and the **complete** `newRecord`, so it reads `tranid`/entity/title and builds a proper name; the
96
+ empty→set guard still works (`oldRecord` reflects the pre-save state). **Verify** by watching the
97
+ next `SCH` empty→set run for a properly-named task (not `OPP <id>`) not yet observed against a
98
+ live scheduled run as of the fix.
99
+ - **Residual exposure:** 2493 still reads off `context.newRecord`, so *other* `xedit`-context
100
+ presales-lead sets (inline-grid edit, Mass Update, any other script's `submitFields`) would still
101
+ stub. The 2412 fix closes the actual regression, not the latent 2493 hole. Belt-and-suspenders =
102
+ add a `record.load()`/`lookupFields` fallback **inside 2493** too (not done).
103
+ - **Watch-outs from the full save:** governance per opp rose ~2.5× (`load` ~5 + `save` ~20 units vs
104
+ `submitFields` ~10) — guard batch runs against the governance ceiling (yield/reschedule); and a
105
+ full `save()` re-fires **all** `edit`-context UserEvents/workflows on the opp (Quosal, LSA, etc.),
106
+ not just 2493.
107
+ - **TOGA backstop (optional, not done):** in `createTask()`, if `name` is empty or matches
108
+ `^OPP \d+$`, look the opp up by internal id and rebuild the name before POSTing.
99
109
  - **No inbound logging.** `Webhook_NetSuite::post()` has a `// Log payload to file` comment but does
100
110
  **nothing** — the raw NetSuite payload is persisted nowhere, which is why this was hard to trace.
101
111
  Adding real request logging here would make recurrences diagnosable immediately.
@@ -118,9 +128,13 @@ It blanks then restores `custbody_ctc_solution_architect` via REST (`RWS`/full-e
118
128
  with the full record → proper `<tranid> — <custNum> <customer> — <title>` task ~1–2s later.
119
129
  **Leaves the original stub** — delete the `OPP <id>` task in ClickUp afterward.
120
130
  Done 2026-06-15 for opps 7147699/7147698/7147472/6382879 → 4 proper tasks created; the 4 stubs
121
- (task ids `868k0tr41`, `868k0tr16`, `868k0rwtp`, `868k0h44m`) were left for deletion.
131
+ (task ids `868k0tr41`, `868k0tr16`, `868k0rwtp`, `868k0h44m`) were archived in ClickUp afterward.
122
132
 
123
133
  ## Change history
134
+ - 2026-06-15 — **Fix deployed in NetSuite prod:** scheduled script 2412's presales-lead assignment
135
+ switched from `submitFields` to full `load`/`setValue`/`save` → fires 2493 in `edit` (full-record)
136
+ context → proper names. Residual: 2493 still latently `xedit`-vulnerable to other triggers; watch
137
+ governance (~2.5×) and other UserEvents re-firing on the full save. Pending live-run verification. (dfranks)
124
138
  - 2026-06-15 — Identified the exact NetSuite culprits (scheduled **2412** `submitFields`→`xedit`→
125
139
  UserEvent **2493**), regression date (script 2412 modified 2026-06-01; no stubs before Jun 12),
126
140
  and `systemnote`/`SCH` confirmation; added remediation-via-touch procedure and fix-option
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
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",