# forensic_deep_dive.py
# Copyright (c) 2026 User - All Rights Reserved.
# License: Proprietary. This forensic deep dive methodology and script were created for the user.
# The user retains all license rights. No redistribution, resale, or republication without the user's written permission.
# SPDX-License-Identifier: LicenseRef-User-Proprietary-All-Rights-Reserved
#
# PURPOSE:
# Implement the Voyager / no-ACK verification method from the PayPal analysis for an aggregate umbrella.
# No single source is trusted. Each source is a biased sensor. Verification comes from redundancy,
# checksums, and intervals, not from a company ACK.
#
# OWNERSHIP CORRECTION - IMPORTANT FOR THE UMBRELLA:
# Meta Platforms (META) owns: Facebook, Instagram, Messenger, WhatsApp, Threads, Reality Labs / Quest, Meta AI.
# Snapchat is NOT owned by Zuckerberg / Meta. It is owned by Snap Inc. (SNAP).
# WeChat is NOT owned by Zuckerberg / Meta. It is owned by Tencent (TCEHY).
# Including SNAP and Tencent as COMPARATORS strengthens the pattern detection across tech,
# but they must not be coded as Meta subsidiaries or the aggregate will be wrong.
import json
import math
import random
import statistics
from dataclasses import dataclass, asdict
from typing import List, Dict, Optional
# ------------------------------------------------------------------
# 1. COMPANY UNIVERSE
# ------------------------------------------------------------------
COMPANIES = {
"META": {
"name": "Meta Platforms, Inc.",
"ticker": "META",
"owner": "Meta Platforms / Mark Zuckerberg",
"role": "Parent",
"subsidiaries": ["Facebook", "Instagram", "Messenger", "WhatsApp", "Threads", "Reality Labs / Quest", "Meta AI"],
"note": "File 10-K as META. Subsidiary headcount is not broken out in 10-K, use 10-K total + WARN + LinkedIn as sensors."
},
"Facebook": {"name": "Facebook", "ticker": "META", "owner": "Meta Platforms", "role": "Subsidiary / Product", "subsidiaries": [], "note": "No separate 10-K. Use META total + site WARN."},
"Instagram": {"name": "Instagram", "ticker": "META", "owner": "Meta Platforms", "role": "Subsidiary / Product", "subsidiaries": [], "note": "No separate 10-K. Use META total + site WARN + hiring flow."},
"Messenger": {"name": "Messenger", "ticker": "META", "owner": "Meta Platforms", "role": "Subsidiary / Product", "subsidiaries": [], "note": "Part of META Family of Apps."},
"WhatsApp": {"name": "WhatsApp", "ticker": "META", "owner": "Meta Platforms", "role": "Subsidiary / Product", "subsidiaries": [], "note": "Part of META. Historically small headcount, high revenue per employee."},
"Threads": {"name": "Threads", "ticker": "META", "owner": "Meta Platforms", "role": "Subsidiary / Product", "subsidiaries": [], "note": "Built inside Instagram org. Do not double count with Instagram."},
"Reality_Labs": {"name": "Reality Labs / Quest", "ticker": "META", "owner": "Meta Platforms", "role": "Segment", "subsidiaries": [], "note": "Segment loss is disclosed in META 10-K. Headcount is not, use WARN + LinkedIn."},
"SNAP": {
"name": "Snap Inc. - Snapchat",
"ticker": "SNAP",
"owner": "Snap Inc. / Evan Spiegel - NOT Zuckerberg / Meta",
"role": "Comparator - Peer, NOT owned",
"subsidiaries": ["Snapchat", "Spectacles"],
"note": "Include as comparator to test if pattern is Meta specific or tech wide. Do NOT aggregate into META total."
},
"Tencent_WeChat": {
"name": "Tencent / WeChat",
"ticker": "TCEHY",
"owner": "Tencent / Pony Ma - NOT Zuckerberg / Meta",
"role": "Comparator - Peer, NOT owned",
"subsidiaries": ["WeChat / Weixin", "QQ", "Tencent Games"],
"note": "Include as comparator. China WARN does not exist like US WARN, so coverage correction differs. Use annual report headcount + restructuring notes."
},
"PayPal": {
"name": "PayPal Holdings, Inc. - Template / Worked Example",
"ticker": "PYPL",
"owner": "Independent - NOT Zuckerberg / Meta",
"role": "Worked Example - Verified in prior analysis",
"subsidiaries": ["Venmo", "Braintree", "Xoom"],
"note": "Use as calibration case. All numbers below are from the prior verified deep dive."
}
}
# ------------------------------------------------------------------
# 2. INPUT TEMPLATE - Fill per company from primary sources only
# ------------------------------------------------------------------
# Never fill headcount from a headline. Fill from 10-K / annual report first, then WARN, then 10-Q charges.
DATA_TEMPLATE = {
"headcount_by_year": {}, # e.g. {2021: 30900, 2022: 29900, 2023: 27200, 2024: 24400, 2025: 23800}
"warn_by_year": {}, # e.g. {2023: 319, 2024: 311, 2026: 251} - California WARN only, site level
"restructuring_charges_m": {}, # e.g. {"1Q 2023 Plan": 122, "1Q 2024 Plan": 307}
"revenue_m": {}, # e.g. {2025: 33172}
"announced_roles": {}, # e.g. {2023: 2000, 2024: 2500} - mark if includes open roles
"announced_includes_open_roles": False,
"source_notes": []
}
# Worked example: PayPal, from verified analysis
PAYPAL_EXAMPLE = {
"headcount_by_year": {2020: 26500, 2021: 30900, 2022: 29900, 2023: 27200, 2024: 24400, 2025: 23800},
"warn_by_year": {2020: 56, 2021: 196, 2022: 142, 2023: 319, 2024: 311, 2026: 251},
"restructuring_charges_m": {"1Q 2023 Plan": 122, "1Q 2024 Plan": 307, "1Q 2025 Plan": 36, "2Q 2025 Plan 2025": 102, "Apr 2026 Reorg 9M": 61, "3Q 2026 Plan": 152},
"revenue_m": {2021: 25371, 2022: 27518, 2023: 29771, 2024: 31797, 2025: 33172},
"announced_roles": {2023: 2000, 2024: 2500},
"announced_includes_open_roles": True,
"source_notes": ["10-K headcount", "California WARN dataset", "10-Q restructuring charges", "Reuters India 220", "Globes Israel 70"]
}
# ------------------------------------------------------------------
# 3. METHOD 1 - Stock-flow identity / Checksum
# ------------------------------------------------------------------
def stock_flow_check(headcount_by_year: Dict[int, int], hires=None, voluntary=None, involuntary=None):
"""Headcount_t = Headcount_{t-1} + Hires - Voluntary - Involuntary
Returns net change and implied gross separations if hires known.
This is the checksum. If announced cuts do not reconcile to net change, the gap is hires / attrition / open roles."""
years = sorted(headcount_by_year)
out = []
for i in range(1, len(years)):
prev, cur = years[i-1], years[i]
net = headcount_by_year[cur] - headcount_by_year[prev]
pct = net / headcount_by_year[prev] * 100 if headcount_by_year[prev] else 0
out.append({"year": cur, "prev": headcount_by_year[prev], "cur": headcount_by_year[cur], "net_change": net, "pct_change": round(pct, 2)})
return out
def net_peak_to_latest(headcount_by_year: Dict[int, int]):
if not headcount_by_year:
return None
peak_year = max(headcount_by_year, key=lambda y: headcount_by_year[y])
latest_year = max(headcount_by_year)
net = headcount_by_year[latest_year] - headcount_by_year[peak_year]
pct = net / headcount_by_year[peak_year] * 100
return {"peak_year": peak_year, "peak": headcount_by_year[peak_year], "latest_year": latest_year, "latest": headcount_by_year[latest_year], "net": net, "pct": round(pct, 2)}
# ------------------------------------------------------------------
# 4. METHOD 2A - Coverage-corrected WARN
# ------------------------------------------------------------------
def coverage_corrected_warn(warn_observed: float, coverage_rate: float, coverage_low: float = None, coverage_high: float = None):
"""Estimated_global = WARN_observed / coverage_rate
coverage_rate = share of global cuts that would appear in the WARN dataset you have.
Example: California WARN is only a fraction of US cuts, and US is a fraction of global cuts.
Always return interval, never a point, because coverage is uncertain."""
if coverage_rate <= 0 or coverage_rate > 1:
raise ValueError("coverage_rate must be in (0,1]")
point = warn_observed / coverage_rate
if coverage_low and coverage_high:
# Low coverage implies higher true total, high coverage implies lower true total
lo = warn_observed / coverage_high
hi = warn_observed / coverage_low
return {"warn_observed": warn_observed, "coverage_point": coverage_rate, "point_estimate": round(point), "interval_low": round(lo), "interval_high": round(hi)}
return {"warn_observed": warn_observed, "coverage_point": coverage_rate, "point_estimate": round(point)}
# ------------------------------------------------------------------
# 5. METHOD 2B - Severance-implied headcount band
# ------------------------------------------------------------------
def severance_implied_band(severance_m: float, severance_per_person_low: float = 50000, severance_per_person_high: float = 120000):
"""Implied_heads = Severance / Severance_per_person
Returns band. Do NOT convert dollars to a point count, per-person cost varies by tenure, level, country."""
low_heads = (severance_m * 1_000_000) / severance_per_person_high
high_heads = (severance_m * 1_000_000) / severance_per_person_low
return {"severance_m": severance_m, "per_person_low": severance_per_person_low, "per_person_high": severance_per_person_high, "implied_low": round(low_heads), "implied_high": round(high_heads)}
# ------------------------------------------------------------------
# 6. METHOD 2C - Capture-recapture / Lincoln-Petersen
# ------------------------------------------------------------------
def capture_recapture(list_a: int, list_b: int, overlap: int):
"""Lincoln-Petersen: N = (A * B) / overlap, with Chapman correction.
Use for two independent lists, e.g. WARN names vs LinkedIn layoff posts.
If overlap is 0, estimator is undefined - that itself is a signal of non-independence or bad lists."""
if overlap <= 0:
return {"error": "overlap is 0, cannot estimate. Lists may be non-independent or disjoint by construction."}
n_lp = (list_a * list_b) / overlap
n_chapman = ((list_a + 1) * (list_b + 1) / (overlap + 1)) - 1
# Approx variance for Lincoln-Petersen
var = (list_a * list_b * (list_a - overlap) * (list_b - overlap)) / (overlap ** 3) if overlap > 0 else None
se = math.sqrt(var) if var else None
return {"list_a": list_a, "list_b": list_b, "overlap": overlap, "lincoln_petersen": round(n_lp), "chapman": round(n_chapman), "se_approx": round(se) if se else None}
# ------------------------------------------------------------------
# 7. METHOD 2D - Revenue per employee / Cost consistency check
# ------------------------------------------------------------------
def revenue_per_employee(revenue_m: Dict[int, float], headcount_by_year: Dict[int, int]):
out = []
for y in sorted(set(revenue_m) & set(headcount_by_year)):
rpe = (revenue_m[y] * 1_000_000) / headcount_by_year[y] if headcount_by_year[y] else None
out.append({"year": y, "revenue_m": revenue_m[y], "headcount": headcount_by_year[y], "revenue_per_employee": round(rpe) if rpe else None})
return out
# ------------------------------------------------------------------
# 8. METHOD 3 - Voyager FEC / Triangulation rule
# ------------------------------------------------------------------
def voyager_triangulation(signals: List[Dict]):
"""Require 3 independent signals to agree in direction before trusting a number.
signals: list of {source, direction: -1/0/1, value, independence: high/medium/low}
Returns triangulation score and verdict."""
independent = [s for s in signals if s.get("independence", "medium") in ("high", "medium")]
dirs = [s["direction"] for s in independent]
agree = len(set(dirs)) == 1 and len(dirs) >= 3
return {
"signals_count": len(signals),
"independent_count": len(independent),
"directions": dirs,
"triangulated": agree,
"verdict": "TRIANGULATED - direction confirmed, use interval for magnitude" if agree else "NOT TRIANGULATED - do not use point estimate, widen interval"
}
# ------------------------------------------------------------------
# 9. METHOD 4 - Monte Carlo for financial forecasting
# ------------------------------------------------------------------
def monte_carlo_forecast(n_sim: int = 10000, seed: int = 42,
severance_m_low: float = 120, severance_m_high: float = 180,
per_person_low: float = 50000, per_person_high: float = 120000,
backfill_rate_low: float = 0.15, backfill_rate_high: float = 0.45,
saving_per_head_low: float = 140000, saving_per_head_high: float = 220000):
"""Forecast distribution, not point. Inputs are ranges, output is distribution of net saving.
Net saving = gross saving from cuts - cost of backfill hiring - severance."""
random.seed(seed)
results = []
for _ in range(n_sim):
sev_m = random.uniform(severance_m_low, severance_m_high)
ppp = random.uniform(per_person_low, per_person_high)
gross_heads = (sev_m * 1_000_000) / ppp
backfill = random.uniform(backfill_rate_low, backfill_rate_high)
net_heads = gross_heads * (1 - backfill)
saving_per = random.uniform(saving_per_head_low, saving_per_head_high)
annual_saving_m = (net_heads * saving_per) / 1_000_000 - sev_m # first year net of severance, simplified
results.append({"gross_heads": gross_heads, "net_heads": net_heads, "annual_saving_m": annual_saving_m})
def pct(arr, p):
s = sorted(arr)
return s[int(len(s) * p / 100)]
gross = [r["gross_heads"] for r in results]
net = [r["net_heads"] for r in results]
sav = [r["annual_saving_m"] for r in results]
return {
"n_sim": n_sim,
"gross_heads_p10_p50_p90": [round(pct(gross, 10)), round(pct(gross, 50)), round(pct(gross, 90))],
"net_heads_p10_p50_p90": [round(pct(net, 10)), round(pct(net, 50)), round(pct(net, 90))],
"annual_saving_m_p10_p50_p90": [round(pct(sav, 10)), round(pct(sav, 50)), round(pct(sav, 90))],
"mean_annual_saving_m": round(statistics.mean(sav), 1)
}
# ------------------------------------------------------------------
# 10. AGGREGATE UMBRELLA - Pattern across tech
# ------------------------------------------------------------------
def aggregate_umbrella(company_data: Dict[str, Dict]):
"""Aggregate without double counting.
RULE: META subsidiaries must NOT be added to META total. SNAP and Tencent are comparators, not META.
Pattern metrics: median net pct change, correlation between layoff intensity and revenue per employee change."""
rows = []
for key, d in company_data.items():
hc = d.get("headcount_by_year", {})
if len(hc) >= 2:
peak = net_peak_to_latest(hc)
rpe = revenue_per_employee(d.get("revenue_m", {}), hc)
rows.append({"company": key, "peak_to_latest": peak, "revenue_per_employee_series": rpe})
# Do not sum subsidiaries into parent. Report separately and flag double-count risk.
return {"companies_analyzed": len(rows), "rows": rows, "warning": "Do NOT sum Facebook + Instagram + WhatsApp into META. META total already includes them. SNAP and Tencent are comparators only."}
# ------------------------------------------------------------------
# 11. RUN - Worked example + template
# ------------------------------------------------------------------
def run():
out = {
"license": "User retains all rights. Proprietary. See file header.",
"method": "Voyager no-ACK verification: stock-flow checksum + coverage-corrected WARN + severance band + capture-recapture + RPE check + Monte Carlo distribution",
"companies": COMPANIES,
"paypal_worked_example": {}
}
ex = PAYPAL_EXAMPLE
out["paypal_worked_example"]["stock_flow"] = stock_flow_check(ex["headcount_by_year"])
out["paypal_worked_example"]["peak_to_latest"] = net_peak_to_latest(ex["headcount_by_year"])
out["paypal_worked_example"]["revenue_per_employee"] = revenue_per_employee(ex["revenue_m"], ex["headcount_by_year"])
out["paypal_worked_example"]["severance_band_3Q2026_152M"] = severance_implied_band(152, 50000, 120000)
# Coverage example: 251 San Jose WARN, assume California WARN is 12% to 30% of global cuts for that tranche
out["paypal_worked_example"]["coverage_corrected_warn_251"] = coverage_corrected_warn(251, 0.20, 0.12, 0.30)
out["paypal_worked_example"]["capture_recapture_example"] = capture_recapture(250, 400, 80)
out["paypal_worked_example"]["voyager_triangulation_AugSep2026"] = voyager_triangulation([
{"source": "Reuters India 220", "direction": -1, "independence": "high"},
{"source": "Globes Israel 70", "direction": -1, "independence": "high"},
{"source": "California WARN 251", "direction": -1, "independence": "high"},
])
out["paypal_worked_example"]["monte_carlo"] = monte_carlo_forecast(n_sim=5000)
out["aggregate_template"] = aggregate_umbrella({"PayPal": PAYPAL_EXAMPLE})
out["next_steps"] = [
"Fill DATA_TEMPLATE per company from 10-K first, then WARN, then 10-Q charges. Never from headlines.",
"For META, fill META total once. Fill Facebook/Instagram/Threads as qualitative sensors, not additive headcount.",
"For SNAP and Tencent, fill as comparators with their own coverage rates. Tencent has no US WARN, so coverage correction must use annual report + local reporting.",
"Re-run after each 10-K. Keep v1, v2, v3 versioning like Voyager sequence numbers.",
"For financial forecasting, use monte_carlo p10/p50/p90, not a point."
]
print(json.dumps(out, indent=2))
with open("/mnt/data/forensic_results.json", "w") as f:
json.dump(out, f, indent=2)
return out
if __name__ == "__main__":
run()