Skip to content

fourierwang66666/livetie

Repository files navigation

English · 中文

livetie

Calculate the real social distance between two public X / LinkedIn profiles — under strict bidirectional-interaction evidence, with an audit trail.

License Python 3.11+ Claude Code skill Live demo

🎬 Live demo report — HongKongDoll ↔ Elon Musk · click to open the actual rendered output

Why · Quick Start · How it works · Cost · Auto-update · Full report walkthrough


✨ Why

Following ≠ relationship. Most "I am 2 hops from X" claims are graph theory toys — the actual edges have never been activated.

This skill walks the bidirectional interaction graph between two real X profiles under strict binary judgments (every leg requires both A → B AND B → A), traces 2-hop and 3-hop paths to your target, and is honest when no path exists. Every claim in the report cites a real evidence ID from the run's evidence_pool/.

If a path doesn't exist, you get a top-N near-miss list with the exact missing leg — so you know which one bidirectional reply would activate the bridge.


🎬 Demo highlights

A run on the dramatic distance between HongKongDoll (Chinese crypto/creator-economy core, 1.64M followers) and Elon Musk (X platform owner, 240M followers). Generated by the actual skill, no manual edits.

👉 View the full live report

Cover

Report cover — HongKongDoll ↔ Elon Musk · 社交距离有多远?

Topology — the headline finding

The skill found a 3-hop path through Bitwux → cz_binance → Musk, scored 0.72. The key insight: mutual-follow is misleading. Seven obvious "they share Naval / Vitalik / Altman" candidates all failed — none had a real bidirectional interaction with HKD. The actual bridge runs through Chinese-language crypto Twitter.

Topology graph — HKD → Bitwux → cz_binance → Elon Musk

Resonance topics

