Skip to content

Codebase Analysis & Architectural Map ​

Quick Reference

  • Project Name: LinkedIn Automation — Antigravity 2.0
  • Primary Language: Python 3.10+
  • Core Integrations: NotebookLM MCP, LinkedIn REST API, Notion API, OBS Studio WebSocket (Telemetry)
  • Primary Entry Point: main.py (main.py:1–392)
  • MCP Server Entry: mcp_server.py (mcp_server.py:1–160)
  • Safety Gate: judge_guard.py (judge_guard.py:1–400)

1. Executive Overview ​

The LinkedIn Automation repository is a state-of-the-art autonomous content generation and publishing pipeline powered by Antigravity 2.0, Google NotebookLM, and JudgeGuard verification. It operates on a hybrid CLI and MCP architecture designed to ingest knowledge, synthesize LinkedIn content, validate quality and tone, track engagement analytics, and maintain persistent system memory.


2. Directory Structure ​

elegant-franklin/
├── main.py                               # CLI entry point for orchestration & tasks
├── mcp_server.py                          # FastMCP server for LinkedIn Agent
├── judge_guard.py                         # Pre-action & governance safety gate
├── setup_linkedin_auth.py                 # OAuth2 token generator for LinkedIn API
├── run_live.sh                            # Production runner script
├── WORK_LOG.md                            # Immutable execution log
├── tasks.json                             # Active micro-task tracking
├── requirements.txt                       # Python dependencies
│
├── linkedin_automation/                   # Core Business Domain Package
│   ├── agents/
│   │   ├── linkedin_agent.py              # Single post & weekly workflow executor
│   │   └── orchestrator.py                # MainOrchestrator (end-to-end pipeline)
│   ├── core/
│   │   ├── nlm_bridge.py                  # NotebookLM MCP & NLM CLI Bridge
│   │   ├── content_generator.py           # AI content generator & formatting engine
│   │   ├── publisher.py                   # Official LinkedIn API client
│   │   ├── analytics.py                   # Analytics aggregator & report builder
│   │   ├── scheduler.py                   # Cron scheduler & topic pipeline
│   │   └── soul.py                        # Brand voice & persona rules
│   └── config/                            # System configuration schemas
│
├── src/                                   # Infrastructure & Observability
│   ├── antigravity_core/
│   │   ├── gemini_client.py               # Gemini LLM caller for JudgeGuard
│   │   └── obs_wiggum_bridge.py           # Ralph Wiggum OBS HUD observability bridge
│   ├── kaggle_stream/                     # Data streaming pipelines
│   └── mobile_app_pwa/                    # PWA interface modules
│
├── docs/                                  # Documentation suite (VitePress)
│
└── tests/                                 # Pytest test suite

3. Core Architectural Modules ​

3.1 Entry Point (main.py) ​

  • Location: main.py (project root)
  • Functions: Parses CLI flags (--action, --topic, --preview, --live, --orchestrate, --wiggum-obs) and routes calls to domain agents.

3.2 Main Orchestrator (orchestrator.py) ​

  • Location: linkedin_automation/agents/orchestrator.py
  • Responsibilities: Executes end-to-end multi-step cycles:
    1. NotebookLM query & topic selection
    2. Research pipeline execution (fast or deep mode)
    3. Studio artifact generation (reports/audio)
    4. Content drafting & validation against soul.py
    5. LinkedIn publishing or preview output

3.3 Safety & Governance (judge_guard.py) ​

  • Location: judge_guard.py (project root)
  • Enforcement: Inspects actions against MASTER_ORCHESTRATION.md rules, verifies WORK_LOG.md freshness, blocks blacklisted commands, and streams verdicts to OBS telemetry.

3.4 Observability Bridge (obs_wiggum_bridge.py) ​

  • Location: src/antigravity_core/obs_wiggum_bridge.py
  • Capabilities: Manages NVENC hardware encoding, streams Layer 2 thought streams to OBS HUD, records subtask execution cycles, and maintains task state in tasks.json.

4. Dependencies & Technical Requirements ​

plaintext
dotenv / python-dotenv >= 1.0.0
requests >= 2.31.0
mcp / fastmcp >= 0.1.0
pytest >= 7.4.0
google-genai / google-generativeai

5. Security & Verification Audit ​

ComponentProtection MechanismFile Reference
Command ExecutionJudgeGuard CLI & Blacklist Filterjudge_guard.py:40–120
Work LoggingMandatory pre-log and post-log checkWORK_LOG.md
OAuth TokensRefresh token rotation via setup_linkedin_auth.pysetup_linkedin_auth.py