Merged
Conversation
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.
概要
EPIC #62(Harness Engineering)の子Issue
#56 #57 #58 #59 #60 #61を、CLIの運用安全性・再現性・契約検証性を中心に一括実装しました。この変更により、
ableton-cliは以下を機械的に保証できるようになります。--read-onlyで破壊的コマンドを強制ブロックするsession diffと--compactでエージェント文脈量を削減するユーザー影響(何が改善されるか)
日常利用者・自動化利用者の双方で、失敗が「曖昧に通る」ケースを減らし、失敗時の理由が安定コードで判定可能になります。
特にエージェント運用では、破壊的操作の事故回避、巨大レスポンス圧縮、再現可能テストの導入により、運用の信頼性が上がります。
根本原因
これまでの実装は、機能はあっても次の外骨格が不足していました。
実装内容(要点)
1. 契約検証(#56)
src/ableton_cli/contracts/を新設runtime.execute_command()成功時に契約検証を実行ping,doctor,song info,tracks list,session diff)を対象化PROTOCOL_INVALID_RESPONSE+ ExitCode 13 で失敗2. Record/Replay(#57)
RecordingTransport/ReplayTransportを追加--record/--replayを追加name + argsで照合し、ミスマッチは明示失敗3. Read-only(#58)
--read-onlyを追加READ_ONLY_VIOLATION(exit 20)を追加4. Batch拡張(#59)
batch run/streamの入力仕様を拡張preflight: protocol/hash/required commands の先頭検証retry: 指定エラーコードのみ再試行assert: previous/current 結果の条件検証BATCH_PREFLIGHT_FAILEDBATCH_ASSERT_FAILEDBATCH_RETRY_EXHAUSTED5. session diff / compact(#61)
session diff --from <snapshot.json> --to <snapshot.json>を追加--compactを追加6. docs生成と差分ゲート(#60)
src/ableton_cli/actions.pyを単一ソース化tools/generate_skill_docs.pyを追加skills/ableton-cli/SKILL.md,docs/skills/skill-actions.mdgit diff --exit-code)dev_checksにtools/generate_skill_docs.py --checkを追加主な追加/変更ファイル
src/ableton_cli/contracts/*src/ableton_cli/client/transport.pysrc/ableton_cli/client/_client_core.pysrc/ableton_cli/commands/batch.pysrc/ableton_cli/commands/session.pysrc/ableton_cli/session_diff.pysrc/ableton_cli/compact.pysrc/ableton_cli/actions.pytools/generate_skill_docs.py.github/workflows/ci.yml検証
ローカルで以下を実行し、すべて通過しています。
uv run python -m ableton_cli.dev_checksuv run ruff check .uv run ruff format --check .uv run pytest(481 passed)補足
今回の変更は「フォールバックなし・後方互換維持なし」の方針で実装しています。曖昧な救済経路は追加せず、条件不一致時は明示的に失敗させる設計です。
Closes #56
Closes #57
Closes #58
Closes #59
Closes #60
Closes #61
Closes #62