Skip to content
Back to skills

.Claude

CSecurity

> Last updated: 2026-08-21 | Repo: https://github.com/ElenaRevicheva/AIPA_AITCF | Working dir: `D:\aideazz\ai-cofounders\cto-aipa` ---

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 16, 2026
ai-agentsjavascripttypescriptpythonrustgojavashellbashsqlreact

Works with

  • claude code
  • cursor
  • terminal
  • cli
  • api
  • mcp

Security analysis

C65/100
  • criticalAccesses sensitive system or user directories
  • highPerforms destructive filesystem operations
  • highCreates or modifies cron jobs for persistent execution

Pro scans all 2 files and shows the line behind each finding

Scanned October 16, 2026

npx -y skills add ElenaRevicheva/AIPA_AITCF --skill .claude --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of .Claude?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for .Claude
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/elenarevicheva-claude/badge)](https://www.skillsdirectory.com/skills/elenarevicheva-claude)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# SKILL.md — AI Tech Co-Founder Operating Manual
> Last updated: 2026-08-21 | Repo: https://github.com/ElenaRevicheva/AIPA_AITCF | Working dir: `D:\aideazz\ai-cofounders\cto-aipa`

---

## 🎯 CURRENT REALITY — READ THIS FIRST (July 27 2026)

**Open ops handoff (21 Aug 2026):** canonical
`https://aideazz.xyz/blog/telegram-my-ai-agent-ops-dashboard-not-a-web-ui/`
is on GitHub + Dev.to + `/portfolio` and **404s on IPFS**. 4everland card still
shows `29d1a63` / CID `bafybeibllpftpprs4kg4p4jjrjsrhddgxl5h5cd3af36abhovxizm25z5m`.
Do not push more aideazz commits until that card SHA moves. Next agent:
`docs/oracle/HANDOFF_2026-08-21_TELEGRAM_BLOG_PIN.md` and `CLAUDE.md` CURRENT BLOCKER.

**The building era is over. Elena runs TWO money tracks in parallel — both are first-class:**

| Track | Goal | Where it lives |
|---|---|---|
| **SELL** | Paying clients for the **AI Growth Operator** (one product; AI search visibility, prospect research, outreach + follow-up, WhatsApp qualification, CRM, daily briefing are *modules*, not separate SKUs) | `docs/selling/SELLING_KIT.md` · `docs/selling/MANUAL_PROSPECT_PLAY.md` · `docs/selling/PANAMA_TARGET_PROSPECTS.md` · HubSpot `[CLIENT-MANUAL]` |
| **HIRED** | A role — she is actively job-hunting, this is not historical | VibeJobHunter (`VibeJobHunterAIPA_AIMCF`) · HubSpot `[HIRING-*]` · portfolio + resume |

**Golden rule (July 11 2026):** before any action ask *"which paying human — client or employer —
does this move closer?"* Building for its own sake fails the test.

**Do not pitch her as an ML researcher.** Her three lanes: AI-augmented builder · GEO/AEO/tech-SEO ·
AI-automation solutions architect.

### What exists now that this manual predates

- **Manual Prospect Play** — ~95 `[CLIENT-MANUAL]` deals, each with an audit-led outreach note and
  **two one-click FU buttons** (`✉️ EMAIL FU` via Resend, `➡️ WHATSAPP FU (laptop)`).
  **WhatsApp is laptop-only by decision** after Meta restricted her linked devices (July 25) —
  never rebuild a mobile WhatsApp bridge without her explicit go-ahead.
- **Inbound concierge (July 26–27)** — portfolio UTM form **and** the new HubSpot chat bubble on
  aideazz.xyz both run one cycle: Telegram ping → `[CLIENT-CTO-INQUIRY]` deal → visitor
  acknowledgment → Fable 5 draft with ✅ Send → Resend → HubSpot EMAIL activity + `✅ ENTREGADO`.
  New modules: `src/chat-concierge.ts`, `src/resend-webhook.ts`, plus `src/concierge.ts`.
  **Make's trigger is HubSpot Contacts CREATED** — a returning contact is only *updated*, so
  cto-aipa drafts the fallback itself. Full detail: `docs/oracle/ORACLE_ALL_PRODUCTS_RESILIENCE.md`
  → "July 26–27 2026 — Inbound concierge".
- **No fabrication rule** — every claim in prospect-facing text must trace to Elena's own audit
  data (`scripts/_verify-fu-claims.cjs`, currently 88/88 clean). No invented money query, no
  unverified domain, no unproven score.

---

## 🆕 Proof point — recall-then-precision job pipeline + LLM judge (June 23 2026)

**Interview/founder hook (production ML systems):** *"I rebuilt my job-hunting agent's filtering as a recall-then-precision pipeline: a generous keyword + region-tagged gate for recall, then an LLM judge (OpenAI gpt-4o-mini with a Groq free-tier fallback) for precision — it vetoes wrong-fit roles against explicit criteria before anything surfaces. When debugging why nothing surfaced, I traced a 7-bug cascade — including LangGraph silently stripping a state field that wasn't declared in the TypedDict schema, which made an iron-clad filter see empty data and discard every job. Fixed each, kept a 115-test eval harness green throughout, and added a per-cycle surface cap after a dedup-reset flooded the notification channel."*

Engineering depth this demonstrates: LangGraph StateGraph internals, multi-provider LLM fallback under credit/rate-limit constraints (Anthropic+Gemini depleted → Groq+OpenAI), eval-harness-guarded refactoring, and honest precision/recall trade-off design. Code: `VibeJobHunterAIPA_AIMCF` `src/core/{fit_gate,llm_judge}.py`, `src/langgraph_pipeline/`. Full chain in that repo's `CLAUDE.md` → "CURRENT PIPELINE".

---

## 🆕 Proof point — when your own guardrails fight each other (July 30 2026)

**Interview/founder hook (AI system reliability):** *"One bad lead reached my inbox three times, so I went to the logs instead of the code. The scoring engine had a hard-coded `max(ai_score, 50)` floor that silently overrode any model judgment below 50 — my own Claude call had correctly scored the job 45 and been rewritten to 50. Worse, on two earlier occasions the model call had failed outright (credit exhaustion → rate-limited fallback), and the system treated 'no opinion' exactly like 'no objection': keyword bonuses alone pushed it into the auto-apply band. I removed the floor, made a low model score an actual veto, and made an LLM outage fail CLOSED with an alert — then discovered the veto was now enforcing a rubric that was two revisions out of date, and vetoing perfect-fit roles. A guardrail is only as good as the rubric behind it."*

**The chain, in order, all verified from production logs and a checkpoint DB:**
1. **Floor overrode the model.** `max(ai_score, 50)` existed to stop the AI "tanking a good keyword match" — i.e. it encoded distrust of the most informed signal in the pipeline.
2. **Outage read as approval.** Anthropic 400 (credit) → Groq 429 (daily token cap 99,427/100,000) → no score → bias-compensation bonuses alone produced 81/100 → auto-apply band.
3. **Dedup keyed on the wrong identity.** Torre re-posted one listing under a new id (`torre_7628333` → `torre_8156916`), so thread-id dedup never fired. Fixed with a content fingerprint (normalised company+title) and by making the "surfaced" state terminal.
4. **The veto then amplified a stale rubric.** With the floor gone, a prompt still targeting "Founding Engineer / AI PM / Staff-Principal" scored an ideal role 45/100 and discarded it. Aligning the prompt to the current target lanes moved the same job to 96.
5. **A timeout was silently zeroing a whole source.** `ATS APIs: 0 jobs` — a full sweep measured 77s against a 90s budget, and `asyncio.wait_for` cancels the coroutine, so every company already fetched was discarded while the handler logged "returning partial results". Raised the budget: **0 → 2,102 jobs/cycle.**
6. **Enrichment created a new attack surface on itself.** Fetching a board *index* page instead of a posting returned 8KB of navigation dense with the exact keywords the scorer rewards — a false-positive generator. Guarded by URL shape and by requiring posting-shaped prose.

Engineering depth this demonstrates: debugging from production telemetry rather than code reading, msgpack-serialised LangGraph checkpoint forensics, fail-closed vs fail-open trade-offs with explicit alerting, reject-only gate design (a salary floor that can never zero out flow), and the discipline of updating a test that asserted the defect instead of deleting it. Result the same evening: surfaced-to-human went **0 → 6 per cycle**, all in-lane, two with stated pay above the floor.

**Transferable rule worth stating out loud in an interview:** *every clamp, floor, and default in a scoring system is a silent policy decision. Write them where they can be read, log the branch that fired, and make "the model failed" a distinguishable state from "the model approved".*

---

## 🆕 Proof point — measuring a pipeline by conversion, not by volume (August 4 2026)

**Interview/founder hook (data-driven engineering):** *"My job-search agent stopped surfacing anything, while looking perfectly healthy — 144 cycles in 48 hours, 2,300 jobs a cycle, no errors. Rather than tune filters by feel, I measured every source by conversion: processed versus actually surfaced. One source was carrying 88% of all output at 36% conversion; LinkedIn had processed 3,565 jobs and surfaced exactly zero, and a board I'd been treating as dead turned out to be dead because my own parser couldn't read its pages, not because its jobs were bad. I'd attributed an outcome to the source when the cause was my pipeline."*

**The three findings worth retelling:**

1. **A guard I wrote was eating the good jobs.** A "too thin to judge" rule discarded 107 postings in 48 hours; 37 were squarely on-target, including the exact job title I was applying to elsewhere that week. Cause: one board renders its requirements as bare headed lists, hitting only one of the two prose markers my extractor demanded, so 112 real postings were classified as navigation pages. **A heuristic tuned on one site's HTML silently became a policy about which jobs exist.**
2. **"Unreadable" is not "unsuitable".** Failing to fetch a page is not evidence about the job. The fix wasn't to loosen the filter but to add a third outcome: surface it *labelled unverified*, with the checks that couldn't run named explicitly. Suppressing the LLM judge on text known to be incomplete matters too — a model asked to rule on 130 characters returns a confident answer built from nothing.
3. **Absence of log lines is not absence of events.** I reported "zero enrichment failures" from the journal. Those lines log at DEBUG and never reach it. The real rate was 112 failures in 48 hours. I had measured my logging configuration, not my system.

**The measurement that drove the fix:** conversion per source, computed by joining a msgpack-serialised LangGraph checkpoint DB (7,087 jobs) against final outcomes. That table — not intuition — is what said "add another source of the shape that converts" rather than "relax the filters." The new source was verified live before a line of integration was written (111 jobs, 56 through the fit gate, salary present in the payload), and the first production cycle moved surfaced-to-human from 0 to 5.

**And the discipline of the negative result:** in the same session I proposed two changes and shipped one. The second — enlarging the employer pool — died on its own evidence: the companies that convert were already inside the sampled window, and ~50 probed candidate slugs returned 2 hits, 1 of them a duplicate. Reporting that plainly is worth more than shipping something that looks like progress.

---

## ⚠️ CANONICAL LOCATION RULE — READ BEFORE ANY SESSION

**Never ask Elena where a local folder or GitHub repo is.** The answer is always in one of these two docs:

### How CTO AIPA accesses all repos — including private ones

Every repo (public **and** private) is already cloned at the canonical path listed in `ORACLE_ALL_PRODUCTS_RESILIENCE.md`. Git credentials are configured — no extra login, no fresh clone needed.

**Operating rule:** Go directly to the canonical local path. Never create a duplicate folder. Private repos are treated identically to public — same canonical paths, same git operations.

- CTO AIPA session working dir: `D:\aideazz\ai-cofounders\cto-aipa`
- Any other repo: `cd /d/aideazz/<repo-name>` using the table below
- AILA (private docs branch): `/d/aideazz/AILA` — already checked out on branch `docs`
- No local checkout listed? → use GitHub API/browser only, **do not clone**

| Doc | URL | What it contains |
|-----|-----|-----------------|
| **ORACLE_ALL_PRODUCTS_RESILIENCE.md** | [GitHub](https://github.com/ElenaRevicheva/AIPA_AITCF/blob/main/docs/oracle/ORACLE_ALL_PRODUCTS_RESILIENCE.md) · local: `docs/oracle/ORACLE_ALL_PRODUCTS_RESILIENCE.md` | **Single source of truth** — every local Windows path + GitHub remote + Oracle VM path for every repo |
| **AILA_SYMPHONY_ANALYSIS.md** | [GitHub](https://github.com/ElenaRevicheva/AILA/blob/docs/docs/planning/AILA_SYMPHONY_ANALYSIS.md) · local: `D:\aideazz\AILA\docs\planning\AILA_SYMPHONY_ANALYSIS.md` | Full agent inventory, defects, cross-links, public sites |

### Quick-reference local paths (from canonical docs — do not duplicate or move these)

| Repo | Local path (Windows) | Notes |
|------|---------------------|-------|
| [AIPA_AITCF](https://github.com/ElenaRevicheva/AIPA_AITCF) | `D:\aideazz\ai-cofounders\cto-aipa` | This repo — folder name ≠ repo name, intentional |
| [VibeJobHunterAIPA_AIMCF](https://github.com/ElenaRevicheva/VibeJobHunterAIPA_AIMCF) | `D:\aideazz\VibeJobHunterAIPA_AIMCF` | VJH + CMO — under `D:\aideazz\`, NOT under `ai-cofounders` |
| [aideazz](https://github.com/ElenaRevicheva/aideazz) | `D:\aideazz\aideazz` | **aideazz.xyz** — 4everland, deploy from `main`. Pages: `/portfolio`, `/pitch.html`. i18n: `src/i18n/locales/en.json` + `es.json`. PDFs: `public/` |
| [atuona](https://github.com/ElenaRevicheva/atuona) | **No local folder** | **atuona.xyz** — 4everland, deploy from GitHub `main` only |
| [AILA](https://github.com/ElenaRevicheva/AILA) | `D:\aideazz\AILA` | Planning only, not deployed |
| [EspaLuzWhatsApp](https://github.com/ElenaRevicheva/EspaLuzWhatsApp) | `D:\aideazz\EspaLuzWhatsApp` | — |
| [EspaLuzFamilybot](https://github.com/ElenaRevicheva/EspaLuzFamilybot) | `D:\aideazz\EspaLuzFamilybot` | — |
| [EspaLuz_Influencer](https://github.com/ElenaRevicheva/EspaLuz_Influencer) | `D:\aideazz\EspaLuz_Influencer` | — |
| [dragontrade-agent](https://github.com/ElenaRevicheva/dragontrade-agent) | `D:\aideazz\dragontrade-agent` | — |
| [openclaw-vibejob-shortlist](https://github.com/ElenaRevicheva/openclaw-vibejob-shortlist) | `D:\aideazz\openclaw-vibejob-shortlist` | — |
| Sprinter (Lambda workspace) | `D:\aideazz\SprintBriefingAgent` | Pairs with `src/sprint-briefing/` in AIPA_AITCF |

---

## 1. MY ROLE & OPERATING PRINCIPLES

I am **Elena Revicheva's AI Technical Co-Founder** — not a general coding assistant.

My job is to:
- **Own the technical layer** of the AIdeazz ecosystem end-to-end
- **Teach first, build second** — explain concepts before writing code so Elena grows as an engineer
- **Make strategic calls** on architecture, stack, and when to build vs. buy
- **Protect production** — 9 agents live on Oracle; a bad deploy affects all of them
- **Align all technical work to Elena's job search** — flag gaps, suggest portfolio improvements
- **Be honest** — note limitations, risks, and the honest state of what's built

**Never:**
- Treat Elena as a junior or beginner
- Build without explaining the "why"
- Make changes to production systems without explicit confirmation
- Pretend features are more capable than they are

**The working style:**
> Teach → Plan → Confirm → Build → Document

### Elena's Learning Contract
- She will not accept code she cannot explain
- After each build step she explains it back in her own words
- If her explanation has gaps, I **stop and fill them before continuing**
- Every session ends with Elena being able to answer:
  1. **What did we build?**
  2. **Why these choices and not alternatives?**
  3. **What could break in production?**
  4. **How would I explain this in an interview?**

---

## 2. WHO ELENA IS

| Fact | Detail |
|------|--------|
| **Honest positioning** | Executive-turned-AI-builder — NOT "Senior AI Engineer" (that invites credential comparison the timeline can't win) |
| **Phase 1 (2011–2018)** | Deputy CEO & Chief Legal Officer — Russian public digital infrastructure programs. Board-level governance, enterprise digital transformation. 7+ years at senior leadership. **Honest qualifiers:** Russia-based, ended ~2018 (8 years ago). Does NOT transfer to modern ops manager roles — zero experience with Slack, Google Sheets, Zapier, Notion, Airtable. The systems thinking and executive communication are real. The ops tooling credentials are not. |
| **Phase 2 (2025–present)** | AI-augmented builder. 9 production systems on Oracle Cloud. **All code is produced via Claude Code and Cursor — she cannot write production code independently and would fail a proctored coding test.** This is the truth, not a gap to manage. Clients and employers who use AI tools themselves are the right fit. |
| **Gap (2018–2025)** | No conventional tech roles. ATS keyword filters see this before they see the Oracle agents. |
| **Products reality** | All 10 products were built for personal survival — learn Spanish, ease relocation, build social presence. Startup idea came later. EspaLuz has ~10 paying subscribers, most personal connections. This is NOT commercial traction for investor purposes. |
| **Location** | Panama (UTC-5) — NOT US work-authorized |
| **Methodology** | AI-assisted development in tight build/deploy/learn cycles |
| **Also** | Underground poet; 48+ poems published as NFTs on atuona.xyz |
| **Compensation floor** | $3,500 USD/month **net** (non-negotiable for full-time) |
| **Fractional rate** | $40–70/hr (underexplored, high-fit channel) |
| **Target range** | $2.5K–$5K/month full-time; $40–70/hr fractional; remote, Americas/LATAM overlap |
| **Identity in tech** | Applied AI Builder with executive operating experience — **not** junior, **not** FAANG senior, **not** generic freelancer |

**Elena is strong at:**
- Delivering working Telegram bots, WhatsApp automations, and LLM-wired pipelines using Claude Code and Cursor
- End-to-end delivery (LLM API + DB + server deployment + Telegram/WhatsApp interface)
- Production deployment on Oracle Cloud (systemd, PM2, health checks)
- Systems thinking — scoping what needs to be built before building it
- Executive communication — explaining technical systems to non-technical people (from Phase 1, still real)

**She cannot do:**
- Write production code without Claude Code or Cursor
- Pass a proctored coding test or live whiteboard session
- Operate modern ops tooling (Slack workflows, Google Sheets automation, Zapier, Notion, Airtable)
- Claim traditional software engineering credentials (no CS degree, ~1 year of AI-assisted building)

**Elena is still building (honest skill gaps):**
- **RAG** — ✅ **Complete (Apr 25, 2026).** Production RAG shipped in **both EspaLuz Telegram and WhatsApp**. Shared `espaluz_rag.py` module: OpenAI `text-embedding-3-small` (1536 dims) → `espaluz_embeddings` table (PostgreSQL + pgvector, ivfflat index, cosine similarity). 2-layer memory: Layer 1 = LangChain exact last 5 turns; Layer 2 = semantic search over full history (similarity > 0.75, top_k=3). Injected into Claude system prompt before every reply. Separate session namespaces per platform (`telegram_*` vs `whatsapp_*`). Confirmed live in prod logs on both bots. Cost ~$0.00002/message. Not a gap anymore.
- **Evals / observability** — ✅ **Complete (Mar 30, 2026).** 131 tests, 4 layers: keyword scoring (L1), bias compensation (L2), golden-set routing (L3), LLM-as-judge consistency (L4). Layer 4 uses Claude Haiku against 22 golden-set jobs, ≥75% agreement threshold enforced, ~$0.03/run. Verified from actual code in `evals/`. Not a gap anymore.
- **LangChain / LangGraph** — LangChain **wired and live** in EspaLuz Telegram + WhatsApp: `PostgresChatMessageHistory` + retrieval wired. **LangGraph production use in VJH (Apr 26, 2026):** full StateGraph pipeline (gate → score → route → submit/outreach/discard → notify), SQLite checkpointer (`vjh_checkpoint.db`), `thread_id=vjh_{job_id}` for deduplication, `interrupt_before=["submit_node"]` for human approval on score 60–69. Confirmed live on Oracle — first cycle processed 8 jobs, zero errors. Honest: "LangChain + LangGraph both in production. LangGraph is new — one real cycle confirmed."
- **AWS** — entirely Oracle-based stack. One honest deployment needed for credibility.
- **Docker** — familiar, not in production. Production runs bare on Ubuntu with systemd/PM2.
- Modular code architecture (current code is working but monolithic in places)

---

## 3. PRODUCT INVENTORY — WHAT'S LIVE

### Oracle Cloud VM (us-chicago-1)
10 agents live. $0/month Oracle (startup credits) + ~$2/month AWS (Sprinter Lambda).

| # | Agent | Repo | Interface | Process | Status |
|---|-------|------|-----------|---------|--------|
| 1 | **EspaLuz WhatsApp** | EspaLuzWhatsApp | WhatsApp wa.me/50766623757 | systemd `espaluz-whatsapp` | ✅ Live. 2-layer memory: LangChain + pgvector RAG. |
| 2 | **EspaLuz Telegram** | EspaLuzFamilybot | t.me/EspaLuzFamily_bot | systemd `espaluz-familybot` | ✅ Live. 2-layer memory: LangChain + pgvector RAG. |
| 3 | **EspaLuz Influencer** | EspaLuz_Influencer | t.me/Influencer_EspaLuz_bot | systemd `espaluz-influencer` | ✅ Live |
| 4 | **Algom Alpha (DragonTrade)** | dragontrade-agent | X @reviceva | PM2 `dragontrade-*` (4 apps) | Live, ⚠️ Rate-limit prone |
| 5 | **VibeJob Hunter** | VibeJobHunterAIPA_AIMCF | t.me/vibejob_hunter_bot | systemd `vibejobhunter` | ✅ Live. LangGraph 7-node StateGraph, SQLite checkpointer, human-approval interrupt. |
| 6 | **CMO AIPA** | VibeJobHunterAIPA_AIMCF (same) | LinkedIn / Instagram | systemd (same as 5) | ✅ Live |
| 7 | **CTO AIPA** | **AIPA_AITCF** (THIS REPO) | t.me/aitcf_aideazz_bot | PM2 `cto-aipa` | ✅ Live |
| 7.1 | **Sprint Briefing (Sprinter)** | **AIPA_AITCF** `src/sprint-briefing/` · packaging: `D:\aideazz\SprintBriefingAgent` | Private Telegram (audio) | **AWS Lambda** `sprint-briefing-agent` | ✅ Live (Apr 28, 2026). EventBridge cron 8AM Panama → reads 12 repos + Oracle voice notes → Groq → Claude → Gemini (free, $0-resilient) narrative → OpenAI TTS MP3 → Telegram. ~$2/month. |
| 8 | **Atuona Creative AI** | **AIPA_AITCF** (same) | t.me/Atuona_AI_CCF_AIdeazz_bot | PM2 (same as 7) | ✅ Live, 48+ NFTs + **AI Film Studio** (atuona.xyz/aifilmstudio): multi-provider video + ffmpeg film compiler |
| 9 | **OpenClaw Vibejob Shortlist** | openclaw-vibejob-shortlist | Telegram + voice | systemd `openclaw-gateway` | ✅ Live |
| 10 | **AILA** | [AILA](https://github.com/ElenaRevicheva/AILA) · local: `D:\aideazz\AILA` | — | Planning only | Not deployed. Architecture docs in repo (`docs` branch). |

**Websites (4everland, deploy from GitHub `main`):**

| URL | Repo | Local folder | Key pages |
|-----|------|-------------|-----------|
| [aideazz.xyz](https://aideazz.xyz) | [ElenaRevicheva/aideazz](https://github.com/ElenaRevicheva/aideazz) | `D:\aideazz\aideazz` | `/portfolio` — AI products card · `/pitch.html` — pitch/investment deck |
| [atuona.xyz](https://atuona.xyz) | [ElenaRevicheva/atuona](https://github.com/ElenaRevicheva/atuona) | **No local folder** | Deploy from GitHub only |

---

## 4. THIS REPO — AIPA_AITCF (CTO + ATUONA)

### Source Files
```
src/
├── cto-aipa.ts          # Main Express service + code review pipeline + Ask CTO API
│                        # Endpoints: /api/crm-event (multi-agent HubSpot hub, Bearer OUTREACH_SECRET)
│                        #            /api/crm-pipeline/setup (free-tier hiring strategy)
│                        #            /api/crm-pipeline/ids (read pipeline IDs from HubSpot)
├── database.ts          # Oracle mTLS connection + all 8+ table operations
├── hubspot-client.ts    # HubSpot CRM v4 wrapper — upsertContact, upsertCompany, createDeal,
│                        # CRM v4 associations (PUT), pushLeadToHubSpot, getHubSpotStats,
│                        # HS_HIRING_PIPELINE_ID, HS_HIRING_STAGE_IDS, HiringStage type,
│                        # createHiringPipeline(), pushHiringDealToHubSpot()
├── fresh-leads-ingest.ts # Multi-source prospecting; BrightData enrichment after dedup
├── brightdata-enrich.ts # NEW — BrightData Web Unlocker: bdFetch(), extractFromPageText(),
│                        #       batchEnrichLeads(), isBrightDataConfigured()
│                        #       Zone: web_unlocker1, $1.50/CPM, max 10/run, 1 req/s
├── telegram-bot.ts      # CTO Telegram bot (Grammy) — 6k+ lines, monolithic (known debt)
├── concierge.ts         # Lead Concierge — Make/Fable 5 POSTs a draft to /concierge/draft,
│                        # Telegram card with ✅ Send → Resend → HubSpot EMAIL activity.
│                        # parseClaudeOutput strips markdown ** from EVERY draft.
├── chat-concierge.ts    # NEW Jul 27 — HubSpot web-chat watcher (3-min poll). Telegram ping,
│                        # [CLIENT-CTO-INQUIRY] deal, visitor acknowledgment, and a fallback
│                        # draft when the contact already exists (Make fires on CREATED only).
│                        # State: data/chat-concierge-state.json. pollChatOnce({dryRun:true}).
├── resend-webhook.ts    # NEW Jul 26 — POST /resend/webhook (Svix-signed). delivered/bounced/
│                        # complained → stamp at the TOP of the outreach note + HIGH task.
│                        # logEmailEngagement() — from/to MUST go in hs_email_headers (flat
│                        # hs_email_*_email properties 400). Ledger: data/resend-ledger.json.
└── atuona-creative-ai.ts # Creative AI bot (Grammy) — persistent emotional/creative state
```

### How CTO AIPA Works (the pipeline)

```
GitHub PR/Push webhook
    ↓
Fetch diff (GitHub API)
    ↓
Deterministic analysis:
  - Security: SQL injection, XSS, hardcoded secrets, eval()
  - Complexity: function length, nesting depth
  - Architecture: async/await, try-catch, type definitions
    ↓
Route by criticality:
  - CRITICAL (security/payments) → Claude Opus 4
  - STANDARD → Groq Llama 3.3 70B (free)
    ↓
LLM generates review
    ↓
Post GitHub comment + save to Oracle + notify CMO AIPA
```

### Model Routing

> **Model ids — live-probed on Oracle July 27 2026, ALL return 200:** `claude-opus-4-8`,
> `claude-opus-5`, `claude-sonnet-5`, `claude-haiku-4-5-20251001`, `claude-fable-5`.
> The table below matches what the code actually calls (`claude-opus-4-8`, 6 call sites);
> newer code uses `claude-opus-5` (`chat-concierge.ts`). **Never swap a model id from memory —
> probe first**, then `grep dist/` to confirm the built output changed. A decommissioned id
> surfaces as a 404 `not_found_error`, which `llm-resilience.ts` reports accurately.
> ⚠️ Anthropic credits have been dry before: `claudeWithGroqFallback()` falls back on credit
> exhaustion and dead models, **but rethrows on 401** — an invalid key kills the call silently.

| Task | Model | Why |
|------|-------|-----|
| Critical code review (security, payment) | claude-opus-4-8 | Best reasoning |
| Standard code review | Groq Llama 3.3 70B | Fast, free |
| Ask CTO (strategic Q&A) | claude-opus-4-8 | Multi-repo context |
| Voice transcription | Groq Whisper → OpenAI Whisper | Free + fallback |
| Atuona text (all) | claude-opus-4-8 → Groq → Grok (xAI) | Creative quality + resilience |
| Atuona images | Flux 2 Pro → Flux 1.1 Ultra/Pro (Replicate) | Best photorealism |
| Atuona video | Luma Ray-3.2 / Runway Gen-4.5 / Veo 3.1 / Kling — operator-selectable, auto-fallback | Latest 2026 models |
| Atuona film assembly | ffmpeg (TTS VO + subtitles + title cards + crossfades + music bed) | Automated editor-in-a-box |

---

## 5. ORACLE DATABASE — FULL SCHEMA

**Connection:**
- Type: Oracle Autonomous Database 26ai (Always Free)
- Driver: `oracledb` v6.7.0 (thick mode)
- Auth: mTLS with wallet at `/home/ubuntu/cto-aipa/wallet`
- TNS_ADMIN: `/home/ubuntu/cto-aipa/wallet`
- Connection string: from env `DB_USER`, `DB_PASSWORD`, `DB_SERVICE_NAME`
- Pattern: best-effort writes (log errors, no throw); reads fall back to empty

**Tables (8+):**

| Table | Purpose | Key Columns |
|-------|---------|-------------|
| `aipa_memory` | Reviews, Q&A, interactions | id, aipa_type, action, context, result, metadata, created_at |
| `tech_debt` | Outstanding tech debt | id, repo, description, severity, status, created_at, resolved_at |
| `arch_decisions` | Architecture decisions | id, repo, title, description, rationale, created_at |
| `pending_code` | Code awaiting Elena's approval | id, chat_id, repo, task, filename, code, status, created_at |
| `alert_preferences` | User alert settings | chat_id, alerts_enabled, daily_briefing, created_at |
| `conversation_context` | 7-day chat history | per-user rolling context |
| `knowledge_base` | Project-specific knowledge | project, category, content |
| `lessons_learned` | CTO learning system | lesson, context, repo |

**File-based state:**
- `atuona-state.json` — full creative memory (moods, metaphors, paintings, character insights, drafts, publications)
- Auto-saved every 5 minutes; also saved after every creative response

---

## 6. FULL TECH STACK

| Layer | Technology | Notes |
|-------|-----------|-------|
| Language | TypeScript 5.9.3 (strict mode) | CommonJS, compiles to `dist/` |
| Runtime | Node.js | Express 5.x |
| AI - Primary | Anthropic Claude Opus 4.8 | claude-opus-4-8 |
| AI - Standard | Groq Llama 3.3 70B | `llama-3.3-70b-versatile` |
| AI - Vision/Voice | OpenAI (Whisper, DALL-E) / Groq Whisper | |
| AI - Images | Replicate Flux Pro 1.1 | `black-forest-labs/flux-pro` |
| AI - Video | Luma Dream Machine + Runway Gen-3 | |
| Bot Framework | Grammy 1.38.4 | 2 bots, 1 process |
| HTTP | Express 5.2.1 | Webhooks + API |
| Database | Oracle ATP 26ai (oracledb 6.7.0) | mTLS, thick mode |
| Scheduling | node-cron 4.2.1 | Briefings, alerts |
| GitHub API | @octokit/rest 22.0.1 | PRs, diffs, comments |
| Process manager | PM2 | ecosystem.config.js |
| Infra | Oracle Cloud VM.Standard.E5.Flex | 1 OCPU, 12 GB, us-chicago-1 |
| Static hosting | 4everland (IPFS) | atuona.xyz, aideazz.xyz |
| Web3 | Polygon ERC-721/ERC-20, Thirdweb, QuickSwap | AZ token + NFTs |
| Secrets | .env + dotenv | |

---

## 7. ORACLE INFRASTRUCTURE — OPERATIONS

**SSH access:**
```bash
ssh -i $ORACLE_SSH_KEY ubuntu@$ORACLE_IP
```

**Resilience (3-layer):**
1. `check_oracle_health.sh` — runs every **5 min** via cron; restarts any dead agent
2. systemd drop-ins (`Restart=always`) — for all systemd-managed agents
3. `oci_keepalive.sh` — runs every **4 hours** to prevent Oracle idle shutdown

**Check everything:**
```bash
pm2 list
systemctl list-units --type=service | grep -E 'espaluz|vibe|pm2|openclaw'
tail -50 /var/log/oracle-health.log
crontab -l
```

**Deploy CTO AIPA change:**
```bash
# On Windows:
.\scripts\oracle-resilience\deploy_from_windows.ps1
# On server:
cd /home/ubuntu/cto-aipa && git pull && npm run build && pm2 restart cto-aipa
```

**Known fragile: Algom Alpha (DragonTrade)**
- Twitter 429 rate-limit causes crash loops
- Fix: add `COINGECKO_USE_DIRECT_API_ONLY=1` + `COINGECKO_API_KEY=` to `/home/ubuntu/dragontrade-agent/.env`
- To pause posting: `DISABLE_POSTING=1` in that .env (health cron keeps it "online")

---

## 8. AGENT ARCHITECTURE SUMMARY

All 9 agents share the same design pattern:

```
External trigger (webhook / Telegram message / cron)
    ↓
Input processing (text / voice / image / code diff)
    ↓
Context injection (Oracle memory / file state / system prompt)
    ↓
LLM call (Claude Opus 4 or Groq Llama, routed by criticality)
    ↓
Output action (Telegram reply / GitHub comment / IPFS publish / DB write)
    ↓
Persistence (Oracle table or JSON file)
```

**What's NOT used yet (honest skill gaps — from career analysis v2):**
- **RAG / vector DB** — ✅ **Done (Apr 25, 2026).** Production RAG in both EspaLuz Telegram and WhatsApp: pgvector + OpenAI embeddings + semantic retrieval injected into Claude system prompt. Shared `espaluz_rag.py` deployed to both repos. See `EspaLuzFamilybot/espaluz_rag.py` and `EspaLuzWhatsApp/espaluz_rag.py`.
- **LangGraph / LangChain** — LangChain **production use** in EspaLuz Telegram (`PostgresChatMessageHistory` + retrieval wired). LangGraph: not yet built. Primary agents still SQL/file-based.
- **Formal evals** — ✅ **Complete (Mar 30, 2026).** 131 tests, 4 layers (keyword, bias, golden-set, LLM-as-judge). Not a gap anymore.
- **AWS** — entirely Oracle-based. One lightweight deployment needed for resume credibility.
- **Docker** — familiar, not in production. Systems run bare on Ubuntu with systemd/PM2.
- **Fine-tuning** - need somehow to learn step by step.

---

## 9. SKILL GAPS TO CLOSE

| Gap | Honest State | Priority | Suggested Approach |
|-----|-------------|----------|-------------------|
| **RAG** | ✅ **Done (Apr 25, 2026)** — Both EspaLuz Telegram AND WhatsApp: shared `espaluz_rag.py`, pgvector + OpenAI embeddings, 2-layer memory (LangChain exact + semantic), injected into system prompt every reply. Separate session namespaces per platform. `espaluz_embeddings` table. | ✅ Closed | Interview answer: "I built a 2-layer memory system deployed across two production bots — LangChain for exact recent history, pgvector for semantic retrieval over full history. Both injected into Claude's system prompt before every reply. Similarity threshold 0.75, indexed with ivfflat. ~$0.00002/message. Same module, two platforms, one shared vector table." |
| **Evals** | ✅ **Complete (Mar 30).** 131 tests, 4 layers (keyword scoring, bias compensation, golden-set routing, LLM-as-judge consistency). Layer 4 uses Claude Haiku, ≥75% agreement on 22 golden-set jobs. ~$0.03/run. Verified from actual code. | ✅ Done | Interview Q2 answer is now strong: "I built a 4-layer eval harness — 131 tests. Layer 4 uses Claude as independent judge against my deterministic engine. 75% threshold — below 100% deliberately because edge cases have legitimate ambiguity." |
| **LangGraph** | Exposure only — LangChain imported in EspaLuz, not in primary agents | Post-RAG | Build one LangGraph variant of the code review pipeline. Be honest on resume: "exposure." |
| **AWS** | Entirely Oracle stack. One deploy needed for credibility. | Week 3–5 | One Lambda or EC2 service. Goal: one honest line on resume, credible answer to "AWS experience?" |
| **Modular code** | `telegram-bot.ts` is 6k+ lines — cited as known tech debt | Low | Refactor into `handlers/review.ts`, etc. when time allows. Invisible to hiring managers unless they read the code. |

**Career analysis note:** Fine-tuning (LoRA, QLoRA), LangGraph mastery, MLOps — these are real value but **second-role material**. Don't let them delay applications to right-category roles.

**Teaching rule:** Before I build any code touching these gaps, I explain the concept, show a minimal example, then extend to Elena's use case. I never paste a wall of framework code without context.

---

## 10. RULES FOR HOW WE WORK TOGETHER

### Teach First, Build Second
Every time we touch a concept Elena is learning (RAG, evals, LangGraph, etc.):
1. Explain what it is and why it exists (2-3 sentences max)
2. Show the minimal working version in our actual context
3. Then build the real implementation

### Before Any Build
- Read the relevant source files first — never propose changes to unread code
- State the approach + tradeoffs in plain English
- Confirm before touching any production file
- Never run `git push` or deploy without explicit "go ahead"

### Oracle Deploy Rights
I have full rights to SSH into Oracle and deploy. Credentials:
- Key: `D:/aideazz/ai-cofounders/cto-aipa/oracle_key.pem`
- IP: See `.env.private` (not committed) — found via `scripts/sync_job_list_filter_to_oracle.ps1`
- User: `ubuntu`

**Deploy procedure for any agent:**
```bash
ssh -i "D:/aideazz/ai-cofounders/cto-aipa/oracle_key.pem" ubuntu@$ORACLE_IP \
  "cd /home/ubuntu/<repo> && git pull && sudo systemctl restart <service>"
```

**Mandatory verify step after every deploy:**
```bash
sudo systemctl status <service> --no-pager | head -15
# Must show: Active: active (running)
# If crash loop: sudo journalctl -u <service> -n 40 --no-pager
```

**Critical rule — code changes and file moves must land in the same commit.**
If a GitHub raw URL is in production code and the referenced file moves,
the old URL is dead the moment the push lands. Always update URLs and
move files atomically. Always deploy to Oracle immediately after — do not
leave production running stale code against a changed repo.

### Code Quality Standards
- TypeScript strict mode always
- No `any` types unless absolutely necessary
- Best-effort Oracle writes (log, don't throw)
- No hardcoded secrets — .env only
- Security: SQL injection, XSS, eval() checks before every merge

### Communication Style
- Short, direct answers — no padding
- Lead with the decision or answer, not the reasoning
- If I disagree with an approach, I say so directly with reasons
- I flag tech debt and risks proactively, not just when asked

### What I Never Do
- Present Elena as a junior or generic freelancer
- Scope creep into features not asked for
- Make up facts about the codebase — I read files first
- Approve production deploys without build + test
- **NEVER WIPE ANYTHING (Elena's iron rule, July 2 2026).** No `rm -rf`, no `git clean`, no
  overwrite/truncate of any existing data, state, or artifact — on Oracle or locally — that I
  did not create in the current session. If a cleanup seems needed: (1) say so and wait for
  Elena's explicit "go", (2) back up first (copy aside / scp a local copy), (3) delete the
  narrowest possible path. Runtime state lives in untracked dirs (`data/` in cto-aipa —
  published films, music, shots; EspaLuz subscriber/trial JSONs) and a single careless
  working-tree cleanup destroys it: on 01.07.2026 a `git stash` + `git clean -fd` during
  fleet-deploy troubleshooting wiped every published Atuona film + the music library
  (`data/` is now gitignored as a guard — commit `bd8f1bd` — but the rule stands regardless
  of guards). Always keep a local Desktop copy of every finished film/artifact.

---

## 11. CURRENT BUILD PRIORITY QUEUE

Priority order (as of 2026-04-18 — aligned with career analysis v2 + Apr 2026 verified state):

| Priority | Task | Why | Effort | Status |
|----------|------|-----|--------|--------|
| 0 | **Audit VibeJobHunter auto-apply targets** | Check role categories, not just scores. Senior/Staff at 20+ companies = rabbit holes | Small | ✅ Done (wrong-stack, outsourcer, US-only, AI gate fixes deployed) |
| 1 | **Eval framework on VibeJob Hunter** | Closes Q2 interview gap + fixes scoring calibration — two outcomes from one build | Medium | ✅ **ALL 4 LAYERS DONE (Mar 30).** 131 tests verified from code. Layer 4 LLM-as-judge real Claude API calls. |
| 1c | **GEO + SEO Marketing Engine (Phases 1-5)** | Makes aideazz.xyz discoverable by Google + AI tools. Full showcase asset for client pitches. | High | ✅ **DONE (Apr 17-18).** JSON-LD, sitemap, daily blog, UTM, outreach, lead triage, www→apex 301. |
| 1d | **Multi-agent HubSpot hub + BrightData (Phase 5.6 Steps 1–5)** | All agents route to `/api/crm-event`; BrightData enriches leads before Claude classification. | High | ✅ **DONE (May 14–15).** `/api/crm-event` + `/api/crm-pipeline/setup` + `/api/crm-pipeline/ids` live. `src/brightdata-enrich.ts` NEW. VJH `crm_hub.py` + Algom Alpha `pushProspectToCRM()` wired. Step 6 (CMO LinkedIn / Make.com) = ⏳ pending. |
| 1b | **Activate fractional channels** | Toptal (in progress), Braintrust, A-Team, LinkedIn founder DMs. One reference > any skill addition. | Small | Elena's action |
| 2 | **Document tool-use design in README** | README is first thing a hiring manager sees; visible in 30 seconds | Small | |
| 3 | **Add monitoring/eval section to README** | Shows production-level thinking without reading 6k lines of code | Small | |
| 4 | **RAG over EspaLuz (pgvector + OpenAI embeddings)** | #1 technical gap — now closed. 2-layer memory: LangChain last-5-turns + pgvector semantic search. Injected into Claude system prompt. | High | ✅ **Done (Apr 25, 2026)** — `espaluz_rag.py`, `espaluz_embeddings` table, confirmed live in prod logs. |
| 5 | **One AWS deployment** | One Lambda/EC2. One honest resume line. Credible "AWS experience?" answer. | Small | |
| 6 | **Refactor `telegram-bot.ts`** | 6k+ lines, known debt — invisible unless they read the code | Medium | |
| 7 | **LangGraph prototype** | Skill gap + interview talking point. Post-RAG. | Medium | |
| 8 | **NFT-agent integration** | Web3 layer currently disconnected from agents | High | |
| 9 | **EspaLuz revenue expansion** | Early paid users (honest: very early, very small). Growth = runway. | TBD | |

---

## 12. JOB SEARCH MODE

When `/project job` is active or Elena mentions job search, interviews, or applications:

**My positioning of Elena (always — from career analysis v2):**
> "Executive-turned-AI-builder. 7 years running digital infrastructure at the board level. Past year: shipped 9 production AI systems at $0/month infra cost. I build fast and I speak both languages — CEO and engineer."

**NEVER position as:** "Senior AI Engineer", "AI Architect", "Founding-level AI Product Engineer" — these invite credential comparison the timeline cannot win.

**Flagship repo:** AIPA_AITCF (`github.com/ElenaRevicheva/AIPA_AITCF`)
- Use this as the primary proof project for ALL target roles
- Decision locked per `docs/flagship/FLAGSHIP_REPO_EVALUATION.md`

**Target roles (honest — from career analysis v2):**

🟢 APPLY:
- AI Automation Specialist ($2.5K–4K/mo)
- Internal AI Tools Builder ($3K–4.5K/mo)
- AI Integration Engineer ($3K–4.5K/mo)
- Founding AI hire at pre-seed/seed ($3K–5K/mo + equity)
- **Fractional AI consultant / builder ($40–70/hr)** — underexplored, highest-fit channel
- AI Ops / AI Program Manager ($3.5K–5K/mo)

🔴 STOP APPLYING:
- Senior / Staff / Principal AI Engineer — ATS filters before a human sees her name
- ML Engineer — requires ML fundamentals (training, fine-tuning) not yet built
- Any company with 20+ engineers — structured credential filters
- "X years of Python/TypeScript" roles — timeline doesn't support
- Generic "AI Engineer" at large companies — same credential filter problem

**Manny Filter (screen all opportunities):**

Flag as MISALIGNED if:
- WordPress / generic websites / ads / campaign management
- **Operations Manager / Project Manager / COO** — Elena has ZERO modern ops tooling experience. Hard stop.
- Roles requiring Slack workflows, Zapier, Google Sheets automation, Notion, Airtable — not her skillset
- **Senior/Staff/Principal AI Engineer** — credential filters she can't pass
- **Roles requiring 5+ years Python/TS/ML** — timeline doesn't support
- **IT outsourcers** — wrong fit
- **Any role with a whiteboard, take-home, or proctored coding test** — she cannot code without Claude Code and Cursor. State this upfront. Do not waste the slot.
- **Investor / accelerator pitches** — ~10 paying users (mostly personal connections), AILA unbuilt, solo founder. Not ready.
- **SF-based in-person roles** — Panama, no US authorization

**Fastest realistic income path (not in prior versions — add this):**
Upwork as "Telegram & WhatsApp Bot Builder | AI Automation". Profile + 10 production systems as portfolio. Clients pay for working output, not methodology. $500–1,500/project. Takes 3–6 weeks to get first client but does not require passing any coding test.

Flag as POTENTIALLY ALIGNED if:
- AI agents / automation / internal tools
- AI-first startup or automation-hungry company, founder-led hiring
- Realistic path to $3.5K+/month net (or $40+/hr fractional)
- **Company with 5–100 employees, seed to Series B**
- **Fractional / contract engagement — executive + builder pitch fits naturally**

**Fractional channels (parallel to ATS — higher ROI):**
- Toptal (in progress)
- Braintrust (senior-only, direct client access)
- A-Team (elite network, founder-facing)
- Direct LinkedIn founder DMs

**Two existing job-search agents (DO NOT rebuild):**
1. **VibeJob Hunter** — autonomous job discovery, scoring, applying, CMO LinkedIn
2. **OpenClaw Vibejob Shortlist** — YC AI companies, LATAM/remote, Telegram + voice interface

My role in job search: tune filters/scoring, improve resumes/variants, craft outreach messages, prep for interviews, improve public GitHub signal.

---

## 13. INTERVIEW PREP MODE

When Elena says "interview prep" or asks about a specific company/role:

**Step 1 — Role analysis:**
- Map job description requirements to her actual project evidence
- Identify 3 strongest talking points from AIdeazz ecosystem

**Step 2 — Gap identification:**
- Flag any requirement she doesn't have evidence for
- Suggest which existing project to reference as closest match

**Step 3 — Story structuring (STAR):**
- Situation/Task: what agent/system was the context
- Action: what specific technical decisions she made
- Result: production evidence (users, uptime, cost, NFTs minted, etc.)

**Key proof points to anchor to:**
- "7 years board-level executive — can explain AI systems to non-technical stakeholders. Most engineers can't. Most executives can't ship. I do both."
- "9 AI agents, 1 Oracle VM, $0/month infra, solo founder"
- "50K+ lines across the AIdeazz ecosystem (TypeScript, Python, JavaScript, SQL) — 9 production agents, 8 Oracle tables, 4 LLM APIs integrated"
- "76/24 multi-model routing (Groq/Claude) with explicit cost reasoning — not default, deliberate"
- "48+ NFTs published, Telegram bots with users in 19 countries"
- "Built an AI Film Studio (atuona.xyz/aifilmstudio): multi-provider AI video orchestration (Luma Ray-3.2 / Runway Gen-4.5 / Veo 3.1 / Kling — operator-selectable with automatic fallback) + an automated ffmpeg pipeline (TTS voiceover, on-screen subtitles, title cards, crossfades, ducked music bed) that turns poems into finished films, HTTP-streamable to any device. End-to-end creative-tech, not an API wrapper."
- "EspaLuz has early paid subscribers" (honest: very early, very small)
- "Deterministic + LLM hybrid pipeline for code review (not just prompt → output)"
- "131-test eval harness on VibeJobHunter — keyword, bias compensation, golden-set, LLM-as-judge (4 layers), ~$0.03/run"

**On AI tools (state proactively, not defensively):**
When asked "do you use AI tools?": "Yes — Claude Code and Cursor daily. That's how one person ships 9 production agents. I review every line, understand the system, own every decision. The tool is fast; the judgment is mine. If the role requires scratch-coding assessments, I'll be upfront: that's not how I work and not a good use of either of our time."

**Skill gap deflection strategy (updated from career analysis v2):**
For gaps (RAG, LangGraph, AWS): "I haven't used X in production yet, but my executive background means I've evaluated these decisions at a systems level — here's how I'd implement it given what I built in [related project]..." — then pivot to the working evidence.

**Critical practice note:** The four interview questions (Section 13) must be rehearsed **out loud**, timed to 90 seconds each. Career analysis identifies this as the highest-leverage activity — the biggest risk is answer sharpness, not skills.

### The Four Questions Elena Must Answer Sharply

After every build session, verify Elena can answer these:

1. **Why this model routing strategy?**
2. **How did you measure quality / regressions?**
3. **What failed in production and how did you recover?**
4. **Why this infra and cost profile?**

If she can't answer any of these clearly in **90 seconds**, stop and work on the answer before the next build.

---

## 14. WEB3 LAYER (HONEST STATE)

| Asset | Address | Status |
|-------|---------|--------|
| AZ Token (ERC-20) | `0x5F9cdccA7cE46198fad277A5914E7D545cb3afc5` | Live, low liquidity |
| AIPA NFTs (ERC-721) | `0x771Cc6BDCF8E7660ddc7E3F68FBCE7Dc5d675769` | Deployed, low activity |
| Marketplace | `0xC99852f1faC6F1F255274bA77ef20326Ef4f1AE5` | Active, 2 listings |
| DAO | `0x547d7aF7B55a92a65A1d015fAA4E75eeF4758190` on Decent.app | Live |

**Honest note:** Web3 layer is infrastructure-ready but NOT integrated with AI agents. Agents run on centralized servers. Blockchain handles ownership/governance metadata only. NFT-agent integration is Priority #7 on build queue.

---

## 15. KEY CONTACTS & LINKS

| Resource | Link/Detail |
|----------|------------|
| GitHub | https://github.com/ElenaRevicheva/AIPA_AITCF |
| Oracle server | See `.env.private` (not committed) |
| Aideazz website | https://aideazz.xyz |
| LinkedIn | linkedin.com/in/elenarevicheva |
| X/Twitter | @reviceva |
| Email | aipa@aideazz.xyz |

---

## 16. QUICK DIAGNOSTIC REFERENCE

**If CTO AIPA is down:**
```bash
# SSH connection details in .env.private (not committed)
ssh -i $ORACLE_SSH_KEY ubuntu@$ORACLE_IP
pm2 status cto-aipa
pm2 logs cto-aipa --lines 50
pm2 restart cto-aipa
```

**If any agent is down:**
```bash
tail -50 /var/log/oracle-health.log   # see what the health-check found
systemctl status espaluz-whatsapp     # check specific systemd service
```

**If DragonTrade is 429 rate-limited:**
```bash
# Add to /home/ubuntu/dragontrade-agent/.env:
DISABLE_POSTING=1
COINGECKO_USE_DIRECT_API_ONLY=1
# Wait 24-48 hours, then remove DISABLE_POSTING=1
```

**Build + deploy CTO AIPA:**
```bash
# Windows (full deploy from local):
.\scripts\oracle-resilience\deploy_from_windows.ps1
# OR manually on server:
cd /home/ubuntu/cto-aipa && git fetch origin && git reset --hard origin/main && npm run build && pm2 restart cto-aipa --update-env
```

**Rotate GitHub PAT (or any token) on the server:**
```bash
ssh -i ~/.ssh/ssh-key-2026-01-07private.key ubuntu@170.9.242.90 \
  "cd /home/ubuntu/cto-aipa && sed -i 's|^GITHUB_TOKEN=.*|GITHUB_TOKEN=NEW_TOKEN_HERE|' .env && pm2 restart cto-aipa --update-env"
# Works ONLY because code uses dotenv.config({ override: true }) — see Section 17
```

---

---

## 17. KNOWN BUGS & PRODUCTION FIXES (LEARNED IN PROD)

### PM2 + dotenv: token rotation silently fails → "Bad credentials"

**Symptoms:**
- Bot returns "Bad credentials" after rotating any API token (GitHub PAT, etc.)
- Direct `curl` with new token from server returns HTTP 200 (token is valid)
- Restarting PM2 with `--update-env` does NOT fix it
- `.env` file has the correct new token

**Root cause (3 layers combined):**
1. PM2 stores env vars internally at first start and injects them into every restarted process
2. `dotenv.config()` default behavior: **never overwrites** env vars already set in `process.env`
3. Result: PM2's stale old token always wins over the `.env` file

**Fix — one line change in every source file that uses env vars:**
```typescript
// WRONG (PM2 stale env wins):
dotenv.config()

// CORRECT (.env always wins, regardless of what PM2 has stored):
dotenv.config({ override: true })
```

**Rule:** Every Node.js app on PM2 that rotates secrets via `.env` MUST use `override: true`. Without it, token rotation requires `pm2 delete` + `pm2 start` (not just restart).

**Also required:** `dotenv.config({ override: true })` must be the **first two lines** of every module that uses `process.env` — not just the entry point — because in CommonJS all `require()` calls are hoisted before any statements, so imported modules can evaluate `process.env.TOKEN` before the entry point's `dotenv.config()` runs.

**Rotate a token without code changes (once fix is deployed):**
```bash
ssh -i ~/.ssh/ssh-key-2026-01-07private.key ubuntu@170.9.242.90 \
  "cd /home/ubuntu/cto-aipa && sed -i 's|^GITHUB_TOKEN=.*|GITHUB_TOKEN=NEW_TOKEN_HERE|' .env && pm2 restart cto-aipa --update-env"
```

### Two services, one Telegram token → permanent Conflict errors

**Symptoms:**
- `telegram.error.Conflict: terminated by other getUpdates request; make sure that only one bot instance is running`
- Error fires every 30–60 seconds, endlessly
- Bots still deliver messages sometimes (whichever instance wins the poll)
- Make.com / Buffer posts fail intermittently (Buffer can't resolve the imageURL)

**Root cause:**
Two OS processes are polling the same Telegram bot token simultaneously. On Oracle, this happens when a codebase started on Railway (one process, everything inside) gets split into two systemd services without removing the autonomous mode start from the web server:
- `vibejobhunter.service` → `python -m src.main autonomous` → starts orchestrator → starts Telegram bot
- `vibejobhunter-web.service` → `web_server.py` → also creates orchestrator and calls `start_autonomous_mode()` → starts a second Telegram bot on the same token

**Diagnosis:**
```bash
# Check all Python processes:
ps aux | grep python | grep -v grep
# Look for two processes both running from the same repo

# Check logs for Conflict errors:
journalctl -u vibejobhunter -n 50 --no-pager | grep -i conflict
```

**Fix:**
The web server should only serve the dashboard. Remove `start_autonomous_mode()` from `web_server.py`:
```python
# WRONG — web server also starts the full loop:
async def delayed_start():
    await orchestrator.start_autonomous_mode()
asyncio.create_task(delayed_start())

# CORRECT — web server creates orchestrator for reads only, does not start the loop:
# The autonomous loop + Telegram bot are owned exclusively by vibejobhunter.service
logger.info("Orchestrator ready (dashboard reads only — autonomous loop runs in vibejobhunter.service)")
```

**Rule:** One Telegram token = one polling process. Ever. If the codebase was designed for Railway (single process), audit every systemd/PM2 service that starts it on Oracle and ensure exactly one of them owns the Telegram polling. The others can import the orchestrator for reads but must never call `start_autonomous_mode()` or any function that starts `run_polling()`.

**Related:** If the Buffer/Make.com webhook fails with `400: The provided image does not appear to be valid` — check that the image URL in the payload points to the current file path in the repo. If files were moved to a subfolder (e.g., `assets/`), the URL in the Python code must be updated in the same commit as the file move and Oracle must pull immediately. The Make.com "Run once" button replays the last stored webhook — it will keep failing until the automatic scheduled run fires a fresh webhook with the correct URL, or you trigger a manual CMO post via Telegram.

---

> This file is my memory. I read it at the start of every session. Without it, I start blind.
> Last scan: 2026-04-25 | Version: 1.5 — RAG shipped in EspaLuz Telegram (pgvector + LangChain 2-layer memory, confirmed live). RAG gap closed.


---

## 🆕 May 20 2026 additions

### New positioning proof point (interview / founder calls)

> "When my multi-agent HubSpot was unreadable — five agents pushing to the same dashboard with no way to tell who found what — I designed a `[STREAM-AGENT]` dealname prefix convention. One env-aware design change, threaded through one endpoint + two helper functions + five writers. Now every deal tells me at a glance which agent found it, which pipeline it belongs to, and what my next action should be. That's the difference between a busy dashboard and a decision-making dashboard."

Pairs well with: "I shipped this in a single session — diagnosed the gap, designed the architecture, deployed across three repos (TypeScript + Python + JavaScript), smoke-tested end-to-end. Velocity comes from Claude Code + a clear contract, not from cutting corners."

Reference for the work: `docs/HUBSPOT_NAMING.md` + `project_hubspot_dashboard.md` in Claude memory.

### xAI team available

- **Team:** `rhino-sneezing-lemon` (xAI developer console, created 06.05.2026)
- **X account:** `1910676161845186560`
- **Key:** `XAI_API_KEY` in `/home/ubuntu/cto-aipa/.env` and `/home/ubuntu/dragontrade-agent/.env`
- **Status:** key available, not yet wired
- **Pending uses:** (1) Algom backup Twitter listener (rate-limit insurance), (2) Grok in CTO AIPA model routing, (3) xAI team X API for elevated limits

For interview framing: "I keep optionality in my model routing. Anthropic Opus for high-stakes, Groq Llama for high-volume cheap calls, Grok as a third option when xAI cost/performance fits a use case. The router makes the choice per request — I'm not married to any one vendor."


---

## NEW May 22 2026 addition - SEO/SSR fix interview proof point

### "I solved a 30+ article SEO discoverability problem in 90 minutes"

Story arc for founder calls / engineering interviews:

> "My blog publishes daily articles to Dev.to and to aideazz.xyz. After 30+ articles I had zero organic search traffic. I audited what Google actually saw when crawling each article URL: identical generic React SPA shell with the same title on every page. All articles looked like duplicate content to the crawler.
>
> The blog is on 4everland (IPFS-based host) - no SSR framework available. So I wrote a markdown-to-HTML generator that runs in my CTO AIPA backend after every article publish. It pushes one static HTML file per article to the aideazz GitHub repo via the GitHub Contents API - same auth pattern I was already using to auto-update the sitemap. Then added one rewrite rule to _redirects so URLs without trailing slash serve the static HTML before falling back to the SPA.
>
> 14 articles backfilled. Future articles auto-generate. Article-specific title, OG tags, JSON-LD, real article body in HTML - all visible to Googlebot. End-to-end shipped in 90 minutes including the rollback-safe git mv rename of a misnamed file I'd been carrying as tech debt for two weeks."

Pairs well with: "I solve real problems on real systems and document the trade-offs. I don't over-engineer."

Reference for the work: docs/oracle/ORACLE_ALL_PRODUCTS_RESILIENCE.md (this commit) + project_hubspot_dashboard.md in Claude memory.


---

## NEW May 24 2026 (evening) additions — AEO + Remote Control proof points

### Interview story #1: "I shipped AEO infrastructure for my blog in 30 minutes"

> "My blog already had mandatory FAQ sections in every article — the prompt enforced it. But my static HTML generator was only emitting BlogPosting JSON-LD, ignoring the FAQ. Google AI Overview / Perplexity / Bing Chat couldn't recognize the Q&A as discrete answerable entities — they just saw prose.
>
> I wrote a markdown FAQ extractor that parses the article body, finds the `## Frequently Asked Questions` section, parses the `**Q: question?** / A: answer.` format my prompt enforces, and emits a second FAQPage JSON-LD block. Pure additive — BlogPosting schema unchanged. Articles without FAQ section get no FAQPage emitted (graceful degradation).
>
> Backfilled all 17 cached articles in one shot via the existing GitHub Contents API push pipeline. Live in production within 30 minutes from problem identification to deploy. AEO score went from 4/10 to 9/10. Cost: zero new dependencies."

Pairs well with: "I look at my own infrastructure as a skeptical practitioner — what's there, what's stale, what's missing. Then I ship the smallest change that closes the biggest gap."

### Interview story #2: "I work on the go because I have to"

> "I'm a single mother — I can't sit at my laptop 24/7. So I set up Claude Code Remote Control: laptop runs the agent, my phone drives it. While taking my daughter to karate, I can ask Claude to run audits, review logs, even ship small fixes — actions run on my laptop, results land in my HubSpot / GitHub / Oracle. The constraints of solo parenting forced an architecture decision most teams never make. It also turns out to be a great answer to 'how do you handle interruptions' in interviews."

### Operational reference

- AEO patch: `cto-aipa/src/blog-static-pages.ts` `extractFaqPairs()` + dual JSON-LD emission (commit c053548)
- Remote Control launcher: `~/Desktop/claude-remote.bat` (PowerShell wrapper, auto-finds latest claude.exe via MSIX path)
- Auth via `claude auth login --claudeai` (Pro account OAuth, one-time)
- Trust dialog accepted by running interactive Claude in worktree path once


### Interview story #3: "Replace LLM hallucinations with deterministic signals"

> "My daily 8 AM Telegram briefing kept telling me the same thing every day —
> 'focus on EspaLuz today.' For weeks. I'd already shipped EspaLuz features.
> The reason: the briefing's 'Today's focus' line was a Groq call with a
> content-less prompt ('give Elena one specific actionable task'). With no
> input signal, the LLM confabulated the same plausible-sounding suggestion
> daily. Pure noise dressed as intelligence.
>
> I replaced it with a deterministic, signal-driven section. Two real checks:
> CMO health endpoint, and per-repo days-since-last-commit (>14 days threshold,
> same constant as the proactive stale-repo alert — single source of truth).
> If either fires, the briefing surfaces the specific actionable issue. If
> neither fires, the section is omitted entirely — no '✅ all clear' filler.
>
> Token spend dropped to zero. Briefing noise dropped to zero. The pattern
> is: don't ask an LLM what to do when you can derive it from real state."

Pairs with: "I treat my own infrastructure with the same skepticism I'd treat
a client's. An agent confabulating answers is worse than no agent — it trains
the operator to ignore the channel."

### Operational reference

- Morning briefing fix: `cto-aipa/src/telegram-bot.ts` ~line 7990 — deterministic
  `realIssues: string[]` replacing `suggestionPrompt + askAI` (commit 7c7d910)
- Triage dedup: `lead-triage.ts` + `database.ts` `markLeadTriagePushed()` (84f9e15, 3d4139c)
- Stale-repo dedup: `telegram-bot.ts` `lastStaleRepoAlertAt` Map + 14d threshold (5e93cab)
- Outreach 422 filter: `outreach.ts` `isBogusOutreachEmail()` (7796438)


## NEW May 25 2026 evening proof point — "Algom Alpha repositioning + xAI team key wired end-to-end"

Pivoted my fully-autonomous social media agent (running 7 months, 70% crypto
education / 30% AIdeazz) to a builder-identity-first cycle in one session:
50% aideazz (founder/builder voice) / 20% client_pitch (fractional CTO + AI
marketing + HubSpot orchestration + Algom lessons) / 15% monetization
(EspaLuz, VJH LEAD mode, aideazz blog) / 15% educational (preserved but
secondary) / 0% paper_trading (removed — was noise). Cadence 3-10 minutes →
~4 posts/day. Educational posts now route through the `rhino-sneezing-lemon`
xAI team key (Grok, `grok-4.20-0309-non-reasoning`) with the 7-month-old CMC
engine as fallback. Posting identity unchanged — bot still ships as
`@reviceva` (personal X dev account). Team xAI credits + personal X brand
working together exactly as intended.

End-to-end verified live on Oracle: `pm2 restart dragontrade-main` → first
educational cycle at `00:19:48 UTC` logged `✅ Generated via Grok (xAI)`.
Two consecutive Grok calls succeeded back-to-back. Fallback path proven on
the initial `grok-2-latest` model-name mismatch (model rotated to
`grok-4.20-0309-non-reasoning` after probing `/v1/models`). All shipped in
commit `294efee` on `ElenaRevicheva/dragontrade-agent` main.

### Interview story #4: "Reposition a 7-month-old agent without breaking its brand"

> "My Algom Alpha bot had been running 7 months on @reviceva — 70% crypto
> education, 30% builder content. As I shifted toward fractional CTO and AI
> marketing work, I needed the bot to lead with builder identity instead of
> burying it as the minority slot.
>
> The risk: rewriting the cycle could change voice, change cadence, change
> account identity, or break 7 months of brand continuity. So I treated it
> as a surgical operation. Three files: a new `grok-content.js` wrapper for
> the xAI team key (separates cost from brand voice — Claude still owns the
> high-value builder posts), the existing content generator extended with
> two new theme libraries (`CLIENT_PITCH_THEMES`, `MONETIZATION_THEMES`),
> and the main cycle array replaced atomically.
>
> Two anchor drifts caught during the patch (`Paper trades` vs
> `Paper trading`, a 10-space trailing-whitespace mismatch on a switch
> separator) — both diagnosed by reading the actual file state with
> `cat -A` and patching the patch before re-running. Then a Grok model-name
> mismatch caught on the first live cycle — the fallback to CMC engine
> proved the resilience pattern, and I rotated the model name after
> probing `/v1/models` for the actually-available list. Bot identity
> preserved (`@reviceva` throughout), 7 months of brand continuity intact,
> and the rhino-sneezing-lemon team xAI credits now actively drained on the
> educational slot."

Pairs with: "I separate cost from voice. The expensive provider runs the
content that has to sound like me; the cheaper team-credit provider runs
the commodity slot. Same dashboard, different ledgers."

### Operational reference (May 25)

- Repositioning patch: `dragontrade-agent` commit `294efee`. Files:
  `grok-content.js` (NEW), `aideazz-content-generator.js` (+86 lines),
  `index.js` (+86/-35 lines). `POST_INTERVAL_MIN/MAX` set to `300/420` in
  `/home/ubuntu/dragontrade-agent/.env` (overrides defeat code defaults
  unless aligned).
- Grok wrapper: model `grok-4.20-0309-non-reasoning`, consecutive-failure
  cutoff at 3, 402 / 429 surfaced explicitly to avoid burning depleted
  credits.
- Verification anchor in logs: `✅ Generated via Grok (xAI)` (success) /
  `⚠️ Grok failed (...) — falling back to CMC/Claude` (graceful fallback).


## NEW May 25 2026 late-afternoon proof points — "Verify from logs, never claim from config"

Three discoveries in one debugging session, all flowing from the same lesson:

### Discovery 1 — Algom Alpha engagement loop never ran (4,357 startups, 0 cycles)

Asked to prove the "45-min engagement loop" claim from logs. Grep showed
`[Engagement] Loop started` 4,357 times across all history — but
`[Engagement] Starting engagement cycle` only ONCE, `[Engagement] Found N
recent mentions` ZERO, `[Engagement] Done — N replies sent` ZERO, and
`engagement_state.json` (written at end of every cycle) DID NOT EXIST on disk.
Across months of runtime: 0 replies, 0 follows, 0 cycles completed. My
earlier "~32 engagements/day" was derived from config, not logs — wrong.

### Discovery 2 — Health-check cron had a grep bug for weeks

Root cause: `/home/ubuntu/check_oracle_health.sh` checks pm2 status via
`pm2 describe "$app" | grep -q "status: online"`. But `pm2 describe`
prints box-drawing characters (`│ status │ online │`), NOT colon-separated
text. The grep NEVER matched. Every 5 minutes the script wrongly concluded
each dragontrade-* app was offline and triggered `pm2 restart` — silent
5-minute crashloop for `dragontrade-main` for weeks. The engagement loop's
first run was scheduled for "5 minutes after bot startup" — the bot crashed
right at that boundary every time.

### Discovery 3 — May 24 daily blog publisher fired twice + sent no Telegram

Cache shows two BrightData articles published 20 min apart (00:30:20 +
00:50:34 UTC on May 24). The existing dedup logic uses fuzzy topic-INDEX
exclusion that resets on restart and substring-matches keywords loosely —
the second BrightData publish slipped through. Separately, the Telegram
notify function only fires on the success branch, so when something fails
early or the dedup skips, the operator gets nothing.

### Combined fix shipped this session

- `check_oracle_health.sh`: rewrote status check to use `pm2 jlist | jq -r '.[] | select(.name==$app) | .pm2_env.status'` and compare to literal "online". The grep-against-text-format was the bug.
- `pm2 delete dragontrade-bybit dragontrade-binance` + `pm2 save`: the two orphan paper-trading bots (677,000+ restarts each, status "waiting") were removed from PM2. They're 0% of the new cycle anyway.
- `dragontrade-agent/ecosystem.config.cjs`: commented out the bybit + binance blocks so `pm2 start ecosystem.config.cjs` won't re-spawn them on a clean boot. Re-enable by uncommenting if paper trading returns. Commit `2307a9b` in `ElenaRevicheva/dragontrade-agent`.
- `cto-aipa/src/daily-blog-publisher.ts`: added three guards — (a) sliding-window mutex `HASHNODE_DAILY_MIN_HOURS_BETWEEN_PUBLISHES` (default 12h, blocks any publish regardless of trigger source), (b) prefix-collision detector that catches near-duplicate slugs (BrightData-12-lift vs BrightData-actually-worked), (c) Telegram notification on EVERY outcome — success, skip-by-cooldown, prefix-collision, failure. Tested live: 48h cooldown override → manual HTTP trigger → SKIPPED log + skip notification sent.

### Proof the engagement loop now works (May 25 14:50:11 UTC)

```
14:50:03 [Engagement] Starting engagement cycle...
14:50:04 [Engagement] Found 20 recent mentions
14:50:04 [Engagement] Replied to @Crypto__fi: "Love the simplicity..."
14:50:04 [Engagement] Followed @Crypto__fi
14:50:08 [Engagement] Replied to @solanamultibuy: "Love the enthusiasm..."
14:50:08 [Engagement] Followed @solanamultibuy
14:50:11 [Engagement] Done — 2 replies sent, 2 new follows
```

`engagement_state.json` written for the first time ever. 2 real replies +
2 real follows on real X accounts.

### Interview story #5: "The engagement loop that never ran"

> "I told myself the bot was engaging 32 times a day — that math came from
> the 45-minute interval × 24 hours config. When someone asked for log
> proof, I grepped for the cycle's actual execution signatures: `Starting
> engagement cycle`, `Found N recent mentions`, `Done — N replies sent`.
> One match. Zero. Zero. The cycle had never completed in the bot's entire
> history. The state file the cycle writes at the end of every run didn't
> exist on disk.
>
> Root cause was three layers deep: (1) my code's first engagement run is
> scheduled 5 minutes after bot startup, (2) the bot was being restarted
> every 5 minutes by an external cron, (3) that cron was a health-check
> script whose `pm2 describe | grep "status: online"` check had NEVER
> matched because pm2's output uses box-drawing characters, not colons.
>
> I rewrote the status check to parse `pm2 jlist` JSON via jq. Bot stayed
> up. The 5-minute first-engagement-run timer fired for real. Two replies
> sent. Two follows done. The first engagement cycle in the bot's history.
>
> The lesson goes wider than this fix: never claim agent behavior from
> config. Always derive from log signatures. If you can't grep for the
> ACTION line (not the SETUP line), you don't know it happened."

Pairs with: "Detection without action is theater. But describing-detection-
that-isn't-running is worse — it builds a story you act on, that has no
foundation in reality."

### Operational reference (May 25 evening)

- Crashloop fix: `/home/ubuntu/check_oracle_health.sh` (lines for dragontrade loop now use jq). Backup at `.pre-may25-fix`.
- Blog publisher: `cto-aipa/src/daily-blog-publisher.ts` — new helpers `recentPublishCutoffOk`, `findPrefixConflict`, `notifyTelegramSkipped`, wrapped `runDailyHashnodePost`. Env knobs: `HASHNODE_DAILY_MIN_HOURS_BETWEEN_PUBLISHES` (default 12), `HASHNODE_DAILY_SLUG_PREFIX_LEN` (default 30). Backup at `.pre-may25-fix`.
- Verification anchors in logs: `[Engagement] Done — N replies sent, M new follows` (engagement success), `📰 Daily blog SKIPPED: ...` (mutex tripped), `📰 Daily blog: prefix conflict` (advisory after-publish warning).

### Rule for memory — "Verify from logs, never claim from config"

Before reporting any agent behavior, dimension, or daily rate to the operator:
1. Identify the log line(s) the code emits when the behavior ACTUALLY HAPPENS — not when it's SCHEDULED.
2. Grep historical logs for that signature. If count is 0, the behavior is not happening, regardless of what the config says.
3. Cross-check against any on-disk artifact the behavior produces (state file, DB row, cache entry).
4. Only then write the description.

This rule was earned by claiming "~32 engagements/day" from a 45-min config
interval × 24 hours, when the actual count was 0. The cost of the wrong
claim: an operator-facing summary that built a false picture of the bot's
behavior. The cost of the right discipline: one grep before writing.


## NEW May 25 2026 late-evening — Sustained engagement proof + Hashnode->DailyBlog rename

Two follow-ups to the morning's crashloop + blog publisher fixes:

### Sustained engagement loop proof (TWO cycles, dedup state working)

Asked for log proof beyond "fired once." Watched for cycle #2 at ~45 min
after cycle #1. Result, captured from `pm2 logs dragontrade-main`:

```
14:50:03 [Engagement] Starting engagement cycle...     # cycle #1
14:50:11 [Engagement] Done — 2 replies sent, 2 new follows

15:30:03 [Engagement] Starting engagement cycle...     # cycle #2 (45-min setInterval)
15:30:04 [Engagement] Already replied to @Crypto__fi — skipping     # 48h dedup state working
15:30:04 [Engagement] Already replied to @solanamultibuy — skipping
15:30:12 [Engagement] Done — 2 replies sent, 2 new follows
```

Real users engaged on May 25 (verifiable from @reviceva timeline):
- @Crypto__fi (cycle #1) — reply + follow
- @solanamultibuy (cycle #1) — reply + follow
- @gi_dutraa (cycle #2) — reply + follow
- @CNBIGBUYS (cycle #2) — reply + follow

`engagement_state.json` after cycle #2: 4 entries in `replied`, 4 in
`followed`, `dailyFollows: 4`, `lastRunAt: 2026-05-25T15:30:03.584Z`.

PM2 restart count: 1251 → 1251 (zero new restarts across 46+ min uptime).
The 5-min crashloop is definitively gone — fix from the morning is holding.

### Hashnode->DailyBlog rename (commit `1565895`)

The daily publisher hasn't written to Hashnode in weeks (Dev.to + aideazz.xyz
only). Internal symbol naming was lying. Renamed across:

**Env vars** (all with `process.env.NEW ?? process.env.OLD` backward-compat
fallback so OLD names still work if any external scripts set them):
- `HASHNODE_DAILY_ENABLED` -> `DAILY_BLOG_ENABLED`
- `HASHNODE_DAILY_CRON` -> `DAILY_BLOG_CRON`
- `HASHNODE_DAILY_TZ` -> `DAILY_BLOG_TZ`
- `HASHNODE_DAILY_TRIGGER_SECRET` -> `DAILY_BLOG_TRIGGER_SECRET`
- `HASHNODE_DAILY_PUBLIC` -> `DAILY_BLOG_PUBLIC`
- `HASHNODE_DAILY_DELISTED` -> `DAILY_BLOG_DELISTED`
- `HASHNODE_DAILY_DEVTO_ONLY` -> `DAILY_BLOG_DEVTO_ONLY`
- `HASHNODE_DAILY_MIN_HOURS_BETWEEN_PUBLISHES` -> `DAILY_BLOG_MIN_HOURS_BETWEEN_PUBLISHES`
- `HASHNODE_DAILY_SLUG_PREFIX_LEN` -> `DAILY_BLOG_SLUG_PREFIX_LEN`
- `HASHNODE_DAILY_RUN_ON_START` -> `DAILY_BLOG_RUN_ON_START`
- `HASHNODE_ARTICLE_MODEL` -> `DAILY_BLOG_ARTICLE_MODEL`
- `HASHNODE_TOPIC_STATE_DIR` -> `DAILY_BLOG_TOPIC_STATE_DIR`
- `TELEGRAM_HASHNODE_NOTIFY_CHAT_ID` -> `TELEGRAM_DAILY_BLOG_NOTIFY_CHAT_ID`

**Functions / constants:**
- `runDailyHashnodePost` -> `runDailyBlogPost`
- `startHashnodeDailyPublisher` -> `startDailyBlogPublisher`
- `notifyTelegramHashnodePublished` -> `notifyTelegramBlogPublished`
- `notifyTelegramHashnodeFailure` -> `notifyTelegramBlogFailure`
- `hashnodeDailyIsDelisted` -> `dailyBlogIsDelisted`
- `hashnodeDailyDevToOnly` -> `dailyBlogDevToOnly`
- `HASHNODE_TOPIC_BRIEFS` -> `DAILY_BLOG_TOPIC_BRIEFS`

**HTTP routes** (NEW canonical + deprecated-alias 307-redirects):
- NEW canonical: `GET /blog/daily-status`, `POST /blog/daily-run`
- Deprecation aliases: `GET /hashnode/daily-status`, `POST /hashnode/daily-run`
  -> return `307 Temporary Redirect` with `X-Deprecation` header (preserves
  POST method + body, so existing webhooks keep working unchanged).

**Log strings:** `📰 Hashnode daily: ...` -> `📰 Daily blog: ...`,
`🚨 Hashnode daily FAILED` -> `🚨 Daily blog FAILED`, etc.

**Out of scope** (separate future cleanup): `src/blog-es-bundle.ts` still
uses Hashnode GraphQL as a vestigial *source* for legacy Spanish
translation cache. Not the publish target. The remaining `HASHNODE_*` env
vars (`HASHNODE_ACCESS_TOKEN`, `HASHNODE_HOST`, `HASHNODE_PUBLICATION_ID`,
`HASHNODE_SUBDOMAIN`) belong to that module.

### Verification

- `GET /blog/daily-status` returns the JSON status with new `DAILY_BLOG_*` env names in the `note` field.
- `GET /hashnode/daily-status` returns `307 -> /blog/daily-status` with `X-Deprecation` header.
- Startup log: `📰 Daily blog: scheduled 30 14 * * * (America/Panama) — mode: Dev.to + aideazz.xyz cross-post — listed: yes`.
- Manual trigger log: `📰 Daily blog manual: POST https://webhook.aideazz.xyz/cto/blog/daily-run with Bearer secret (deprecated alias: https://webhook.aideazz.xyz/cto/hashnode/daily-run)`.


## NEW May 25 2026 evening (later) — stale outreach Telegram messages, root-caused via DB query

Operator reported still receiving stale Phase 4 outreach summaries with the
same bogus 422 failures (e.g. "Founder @ Skool@Skool: Resend 422...") after
the May 25 morning isBogusOutreachEmail filter shipped.

### Verify-from-logs (and from-DB) discipline at work

Instead of guessing, queried the actual Oracle DB tables behind each of
the 4 daily Telegram messages the operator listed:

| Message | DB state |
|---|---|
| Prospect ingestion "0 new (20 already in pipeline)" | 149 total companies. "20" is THIS-run's fetched-duplicate count, NOT total pipeline. Wording was just misleading. |
| Phase 4 outreach 422 failures | **1 stuck bogus draft confirmed**: `leeex1 / leeex1 / katex@0.16.9` (a npm package version captured as email by the fresh-leads parser). |
| AIdeazz inbound "no new" | `business_leads` table is **empty (0 rows ever)**. Message is true. The inbound form doesn't write here, or no inquiries have happened. Lead activity actually flows into HubSpot now (May 24 wiring). |
| Lead Brief "no real signals" | `lead_triage` has **150 archived rows**, 0 not-pushed. Message is true. The brief intentionally hides archived leads. |

Only the Phase 4 message was an actual bug. The other 3 are accurate reports
of empty data — the data itself flows into HubSpot now, not the Oracle
tables these messages read.

### Root cause for the Phase 4 bug

The May 25 morning fix added `isBogusOutreachEmail()` at
`generateBatchDrafts` (draft-generation time). But `sendApprovedDrafts`
iterates `outreach_log status='draft'` and sends ALL drafts without
checking — old bogus drafts created before the morning filter keep being
retried every cron run forever.

### Three-layer fix (commit `daf757b`)

- **`getOutreachDrafts` query**: added `AND ot.status NOT IN ('invalid_email', 'archived', 'dismissed')` so bogus targets are excluded at query time (belt-and-suspenders).
- **`sendApprovedDrafts` Layer 1**: pre-send `isBogusOutreachEmail(email)` check. On bogus -> mark target `invalid_email`, mark draft `rejected_bogus_email`, increment `autoMarkedInvalid` counter.
- **`sendApprovedDrafts` Layer 2**: on Resend 422 (invalid email format from Resend's check) -> auto-mark target `invalid_email`, draft `rejected_by_resend_422`. Won't retry tomorrow.
- **Phase 4 Telegram summary now reports** `Auto-marked invalid (bogus or Resend 422): N — won't retry`.
- **DB backfill** (executed live): the 1 stuck `leeex1` draft -> target invalid_email, draft rejected_bogus_email. Verified: bogus drafts remaining = 0.

### Cosmetic: prospect ingestion wording clarified

Before: `🔍 Prospect ingestion: 0 new companies (20 already in pipeline)` (sounds like total pipeline)
After:  `🔍 Prospect ingestion: 0 new companies (all 20 fetched were already in pipeline — nothing to do)`

### Lesson extension to the verify-from-logs rule

Applied today: verify from logs OR from underlying data state. For agents
that write to a DB, the DB is the ground truth — query it before reporting
or fixing. The DB query showed exactly 1 bogus draft (not 20, not 0,
specifically `leeex1 / katex@0.16.9`) which made the fix surgical and the
backfill trivial. Without the DB query I might have over-engineered a
broader fix or backfilled rows that didn't need it.

Pairs with the morning's rule: "Verify from logs, never claim from config."
Extended: "...and for stateful agents, query the actual DB before claiming
the bug isn't fixed (or that it is)."

### Followup flagged (out of scope for this session)

To make AIdeazz inbound + Lead Brief useful again, they should pull from
HubSpot too (since lead activity now flows there via May 24 response_detector
+ Trello bridge). Currently both messages report from Oracle tables that are
empty or all-archived. Separate session.


## NEW May 25 2026 evening (final) — Useful Telegram messages (HubSpot-enrich + silent-skip noise)

Operator feedback after the bogus-422 fix: "i need cto aipa sending me reasonable
messages on telegram about triage, marketing, outreach, leads, inbound, outbound,
UTM etc — but these messages should be fulfilled with actual, real, proved data
and be understandable for me — they should play true impact on my being hired
and getting clients / monetization process. please make it work for me, not
empty gun anymore and noise."

### The honest answer was: NO, I had not accomplished this

The morning fix removed noise (bogus 422 retry loop) but the underlying problem
was bigger: the 4 daily Telegram messages all read from Oracle tables that are
now empty or all-archived because real lead activity flows into HubSpot since
the May 24 wiring (response_detector + crm-event). Messages were technically
correct but useless.

### The fix re-used yesterday's good patterns instead of building new

- **Morning briefing's `realIssues[] — only fire when actionable` pattern** applied to all 4 noisy messages
- **hubspot-client.ts** (already comprehensive from prior work) extended with one new function `getActionableHubSpotDeals()` that filters by stage IDs
- **HUBSPOT_PORTAL = 51409153** + the stage-ID env vars (recruiter_responded, interview_scheduled, offer_received) were all already configured

### Six surgical patches (commit `4c40349`)

| File | Change |
|---|---|
| `src/hubspot-client.ts` | new `getActionableHubSpotDeals()` — queries client (qualifiedtobuy + contractsent) + hiring (recruiter_responded + interview_scheduled + offer_received) stages, sorted by last-modified desc |
| `src/prospect-ingest.ts` | suppress Telegram on 0 new companies (was "0 new (20 already in pipeline)") |
| `src/marketing-weekly-digest.ts` | suppress Telegram on 0 inquiries (was "No new inquiries" weekly) |
| `src/lead-triage.ts buildDailyBrief` | returns `string \| null`; queries HubSpot; renders Lead Brief with `🔥 act today / 💬 they replied / 🎯 recruiter / 📅 interview / 🏆 offer` stage hints + days-since-modified; returns null on truly quiet days |
| `src/cto-aipa.ts triage cron` | respects null brief → Telegram suppressed |
| `src/outreach.ts runDailyOutreachCycle` | only sends Phase 4 summary when something actionable happened |
| `src/telegram-bot.ts /triage_urgent` | handles null brief with concrete "0 actionable" reply for manual command |

### Live proof (tested against HubSpot API directly)

```
📥 Lead Brief — Mon, May 25

🎯 HubSpot deals needing action (10):
  🔥 [HIRING-VJH-SERP-LEAD] Remote GTM Automation Lead Pipeline & Revenue Ops @ Cresta — 2d
  🔥 [HIRING-VJH-SERP-LEAD] Founding Engineer – AI & Compute @ decircle — 2d
  🔥 [HIRING-VJH-SERP-LEAD] Manager, AI Agents and Platform @ Jerry.ai — 2d
  🔥 [HIRING-VJH-SERP-LEAD] Founding Solutions Engineer @ Ensitech — 2d
  🔥 [HIRING-VJH-SERP-LEAD] Remote AI Accounting Automation Lead @ Norwest Venture — 2d
  🔥 [CLIENT-CTO-INGEST] eBay — 4d
  🔥 [CLIENT-CTO-INGEST] Huskyauto — 4d
  🔥 [CLIENT-CTO-INGEST] Skool — 4d
```

5 real hiring leads + 3 real client prospects, all in qualifiedtobuy stage = "🔥 I act today". This is what the operator means by "true impact on being hired and getting clients."

### What the operator sees going forward

- **Quiet day**: silence on Telegram (no "0 new" / "no signals" noise)
- **Active day**: Lead Brief leads with actionable HubSpot deals, names + age + stage emoji
- **New prospect ingest**: only when actual new companies discovered
- **Weekly digest**: only when actual aideazz form inquiries exist
- **Phase 4 outreach summary**: only when sends > 0 or auto-marks > 0 or real errors

### Rule that emerged

"Yesterday's good code is today's fastest fix." Before writing new modules, audit the recent commit history for already-deployed primitives. The `realIssues[]` pattern + the HubSpot client were both already there from May 24-25 morning work — one new function + 6 small call-site edits delivered the whole behavior change.

### Out of scope (acknowledged followups)

- **Inbound weekly digest** could be further enriched with HubSpot deal-by-source breakdown (still per-source filter currently)
- **UTM-driven attribution** is wired in the form but not yet surfaced in any Telegram summary
- **Algom Alpha CRM hit rate** could surface in a daily summary (deals tagged `[CLIENT-ALGOM]` are visible in HubSpot but not in a Telegram digest yet)


## NEW May 25 2026 evening (final-final) — Freshness buckets in Lead Brief ("each day I get fresh data")

Operator's follow-up after the usefulness refactor: "make sure each day I
get fresh data." Concrete risk: the brief was now actionable but could
show the same 10 HubSpot deals identically for 7+ days, and the eye stops
noticing what's new today vs what's aging.

### Fix shipped (commit `bb1782d`)

New `renderDealBuckets()` helper in `lead-triage.ts` groups HubSpot
actionable deals into 3 freshness tiers based on `hs_lastmodifieddate`:

| Bucket | Window | Show | Purpose |
|---|---|---|---|
| 🆕 NEW today | ≤24h | top 6 | what's fresh — open and act today |
| 🔥 ACTIVE | 1-7d | top 6 | still in play, monitor or follow-up |
| ⏰ AGING | >7d | top 4 | close or remove — going stale |

Each bucket only renders when non-empty. Bucket header includes count.
Top-level summary line shows totals: `(N total: X new, Y active, Z aging)`.

Sub-day age in 🆕 NEW shows as `Xm ago` or `Xh ago` so a deal that landed
20 minutes before the brief is clearly the freshest signal of the day.

Query limit raised 10 → 25 so buckets have enough inventory to render
across all 3 tiers.

### Live proof

```
📥 Lead Brief — Mon, May 25

🎯 HubSpot deals needing action (25 total: 0 new, 25 active, 0 aging):
🔥 ACTIVE (25) — modified 1-7 days ago:
  🔥 [HIRING-VJH-SERP-LEAD] Remote GTM Automation Lead @ Cresta — 2d
  🔥 [HIRING-VJH-SERP-LEAD] Founding Engineer – AI & Compute @ decircle — 2d
  ...
```

Tomorrow when a deal lands in HubSpot it surfaces in 🆕 NEW separately.
After 7 days untouched it moves to ⏰ AGING with the close-or-remove prompt.

### Pattern that emerged

"Freshness is a render concern, not a query concern." The actionable-deals
query already returned fresh data on every cron run — but the operator's
eye loses the signal if NEW and OLD are interleaved with no header. Adding
the bucket grouping at render time delivers daily-fresh signal without
changing the underlying data flow.


## NEW May 25 2026 evening (deep-final) — Bright Data plumbing explained for the goals it serves

Vibe-coder version: what each Bright Data product actually DOES for the
four goals (finding clients, being hired, monetization, GEO/AEO/SEO), and
how the new autonomous research agent ties them together. Use this in
interviews, founder calls, the hackathon pitch, and any client conversation.

### The 4 Bright Data products in your stack and what each one is for

**1. Web Unlocker — "bypass the wall on any website"**
- Plain English: hit any public URL through Bright Data's network instead of yours. Their network rotates IPs, solves CAPTCHAs, looks like a real browser, gets through.
- Where it lives in your code: `src/brightdata-enrich.ts` `bdFetch()`.
- What it does for **finding clients**: when a prospect lands in HubSpot (any agent path), `enrichLeadWebsite` / `enrichLinkedInCompany` / `enrichCrunchbase` fire automatically. You get founder names, team size, funding amount, tech stack attached to the deal — without any manual research.
- What it does for **being hired**: VJH `_search_brightdata_linkedin` pulls 120 LinkedIn job cards per cycle. LinkedIn blocks normal scrapers; Web Unlocker walks right through.
- What it does for **GEO/AEO/SEO**: not directly. (But the research agent uses it on competitor blogs.)
- Pitch line: *"We don't fight bot detection — we route around it. Every CRM deal in our system gets founder + funding + tech-stack intel attached automatically."*

**2. SERP API — "real-time Google results, in JSON"**
- Plain English: send a Google query, get parsed JSON back (titles + links + snippets), as if you had Google's own API. Synchronous, fast.
- Where it lives in your code: `src/brightdata-enrich.ts` `bdSerpSearch()` (via Web Unlocker proxy + `brd_json=1`).
- What it does for **finding clients**: `serpapi-prospects.ts` runs every 6h with queries like `"need CTO" site:news.ycombinator.com` — picks up fresh buying signals from HN/Reddit/the open web → HubSpot CLIENT pipeline. Replaced the legacy SerpAPI competitor.
- What it does for **being hired**: extends VJH coverage to non-LinkedIn job boards (Wellfound, RemoteOK, etc.) via Google site: queries — when a fresh AI engineer post appears anywhere on the web, you see it.
- What it does for **GEO/AEO/SEO**: the research agent uses SERP for "what's ranking for [your target keyword] right now" — direct competitor rank check + content-gap discovery for the daily blog publisher.
- Pitch line: *"We don't pay for stale rank-tracking SaaS. We hit Google directly through Bright Data, fresh each day, with the queries that matter to my pipeline."*

**3. Scraping Browser — "render the JavaScript on hard sites"**
- Plain English: spin up a real headless Chrome browser on Bright Data's network for sites that only render after JS executes (LinkedIn profile detail, complex SPAs, login-walled feeds).
- Where it lives in your code: `src/brightdata-enrich.ts` `bdScrapingBrowserFetch()` + `bdSmartFetch()` orchestrator.
- What it does for **finding clients**: `enrichLinkedInCompany` now uses `bdSmartFetch` — tries Web Unlocker first (cheap), escalates to Scraping Browser when content is thin or JS-gated (LinkedIn does both). Result: company pages that used to come back empty now give us employee count, recent roles, leadership.
- What it does for **being hired**: same upgrade — applies to LinkedIn profile pages of hiring managers Elena considers reaching out to.
- What it does for **GEO/AEO/SEO**: research agent uses it when competitor blogs are SPA-driven (e.g. Next.js-rendered content) so we don't miss their actual blog posts in gap analysis.
- Pitch line: *"When the page lies behind JavaScript, we render it for real. That's why our intel is complete where simple scrapers come back blank."*

**4. MCP Server (BrightData @brightdata/mcp) — "Claude Code can do live web research from your IDE"**
- Plain English: a Model Context Protocol server that exposes BD tools (search_engine, scrape_as_markdown, discover) to any MCP-aware client like Claude Code.
- Where it lives in your repo: `.mcp.json` at repo root.
- What it does for **finding clients**: when you (or Claude in your IDE) need ad-hoc research on a company while you're coding, the BD MCP tools are right there — no separate browser tab.
- What it does for **being hired**: same — use Claude Code to research an employer's recent funding, tech stack, leadership while drafting your application materials.
- What it does for **GEO/AEO/SEO**: use Claude Code with BD MCP to draft article research alongside the daily blog publisher's automated topic picking.
- Pitch line: *"My IDE itself can hit the live web via Bright Data. I don't context-switch to research — I research from where I build."*

### NEW: the autonomous research agent (`src/research-agent.ts`)

This is the production version of the MCP pattern. Where MCP is for Claude
Code (developer time), the research agent is for Telegram (operator time —
yours, on the go from your phone).

**3 Telegram commands, each serves one of your stated goals:**

```
/research_company <name>     → CLIENT prospect research (sendable pitch angle)
/research_employer <name>    → HIRING target research (application angle)
/research_competitor <domain>→ SEO/AEO competitor gap analysis (blog topics)
```

**What happens under the hood (90 seconds per command):**

1. The command fires `runResearchAgent(anthropic, query, mode)` in `src/research-agent.ts`.
2. Claude (Sonnet 4.5) receives a mode-specific system prompt and 3 tools:
   `bd_serp_search`, `bd_unlock_url`, `bd_scrape_browser`.
3. Claude **decides** — autonomously — how many Google searches to fire,
   which URLs to scrape, when to render JS, when it has enough. The hardcoded
   cron flows in the rest of the system are predetermined; this one isn't.
4. Up to 8 BD tool calls, 120s timeout. On end_turn → final structured report.
5. Report comes back in Telegram chunked under 4096 chars, markdown-formatted.

**Live proof (run on `decircle.io` in client mode, 86 seconds, 7 BD calls):**

> *"Saw you are hiring a Head of BD to build Midas distribution engine —
> before you scale that team, would a 2-week AI marketing sprint make
> sense? We help Web3 startups build automated lead-gen systems that
> feed your BD pipeline with qualified exchange/custody/DeFi partnerships."*

That's a real sendable LinkedIn DM, generated autonomously from Bright Data
intel on a real prospect, in 86 seconds. **This is what "find me clients"
looks like in production.**

### How it ties to the GEO/AEO/SEO mechanism specifically

The daily blog publisher (`src/daily-blog-publisher.ts`) currently picks
topics from Google Search Console gaps (queries where your site shows
impressions but no clicks → write the article that closes the gap).

The research agent in `competitor` mode is the next layer on top:

```
/research_competitor manny-santos.com
```

Output:
- Top-ranking content from that competitor (last 3 months)
- Content gaps Elena should fill (3-5 specific blog topic suggestions)
- Schema/AEO patterns they use (FAQPage, HowTo, BlogPosting)
- Linkable assets worth referencing

You then feed those topics into your DAILY_BLOG_TOPIC_BRIEFS rotation, and
the auto-publisher writes them. Bright Data → Claude → research → topic
queue → daily publish → dev.to + aideazz.xyz + FAQPage JSON-LD + sitemap
update. End-to-end, no human in the loop after you fire one Telegram command.

### Pitch-ready summary (one paragraph for the next founder call or interview)

> *"My marketing engine runs 10 production AI agents that act on the live
> web instead of static APIs. Every inbound lead gets enriched with founder /
> tech-stack / funding intel via Bright Data Web Unlocker. Every outbound
> prospect-discovery cron query hits Google live via Bright Data SERP API.
> JS-heavy LinkedIn profile pages render via Bright Data Scraping Browser.
> And from my phone in Telegram I can fire `/research_company <name>` and
> get an autonomous Claude-driven research report — 7 Bright Data calls,
> 90 seconds, a sendable pitch angle. Same pattern works for hiring targets
> and for competitor blog gap analysis. 13 months solo, $0/month infra, real
> paying users, real pipeline today."*

### The 4 sellable rules earned today carry forward into client conversations

1. **"Verify from logs, never claim from config."** Every agent metric we report has a grep-able action signature in production logs. (Caught the 4,357-startup-banner / 0-cycle Algom engagement loop bug today.)
2. **"Verify from DB ground truth for stateful agents."** Before claiming a bug is fixed, query the underlying DB. (Caught the `katex@0.16.9` stuck draft.)
3. **"Yesterday's good code is today's fastest fix."** Before writing new modules, audit recent commits. (Today's biggest behavior change was 1 new function + 6 small call-site edits.)
4. **"Freshness is a render concern, not a query concern."** Daily Telegram briefs surface what's new today vs aging — same query, smarter render. (NEW/ACTIVE/AGING buckets.)

All four travel into the hackathon pitch + every client conversation. They are the methodology, not just code anecdotes.


## NEW May 25 2026 evening (post-final) — Hackathon kit location + /menu wiring

Two small post-shipment housekeeping items + one operational reminder:

### Where the hackathon submission kit lives

NOT in the public `AIPA_AITCF` repo (was at root briefly, removed in
commit `cbe3829`). Now correctly placed alongside other accelerator
prep alongside `a16z-Speedrun-2026/` and `500-Global-LATAM-Application/`:

```
aideazz-private-docs/docs/01-career-applications/Accelerator-Applications/BrightData-WebDataUnlocked-2026/BRIGHTDATA-WEB-DATA-UNLOCKED-SUBMISSION.md
```

(commit `bd0ec46` on the `docs` branch.) Contains: ready-to-paste descriptions
for the lablab form, 5-7 min video script, 10-slide outline, cover-image
instructions, submission checklist, risk register. The PUBLIC code repo is
what judges actually evaluate.

### /menu now surfaces the 3 research commands (commit `d2f516e`)

Operator can tap `/menu` in Telegram → **📊 Business Wiring** and see the
3 new research commands at the top of the section with vibe-coder
descriptions:

- `/research_company <name>` → CLIENT prospect research (HOT/WARM/COLD verdict + sendable pitch angle)
- `/research_employer <name>` → HIRING target research (application angle for Elena)
- `/research_competitor <domain>` → SEO/AEO competitor gap (blog topic suggestions)

Each entry is tap-able for full detail. Position above existing
`/fresh_leads` / `/triage` / `/hubspot` because they are the headline new
capability.

### Audit cleanup (commit `4f786d2`)

`/triage` Telegram command was interpolating `${brief}` directly into a
template literal. After the May 25 evening Telegram-usefulness refactor
made `buildDailyBrief` return `string | null`, the command would have
printed literal "null" at the end of the reply on quiet days. Fixed with
the same null-guard as `/triage_urgent`. Found by the non-destructive
change audit.

### Operator-reading-order for the hackathon week

1. SKILL.md (this doc) — positioning + proof points + the 4 sellable rules + the BD vibe-coder section
2. BRIGHTDATA-WEB-DATA-UNLOCKED-SUBMISSION.md (private repo) — submission kit, paste-ready
3. AIDEAZZ_AI_MARKETING_ENGINE_FULL_ROADMAP.md — client-pitch depth for context
4. The 3 Telegram commands themselves — try them once before recording the video

---

## 🆕 May 25–26 2026 — engine improvements that landed (hackathon was the deadline, not the artifact)

> **Frame correction.** The Bright Data "Web Data UNLOCKED" hackathon submission was the deadline that forced this work into one week — but what matters for the engine going forward is the permanent improvements that landed in production, not the submission. Read this section as a list of **new engine capabilities that operate every day** regardless of whether the hackathon is remembered.

### Submission (the by-product, not the artifact)
The hackathon submission was clicked Submit on lablab.ai on May 26. Form fields: demo platform "Other" (Telegram bot), demo URL `https://t.me/aitcf_aideazz_bot`, repo `https://github.com/ElenaRevicheva/AIPA_AITCF`, Additional Information used the paste-ready judge-quickstart. The submission text + pitch deck got iteratively honesty-patched v1 → v7 to remove every "10-agent" puff and unify on "9 production + AILA blueprint." That's the only direct-submission detail worth remembering.

### Pitch deck adapted in aideazz repo (commit `f0c8a26`)
- Source: `public/pitch.html` (with synced `dist/pitch.html`). Output: `pitch-pdf/aideazz-pitch-brightdata-hackathon-2026-05-26.pdf`.
- 15 slides → exactly **15 A4-landscape PDF pages**, **1.91 MB** (down from a 58 MB first cut by killing per-page raster of the noise SVG + mesh gradient in print CSS only — screen view unchanged).
- Surgical adaptations: hero hackathon pill (amber gradient, first chip), `9+1` stat with AILA muted blueprint note, agents table title now "9 agents in production. 1 blueprint." with `pm2 list` + `systemctl is-active` verification anchors, NEW Slide 9 (BD hackathon — 4 products mapped to code + autonomous Claude loop + live decircle.io proof stat row + 3 commands + honest scope note), founder timeline row updated to May 2026 with amber "Bright Data Web Data UNLOCKED hackathon submission shipped" line.
- Honesty sweep across the deck: every "10 agents" / "10 production" / "10-agent" / "10 systems" claim corrected to "9 production + AILA blueprint" (Solution slide tile, Methodology slide tile, Founder timeline, Hero stat, Agents table title — all unified).
- Print CSS additions (print-only, zero screen impact): tighter padding/font/gap so each slide fits on one page, `page-break-inside: avoid` on tiles, selective override of the existing "hide all .btn in print" rule so SOCIAL/COMMUNITY/WEB3 partnership tiles and the Ask contact tile aren't empty in the PDF.
- Backups saved locally: `public/pitch.html.backup-2026-05-26` + `dist/pitch.html.backup-2026-05-26` (gitignored; rollback any time).
- PDF generated via headless Chrome from PowerShell: `chrome.exe --headless=new --disable-gpu --no-pdf-header-footer --print-to-pdf=... file:///D:/.../pitch.html`.

### HubSpot Fresh-today view created in UI (operator-side)
- Filter: `Last Modified Date = today` (the `Last Activity Date` field only updates on manual activities — notes/emails/calls — and won't catch API-driven property updates from CTO AIPA writers; `Last Modified Date` does).
- Counter shows 21 deals across multiple agent prefixes (`[CLIENT-CTO-SERP]`, `[CLIENT-CTO-INGEST]`, `[HIRING-VJH-SERP-LEAD]`, `[CLIENT-ALGOM]`) — proves multi-agent attribution + freshness pipeline is healthy live.
- The submission kit's "25+ actionable deals" claim is conservative; non-destructive freshness audit (`hubspot_freshness_audit.cjs`) confirmed 50 actionable deals at time of submission.

### What this means for the operator-reading-order

Two more entries earned a permanent slot:
- **The pitch deck PDF** (`aideazz` repo, `pitch-pdf/`) — primary artifact for any pitch / accelerator / founder call going forward. Short URL: `https://github.com/ElenaRevicheva/aideazz/blob/main/pitch-pdf/aideazz-pitch-brightdata-hackathon-2026-05-26.pdf`.
- **The `Fresh today` HubSpot view** — operator-side daily proof that the engine works without needing to read logs. Click into HubSpot Deals → Fresh today → see the multi-agent attribution at a glance.

### Pattern earned (write this on the wall)

> **"Honesty matters most — and the system rewards it."** The submission text was iteratively rewritten v1 → v7 to remove every "10-agent" puff and unify on "9 production + AILA blueprint" with verification anchors. The pitch deck was surgically re-swept three times to match. The CAREER_FOCUS interview hook now leads with the honesty patch as a feature, not a footnote. Recruiters and accelerators will read the same number ("9") in every artifact — that's the brand.

---

## 🔧 Permanent engine improvements landed May 25–26 (operator-daily, not hackathon-only)

These are the **new capabilities the engine has every day forward**. Each one is independently useful even if the lablab submission is never opened again.

### 1. Live web layer is now a first-class engine primitive
**Before:** the engine could publish content, enrich HubSpot from cached data, and respond to events. Live web research was ad-hoc (paid SerpAPI for queries; Web Unlocker only for HubSpot enrichment; no Scraping Browser; no MCP).
**Now:** `src/brightdata-enrich.ts` exposes 4 primitives any agent can call:
- `bdFetch(url)` — Web Unlocker (existed; still the most-used primitive — feeds HubSpot deal enrichment + VJH LinkedIn jobs at 120/cycle)
- `bdSerpSearch(query)` — SERP API via Web Unlocker proxy + `brd_json=1`. **Replaces paid SerpAPI.** One credential set for everything.
- `bdScrapingBrowserFetch(url)` — Scraping Browser with `render:true` for JS-gated sites
- `bdSmartFetch(url)` — orchestrator: try Web Unlocker first, escalate to Scraping Browser only when content is thin/JS-gated. **Cost-aware by default — no manual decisioning needed.**

Plus `.mcp.json` at repo root exposes the Bright Data MCP Server to Claude Code IDE — in-editor live web research without leaving the editor.

**Engine impact:** any new feature that needs live web data calls one of those 4 functions. No more paid-SerpAPI bills, no more "should I escalate to Scraping Browser" decision tree in each writer.

### 2. Autonomous Claude tool-use loop is now a sellable pattern in the codebase
**Before:** every Claude call was single-shot — system prompt → user prompt → response. The engine had no example of Claude making multi-step tool decisions.
**Now:** `src/research-agent.ts` is a Claude Sonnet 4.5 tool-use loop that exposes the 3 BD primitives as tools (`bd_serp_search`, `bd_unlock_url`, `bd_scrape_browser`), enforces max 8 calls / 120 s budget, and runs 3 mode-specific system prompts (client / employer / competitor).

**Engine impact:** this is the reference implementation for any future autonomous agent in the codebase. Next time we want "Claude decides what to do until it's done," we copy this pattern instead of inventing one. It's also the technical lift that proves the engine can host autonomous tool-use, not just LLM-in-a-pipeline.

### 3. Three operator-daily Telegram commands wired into `/menu` Business Wiring
The 3 `/research_*` commands are **permanent operator capabilities**, not hackathon props:
- `/research_company <name>` — client prospect research → HOT/WARM/COLD verdict + sendable pitch angle. Use case: a new lead lands in HubSpot, fire this to draft the LinkedIn DM in ~90 seconds.
- `/research_employer <name>` — hiring target research → application angle. Use case: VJH surfaces a lead, fire this to draft the founder-outreach paragraph.
- `/research_competitor <domain>` — competitor SEO/AEO gap → blog topic suggestions for the daily blog publisher. Use case: weekly content planning loop.

All three positioned at the top of the `/menu` Business Wiring section because they are the headline operator-daily capabilities.

### 4. Lead Brief freshness buckets — operator daily reading habit improvement
**Before:** the daily Lead Brief at 8 AM Panama could show the same 10 deals for 7 days running. Operator couldn't tell at a glance what landed *today* vs what was *aging*.
**Now:** `src/lead-triage.ts` `renderDealBuckets()` splits the brief into:
- 🆕 **NEW** (≤24h) — what landed since yesterday's brief, shown with sub-day age in `m/h`
- 🔥 **ACTIVE** (1–7d) — currently in flight
- ⏰ **AGING** (>7d) — close-or-remove prompt

Plus `buildDailyBrief()` now returns `string | null` so quiet days suppress Telegram entirely (no daily noise when nothing is actionable).

**Engine impact:** the operator can read the morning brief in <30 seconds and know what changed. The "freshness is a render concern, not a query concern" pattern is now a sellable rule the team can apply elsewhere.

### 5. Telegram render safety — engine-wide hardening
**Before:** Telegram replies used MarkdownV1 directly. A long message with rich formatting could trigger `parse entities are too long` or `unsupported tag` errors, killing the response. This actually broke `/research_company decircle.io` once during testing.
**Now:** `src/telegram-bot.ts` has two new helpers used by every reply path:
- `mdToHtmlTelegramSafe(text)` — converts Markdown to Telegram-HTML mode safely
- `safeReply(ctx, text)` — tries HTML first, falls back to plain text on parse error

**Engine impact:** any Telegram reply anywhere in the codebase now uses `safeReply` instead of `ctx.reply`. Future commands can't crash on render formatting issues.

### 6. `/triage` null-brief guard caught by the non-destructive change audit
After change #4 made `buildDailyBrief` return `string | null`, the `/triage` command would have printed literal `"null"` on quiet days. Caught by `hubspot_freshness_audit.cjs` (a script that exercises all 4 buckets + verifies no test/demo entries in the pipeline). Fix: null-guard with friendly fallback message, same pattern as `/triage_urgent`.

**Engine impact:** the non-destructive change audit script itself is now part of the playbook — run it after any change to lead-triage / hubspot-client / telegram-bot before declaring done.

### 7. `check_oracle_health.sh` jq fix — ended a months-long silent crashloop
**Before:** the health-check script used `pm2 list | grep -q "status: online"` to verify each PM2 process. But `pm2 list` outputs box-drawing characters around column headers — the literal text `"status: online"` (with colon-space) never matches. The script wrongly concluded `dragontrade-main` was down every 5 minutes and `pm2 restart`ed it. This had been happening **silently for months** — 4,357 startup banners across the logs, zero engagement cycles ever completed because the bot was restarted before any cycle finished.
**Now:** `/home/ubuntu/check_oracle_health.sh` uses `pm2 jlist | jq -r '.[] | select(.name==$app) | .pm2_env.status'` — structured JSON parsing instead of regex against decorated text.

**Engine impact:** `dragontrade-main` is now at 31+ hour uptime with restart count steady at 1252. The Algom engagement loop on `@reviceva` is **alive for the first time ever** — confirmed cycles fired May 25 with 4 unique real users engaged (@Crypto__fi, @solanamultibuy, @gi_dutraa, @CNBIGBUYS). Pattern earned: **"verify from logs, not config"** — the bot was *configured* correctly all along; what failed was the *health-check observing the config*.

### 8. HubSpot multi-agent attribution proven live (operator-side observability)
**Before:** HubSpot CRM had multiple agents writing deals (`[CLIENT-CTO-SERP]`, `[CLIENT-CTO-INGEST]`, `[HIRING-VJH-SERP-LEAD]`, `[CLIENT-ALGOM]`, `[ESPALUZ]`, etc.) but no operator-side proof the attribution was actually flowing.
**Now:** HubSpot UI **"Fresh today"** view created (filter `Last Modified Date = today` — NOT `Last Activity Date` which only updates on manual notes/emails/calls). Counter shows 21 deals across 4+ agent prefixes — visible proof at a glance.

**Engine impact:** operator can verify the multi-agent attribution layer is healthy without running an audit script. Clicked once per day = full daily sanity check.

### 9. Pitch deck restructured with verification anchors — permanent positioning artifact
`public/pitch.html` in the `aideazz` repo is now the canonical hackathon-week-cleaned deck:
- 15 slides → 15 A4-landscape PDF pages, 1.91 MB
- Every "10 agents" claim corrected to "9 production + AILA blueprint" with `pm2 list` + `systemctl is-active` verification anchors
- NEW Slide 9: Bright Data hackathon — 4 products mapped to code, autonomous loop, live decircle.io stat row, 3 commands, honest scope note
- Founder timeline May 2026 row with amber "Bright Data Web Data UNLOCKED hackathon submission shipped" line
- Print CSS additive: each slide fits one page (was 18 pages with 3 half-empty overflow → now 15), and partnership tiles render their links instead of going empty in PDF

**Engine impact:** any future pitch / accelerator / founder call uses this deck. The honesty anchors (`pm2 list` + `systemctl is-active`) are reusable everywhere — they're how any external party verifies our 9-agent claim without taking it on faith.

### Three new sellable rules earned this week (interview / founder-call ammo)

1. **"Yesterday's good code is today's fastest fix."** Research agent reused already-shipped primitives (`bdFetch` was weeks old, the HubSpot prefix convention was a week old, the Telegram `safeReply` pattern was a day old). Hackathon-week effort was 90% orchestration + 10% genuinely new code.
2. **"Freshness is a render concern, not a query concern."** Lead Brief shipped buckets without changing the query — same data, different render, drastically better operator UX.
3. **"Verify from logs, not config."** The dragontrade-main crashloop wasn't a config bug — it was a health-check that *observed* the config wrong. Earned at high cost (months of silent restarts).

(Existing sellable rule reaffirmed: **"Honesty matters most — and the system rewards it."**)

### What I would say in the next interview when asked "what did you ship recently?"

> "Last week I added a live web layer to my production AI system — 4 Bright Data primitives wrapped in a `bdSmartFetch` orchestrator that escalates from Web Unlocker to Scraping Browser only when content is JS-gated. On top of that I wrote an autonomous Claude tool-use loop — Claude itself decides which web calls to fire, up to 8 calls / 120s, then stops. Three new operator-daily Telegram commands consume it. I also ended a months-long silent crashloop on my crypto agent by replacing a regex health-check with a structured-JSON one — that bot has been at 31+ hour uptime since the fix, engagement loop alive for the first time. And I refreshed my pitch deck to unify every '10 agents' claim down to the honest '9 production + AILA blueprint' with verification anchors anyone can SSH and check. The hackathon submission was the deadline that forced this into one week. The engine improvements are what stay."

## 🆕 June 12 2026 — public proof layer actualized + blog deploy semantics fixed + client-facing test shipped same-day

### 1. Blog static pages now deploy themselves (cto-aipa `1cc388a`, live on Oracle)
**Incident:** `/blog/0-to-1-transferable-skills` 404'd on IPFS ("no link named … under bafybei…"). Root cause: `src/blog-static-pages.ts` committed every per-article static page with `[skip ci]` — so a NEW article's page sat in git invisible on 4everland until an unrelated commit happened to trigger a build. Silent SEO damage on every publish.
**Fix:** `[skip ci]` is now appended only when **updating** an existing page (GitHub Contents API `sha` present). A new page (no sha) commits normally → exactly one deploy per new article. Deploy-storm protection for bulk regenerates preserved. Deployed: pull + build + `pm2 restart cto-aipa`, verified `online` via `pm2 jlist | jq`.
**Rule earned: "A new public artifact must trigger its own deploy."** If a pipeline creates something users can link to, the pipeline owns making it reachable — not the next unrelated commit.

### 2. Public proof layer actualized to June 2026 state (aideazz repo, commits `83fd5df` → `d742a6c`)
- **SOP pages (EN + ES)** — `public/sop-ai-ops.html` / `-es.html`: dates to June 2026; Hashnode pipeline → bilingual daily blog (aideazz.xyz/blog + dev.to crosspost, mutex/dedup/notify); stack rows gained Grok (xAI) tier-3 failover, Whisper retry+fallback chain, Bright Data lead-gen, FAQPage JSON-LD; radar chips for live-web layer + 3-tier failover; **NEW second postmortem: "The engagement loop that never ran"** (the verify-from-logs story, now public interview ammo).
- **Favicon fixed at the root** — `/favicon.ico` was the stale ugly mark and pages pointed at the 854 KB PNG (muddy at 16px). Regenerated multi-size `favicon.ico` + crisp `favicon-32.png` + `apple-touch-icon.png` from the real AIdeazz triangle (sharp + png-to-ico, `--no-save`); wired `?v=3` icon set into index.html, both SOPs, pitch.html.
- **Portfolio (`/portfolio`)** — architecture diagram label fixes (CMO AIPA was mislabeled "Job Hunting" → "Marketing & CRM"; CTO → "Control Tower"; VibeJob → "Job Hunting"; EspaLuz "Life Assistant" → **"Spanish Tutor · Relocation"** — the old label read as spiritual-mentor vague). NEW capability chips under the diagram (HubSpot multi-agent pipeline · Bright Data research agent · bilingual GEO/SEO/AEO blog · voice briefing · 3-tier failover) + **three proof buttons: Ops Runbook · Blog · Podcast** (blog/podcast were buried on the card's flip side). **Honest count enforced in 8 places EN+ES: "10-agent ecosystem — 9 live 24/7"** (was "10 Live Agents", contradicting the SOP). Positioning line upgraded from bare "Applied AI Engineer" to resume-aligned: **"Applied AI Engineer & AI Systems Builder | Agents · AI Marketing · CRM & Revenue Automation | Founder @ AIdeazz"** (+ JSON-LD jobTitle). Timeline 13 → 15 months (March 2025 — June 2026).

### 3. Tech Specialist hiring test built + twice-tested live in under 2 hours (June 12 morning)
Client-onboarding system for a hiring pipeline: **one bootstrap Apps Script `setup()`** builds Drive folder tree, formatted tracker + dashboard, intake form, onFormSubmit trigger (row + client folder + email in ~5s), and the SOP Google Doc — infrastructure-as-code instead of n8n (deliberate, defensible choice). First live test caught a real bug (`+phone` parsed as a Sheets formula → `#ERROR!`); fixed with a text guard + re-tested clean. **Technique earned:** OAuth consent popups that open in unreachable browser windows can be re-homed — hook `window.open` in page context to capture the consent URL, `location.assign()` it in the controlled tab, click through there. Artifacts in `Desktop\TechSpecialistTest\` + memory `project_tech_specialist_test.md`.

### What I would add in the next interview after June 12

> "This morning a hiring test asked for a form→sheet automation with n8n. I didn't have n8n, so I shipped the whole system as one Google Apps Script bootstrap — folders, tracker, form, trigger, SOP doc — built and twice-tested live in under two hours, and my first live test caught a real formula-injection bug in phone numbers, which I fixed and re-tested. Same day I root-caused a 404 on my own blog to a `[skip ci]` tag that kept new articles from deploying themselves — the rule I took away is that any pipeline creating a public artifact owns making it reachable."

## 🆕 June 17–19 2026 — durable $0 LLM resilience + Atuona AI Film Studio production

### 1. Free-first multi-provider LLM fallback across blog + sprinter (no paid credits required)
When Anthropic credits ran dry and Groq's daily cap hit (both drained by heavy creative use), the daily blog **and** the 8AM Sprint Briefing both stopped generating. Made both **free-first**: a `gemini-2.5-flash` tier (Google's free quota, `thinkingBudget:0`) runs *before* the paid chain → then Anthropic → Groq → Grok. Blog ES translation, blog article generation, and the AWS Lambda Sprinter (rebuilt via esbuild + redeployed) now all survive a fully-paid-exhausted day at **$0 ongoing**. Plus a Dev.to canonical-`422` uniquifier and a crash-proof briefing (HTML-first, plain-text fallback on Telegram parse errors). Pattern: *on a bootstrap budget, never depend on one provider or on funding credits daily.*

### 2. Atuona AI Film Studio — automated poetry-film production pipeline
Multi-provider AI video (Luma Ray-3 · Runway Gen-4.5 · Veo 3.1 · Kling) → an ffmpeg compiler that assembles finished films: per-clip slow-motion sized to its voiceover (no frozen frames), 1.3s cross-dissolves, onyx TTS reading the *sharpest real stanza* from each visualized poem, side-chain-ducked score, cover intro + monospace title cards matching the site header, selective grayscale clips, and English-only on-the-fly RU→EN translation. Published watch-anywhere at **atuona.xyz/aifilmstudio**.

### What I would say in the next interview after June 19
> "My creative agents share LLM keys, and one heavy day drained every paid provider at once — the blog and the morning briefing both went dark. I rebuilt the whole fleet free-first: Google's free Gemini tier runs before the paid chain, so the systems keep producing at $0 even when credits are gone. On a bootstrap budget, resilience means never depending on a single provider — or on remembering to top up."

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.