- Python 96%
- Shell 4%
| config | ||
| multica | ||
| proposals | ||
| reports | ||
| runs | ||
| schemas | ||
| scripts | ||
| state | ||
| templates | ||
| tests | ||
| workflows | ||
| .gitignore | ||
| README.md | ||
Mestra Owned Growth Engine v2
Status: implemented as an approval-safe internal growth engine
Root: /home/josh/forgejo/owned-growth-engine
Public site: https://getmestra.com
Objective
Discover, score, queue, draft, QA, measure, and review Mestra owned SEO/AEO growth opportunities while stopping before approval-gated external side effects.
Governance
- Public brand is Mestra.
- No publishing.
- No CMS create/update.
- No social queueing.
- No outreach.
- No spend.
- No deployment.
- No website code edits.
- No customer, supplier, calendar, or financial commitments.
- Website blockers produce PR-ready proposals/prompts only.
- No secrets in committed config, reports, schemas, manifests, or run folders.
Required keys
The scripts hard-fail if any required key is missing:
SERPER_API_KEYFIRECRAWL_API_KEYKEYWORDS_EVERYWHERE_API_KEY
Optional adapters are skipped when unset:
OPENAI_API_KEYPERPLEXITY_API_KEYGOOGLE_AI_OVERVIEW_PROVIDERGOOGLE_AI_OVERVIEW_API_KEYGOOGLE_CLOUD_PROJECTGOOGLE_APPLICATION_CREDENTIALSMESTRA_GA4_MCP_EXPORT
Add keys to an ignored local file:
cp /home/josh/forgejo/owned-growth-engine/config/env.example /home/josh/forgejo/owned-growth-engine/config/env.local
or for Multica:
cp /home/josh/forgejo/owned-growth-engine/multica/commands/env.example /home/josh/forgejo/owned-growth-engine/multica/commands/env.local
Missing-key behavior
If a required key is missing, the workflow exits before doing work and creates:
runs/YYYY-MM-DDTHHMM-setup-failed/
README.md
run.json
setup-failure.md
The failure output names missing key names only. It never prints secret values.
Workflows
Daily:
python3 '/home/josh/forgejo/owned-growth-engine/scripts/daily_growth_asset.py'
Weekly intelligence:
python3 '/home/josh/forgejo/owned-growth-engine/scripts/weekly_intelligence.py'
Weekly live-provider run:
python3 '/home/josh/forgejo/owned-growth-engine/scripts/weekly_intelligence.py' --live-providers
Impact review:
python3 '/home/josh/forgejo/owned-growth-engine/scripts/impact_review.py'
Coordinator:
python3 '/home/josh/forgejo/owned-growth-engine/scripts/next_best_growth_action.py' --run --workflow daily
Provider calls are only attempted when the operator passes --live-providers
and required keys are present. The setup-failure verification path does not run
provider calls. Weekly v2 writes provider-diagnostics.json and
provider-diagnostics.md for Serper, Firecrawl, Keywords Everywhere, Search
Console, and GA4. Search Console uses /home/josh/.local/bin/gsc-query. GA4
uses the Google Analytics Data API directly when GOOGLE_APPLICATION_CREDENTIALS
points at a service-account key with Viewer access to property 528578832.
MESTRA_GA4_MCP_EXPORT remains supported as a fallback handoff from
analytics_mcp.run_report, and deterministic fixtures are used by tests.
Run folders
Human-facing run folders:
runs/YYYY-MM-DDTHHMM-daily-growth-asset/runs/YYYY-MM-DDTHHMM-weekly-intelligence/runs/YYYY-MM-DDTHHMM-impact-review/runs/YYYY-MM-DDTHHMM-setup-failed/
Every successful run folder includes README.md, run.json, and the canonical
artifacts for that run.
Machine state
Append-only state files:
state/artifact_register.jsonlstate/artifact_events.jsonlstate/opportunity_queue.jsonlstate/opportunity_events.jsonl
Scripts append lifecycle events. They do not rewrite prior history. Daily derives latest opportunity status from events and skips consumed, completed, blocked, or superseded opportunities.
Daily Workflow V2
Daily consumes the latest ranked valid queue item from weekly state. Minimum daily success is one asset, target is two assets, and maximum is three assets. Every asset gets a source manifest and QA report. Full article drafts are created when the queued opportunity qualifies; non-article assets are created when they are the stronger response.
Valid asset types:
article_draftrefresh_draftsource_grounded_briefinternal_link_proposalfaq_schema_proposalllms_txt_update_proposalproduct_led_free_tool_briefsafe_authority_asset_briefpost_publish_improvement_proposalclaim_risk_cleanup_packtechnical_blocker_proposal
QA checks source grounding, duplicate intent, claim risk, commercial relevance,
AEO usefulness, heading/opening similarity, thin drafts, claim ledger, approval
boundary, missing evidence, and recommended status. Medium-confidence drafts
are marked draft_for_QA or qa_required, not treated as publish-ready.
Weekly Intelligence V2
Weekly is the discovery and scoring engine. It builds a local content inventory
from topic, site, internal-link, AEO, brand, approval, brief, published,
discovery, report, CMS-cleanup, and claim-review sources; uses live provider
evidence only behind --live-providers; calculates complete 28-day recent and
comparison measurement windows; converts GSC/GA4 evidence into scoring signals
where available; and writes a ranked daily queue.
Weekly runs produce:
- content inventory
- measurement summary
- provider diagnostics
- opportunity discovery
- ranked daily queue
- site audit
- visibility report
- keyword/competitor gap
- topic queue update proposal
- technical blocker proposal
- website fixer prompt
- impact review summary
- weekly topic/action plan
- next-actions synthesis
The target is seven primary and three backup strong topics/assets, but the engine does not force weak content. Technical blockers outrank new content when they block visibility. Opportunities are scored for qualified organic lead potential using commercial intent, Mestra fit, evidence strength, AEO usefulness, freshness/novelty, execution cost, and risk/blockers.
Provider and cost limits
Default limits:
ai_visibility_prompts_per_run: 7serper.max_queries_per_run: 15serper.hard_stop_queries_per_run: 25firecrawl.max_scrape_pages_per_run: 20firecrawl.hard_stop_scrape_pages_per_run: 30keywords_everywhere.max_keywords_per_run: 30keywords_everywhere.hard_stop_keywords_per_run: 50optional_openai.max_prompts_per_run: 7optional_perplexity.max_prompts_per_run: 7competitor_depth.top_serp_results_per_prompt: 3competitor_depth.max_competitor_pages_per_prompt: 2
These are conservative defaults based on the current seven-prompt Mestra workflow and provider billing units. Real costs depend on provider pricing.
AI visibility
Core visibility uses Serper-backed SERP/AEO checks when live providers are explicitly enabled. Optional adapter stubs exist for OpenAI, Perplexity/Sonar, and Google AI Overview provider checks.
Do not claim direct ChatGPT, Perplexity, or Google AI Overview visibility unless that specific adapter actually ran. Google AI Overview remains provider pluggable unless a concrete provider is configured.
Multica setup
The setup pack lives under multica/ and its instructions describe v2
behavior. Do not run setup until Josh explicitly approves Multica creation.
/home/josh/forgejo/owned-growth-engine/multica/commands/setup-growth-engine.sh --yes
It validates the Multica CLI, workspace/runtime discovery, local env file, and instruction files. It creates or updates named agents and autopilots rather than duplicating them, injects shared env into generated agents, and writes:
multica/setup-manifest.json
Default schedules:
daily_growth_asset: daily 07:30 Europe/Londonweekly_intelligence: Monday 06:30 Europe/Londonweekly_impact_review: Friday 14:30 Europe/London
Website fixer lane
See workflows/website-fixer-lane.md. Website fixes are PR-only and require
separate approval for implementation and deployment.