new-site/scripts/gap_tracker.py
justin f8cd37ac8c Initial commit — Performance West telecom compliance platform
Includes: API (Express/TypeScript), Astro site, Python workers,
document generators, FCC compliance tools, Canada CRTC formation,
Ansible infrastructure, and deployment scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 06:54:22 -05:00

35 lines
1.2 KiB
Python

"""
gap_tracker.py — Log capability gaps: things people ask for that Performance West
doesn't yet offer. Monitors call log_gap() when they SKIP a post because we can't
fulfill the request. The gaps log is reviewed for service expansion decisions.
"""
import json
from pathlib import Path
from datetime import datetime, timezone
LOG_DIR = Path.home() / "logs"
GAPS_FILE = LOG_DIR / "capability-gaps.log"
def log_gap(platform: str, source_url: str, title: str, body: str, reason: str = ""):
"""
Log a capability gap.
Args:
platform: Monitor name (Reddit, Stack Exchange, dev.to)
source_url: URL of the post/question we're skipping
title: Title of the post
body: First 300 chars of post body
reason: Why we're skipping — what they need that we don't have
"""
LOG_DIR.mkdir(exist_ok=True)
entry = {
"ts": datetime.now(timezone.utc).isoformat(),
"platform": platform,
"url": source_url,
"title": title,
"body": body[:300],
"reason": reason,
}
with open(GAPS_FILE, "a") as f:
f.write(json.dumps(entry) + "\n")