skills/ops/import-conversation-logs/SKILL.md
# import-conversation-logs **Lane:** ops **Version:** 0.1.0 **Owner:** system **Schedule:** 23:28 PT daily ## Purpose Ingest conversations from multiple AI chat platforms into the unified `messages_v2` table. This is the foundation of the memory pipeline - all other skills depend on this data. ## Sources | Platform | Inbox Path | Format | |----------|-----------|--------| | ChatGPT | `/cosmocrat/inbox/raw/chatgpt/` | OpenAI export JSON | | Claude | `/cosmocrat/inbox/raw/claude/` | Ant
npx skillsauth add orionarchitekton/cosmocrat-core skills/ops/import-conversation-logsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Lane: ops
Version: 0.1.0
Owner: system
Schedule: 23:28 PT daily
Ingest conversations from multiple AI chat platforms into the unified messages_v2 table. This is the foundation of the memory pipeline - all other skills depend on this data.
| Platform | Inbox Path | Format |
|----------|-----------|--------|
| ChatGPT | /cosmocrat/inbox/raw/chatgpt/ | OpenAI export JSON |
| Claude | /cosmocrat/inbox/raw/claude/ | Anthropic export JSON |
| Gemini | /cosmocrat/inbox/raw/gemini/ | Google export JSON |
| Cursor | /cosmocrat/inbox/raw/cursor/ | SQLite global_state.vscdb |
| Codex | /cosmocrat/inbox/raw/codex/ | JSON files |
| Grok | /cosmocrat/inbox/raw/grok/ | JSON files |
| Type | Table | Retention | Description |
|------|-------|-----------|-------------|
| conversation_message | messages_v2 | permanent | All chat messages |
| conversation_topic | conversation_topics | permanent | Extracted topics |
service_only - All writes go through MemoryClient. No direct ClickHouse access.
redactcontentapp/tools/pii_utils.py for redactionEvery ingested message includes:
| Field | Source | Example |
|-------|--------|---------|
| run_id | Generated | ingest_2025-12-22_a1b2c3d4 |
| trace_id | Langfuse or run_id | trace_xyz789 |
| source_ref | Platform:path | chatgpt:/cosmocrat/inbox/raw/chatgpt/web/2025-12-22/export.json |
| actor | Fixed | import-conversation-logs |
| intent | Optional | daily_conversation_ingest |
multi-source-collector (23:22 PT)
↓
inbox files
↓
import-conversation-logs (23:28 PT) ← YOU ARE HERE
↓
messages_v2 table
↓
conversation-exporter (23:35 PT)
↓
executive-daily-report (00:02 PT)
File: app/services/mcp/jobs/ingest/daily_ingest_runner.py
main() - Entry point, orchestrates all sourcesprocess_inbox_source() - Per-source processingcheck_routing_mismatches() - Signature validationarchive_processed_files() - Post-processing cleanupfrom app.services.memory import MemoryClient, MemoryRecord, Provenance
memory = MemoryClient()
provenance = Provenance(
run_id=f"ingest_{date}_{uuid4().hex[:8]}",
trace_id=os.environ.get("LANGFUSE_TRACE_ID", ""),
source_ref=f"{source_name}:{inbox_path}",
actor="import-conversation-logs"
)
records = [
MemoryRecord(
lane="ops",
type="conversation_message",
namespace="cosmocrat",
content=row,
metadata={"source": source_name}
)
for row in rows
]
results = memory.upsert_mem_batch(records, provenance, pii_mode="redact")
| Error | Action | Alert | |-------|--------|-------| | Empty inbox | Log warning, continue | No | | Source processor error | Log error, continue to next source | Slack summary | | Insert batch failure | Retry once, log partial results | Slack summary | | Routing mismatch | Quarantine file, log warning | Slack if >5 files |
/cosmocrat/quarantine/| Variable | Required | Description |
|----------|----------|-------------|
| CLICKHOUSE_URL | Yes | ClickHouse HTTP endpoint |
| CLICKHOUSE_USER | Yes | ClickHouse username |
| CLICKHOUSE_PASSWORD | Yes | ClickHouse password |
| INBOX_ROOT | No | Default: /cosmocrat/inbox/raw |
| ARCHIVE_ROOT | No | Default: /cosmocrat/conversation_archive |
| LANGFUSE_TRACE_ID | No | For observability linking |
| COSMO_NOTIFY_SLACK | No | Default: true |
# Run locally
python -m app.services.mcp.jobs.ingest.daily_ingest_runner
# With backfill
python -m app.services.mcp.jobs.ingest.daily_ingest_runner --backfill-days 7
# Integration tests
pytest tests/skills/test_import_conversation_logs.py -v
| Metric | Type | Description |
|--------|------|-------------|
| ingest.conversation.duration_ms | Gauge | Total run time |
| ingest.conversation.messages_count | Counter | Messages ingested |
| ingest.conversation.sources_processed | Counter | Sources with data |
| ingest.conversation.files_processed | Counter | Files processed |
| ingest.conversation.errors_count | Counter | Errors encountered |
| ingest.conversation.quarantined_count | Counter | Files quarantined |
tools
# tiktok-overnight-pipeline **Lane:** tbm **Version:** 0.1.0 **Owner:** system **Schedule:** 0 1 * * * ## Purpose Complete overnight pipeline for 3-channel TikTok content generation. Generates 9 videos (3 per channel) with TikTok Shop affiliate products. Timeline: 01:00 - 06:10 PT with GPU management (Llama on/off cycles). ## Memory Contract ### Access Mode **`service_only`** - All writes go through MemoryClient. No direct ClickHouse access. ### Writes None - read-only skill ## Pr
tools
# tiktok-health-monitor **Lane:** tbm **Version:** 0.1.0 **Owner:** system **Schedule:** 24 * * * * ## Purpose Hourly health check for TikTok Auto-Gen pipeline. Monitors video generation, QC pass rates, upload success. Alerts to Slack #tiktok-autogen on issues. ## Memory Contract ### Access Mode **`service_only`** - All writes go through MemoryClient. No direct ClickHouse access. ### Writes None - read-only skill ## Provenance Every write includes: | Field | Source | |-------|--
tools
# tbm-supabase-sync **Lane:** tbm **Version:** 0.1.0 **Owner:** system **Schedule:** 12 * * * * ## Purpose Push the latest TikTok readings from ClickHouse into the Supabase tiktok_posts table so tarotbymarie.com shows new content. ## Memory Contract ### Access Mode **`service_only`** - All writes go through MemoryClient. No direct ClickHouse access. ### Writes None - read-only skill ## Provenance Every write includes: | Field | Source | |-------|--------| | `run_id` | Generated
tools
# tbm-reading-sync **Lane:** tbm **Version:** 0.1.0 **Owner:** system **Schedule:** 30 22 * * * ## Purpose Daily sync of tiktok_transcripts to tbm_readings. Uses rule-based extraction for cards, themes, and spread type. Runs after backfill has completed for the day. ## Memory Contract ### Access Mode **`service_only`** - All writes go through MemoryClient. No direct ClickHouse access. ### Writes None - read-only skill ## Provenance Every write includes: | Field | Source | |-----