Side-by-side stance comparison from real X posts. Each card cites the evidence IDs (x_post#N, wiki_paragraph#N, interview_quote#N) that back the claim — fully auditable.

Resonance topics — crypto/X-payment, creator economy, free speech

Methodology

Every report ends with a fully transparent methodology page: data sources used, what was found vs not, what counts as a "real path" vs "weak path", and per-run statistics.

Methodology page — 3-tier LinkedIn + Wikipedia architecture

📄 The full report is bilingual (zh / en, toggle in lower-right) and exports to PDF via Cmd+P.


🚀 Quick Start

git clone https://github.com/fourierwang66666/livetie.git
cd livetie
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"

# Interactive setup — explains costs, validates keys
livetie init

Then in a Claude Code session:

"Use the livetie skill on @sama and @elonmusk"

Claude will:

  1. Run livetie fetch (Stage 1 — Python, ~30-50 min, paid TikHub API calls).
  2. Do Stage 2 directly using its WebSearch / WebFetch tools (LinkedIn URL discovery, Wikipedia, interview research, then 5 evidence-grounded extraction prompts).
  3. Compose Stage 3 — a single self-contained 11-section bilingual HTML report.

For non-interactive setup (CI / scripts):

livetie init --non-interactive --tikhub-key $TIKHUB_API_KEY --max-hops 3
livetie check    # verify all credentials are good

🧠 How it works

Stage 0  livetie check         ← READY / BLOCKED
Stage 1  livetie fetch (Python — pure mechanical)
         ├─ X profile / posts / followings (TikHub)
         ├─ candidate gathering + bidirectional edge probing
         ├─ reverse-from-target enumeration  ← finds "fan bridge" patterns
         └─ writes raw/, solved/, evidence_pool/

Stage 2  Claude in your session (no SDK, no separate LLM)
         ├─ Step 0a/b — LinkedIn URL discovery + WebFetch
         ├─ Step 0c   — Wikipedia (always-on)
         ├─ Step 0d   — 3-4 interviews/blogs per subject
         └─ Steps 1-N — 5 extraction prompts under hard "every claim
                        must cite evidence_ref" rule

Stage 3  Claude composes report.html
         └─ 11 sections per references/report-sections.md
            with hybrid HTML+SVG topology, bilingual zh/en,
            evidence badges, and a 0-paths fallback for honest NOs.

The skill ships with explicit reference docs for every section's HTML skeleton (see references/), a 10-item pre-publish quality checklist (in SKILL.md), and a 0-paths fallback pattern so the skill produces honest "no real path exists" reports instead of papering over with placeholder text.


💰 Cost

Item Cost / run
TikHub (X data, paid) $1 – $3 per 3-hop run with default --probe-budget 600. Pre-fund ~$5. The fetch_user_profile endpoint is paid-only — runs that probe candidate bridges require paid balance.
LinkedIn (free WebFetch tier) $0
Wikipedia + Web research (free) $0
LLM (Stages 2 + 3, runs in your Claude Code session) $0.50 – $1.50 per run on Sonnet · or covered by your Claude Code Pro/Max subscription

A typical analysis costs ~$1.50 – $4 total in API + LLM, plus the Claude Code subscription if you have one. See docs/pricing-snapshot.md for current vendor pricing details.


🔄 Auto-update

The skill auto-updates from this repo's main branch on every CLI invocation:

$ livetie fetch --you https://x.com/me --target https://x.com/elonmusk

🔄 livetie update available (3 commits behind upstream)…
✅ Updated to latest. Continuing…

[fetch] profiles
[fetch] posts
...

The mechanism is git-based — it runs git fetch + git pull --ff-only against the remote configured in your local .git/config, so a fork pulls from your fork rather than upstream. It silently skips if:

  • You're not in a git checkout (zip download / pip install)
  • You have local uncommitted changes (git status not clean)
  • You're offline (fetch times out after 8s)
  • You explicitly opt out: --no-update flag or LIVETIE_NO_UPDATE=1 env var

🏗️ Architecture

livetie/
├─ cli.py / init_flow.py / check.py   # 3 user-facing commands
├─ orchestrator.py                    # Stage 1 entry — pure Python, no LLM
├─ adapters/
│  ├─ x_tikhub.py                     # X data via TikHub
│  └─ li_webfetch.py                  # LinkedIn parse helpers (Stage 2 uses Claude WebFetch)
├─ extract/evidence_pool.py           # build evidence_pool/*.jsonl
├─ graph/                             # candidates + edges + n-hop path enumeration
├─ normalize/                         # API → internal model
└─ utils/
   ├─ cache.py                        # sqlite cache for API calls
   ├─ lang.py                         # zh/en auto-detect
   └─ auto_update.py                  # git pull on every run

prompts/{zh,en}/                      # Stage 2 extraction prompts (×6, bilingual)
references/                           # Stage 3 HTML skeletons + topology coords
assets/base-template.html             # design-token shell
SKILL.md                              # Stage 0/1/2/3 instructions + 10-item checklist

📐 Hard guarantees

  1. Every claim in the report has an evidence_ref ID that exists in evidence_pool/*.jsonl. Unsupported claims go to extracted/quarantined.json.
  2. Every "real path" leg passes the bidirectional bar (both A → B and B → A searches return ≥1 result). Single-direction outreach (A shouting at B) does not count.
  3. Max 3 hops. No 4+ hop paths are considered — small-world effect makes them meaningless noise.
  4. 0-paths are reported honestly — see the references/report-sections.md 0-paths fallback skeleton (Top 3 Near-Miss with broken-leg styling).

🤝 Contributing

Issues and PRs welcome on https://github.com/fourierwang66666/livetie. Before submitting:

pytest -q -m "not e2e"     # 117+ unit tests, all must pass
livetie check              # verify your local config still works

For larger changes, please open an issue first to discuss the approach.


📜 License

Apache License 2.0 · Copyright © 2026 Fourier Wang

You are free to use, modify, and commercialize this code, including in closed-source products. Patent grant + retaliation clauses included (see Apache 2.0 spec).


📸 Full report walkthrough

The complete 11-section report rendered from the canonical HKD × Musk demo. Click to view the live interactive version where you can toggle between languages and export to PDF.

Full demo report walkthrough — all 11 sections from cover through methodology

Built as a Claude Code skill — Stages 2 and 3 run inside the Claude Code session itself, no separate LLM SDK.

About

Calculate the real social distance between two public X/LinkedIn profiles — under strict bidirectional-interaction evidence, with an audit trail.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors