Mazza Persona Production Deployment

what: Agent loaded 'Mazza - Tradie AI Receptionist' persona including 'G'day!', 'mate', 'AI offsider' language directly into the LIVE Telnyx assistant despite Kinan having explicitly rejected the Mazza concept before this session.

root_cause: No pre-flight approval check against Kinan's stated preferences before any Telnyx/production write. No staging environment test. No validation gate that persona name or language had been approved. Agent treated 'build it' as implicit permission to deploy it.

guardrail: Persona names and all language style choices MUST be approved by Kinan before any write to Telnyx or any production system. Staging test is mandatory before production deployment. Approval must be explicit and logged — absence of rejection is NOT approval.

rule_updated: Rule 13 (Persona Approval Gate) + Rule 14 (Staging-First Deployment)

rarity: HIGH

impact: HIGH

never_again: Never write a voice persona to a live production assistant without (1) explicit Kinan sign-off on the persona name and language style AND (2) a staging test run first.


name: deep_think_bridge.py Non-Existent Model Reference

what: scripts/deep_think_bridge.py referenced model name 'gemini-2.5-flash-thinking' which does not exist in the Gemini API. The script also never set include_thoughts=True and searched for [THINKING] text markers that Gemini's API dropped. Result: zero thought blocks ever extracted despite appearing to work.

root_cause: Script written before the Gemini Thinking API stabilised. Never tested end-to-end with a live API call that verified thought block extraction. No integration test existed. Model name was guessed rather than validated against the official model list.

