Skip to content

[dev] Add justfile and devcontainer for reproducible development tasks #28

Description

@Kewton

背景 / 目的

開発者向けの定型タスク(テスト・PTYテスト・corpus回帰・eval・ベンチ)がREADMEやCI定義に散在しており、コントリビュータが「何をどう実行すべきか」を毎回探す必要がある。justfile(タスクランナー定義)とdevcontainer(再現可能な開発環境)を整備する。

現状

  • Makefile / justfile 無し。定型コマンドは .github/workflows/ci.yml と README にのみ存在。
  • CIで実行されるもの: cargo test --all-targets(RUSTFLAGS="-D warnings")、cargo test --test corpus_regression--test generality_guardrails--test conformance、Python 3.10 での evalゴールデンテスト(python3 -m unittest tests/eval/test_*.py)。
  • ローカル限定のテスト: ANVIL_PTY_TESTS=1 cargo test --test tui_pty、live provider テスト(ANVIL_LIVE_PROVIDER_TESTStests/live_provider.rs)。
  • eval/ベンチ: scripts/bench.shscripts/eval-run.py ほか(Python 3 必要)。
  • Dockerfile / devcontainer 無し。

要求仕様(受け入れ基準)

1. justfile

  • ルートに justfile を新設し、最低限以下のレシピを定義する(CIと同一のコマンド・フラグにすること。乖離させない):
    • build / build-release
    • test(= RUSTFLAGS="-D warnings" cargo test --all-targets)
    • test-corpus / test-guardrails / test-conformance(CIの各ステップと同一)
    • test-pty(= ANVIL_PTY_TESTS=1 cargo test --test tui_pty)
    • test-eval(= CIのpython unittest 3本)
    • ci(上記CI相当を一括実行)
    • bench(scripts/bench.sh への薄いラッパー、引数透過)
    • run(開発用の代表的な起動例。モデル等は環境変数で上書き可能に)
  • just --list の説明文(# comment)を全レシピに付ける
  • just 未導入者のために、CONTRIBUTING(または README のDevelopment節)へ導入1行と「justはオプション、生コマンドはCI定義参照」の注記を追加

2. devcontainer

  • .devcontainer/devcontainer.json(+必要なら Dockerfile)を新設: Rust(Cargo.toml の rust-version 以上のstable)、Node.js LTS(インタラクションプローブ用)、Python 3.10+(eval用)、justshellcheck を含む
  • コンテナ内で just ci が通ること(corpus・conformance含む。ネットワーク不要のテストのみで完結することを確認)
  • Ollamaはコンテナに含めない。ホスト側Ollamaへの接続方法(--ollama-host http://host.docker.internal:11434 等)をdevcontainer READMEコメントに記載
  • イメージサイズと初回ビルド時間を常識的な範囲に(公式イメージ+featuresの組み合わせを優先し、カスタムDockerfileは必要時のみ)

実装ガイド

  • justfileのレシピはCI定義からのコピペで開始し、将来CIをjustfile呼び出しに寄せるかは本Issueでは判断しない(コメントで両案併記可)。
  • devcontainerはGitHub Codespacesでも動く標準構成にする。

テスト / 検証

  • ローカルで just ci がCIと同じ結果になること
  • devcontainer(またはCodespaces)で just ci 通過をスクリーンショット/ログでPRに添付
  • cargo test --quiet 全通過(リポジトリのRustコードに変更が無いこと)

スコープ外

  • CI定義自体の再構成 / リリースワークフロー(配布Issue)/ Ollamaを含むフル環境のコンテナ化

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions