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:
@@ -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"`)
|
||||
|
||||
Reference in New Issue
Block a user