Draft
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.
Summary
背景
共有インストラクション(
facets/instructions/*.md)内で{report:filename}を使うと、ピースごとにレポート名が異なる場合に破綻する。例:
review-test.mdが{report:test-plan.md}を参照しているが、default ピースではtest-scope.mdというレポート名を使う。現状の回避策として汎用記述(「Report Directory 内のレポートを参照」)に書き換えたが、これだとエージェントが関係ないファイルを見に行くリスクがある。
{report:filename}の明示的な契約(どのファイルに依存するか)を維持したまま、共有インストラクションの再利用性を両立させたい。提案
ピース YAML の movement に
varsフィールドを追加し、共有インストラクション内のプレースホルダーにピース固有の値をインジェクションする。ピース YAML 側
インストラクション側
展開の流れ
{test_report}→test-scope.md(vars によるインジェクション){report:test-scope.md}→${reportDir}/test-scope.md(既存の report 展開)処理順序
vars の展開を
{report:}の展開より先に実行する。これにより{report:{var}}のネストが自然に解決される。スコープ
varsはRecord<string, string>型(キー・値ともに文字列){key}(既存の予約語task,iteration,previous_response等と衝突しないよう、vars の展開は予約語チェック後に行う)instruction_template内でもinstructionファイル内でも使用可能関連ファイル
src/core/piece/instruction/escape.ts—replaceTemplatePlaceholders()src/core/models/schemas.ts—PieceMovementSchemasrc/infra/config/loaders/pieceParser.ts— YAML パースExecution Report
Piece
defaultcompleted successfully.Closes #381