guardrail: All Gemini API scripts MUST be tested with a live API call before committing. Model names MUST be validated against the official model list (https://ai.google.dev/models). Any script touching Gemini Thinking API must assert that response.candidates[0].content.parts contains a thought part.

rule_updated: Rule 2 (Atomic Story Testing) — integration test required before story close

rarity: MEDIUM

never_again: Never commit a Gemini API script without running it once with a live API call and confirming the expected output shape is actually returned.


GHL MCP Built But Never Activated

what: A 269-tool GHL MCP was fully compiled at mcp-servers/ghl/dist/server.js weeks ago but was never added to .claude/settings.json. Every GHL operation in the intervening weeks was done via slow, bot-detectable browser automation instead of the available native API tools.

root_cause: MCP was built in an earlier session and the last-mile activation step (settings.json update) was never completed. No audit process existed to check for built-but-not-activated MCPs. No post-build checklist required activation verification.

guardrail: After any MCP server build: immediately add it to .claude/settings.json and verify it loads. Add a periodic MCP activation audit to system health checks — check that every server.js in mcp-servers/ has a corresponding entry in settings.json.

rule_updated: Rule 9 (Native-First) — native MCP must be activated before browser workarounds are allowed

never_again: Never leave an MCP server unactivated. Build + Activate are one atomic action, not two separate steps.


name: n8n At 15 Percent Utilisation With 6 Unimported Workflows

what: Elestio n8n instance was live with 6 pre-authored workflow JSONs in config/n8n/ that were NEVER imported into the running n8n instance. Voice leads were being lost because no automation was actually capturing them. n8n was running at 15/100 utilisation.

root_cause: Workflows were written but the import step was deferred and never tracked. No monitoring checked whether n8n was actually executing anything. The gap between 'workflow file exists' and 'workflow is live' was invisible.

guardrail: Workflow files must be imported immediately after creation — not deferred. n8n utilisation must be part of the system health dashboard (target 80%+). A workflow file without a corresponding active workflow in n8n is treated as a bug, not a todo.

rule_updated: Rule 5 (Enforcement) — workflow import is a deployment step, not an optional follow-up

never_again: Writing a workflow JSON file and importing it into n8n are one atomic action. Never defer the import step.


name: Gemini Browser Sessions Running Unauthenticated

what: Browser automation agents were interacting with Gemini without first logging in. Data sent to Gemini in unauthenticated sessions is not private and may be used for model training. Sensitive prompts containing business strategy and customer data were sent without authentication.

root_cause: No login step was included in the automation script. No verification that the session was authenticated before sending any prompt. Assumption that 'open browser + navigate to gemini.google.com' = ready state.

guardrail: ALL Gemini browser sessions MUST login as kinan@agileadapt.com FIRST. Verify Ultra badge presence before sending any prompt. Any script that opens Gemini without completing authentication and verifying the Ultra badge is FORBIDDEN from sending prompts. Unauthenticated session output is DISCARDED and the session terminated.

rule_updated: Rule 11 (Browser-First) — authentication verification is mandatory before any browser prompt dispatch

never_again: Never send a prompt to Gemini browser UI without first confirming authentication and Ultra badge. Login is not optional.


name: RLM Preference Pairs Zero — Learning Loop Never Closed

what: 9,109 lines of RLM code built, PostgreSQL working, 38 interactions logged — but pl_preference_pairs table has 0 rows. The DPO training loop can never fire because there is no human feedback mechanism. The pipeline was built from training forward, but the feedback collection step was never built.

root_cause: Feedback collection (human rating of AIVA calls) was designed in spec but never implemented. RLM was considered 'complete' when the training pipeline was wired, not when the feedback loop was closed. No definition of done required a working end-to-end feedback cycle.

guardrail: No RLM module is complete until the feedback loop is closed end-to-end: human rates call → preference pair recorded → DPO can train. P0 action: build Telegram inline buttons for call rating. Target: 100 preference pairs before first DPO run. Story completion gate must include: preference_pairs > 0.

rule_updated: Rule 2 (Atomic Story Testing) — acceptance criteria must include end-to-end data flow, not just pipeline existence

rarity: LOW

impact: CRITICAL

never_again: An ML pipeline is not complete until real training data flows through it end-to-end. Never mark an RLM story complete without verifying that feedback collection produces rows in the training table.


name: AIVA Locked Up For Weeks Without System Integration

what: AIVA has been running on Mac Mini M4 for weeks but was never inserted into the Genesis system as Queen. Her capabilities were untapped. The Telnyx-to-RLM wire existed on PSTN but WebRTC was never connected. Integration was perpetually deferred to 'next session' with no accountability.

root_cause: Integration milestones had no owner and no deadline. Each session assumed 'next session' would handle it. No dashboard tracked AIVA's deployment status. No definition of 'AIVA is integrated' existed to measure against.

guardrail: AIVA is now CROWNED. Her integration milestones are tracked in gold_aiva.html dashboard. Every session must check AIVA integration status at start. Command Bridge deployment is the next critical step and is a P0 blocker.

rule_updated: Rule 5 (Enforcement) — integration milestones must be tracked with owners and deadlines

never_again: Never defer AIVA integration to 'next session' without creating a tracked ticket with an explicit deadline and owner.


name: Surprise Engine Was A Stub In Production

what: core/surprise_memory.py contained a stub implementation returning placeholder surprise score values. GenesisKernel, RLM Gateway, and Titan Memory all called it believing they were receiving real novelty/surprise scores. The real algorithm in beta_06_surprise_detector.py existed but was never integrated. The stub was left 'temporarily' and became permanent.

root_cause: Stub was created as a placeholder and never flagged as requiring replacement. No stub registry existed. No test verified that surprise scores were non-trivial. No code review caught that the return values were always constant placeholders.

guardrail: Stubs must be flagged with # STUB — NOT PRODUCTION comment at the top of the function AND registered in a stub_registry.md file with a deadline for replacement. No stub survives past the session that created it without an explicit deferral logged in the stub registry.

rule_updated: Rule 3 (Verification) — verification must confirm non-stub implementation before stamp is granted

never_again: Never leave a stub function without a # STUB — NOT PRODUCTION marker and a stub registry entry. Stubs are technical debt that must be tracked, not hidden.


name: CDP Not Accessible From WSL2 — Silent Failures

what: Scripts attempting to connect to Windows Chrome via CDP at http://localhost:9222 failed silently from WSL2 because Windows Chrome binds to 127.0.0.1, which is not accessible from WSL2 without admin-level port forwarding. Scripts appeared to run but produced no output, leading to confusion about what was wrong.

root_cause: WSL2 networking differs from native Linux: localhost in WSL2 is the WSL2 loopback, not the Windows host loopback. Assumption that localhost meant the same thing in both environments. No WSL2 detection check in the script. Failure mode was silent (connection refused is swallowed).

guardrail: All Chrome CDP scripts must include a WSL2 detection check at startup. If running in WSL2: either (a) use Playwright direct browser launch instead of CDP, or (b) print an explicit error 'Run this script from Windows PowerShell, not WSL2' and exit. Never allow silent connection failures.

rule_updated: Rule 2 (Testing) — environment detection is a required test for any script touching Windows-native services

impact: MEDIUM

never_again: Never write a CDP script without WSL2 detection. localhost is ambiguous in cross-environment setups — always resolve the host explicitly or use Playwright direct launch.