toga-ai 1.0.409 → 1.0.411
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.
|
@@ -87,7 +87,10 @@ to its ship state (trusted-IP position for X-Forwarded-For; O(1) LRU-capped limi
|
|
|
87
87
|
`?hsCampaignId=` page-prime param now `isTogaUuid`-validated). All checks green: tsc, eslint,
|
|
88
88
|
**104/104 Vitest**, `next build` (build output labels the proxy `ƒ Proxy (Middleware)`).
|
|
89
89
|
|
|
90
|
-
- **Repo:** `agilantsolutions/BDR` on GitHub,
|
|
90
|
+
- **Repo:** `agilantsolutions/BDR` on GitHub, **source-of-truth branch `_dev-sandbox`**
|
|
91
|
+
(2026-07-21: `BDR-Phase-2` and `BDR-Development` are retired/behind — `_dev-sandbox`
|
|
92
|
+
holds enrichment `6a97dd1`, fast-dial/share/guard `6d52b53`, and the Amplify env fix
|
|
93
|
+
`e17d804`; a future `_production` branch is cut from `_dev-sandbox`). The
|
|
91
94
|
machine-local `.claude/` harness is **gitignored** — committing it would snapshot
|
|
92
95
|
the whole KB stale; devs get the harness via `npx toga-ai`, not from this repo.
|
|
93
96
|
|
|
@@ -371,25 +374,44 @@ PRODUCTION credential set (`TOGA_API_BASE_URL = https://api.togahub.com/v2`).
|
|
|
371
374
|
- **Restart the dev server after creating `.env.local`** — Next reads env files only at
|
|
372
375
|
server startup. `.env.*` is gitignored in BDR.
|
|
373
376
|
|
|
374
|
-
## Deploy status (AWS Amplify —
|
|
375
|
-
|
|
376
|
-
The
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
377
|
+
## Deploy status (AWS Amplify — app EXISTS, first build shipping)
|
|
378
|
+
|
|
379
|
+
**The Amplify app now exists (2026-07-21):** branch `_dev-sandbox` deploys to
|
|
380
|
+
**`dev-sandbox.d65bvvjrww97g.amplifyapp.com`** (supersedes the prior "no Amplify app yet"
|
|
381
|
+
status). Go-live tracking: ClickUp **868kdf4tj "BDR - create amplify and sandbox route"**
|
|
382
|
+
(urgent, Sprint 82). (ClickUp showed Alex Peterson as assignee; the team said Jeff picked it
|
|
383
|
+
up — confirm the real owner before assuming.)
|
|
384
|
+
|
|
385
|
+
- **CRITICAL — the build-spec must WRITE the console env vars into `.env.production` at build
|
|
386
|
+
time (Amplify Next-SSR recipe).** The first deployment surfaced a build-spec bug: the old
|
|
387
|
+
`amplify.yml` only had branch cases for `_production` / `_beta`, each doing
|
|
388
|
+
`cp .env.production .env.local` — which expects a **committed** `.env` file that (correctly)
|
|
389
|
+
does not exist (secrets are never committed). **No branch case matched `_dev-sandbox` at all**,
|
|
390
|
+
so every deploy shipped with **ZERO server env vars**. Amplify console env vars exist only at
|
|
391
|
+
**build time**; the Next SSR **runtime** reads `.env.production` from the build artifact — so the
|
|
392
|
+
build must materialize them. Fix (commit `e17d804`): during build,
|
|
393
|
+
`env | grep -E '^(HUBSPOT_|TOGA_|NEXT_PUBLIC_|RATE_LIMIT_)' >> .env.production`. The same broken
|
|
394
|
+
`cp` pattern would have bitten the `_production` launch too.
|
|
395
|
+
- **Symptom chain when the env vars are missing (what "no vars" looks like end-to-end):**
|
|
396
|
+
page-prime's HubSpot fetch throws → lead ref comes back empty → the **anonymous-visit guard
|
|
397
|
+
notice shows even with a valid `?hsContactId`** → `GET /api/contact` returns
|
|
398
|
+
`500 {"error":"Failed to fetch contact"}`. If you see the guard notice on a deployed URL that
|
|
399
|
+
has a real entry link, suspect missing server-side env before anything else.
|
|
400
|
+
- **OPERATIONAL — env vars saved AFTER a build starts do NOT reach that build.** They are baked in
|
|
401
|
+
at build time, so after adding/changing console vars you must **"Redeploy this version"** for
|
|
402
|
+
them to take effect — a fresh save alone does nothing for an in-flight or already-built deploy.
|
|
384
403
|
- **Amplify must be configured for SSR hosting (NOT static export)** — the app is server-rendered
|
|
385
404
|
(server components, route handlers, and the `proxy.ts` edge proxy all require the SSR/compute
|
|
386
405
|
runtime). Point the app at branch `_dev-sandbox`.
|
|
387
|
-
- **
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
406
|
+
- **7 env vars go in the Amplify console** (never the values — **values live in `info/.env.local`**,
|
|
407
|
+
the production credential set): the 5 server-side ones `HUBSPOT_ACCESS_TOKEN`,
|
|
408
|
+
`TOGA_API_BASE_URL`, `TOGA_CLIENT_ID`, `TOGA_CLIENT_API_UUID`, `TOGA_CLIENT_API_SECRET`, plus
|
|
409
|
+
`TOGA_WORKER_URL` (the fast-dial gate — unset ⇒ cron-only) and `NEXT_PUBLIC_GA_MEASUREMENT_ID`
|
|
410
|
+
(GA4). See the parity audit for the full 7-var accounting.
|
|
411
|
+
- **Status at capture:** env fix pushed (`e17d804` on `_dev-sandbox`); awaiting the console vars +
|
|
412
|
+
a green build for the first successfully deployed page-prime. The primary-phone self-heal (commit
|
|
413
|
+
`4ac579e`, see the phone-less bug above) is already on `_dev-sandbox`, so the first good build
|
|
414
|
+
ships that fix too.
|
|
393
415
|
- **Phase 8 WAF pairing.** `BDR/PLAN.md` Phase 8 specifies a **per-IP rate rule on the CloudFront
|
|
394
416
|
distribution / WAF** that pairs with the in-app token-bucket limiter (the app limiter is
|
|
395
417
|
defense-in-depth only; the edge WAF rule is the authoritative control — see the enumeration
|
|
@@ -520,10 +542,34 @@ up — ClickUp is stale, confirm the real owner before assuming.)
|
|
|
520
542
|
lookup carries the email in the query. Do not reintroduce value logging.
|
|
521
543
|
- **No Tailwind** — see Stack. The mockup CSS is the styling system; adding Tailwind
|
|
522
544
|
risks pixel parity.
|
|
545
|
+
- **Deployed-site triage — "guard notice shows despite a valid entry link."** The
|
|
546
|
+
anonymous-visit guard notice is always the **terminal** symptom of "no lead reference,"
|
|
547
|
+
regardless of the underlying cause, so probe the layer directly:
|
|
548
|
+
`GET /api/contact?hsContactId=<id>` on the deployed URL. **`500 "Failed to fetch contact"`**
|
|
549
|
+
⇒ HubSpot env missing server-side (see the Deploy status env-var bug). **`400`** ⇒ the id
|
|
550
|
+
value/format. **Contact JSON returned** ⇒ env is fine — suspect the rate-limit proxy's
|
|
551
|
+
soft-degrade (it strips `hsContactId` when the per-IP bucket trips, so repeated test refreshes
|
|
552
|
+
can trigger the same symptom).
|
|
523
553
|
- **`.claude/` is gitignored** in the BDR repo on purpose — do not commit the
|
|
524
554
|
harness; pull it with `npx toga-ai`.
|
|
525
555
|
|
|
526
556
|
## Change history
|
|
557
|
+
- 2026-07-21 — **First Amplify deployment** (app now EXISTS: branch `_dev-sandbox` →
|
|
558
|
+
`dev-sandbox.d65bvvjrww97g.amplifyapp.com`, superseding the "not deployed yet" status).
|
|
559
|
+
DISCOVERED + FIXED (`amplify.yml`, commit `e17d804`) an env-var build-spec bug: the old spec only
|
|
560
|
+
handled `_production`/`_beta` with `cp .env.production .env.local` (expecting committed `.env`
|
|
561
|
+
files that correctly don't exist) and had **no `_dev-sandbox` case**, so deploys shipped **zero
|
|
562
|
+
server env vars** — page-prime's HubSpot fetch threw → empty lead ref → anonymous-visit guard
|
|
563
|
+
showed even with a valid `?hsContactId` → `/api/contact` returned `500 "Failed to fetch contact"`.
|
|
564
|
+
Fix is the Amplify Next-SSR recipe: build-time
|
|
565
|
+
`env | grep -E '^(HUBSPOT_|TOGA_|NEXT_PUBLIC_|RATE_LIMIT_)' >> .env.production` (console vars exist
|
|
566
|
+
only at build time; the SSR runtime reads `.env.production` from the artifact). Recorded the
|
|
567
|
+
operational rule that **env vars saved after a build starts require "Redeploy this version,"** and
|
|
568
|
+
a **deployed-site triage gotcha** (probe `GET /api/contact?hsContactId=` — 500 ⇒ missing env, 400
|
|
569
|
+
⇒ bad id, JSON ⇒ suspect the rate-limit soft-degrade). DECIDED the branch model: `BDR-Phase-2` is
|
|
570
|
+
retired and **`_dev-sandbox` is the source-of-truth branch** (holds `6a97dd1` enrichment,
|
|
571
|
+
`6d52b53` fast-dial/share/guard, `e17d804` env fix); a future `_production` is cut from it. Status:
|
|
572
|
+
fix pushed, awaiting console vars + a green build for the first deployed prime. (tcox)
|
|
527
573
|
- 2026-07-21 — Go-live continuation. **The full AI-BDR call loop was proven end-to-end in
|
|
528
574
|
production** (campaign 2, `26.05 - AI BDR - Ryan Nitti`): UI submit → funnel API → dialer → Vapi
|
|
529
575
|
call → webhook write-back (test method now in `../workflows/safe-call-loop-testing.md`). BUILT:
|
|
@@ -28,7 +28,9 @@ updated: 2026-07-21
|
|
|
28
28
|
- **Share button made real** (src/lib/shareMailto.ts, CallSummary.tsx): Send opens the visitor's mail client via mailto: with recipient/subject/summary body. BDR suite 131 tests green, tsc + eslint clean.
|
|
29
29
|
- **Parity audit (info → BDR)**: everything ported; enrichment was net-new in BOTH repos; visit route intentionally dropped; TOGA_PUBLIC_TOKEN_URL and NEXT_PUBLIC_ENV are dead even in info.
|
|
30
30
|
- **Vapi API diagnostics work** with the bearer const at worker2/Worker/Ai/Bdr/Vapi.php:6 (GET /call/{id} endedReason, GET /assistant/{id} config).
|
|
31
|
-
- /capture published 4 doc updates (web-funnel-app, safe-call-loop-testing, vapi-webhook-handler, vapi-integration).
|
|
31
|
+
- /capture published 4 doc updates (web-funnel-app, safe-call-loop-testing, vapi-webhook-handler, vapi-integration) + a delta capture for the deploy findings below.
|
|
32
|
+
- **Amplify app EXISTS now** (tcox deployed): branch `_dev-sandbox` at dev-sandbox.d65bvvjrww97g.amplifyapp.com. **Root cause of "guard notice despite valid ?hsContactId" found and fixed**: old amplify.yml only handled `_production`/`_beta` with `cp` of committed .env files (which rightly don't exist) and had no `_dev-sandbox` case — every deploy shipped with ZERO server env vars → HubSpot prefetch throws → empty lead ref → guard blocks. Fix committed (`e17d804`): official Amplify recipe `env | grep -E '^(HUBSPOT_|TOGA_|NEXT_PUBLIC_|RATE_LIMIT_)' >> .env.production` at build; the 7 vars live in the Amplify console (values: info/.env.local + TOGA_WORKER_URL=https://worker.togahub.com/ + GA id).
|
|
33
|
+
- **Deployed-site triage method** proven: probe `GET <site>/api/contact?hsContactId=<id>` — 500 "Failed to fetch contact" = server env missing; 400 = bad id; contact JSON = env fine (then suspect the rate-limiter's hsContactId-stripping soft-degrade).
|
|
32
34
|
|
|
33
35
|
## What did NOT work — DO NOT RETRY THESE
|
|
34
36
|
- **Answering the test call silently** → 8 seconds of mutual silence, Vapi `endedReason=customer-ended-call`, empty transcript. The healthcare assistant uses `firstMessageMode=assistant-waits-for-user` (deliberate: first-phoneme timing for voicemail/iPhone screening). **Testers must say "Hello?" first.**
|
|
@@ -48,8 +50,9 @@ updated: 2026-07-21
|
|
|
48
50
|
## Current file state
|
|
49
51
|
| File | Status | Notes |
|
|
50
52
|
|------|--------|-------|
|
|
51
|
-
| BDR enrichment + prefill
|
|
52
|
-
| BDR fast-dial + anon guard + share
|
|
53
|
+
| BDR enrichment + prefill | committed `6a97dd1` on `_dev-sandbox` | live-proven on contact 248 |
|
|
54
|
+
| BDR fast-dial + anon guard + share | committed `6d52b53` on `_dev-sandbox` | 131 tests green |
|
|
55
|
+
| BDR amplify.yml env fix | committed `e17d804` on `_dev-sandbox`, pushed (build triggered) | official env-passthrough recipe; branch model: **_dev-sandbox is source of truth, BDR-Phase-2 retired** |
|
|
53
56
|
| BDR/.env.local | TOGA_WORKER_URL added (local only) | dev server restart needed to load |
|
|
54
57
|
| dbchanges2 feature/ai-bdr-test-campaign (e99a367) | pushed; PR must be CLOSED UNMERGED | superseded + buggy (see above) |
|
|
55
58
|
| Prod Client_True data | campaign 2 dateEnd=2026-07-28; all campaign-2 contacts isOkayToCall=0 EXCEPT 248 | restore = go-live switch; exclude ids 120/132/134/146/155 |
|
|
@@ -62,12 +65,12 @@ updated: 2026-07-21
|
|
|
62
65
|
- **Anonymous submits blocked with notice** (matches info) per tcox's directive that anything diverging from info needs correcting.
|
|
63
66
|
|
|
64
67
|
## Blockers
|
|
65
|
-
- **Amplify
|
|
68
|
+
- **Amplify env vars must be saved in the console BEFORE a build starts** (vars added mid-build don't reach it — "Redeploy this version" required). At save time: awaiting tcox confirming the 7 vars are in the console + a green build of `e17d804`. Deployed `/api/contact` still returned 500 at last probe.
|
|
66
69
|
- **ContactAttempts ACL grant** (backend, DB config only) — gates real summaries + live status.
|
|
67
|
-
- **Business decision on the restore SQL** (resumes cold-calling ~70 prospects).
|
|
70
|
+
- **Business decision on the restore SQL** (resumes cold-calling ~70 prospects; exclude DNC ids 120/132/134/146/155).
|
|
68
71
|
|
|
69
72
|
## Exact next step
|
|
70
|
-
>
|
|
73
|
+
> Confirm the 7 env vars are saved in the Amplify console, then redeploy branch `_dev-sandbox` (build must START after the vars are saved). When green, probe `https://dev-sandbox.d65bvvjrww97g.amplifyapp.com/api/contact?hsContactId=131770626674` — contact JSON = fixed. Then open `https://dev-sandbox.d65bvvjrww97g.amplifyapp.com/?hsContactId=131770626674` and submit Call Now: this is simultaneously the deployed smoke test AND the fast-dial first live run (phone rings in seconds from +1 331-244-5958 — ANSWER AND SPEAK FIRST).
|
|
71
74
|
|
|
72
75
|
---
|
|
73
76
|
_Saved by /session-save on 2026-07-21_
|
package/package.json
CHANGED