## 背景 MVP の主要インターフェースとして CLI から compile を実行できるようにする。 ## 想定 UX ```bash texrun compile main.tex ``` 機械利用向けに JSON 出力も提供する。 ```bash texrun compile --json main.tex ``` ## 初期オプション候補 - `--json` - `--output <dir>` - `--timeout <duration>` - `--keep-workspace`(必要なら hidden/experimental でもよい) - `--root <dir>`(入力として workspace にコピーする範囲。既定は entrypoint のディレクトリ。#4 と合わせて決める) `--output` 未指定時の出力先(例: カレントディレクトリ / entrypoint 隣 / `texrun-out/`)と、既存ファイルを上書きするかどうかを決める。 engine 指定は将来追加できる設計にしつつ、MVP では TeX Live を default としてよい。 ## 出力方針 human-readable mode: - 成否 - 生成 PDF - 主要な warning/error - 実行時間 JSON mode: - `CompileResult` を基にした安定した構造 - stdout に JSON 以外を混ぜない - 人間向けログは stderr に分離する ## Exit code 少なくとも以下を区別する。案: | code | 意味 | | --- | --- | | 0 | success | | 1 | document compile failure(diagnostics あり) | | 2 | CLI usage error(clap の既定と一致) | | 3 | texrun runtime / configuration failure(latexmk 不在など) | | 4 | timeout | timeout を compile failure と同じ code にするかは #3 の outcome 設計に合わせて決める。 `--json` の場合、runtime failure 時も可能な限り JSON(error オブジェクト)を stdout に出力し、呼び出し側が exit code と JSON の両方で判定できるようにする。 ## 完了条件 - `texrun compile main.tex` で PDF を生成できる - `--json` の出力を他プロセスから parse できる - compile failure 時にも diagnostics を確認できる - `texrun --help` / `texrun compile --help` が分かりやすい - exit code の定義がドキュメント化されている - CLI の振る舞い(help / exit code / JSON 形状)を検証するテストがある(`assert_cmd` や snapshot test など) ## 依存 - #3, #4, #5(diagnostics 表示は #7、preview 出力は #8 の完了後に拡張する)
Activity
chore: bootstrap Rust workspace and toolchain (#16)
docs: add initial README (#18)
feat(core): define compile domain model and engine interface (#20)
feat(workspace): add isolated compile workspaces (#21)
feat(diagnostics): parse LaTeX logs into structured diagnostics (#23)
nishide-dev commentedon Sep 30, 2026
PR #29(#28)レビューからの申し送り: workspace 自体の置き換えを collect 時に検出した場合も現状は
ArtifactNotFileになる。exit code / JSON の error code に対応付ける際、WorkspaceChanged相当に分離するか検討する。feat(texlive): add latexmk engine (#30)
feat(preview): render PDF pages to PNG previews (#31)
test: add TeX Live integration fixtures and CI job (#33)
feat(workspace): exclude nested output directories by path (#38)
chore(ci): generate release notes from conventional commits (#62)