> Archived status: this project is dead in the water for now and retained for reference.

# Runbook: YouTube Voice Capture Ingest MVP

## Purpose

Process Android voice recordings uploaded to Nextcloud into safe staging transcripts/Markdown without writing to the live Obsidian vault.

## Current Server Setup

- Host: `nextcloud` / `192.168.0.110`
- SSH user: `piagent`
- Nextcloud user: `piagent`
- Shared with: `deeso`
- Capture folder in Nextcloud Files:

```text
YouTube Voice Captures/
```

## Server Paths

```text
/opt/youtube-capture-ingest/youtube_capture_ingest.py
/etc/youtube-capture-ingest/config.json
/etc/systemd/system/youtube-capture-ingest.service
/etc/systemd/system/youtube-capture-ingest.timer
/var/lib/youtube-capture-ingest/
  raw-audio/
  transcripts/
  records/
  notes-staging/
    daily/
  models/
  state.json
/var/log/youtube-capture-ingest/
```

The service reuses the existing `/etc/nextcloud-talk-assistant/env` app password and `/opt/nextcloud-talk-assistant/venv` Python environment.

## Operation

The systemd timer runs hourly:

```sh
sudo systemctl status youtube-capture-ingest.timer
sudo systemctl list-timers youtube-capture-ingest.timer
```

Manual run:

```sh
sudo systemctl start youtube-capture-ingest.service
sudo journalctl -u youtube-capture-ingest.service -n 50 --no-pager
```

## Output

For each new audio file, the ingest process writes:

- copied raw audio in `raw-audio/`
- Whisper transcript in `transcripts/`
- JSON processing record in `records/`
- Markdown staging note in `notes-staging/`
- regenerated daily YouTube staging notes in `notes-staging/daily/`

It deduplicates exact source files by SHA-256 checksum. Repeated watches/captures are still valid if they produce different source files. Daily notes hide accidental duplicate processing artifacts but preserve distinct recordings.

## Safety Rules

- This MVP does **not** write to the live Obsidian vault.
- Generated Markdown stays in staging.
- Raw audio and transcripts are preserved for audit/review.
- Existing user notes must not be edited by automation without explicit approval.

## Rollback

Disable scheduled ingestion:

```sh
sudo systemctl disable --now youtube-capture-ingest.timer
```

Remove service files if needed:

```sh
sudo rm -f /etc/systemd/system/youtube-capture-ingest.service \
  /etc/systemd/system/youtube-capture-ingest.timer
sudo systemctl daemon-reload
```

Preserve `/var/lib/youtube-capture-ingest/` unless the user explicitly confirms deletion, because it contains raw captures/transcripts/staging records.
