NAME
App::karr::Foundation::Runner - karr-foundation command execution — fork/pipe/select tee + error classification
VERSION
version 0.500
DESCRIPTION
App::karr::Foundation::Runner runs a single agent command for App::karr::Foundation. It forks the command under /bin/sh -c, reads its combined stdout/stderr over a native pipe, and tees each chunk to the persistent .karr.log, the terminal (when streaming), and an in-memory buffer used for error scanning, enforcing the per-run max_runtime timeout. It also classifies observable common errors (rate limit, auth, network, 5xx, ...) in that buffer: a symptom word counts only next to a failure word on the same line, or inside a phrase an API really emits, and an HTTP status only where something adjacent marks it as one. The drain asks at all only for a run that made no progress -- see App::karr::Foundation's "Drain semantics". A weak back-reference to the owning foundation supplies shared options and helpers (dry_run, _stream_to_terminal, _prompt_for, _append_log, _say_verbose).
The command is a shell template, not a string karr rewrites: PROMPT, KARR_REPO and KARR_ROLE are exported into the child's environment and /bin/sh expands them like any other parameter. A prompt's own backticks therefore stay text, and awk '{print $2}' reaches awk intact.
A .karr.log it cannot open ends the run for that board before the command is started, never after: the agent is refused rather than launched unwatched. Once the fork has happened the parent owes it a waitpid, so nothing between the two may throw.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/karr/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.