# 020 — File input for ingestion, with restart-safe tailing ## Summary `ingest.rs` only reads stdin today. The wishlist asks for an optional file path as an alternative input source, plus resilience to the log file being recreated (e.g. the host process being tailed restarts and truncates/recreates its log file) — ottyl should keep tailing rather than treating that as EOF-and-done. ## Scope - New `clap` arg (e.g. `--file `), mutually exclusive-in-spirit with stdin: when given, ingest reads from the file instead of stdin; when absent, behavior is unchanged (stdin, as today). - File-mode ingestion must behave like `tail -f`: keep reading as new lines are appended, don't exit on reaching current EOF. - Detect file recreation (the common "log rotated / process restarted and reopened the path" case) — e.g. by tracking the inode/file id and re-opening when it changes, or noticing truncation (current read offset > file size) — and resume tailing the new file from its start rather than exiting or getting stuck. - Sequence numbers continue incrementing across a recreation event (per `IndexKey::IngestedLog`, sequence is ottyl's own line counter, not tied to the source file). - Reuse the existing `IngestedLine` / `EngineMessage::Ingest` plumbing — this only changes where lines come from, not how they're indexed. ## Acceptance criteria - `ottyl --file some.log` ingests existing content and then picks up appended lines live. - Deleting and recreating the file at the same path (simulating a host restart) does not kill ottyl or stop ingestion — new content from the recreated file continues to be ingested. - Running with no `--file` is unchanged: stdin ingestion as today. ## Depends on None — parallels the existing `ingest::run`, doesn't require any of the metrics/ filter machinery.