Jul-28 Execution SOW — Close Every Open Loop
One page that lets a fresh session (Opus subagents) execute every open next action from the Jul-28 close-out — lanes, gates, context links, and the human list.
1 Executive Summary
Where things stand tonight, in plain English:
- Every one of today's 36 work sessions is captured and archived. Nothing is floating in an open tab anymore.
- The lead pipeline had three real holes, and all three got found today: a lead with no phone number could vanish silently (fixed live tonight), leads parked "needs review" were invisible to every screen (fix scoped below), and the chatbot's "is this a real lead?" test had been swapped for a much weaker version that calls almost everyone qualified (your 2-minute paste restores it).
- Delivered SMS were being wrongly marked as failed by a race condition — fixed and deployed tonight, 117/117 tests passing.
- The April scope of work you remembered — where the bot checks and fixes each answer right after collecting it instead of one big review at the end — was found in Notion and on disk. It is the blueprint for closing the remaining bot-quality holes.
- The number that matters: 25 leads transferred to Dan per week. The tripwire is Thursday, Jul 31 — no signed client by Friday means stop ads and rework the offer, by your own rule.
How to use this page: open a fresh session and say *"Execute the Jul-28 execution SOW at stpierre-jul28-execution-sow-docs.pages.dev — spawn one Opus subagent per lane."* Lanes A–E are parallel-safe for agents. The "Your List" section is human-only. Every gate that needs your word is marked GATE.
2 How Agents Run This
- 1Bootstrap the brain:
import sys; sys.path.insert(0, "/Users/akash/Documents/Claude/.codex/references"); import brain - 2One Opus subagent per lane. Lanes are parallel-safe (disjoint systems). Read each lane's GATE lines — a GATE means do not execute that item until Akash says so in chat.
- 3Every external write gets an Activity Ledger row (
change_ledger: surface, target_id, action, why, reverse_how, reversible, actor). Reads never need one. - 4GHL workflow-builder edits are Akash-only (agents fail in that iframe) — agents prepare exact click-paths and paste blocks instead. The Conversation AI API and custom-values API are agent-writable.
- 5n8n credential:
brain.get_credential(service="n8n", scope="agency", label="rest-api-cowork-claude"). Meta:brain.get_credential(service="meta-system-user", scope="stpierre", label="sp-messenger-system-user"). GHL PITs:ghl_pit_registry(DFW/Level King location6c4MSgjdfngrPhwWD2cb). - 6Cloudflare WAF blocks urllib against GHL — use curl subprocess.
3 Lane A — Lead Rail Integrity (P0)
- 1Verify the bridge patch healed. Tonight's patch (ledger 91954) taught the bridge to extract the Messenger PSID and match on it. Confirm lead
ab9be325-9d3a-4290-ac3d-d22816536d25(Tracy Justice Serio, contactLcSSBdJZRTfoE6XmAiUg) now has a processed row inneeds_reviewstate — she is a mis-tagged decliner and must NOT transfer. Bridge workflow: n8njTTms4dkSsa60TfI; pollerlB6TcayZVpR4yueyretries every 5 min. - 2Build the Needs-Review channel. Today a "needs review" lead is a database value nothing renders. Add a Needs Review tab to sales.stpierre.ai/inbox and an alert (phone/ops) when any lead enters the state. Worker:
01-Projects/St_Pierre_Digital/Funnel-and-Offer/sales-crm/worker.js(deployed twice today; established wrangler deploy path, rollback via version pin). The admin PATCH endpoint forqualification_statealready exists (~line 2316). - 3Alarm on silent drops. The bridge reported "success" on a 0-row upsert for 3 days of design life. Add a hard alert when the upsert writes 0 rows for a qualified contact.
- 4GATE — Cindy Shaw Romaguera + Richard Woods. Both real homeowners, parked invisible in needs_review (reason: unanswered messenger inbound). Present both threads to Akash; on his word, flip to
qualifiedvia the admin API — they transfer on the next 5-min drain. - 5Watchers due tomorrow: (a) old ads sync
NcMPrKyd5KN1fsFumust stay silent at 11:00 UTC (zombie-cron flush proof); (b) FB Activity LedgermRK8cDnzPT3dHipm— third off/on cycle applied 19:36 UTC tonight; if the next hourly slot is silent again, STOP cycling and rebuild the schedule-trigger node (delete + recreate node, re-save, re-activate; ledger it).
4 Lane B — Classifier + Meta Signal Integrity
- 1GATE (Akash paste, 2 min) — restore the strict qualifier prompt. The live prompt is a loose sentiment check tagging ~90% of ad leads qualified, including explicit decliners. Click path: Level King sub-account → Automation →
*1. Qualified Convo Tracking→ GPT node "2. Review First Message to Filter Out Accidental Clicks, etc." → replace Prompt with the block below → Save action → Publish.
You asked, "What kind of {{custom_values.niche}} project can we help you with?" The customer replied: {{message.body}} Determine intent: Respond POSITIVE only if the message indicates potential interest in a {{custom_values.niche}} project. Services we offer: {{custom_values.ab_services}} Respond NEGATIVE if: - They are offering services, advertising, or soliciting our business - They need a service we do NOT offer: {{custom_values.kb_exclusions}} - They say they don't need anything, are just browsing, or clicked by accident - They are spam, automated messages, or crypto/advertising solicitations - They are offering to network, partner, or refer without a specific project of their own. Return only POSITIVE or NEGATIVE.- 1Create the
kb_exclusionscustom value on location6c4MSgjdfngrPhwWD2cb(it does not exist — the merge tag renders blank). GATE: Akash supplies the exclusions text; agent pushes via the custom-values API. Note:ab_servicesexists and is correct. - 2GATE — CAPI design decision. Reality: one live leg fires event "Lead" at the shared client pixel
3727287274206232(n8n postergp1NILFWhEfkUGx3, hard-coded "never LeadSubmitted" per Akash decision #4, Jul-25). The DFW messaging dataset1990671461593550has received zero events ever. The native GHL CAPI action is dead (capi_access_tokenCV missing,pixel_idCV points at the shared pixel). Akash picks: (a) bless single-leg reality and delete the dead native action, or (b) restore two-leg design — createcapi_access_tokenCV, point the native action at the messaging dataset with event "Lead Submitted". Context: ad sets optimize on native Messenger lead-gen, not the dataset, so this is signal quality, not delivery-blocking. - 3Retro-audit inflated qualifieds since Jul-25. Misfire class examples: Tracy (decliner), Mark Cope, Bradford Court. Disposition each junk-qualified contact; strip tags where wrong (ledgered).
- 4Mint TX/ATX messaging datasets in Events Manager when Akash does his clicks (1 min each; only DFW exists today).
5 Lane C — Per-Field Self-Correction Port (the April blueprint)
Source of truth: "SOW — GHL Bot Pipeline V2: Self-Correcting Workflow" (2026-04-26) — Notion page (under the "Self Correcting Workflow" toggle) · local (archive): 04-Archive/keeps/eyefly-projects-2026-07-12/GHL-Bot-Pipeline-V2/SOWs/SOW-2026-04-26-self-correction.md · companion build doc with the per-field Defensive Save actions: Phase-1-implementation.md (same folder) · follow-up executed on the EyeFly fleet: SOW-2026-05-11-needs-review-fix.md · brain: deliverable 4573, handoffs 322/279/281/336/350/355. Note: the April SOW targets the EyeFly fleet workflow (where "Is Data Client Facing" lives) — Jordan/SP is a different flow, which is why this is a PORT, not a rerun. Confirmed by full workspace sweep: no current St. Pierre SOW contains this per-field design.
The design: after EACH collected field (phone, zip, city, project, notes) — extract → save → check → FIX in place (deterministic code first, geocode/default fallback second, re-ask the customer third). The single end-of-flow "Is Data Client Facing?" mega-validator decomposes into per-field gates; the LLM validates only Notes.
Deliverable: a DFW port SOW mapping all 5 layers onto Jordan's current flow + the *3 Auto Transfer Tracking workflow — exact GHL click-paths for UI parts, API payloads for the rest, and a test matrix that includes today's three live failures: "live in plano" accepted with no zip, Tracy's empty phone silently dropped, needs_review invisible. GATE: Akash approves the port SOW before any GHL build.
6 Lane D — Ads Account Hygiene (B2C Level King act_3289323034532141)
- 1GATE — duplicate ad set
120247632925500714("…- Copy", created 15:08 today, $0 spend, paused, all 16 ads internally ACTIVE). Akash: delete, or keep as the future Instagram-destination twin. Recommendation: delete; re-duplicate after IG connects. - 2GATE — exclusion lists. None of the three live ad sets excludes prior leads. Apply
SP B2C | Historical Exclusion | Qualified | All Prior Leads(2,600–3,100 people) to all three — blocked by the no-edits-to-spent-ad-sets rule until Akash says go (or he does it in UI). - 3GATE — budget truth. Campaign
120247554600190714is named "$50pd" but spends $100/day. One word: keep-100 (rename) or cut-to-50 (budget change). - 4Delete the broken 2024 lookalike "Lookalike (US, 1%) — AudienceLab | Roofing+Siding Broad" (creation error 433, unusable).
- 5Monitor the 3-way Advantage+ overlap. All three ad sets target the same 5 cities with Advantage+ audience (suggestions: three 1% LALs / new 10% Transferred LAL / none). Meta's allocation is the signal — build the daily allocation readout into the ads dashboard refresh.
7 Lane E — Infrastructure + Rituals
- 1Port the weekend check-ins to n8n. Root cause found: Mac slept, then both scheduled sessions hung forever on a permission prompt (headless, nobody to answer). Port the deterministic halves (cash check P&L build, Sunday projections) to n8n per the Plaid-cutover pattern; add a stall tripwire (scheduled session with zero tool results 15 min after spawn → alert).
- 2GATE — n8n quota. Workspace at 80% of 10,000 executions/mo, and every rail depends on it. Akash picks: upgrade plan, or trim polling cadence (candidates: the 4-per-5-min bridge dispatch pattern; event-based beats loop-based). Do this BEFORE adding the Lane E ports.
- 3Scorecard hero metric. DB half is locked (25 transfers/week, prediction row for W2026-07-27). Verify tomorrow's 06:45 render shows it on weekly-scorecard.html; if not, fix the renderer.
- 4Jordan → Instagram. After Akash connects IG to the DFW sub-account (his click-path), flip Jordan's channels
["FB"]→ FB+IG via the verified GET/PUT API path with readback + ledger (prepared task 8580d224).
8 Your List (human-only, ~80 min total)
_deliverables/2026-07-28/manual-actions-click-paths.md (sent in chat today). Priority order below.- 1Thursday tripwire decision — the battle plan, before everything else.
- 2Text Dan — one message: confirm dummy test cards render correctly in DripJobs, delete them, send his Booking Form link (DripJobs → Settings → Booking Form). That link is the last blocker on direct lead feed. Plus the Joseph Anwah nudge.
- 3Paste the classifier prompt (Lane B item 1) + supply the
kb_exclusionstext. - 4Ads decisions: budget 100-or-50 · delete-or-keep the duplicate · exclusions go-ahead.
- 515 min Facebook clicks: connect TX page in the CRM (claims + system-user access are DONE); mint TX/ATX datasets in Events Manager.
- 6Connect Instagram to the DFW sub-account.
- 7GHL builder items (agents can't touch that UI): webhook action with the exact URL, 6-step follow-up cadence, delete dead
*3 Auto Transfer Trackingworkflow, CAPI toggle / double-fire check. - 8Send Cindie + Scott replies (drafts ready) — promised to Dan.
- 9Telegram: create St. Pierre HQ group, add @akashtrackerbot as admin with Manage Topics — Sam's morning brief auto-wires itself after.
- 10Before Aug 23: record the Collins vision Loom (script live at team.stpierre.ai/builderpipeline/vision/), download old Looms. Before Aug 15/20: paste the 3 Manus research jobs (
_deliverables/2026-07-28/manus-job-prompts.md), use-then-cancel Manus + Adobe. Decide OnlineJobs.ph (card declined Jul-28).
9 Context Pack
Today's live pages: Jul-28 Close-Out · Lead Machine SOW · Texas CL Launch SOW · Campaign Scoreboard · Ads Live Dashboard · rooms.stpierre.ai (all rooms) · sales.stpierre.ai/inbox
Key files: _deliverables/2026-07-28/manual-actions-click-paths.md · _deliverables/2026-07-28/manus-job-prompts.md · 02-Areas/Team/Internal Docs/texas-cl-clickpath.md · Projects/GHL-Bot-Pipeline-V2/SOWs/SOW-2026-04-26-self-correction.md · 01-Projects/St_Pierre_Digital/Funnel-and-Offer/sales-crm/lead-delivery.js (verify fix shipped 18:29Z, version 57ea9ecf)
Tonight's ledger rows: 91949 (lead-delivery verify fix deploy) · 91954 (bridge PSID patch, before-images saved) · n8n cycle #3 on mRK8cDnzPT3dHipm · earlier: 91891-92 (transfer rail rebuild), 91925 (vault-token rewire), 91946 (cycle #2)
Key IDs: GHL location 6c4MSgjdfngrPhwWD2cb (Level King/DFW) · CL campaign 120247554600190714 · ad sets 120247554600210714 (original) / 120247632925500714 (dup, 15:08) / third created 15:23 · shared pixel 3727287274206232 · DFW messaging dataset 1990671461593550 (zero events ever) · n8n: bridge jTTms4dkSsa60TfI, poller lB6TcayZVpR4yuey, drain 6ET0nCwUKY35WBwR, CAPI poster gp1NILFWhEfkUGx3, FB ledger mRK8cDnzPT3dHipm, old ads sync NcMPrKyd5KN1fsFu (must stay dead)
Session history: brain session_handoffs rows 2003–2038 cover all of Jul-28; this close-out session wrote 2024–2038 and ran the audits behind every claim on this page.
Verified-today facts agents can trust: $40.01 ad balance cleared · TX/ATX pages claimed (new ids 1285133024673810 / 1269736852881717) · Loom cancelled, runs to Aug 23 · Spencer + Sam delivered (Dan engaged Sam) · classifier prompt = loose sentiment version · needs_review has no UI · n8n at 80% quota · OnlineJobs.ph card declined