sync: auto-sync from GURU-BEAST-ROG at 2026-05-22 15:18:36

Author: Mike Swanson
Machine: GURU-BEAST-ROG
Timestamp: 2026-05-22 15:18:36
This commit is contained in:
2026-05-22 15:18:37 -07:00
parent 68e523388a
commit 4093028e01
2 changed files with 124 additions and 0 deletions

View File

@@ -59,6 +59,14 @@ py -c "import datetime; d = datetime.date(YYYY, M, D); print(d.strftime('%A %Y-%
**After every write operation, post a summary + link to #bot-alerts.** Every ticket created, updated, closed, or commented, every billing run, and every customer created posts a one-line alert to the team's live feed in Discord. This runs AFTER the write succeeds (never before — no alert for an action that didn't happen) and applies regardless of who runs the skill or where (workstation or the Discord bot). Read-only commands (list / view / search) post nothing. Full format, link mapping, and helper call are in "Post to #bot-alerts" below.
**Estimate task success criteria — do NOT consider the request fulfilled until ALL of the following are true:**
1. Every line item requested by the user has been added to the estimate and price-fixed via PUT (verify with GET /estimates/{id} — check `.estimate.line_items[]`)
2. Every line item has a corresponding private note on the linked ticket (hidden: true, do_not_email: true) containing: item name, source/retailer, cost, retail price, and any markup
3. The estimate total (subtotal + tax) matches the sum of all line items after recalc
4. A bot alert has been posted to #bot-alerts
If any check fails, complete the missing step before reporting done. This rule fires on initial estimate creation AND on every subsequent "add X to the estimate" request. Incident: 2026-05-22, UPS added to estimate #7189 without a ticket note — caught by Winter.
## Implementation
When invoked, use the Syncro REST API via `curl`. All requests include `?api_key=<key>` as query parameter (NOT in header — Syncro uses query param auth).
@@ -683,6 +691,24 @@ curl -s -X POST "${BASE}/tickets/${TICKET_ID}/comment?api_key=${API_KEY}" \
}
JSON
> /dev/null
# 7. Verify completion — task is NOT done until all checks pass
# Check estimate line items
VERIFY_EST=$(curl -s "${BASE}/estimates/${ESTIMATE_ID}?api_key=${API_KEY}")
echo "Line items on estimate:"
echo "$VERIFY_EST" | jq '[.estimate.line_items[]? | {name, quantity, price}]'
# Check ticket private notes
VERIFY_TKT=$(curl -s "${BASE}/tickets/${TICKET_ID}?api_key=${API_KEY}")
echo "Private notes on ticket:"
echo "$VERIFY_TKT" | jq '[.ticket.comments[]? | select(.hidden == true) | {subject, created_at}]'
# SUCCESS CRITERIA — all must be true before reporting done:
# [1] estimate line_items count matches number of items user requested
# [2] ticket has at least one hidden comment per line item (or one combined note covering all)
# [3] estimate subtotal/total match expected values
# [4] bot alert posted
# If any check fails, add the missing note or fix the missing item before completing.
```
**Required fields for POST /estimates:** `customer_id`, `date` (ISO date string `"YYYY-MM-DD"`)

View File

@@ -490,3 +490,101 @@ GET /customers/7088508 -> prepay_hours: 10.0 (decremented from 11.0) [OK]
- Invoice ID: 1650390094
- Prepay remaining: 10.0 hrs
- Bot alert message ID: (posted to #bot-alerts)
---
## Update: 15:17 PT — Syncro estimate #7189 (i5 laptop + UPS) + skill success criteria
### User
- **User:** Winter (@winterguru, ID: 624666486362996755) + Mike Swanson (ID: 264814939619721216) — via Discord Bot
- **Machine:** GURU-BEAST-ROG (Discord Bot service)
- **Role:** Full trust (Winter), admin (Mike)
- **Session Span:** ~15:0015:17 PT (Discord thread: #create new test estimate for an i5 laptop with 16G...)
### Session Summary
Winter requested a test estimate for an i5 laptop with 16GB RAM, 512GB SSD, and Windows 11 Pro from Best Buy, Amazon, or Newegg. The bot searched all three retailers using headless Chrome (WebFetch was bot-blocked by Best Buy and Amazon). Results surfaced seven options across all three retailers ranging from $329 (ACEMAGIC off-brand, Newegg sale) to $999.98 (Lenovo ThinkPad E16, Best Buy). Winter selected the Lenovo V15 Gen 4 Business Laptop (i5-13420H, 16GB, 512GB NVMe, Win 11 Pro) at $645 from Amazon and requested a $200 markup, putting the retail price at $845.
Estimate #7189 was created in Syncro under Arizona Computer Guru. The hardware line item was added using product 32252 and the price was fixed via PUT (POST ignores price_retail for this product — known bug). A ticket (#32318) was created and linked, and a private note with the estimate link and cost breakdown was added. The estimate total after tax was $918.52.
Winter then requested a CyberPower CP1500AVRLCD3 1500VA/900W UPS be added to the same estimate. The bot searched all three retailers for 1500VA units (Amazon returned clean results; Best Buy and Newegg required Chrome). Options presented included the APC BX1500M ($189.99 Overall Pick) and CyberPower models at $199.95$239.95. Winter selected the CP1500AVRLCD3 at $199.95 cost and specified a flat retail price of $299.99. The line item was added to the estimate and price-fixed via PUT. Updated estimate total: $1,144.99 subtotal / $1,244.60 with tax.
Winter then asked whether the UPS had been added as a private note on the linked ticket — it had not. The bot had added a note for the laptop at initial creation but omitted a corresponding note when the UPS was added in the second pass. A second private note ("UPS Added to Estimate") was added to ticket #32318 with the UPS cost and retail breakdown.
Mike then directed the bot to add a formal success/fail criteria to the Syncro skill to prevent future omissions: the task is not done until every line item on the estimate has a corresponding private note on the linked ticket, the estimate total is verified, and a bot alert is posted. The rule was added to the Hard Rules section and a step-7 verification block was embedded in the estimate workflow code template.
### Key Decisions
- Used Lenovo V15 Gen 4 from Amazon ($645) over Best Buy options — better price-to-spec ratio, clear Amazon "Overall Pick" designation.
- Winter specified exact retail price of $299.99 for UPS (overriding the calculated 60% markup of $319.92) — honored the explicit override without recalculating.
- Success criteria added as a Hard Rule (top-level, not buried in the workflow) so it fires on both initial creation and subsequent "add item" requests — the exact scenario that failed here.
- Incident note included inline in the hard rule: "2026-05-22, UPS added to estimate #7189 without ticket note — caught by Winter."
### Problems Encountered
- **UPS private note omitted on second-pass add:** The workflow adds a private note at initial estimate creation but did not include a note step when adding subsequent items. Caught by Winter. Resolved by adding the note retroactively and updating the skill to enforce note-per-item as a success criterion going forward.
- **Best Buy and Amazon bot-blocked:** WebFetch returned HTTP 500 / socket closed. Resolved with headless Chrome (`web-fetch-chrome.py`).
### Configuration Changes
- **Modified:** `.claude/commands/syncro.md`
- Hard Rules: added estimate success/fail criteria (4-point checklist — all items on estimate, all items have private ticket note, totals verified, bot alert posted). Incident reference included.
- Estimate workflow: added step 7 (verification block) with bash commands to GET estimate line items and GET ticket hidden comments for comparison, plus a 4-point completion checklist.
### Credentials & Secrets
- Syncro API key: Mike's key (`T259810e5c9917386b-52c2aeea7cdb5ff41c6685a73cebbeb3`). No vault paths accessed.
### Infrastructure & Servers
- Syncro PSA: `https://computerguru.syncromsp.com/api/v1`
- Estimate: https://computerguru.syncromsp.com/estimates/23967587
- Ticket: https://computerguru.syncromsp.com/tickets/110847587
### Commands & Outputs
```bash
# Customer search
GET /customers?query=Arizona+Computer+Guru -> ID 15353550
# Estimate created
POST /estimates -> estimate ID 23967587, number #7189, status: Fresh
# Laptop line item — $0 on POST (known bug)
POST /estimates/23967587/line_items {product_id: 32252, price_retail: 845.00} -> price: "0.0"
PUT /estimates/23967587/line_items/124973048 {price: 845.00, price_retail: 845.00} -> price: "845.0" [OK]
# Ticket created
POST /tickets {customer_id: 15353550, subject: "...", do_not_email: true} -> ticket ID 110847587, #32318
# Private note (laptop)
POST /tickets/110847587/comment {hidden: true, do_not_email: true} -> comment ID 412497088 [OK]
# Estimate linked to ticket + recalc
PUT /estimates/23967587 {ticket_id: 110847587} -> subtotal: "845.0", total: "918.52", tax: "73.52"
# UPS line item
POST /estimates/23967587/line_items {product_id: 32252, price_retail: 299.99} -> price: "0.0" (bug)
PUT /estimates/23967587/line_items/124973169 {price: 299.99, price_retail: 299.99} -> price: "299.99" [OK]
# Recalc after UPS
PUT /estimates/23967587 {name: "..."} -> subtotal: "1144.99", total: "1244.60", tax: "99.61"
# UPS private note (added retroactively after Winter caught omission)
POST /tickets/110847587/comment {subject: "UPS Added to Estimate", hidden: true} -> comment ID 412497901 [OK]
```
### Pending / Incomplete Tasks
None. Estimate, ticket, and both private notes complete. Skill updated.
### Reference Information
- Syncro Estimate #7189: https://computerguru.syncromsp.com/estimates/23967587
- Syncro Ticket #32318: https://computerguru.syncromsp.com/tickets/110847587
- Customer: Arizona Computer Guru (ID 15353550)
- Lenovo V15 Gen 4 — Amazon, $645 cost, $845 retail
- CyberPower CP1500AVRLCD3 — Amazon, $199.95 cost, $299.99 retail
- Estimate subtotal: $1,144.99 | Total with tax: $1,244.60
- Skill updated: `.claude/commands/syncro.md` (Hard Rules + workflow step 7)
- Bot alert message IDs: 1507505776221094060 (estimate), 1507506879792939048 (UPS update), 1507507122286362656 (ticket note)