Skip to main content
Let’s assemble those parts into something complete and genuinely useful: a tiny log triage CLI that reads log lines from standard input, classifies each, prints a colored severity, tallies the counts, and — importantly for automation — exits non-zero if anything critical was seen, so it can gate a pipeline.
Notice what we built: a deterministic shell (argument handling, timeouts, tallying, exit codes, a CI contract) wrapped around a swappable classification core. Swap mockLLMClassifier{} for ruleClassifier{} and the program still runs — just less cleverly. In later Chapters we will add a third implementation that calls a real model, and main will not change by a single line. That is the architecture of every reliable AI system in this docs, in miniature.
Last modified on June 8, 2026