feat: report_writer — LaTeX report generation (compile_document tool + skill + sub-agent)#100
Merged
Merged
Conversation
Runs latexmk/pdflatex as a guarded subprocess (no shell-escape, timeout, scoped dir) behind _run/_which seams; structured result. Host TeX engine, detect-and-instruct. Claude-Session: https://claude.ai/code/session_01SwkKXQpy3JLEqrPkQA8QRv
…ate forced engine - Catch FileNotFoundError/OSError from _run alongside TimeoutExpired - Wrap mkdir+copy2 PDF delivery in try/except OSError; return pdf_path to build dir - _detect_engine: reject engine not in _ENGINES even if _which finds it - TDD: 3 new tests (RED→GREEN) in test_document_compile.py; 10 passing total Claude-Session: https://claude.ai/code/session_01SwkKXQpy3JLEqrPkQA8QRv
… package) Add tests/examples/conftest.py to enable ADK's SNAKE_CASE_SKILL_NAME feature flag (required in ADK >= 1.36 for underscore skill names). Claude-Session: https://claude.ai/code/session_01SwkKXQpy3JLEqrPkQA8QRv
…ault; drop experimental snake-case flag) Claude-Session: https://claude.ai/code/session_01SwkKXQpy3JLEqrPkQA8QRv
… skill) Adds report_writer leaf (write_file/read_file/glob/compile_document + skill), coordinator delegation, and default skills_dirs. No sandbox_execute on it. Claude-Session: https://claude.ai/code/session_01SwkKXQpy3JLEqrPkQA8QRv
…ape claim to pdflatex; log-read never-raise; kebab prompt prose Claude-Session: https://claude.ai/code/session_01SwkKXQpy3JLEqrPkQA8QRv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds LaTeX analysis-report generation to the framework +
research_demo, validating the framework's Agent-Skills support with a real package:compile_document(framework tool,src/agentic_cli/tools/document/) — compiles a.texto PDF via a host TeX engine (latexmk/pdflatex) as a guarded subprocess: never passes-shell-escape, a wall-clock timeout that kills the whole process group (so a runawaypdflatexgrandchild can't outlive it), a scoped build dir. Returns a structured dict and never raises. Host-based provisioning (detect-and-instruct; no bundled distro). Built behind_run/_whichseams so the logic is fully unit-tested offline; a real-engine compile test is gated on a TeX install (-m latex,LATEX_REQUIRE=1to fail-loud).report-writerAgent-Skill (examples/research_demo/skills/report-writer/) — knowledge-only (no runnable scripts): a SKILL.md with the report structure, compile steps, and error-recovery loop, plus a base-package LaTeX template.report_writersub-agent — wired into theresearch_democoordinator. Holds[write_file, read_file, glob, compile_document, ask_clarification]— notsandbox_execute(capability separation: it can compile documents, not run arbitrary code). Its prompt is a settings-reading callable, so artifacts/build paths follow the configured workspace.Design notes
data_analyst's figures reachreport_writervia the host artifacts dir (existing sandbox copy-out); there is no LaTeX in any Docker image. The compiler is hostlatexmk/pdflatex, not tectonic — the docker sandbox is hard network-isolated, which tectonic's on-demand package fetch can't tolerate.report-writer(ADK 1.36 rejects underscore skill names by default); the agent staysreport_writer(snake, likedata_analyst).Testing
compile_documentunit tests (never-raise on run/copy/timeout, forced-engine validation, and a process-group group-kill mechanism test), 3 skill-resolution tests, 3 sub-agent wiring tests (including assertingsandbox_executeis absent).report.pdfin the artifacts dir with no.aux/.loglitter. An automated-m llm+latexversion is documented for a follow-on.Review
Executed via subagent-driven development: each task was TDD-implemented → spec + code-quality reviewed → fixed. The whole-branch review (on opus) returned "With fixes"; both Important findings were applied — the process-group timeout kill, and honestly scoping the "shell-escape disabled" claim to the pdflatex path (documenting that
latexmkreads.latexmkrc, i.e. arbitrary Perl, from the build dir/home).Documented deferrals
latexmk.latexmkrccode-exec vector (hardening for untrusted.tex).https://claude.ai/code/session_01SwkKXQpy3JLEqrPkQA8QRv