diff --git a/.github/Guidelines/Building.md b/.github/Guidelines/Building.md index e229691f..56e305f9 100644 --- a/.github/Guidelines/Building.md +++ b/.github/Guidelines/Building.md @@ -32,3 +32,4 @@ cd SOLUTION-ROOT - "Build succeeded." - "0 Warning(s)" - "0 Error(s)" +- DO NOT delete the log file by yourself unless explicitly required. diff --git a/.github/Guidelines/Running-UnitTest.md b/.github/Guidelines/Running-UnitTest.md index 26f09d62..63e95b4e 100644 --- a/.github/Guidelines/Running-UnitTest.md +++ b/.github/Guidelines/Running-UnitTest.md @@ -54,3 +54,4 @@ Ignore `LocalDebuggerCommandArgumentsHistory` in `*.vcxproj.user`. - When all test cases pass, the last several lines of `Execute.log` should be in the following pattern; otherwise it crashed at the last shown test case: - "Passed test files: X/X" - "Passed test cases: Y/Y" +- DO NOT delete the log file by yourself unless explicitly required. diff --git a/.github/Scripts/copilotBuild.ps1 b/.github/Scripts/copilotBuild.ps1 index f59009da..3e4e946b 100644 --- a/.github/Scripts/copilotBuild.ps1 +++ b/.github/Scripts/copilotBuild.ps1 @@ -7,7 +7,7 @@ Remove-Item -Path $logFile, $logFileUnfinished -Force -ErrorAction SilentlyConti # Find the solution folder by looking for *.sln files $solutionFolder = GetSolutionDir -$solutionFile = "$solutionFolder\$((Get-ChildItem -Path $solutionFolder -Filter "*.sln" -ErrorAction SilentlyContinue)[0])" +$solutionFile = "$solutionFolder\$((Get-ChildItem -Path $solutionFolder -Filter "*.sln" -ErrorAction SilentlyContinue)[0].Name)" $vsdevcmd = $env:VLPP_VSDEVCMD_PATH if ($vsdevcmd -eq $null) { diff --git a/.github/Scripts/copilotPrepareReview.ps1 b/.github/Scripts/copilotPrepareReview.ps1 new file mode 100644 index 00000000..20243391 --- /dev/null +++ b/.github/Scripts/copilotPrepareReview.ps1 @@ -0,0 +1,12 @@ +# Prepare Copilot review files + +$taskLogsDir = "$PSScriptRoot\..\TaskLogs" + +# Delete all Copilot_Review_Finished_*.md files +Remove-Item -Path "$taskLogsDir\Copilot_Review_Finished_*.md" -Force -ErrorAction SilentlyContinue + +# Rename all Copilot_Review_Writing_*.md files to Copilot_Review_Finished_*.md +Get-ChildItem -Path "$taskLogsDir\Copilot_Review_Writing_*.md" -ErrorAction SilentlyContinue | ForEach-Object { + $newName = $_.Name -replace '^Copilot_Review_Writing_', 'Copilot_Review_Finished_' + Rename-Item -Path $_.FullName -NewName $newName +} diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d53f988b..24b07553 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -81,6 +81,7 @@ If you need to find any document for the current working task, they are in the ` If you need to find any script or log files, they are in the `REPO-ROOT/.github/Scripts` folder: - `copilotPrepare.ps1` +- `copilotPrepareReview.ps1` - `copilotBuild.ps1` - `copilotExecute.ps1` - `copilotDebug_Start.ps1` diff --git a/.github/prompts/review.prompt.md b/.github/prompts/review.prompt.md index 0c1857e0..d019764a 100644 --- a/.github/prompts/review.prompt.md +++ b/.github/prompts/review.prompt.md @@ -6,22 +6,28 @@ ## Goal and Constraints -- Your goal is to review a document as one member of a 4-model review panel. +- Your goal is to review a document as one member of a review panel. - The `KnowledgeBase` and `Learning` folders mentioned in this document are in `REPO-ROOT/.github/`. - The mentioned `Copilot_Review.md` and `Copilot_Review_*_*.md` files are in `REPO-ROOT/.github/TaskLogs/`. - Each model writes its review to a separate file. - When you are asked to create a `Copilot_Review_*_*.md`, You are only allowed to create your own review file. -- Each round of review should consider knowledges from the knowledge base. -- Each round of review should consider learnings from `KnowledgeBase/Learning.md`, `KnowledgeBase/Learning.md`, `Learning/Learning_Coding.md`, and `Learning/Learning_Testing.md` if they exist. +- Document review should consider knowledges from the knowledge base. +- Document review should consider learnings from `KnowledgeBase/Learning.md`, `KnowledgeBase/Learning.md`, `Learning/Learning_Coding.md`, and `Learning/Learning_Testing.md` if they exist. -## Identify Yourself +## Identify the Review Board Team -- You are one of the 4 models in the review panel. Identify yourself: - - If you are GPT, your file name fragment is `GPT`. - - If you are Claude (Opus), your file name fragment is `Opus`. - - If you are Grok, your file name fragment is `Grok`. - - If you are Gemini, your file name fragment is `Gemini`. -- Use your file name fragment in all file operations below. +- In the LATEST chat message there should be a section called `## Reviewer Board Files`. +- Model and their file name fragment is bullet-listed in this format: + - `{ModelName} -> Copilot_Review_{Finished|Writing}_{FileNameFragment}.md`. +- If you cannot find this section, stops immediately. + +## Copilot_Review_*_*.md Structure + +- `# Review Target: {TargetDocumentName}` +- `## Opinion`: Your opinion to the target document. +- `## Replies` + - `### AGREE with {ModelName}` without content. + - `### DISAGREE with {ModelName}`: your opinion to other models' opinion or replying to you in the PREVIOUS ROUND. ## Step 1. Identify the Target Document to Review @@ -29,44 +35,44 @@ - `# Scrum`: review `Copilot_Scrum.md`, begins from `# TASKS` until the end, focus only on unfinished tasks (those marked `- [ ]` instead of `- [*]`). - `# Design`: review `Copilot_Task.md`, begins from `# INSIGHTS AND REASONING` until the end. - `# Plan`: review `Copilot_Planning.md`, begins from `# EXECUTION PLAN` until the end. - - `# Execution`: review `Copilot_Execution.md`, begins from `# EXECUTION PLAN` until the end. + - `# Summary`: review `Copilot_Execution.md`, begins from `# EXECUTION PLAN` until the end. - `# Final`: skip all remaining steps and go to the `Final Review` section. - `# Apply`: skip all remaining steps and go to the `Apply Review` section. - If there is nothing: it means you are accidentally stopped. Please continue your work. -## Step 2. Determine the Current Round Index +## Step 2. Identify Documents from the Review Board -- Look for your own `Copilot_Review_PREVIOUSINDEX_{YourFileNameFragment}.md` file. - - If it exists, the current round index is biggest `PREVIOUSINDEX` + 1. - - If none exists, the current round index is `1`. -- If the current round index is greater that 1, here are a list of review files from the previous round: - - `Copilot_Review_PREVIOUSINDEX_GPT.md` - - `Copilot_Review_PREVIOUSINDEX_Opus.md` - - `Copilot_Review_PREVIOUSINDEX_Grok.md` - - `Copilot_Review_PREVIOUSINDEX_Gemini.md` +- You are one of the models in the review board. `YourFileNameFragment` is your own file name fragment in all file operations below. +- All reviews from the PREVIOUS ROUND should be `Copilot_Review_Finished_{FileNameFragment}.md`. +- You are going to write `Copilot_Review_Writing_{FileNameFragment}.md` in the CURRENT ROUND. ## Step 3. Read Context - Read the target document identified in Step 1. - For `Copilot_Scrum.md`, focus only on unfinished tasks. -- If the current round index is greater than `1`, read all review files from the previous round to collect other models' opinions. +- Read all `Reviewer Board Files` except yours from the PREVIOUS ROUND to collect other models' opinions: + - If you can't find a file from the previous model, you need to disagree with that model and explain that you cannot find their review file. - Their opinion of the review. - Their replies to you. ## Step 4. Write Your Review -- Create file: `Copilot_Review_{RoundIndex}_{YourFileNameFragment}.md` +- Create a new file: `Copilot_Review_Writing_{FileNameFragment}.md` + - If this file already exists, it means you have already completed the review, stops. - You need to consolidate all information from Step 3. - Find what inspires you, what you agree with, and what you disagree with. - Complete the document following the format: - `# Review Target: {TargetDocumentName}`: the name of the document you are reviewing. - `## Opinion`: - Your complete summarized feedback and suggestions for the target document. - - You should not omit anything what is in any documents in the previous round, this is what complete means. - - `## Replies`: this section exists only when the current round index is greater than `1`. - - Find `## Opinion` in every `Copilot_Review_{RoundIndex-1}_{ModelName}.md` except yours. + - You should not omit anything what is in any documents in the PREVIOUS ROUND, this is what "complete" means. + - `## Replies`: + - In every `Copilot_Review_Finished_{FileNameFragment}.md` except yours. + - Find `## Opinion`. + - Find `## Replies` to you. - If you totally agree with a model, add this section: `### AGREE with {ModelName}` with no content. If you have anything to add, put them in your own `## Opinion`. - If you partially or totally disagree with a model, add this section: `### DISAGREE with {ModelName}` and explain why you disagree and what you think is correct. + - If the file does not exist, add this section: `### DISAGREE with {ModelName}` and explain that you cannot find their review file. - The following sections are about what you need to pay attention to when reviewing the target document. - After finishing the review document, stops. @@ -132,17 +138,22 @@ Ignore this section if there is no `# Final` in the LATEST chat message. ### Step F1. Verify Convergence -- Find the latest round of review files. -- Check that in the latest round, every models agree with each other. - - If any reply is not agree, report that the review has not converged and stop. +- Find and execute `copilotPrepareReview.ps1`, it will do the following things: + - Delete all `Copilot_Review_Finished_{FileNameFragment}.md` files. + - Rename all `Copilot_Review_Writing_{FileNameFragment}.md` files to `Copilot_Review_Finished_{FileNameFragment}.md`. +- Collect all new `Copilot_Review_Finished_{FileNameFragment}.md` files as `Review Board Files`. +- Ensure all conditions below are satisfied, otherwise report the problem and stop: + - `Review Board Files` has files from all models in the review board. + - `Review Board Files` all have the same target document. + - `Review Board Files` have no disagreement in their `## Replies` section. ### Step F2. Identify the Target Document -- Identify all review files from the last round. Read their `# Review Target`, they should be the same. +- Identify all `Review Board Files`. Read their `# Review Target`, they should be the same. ### Step F3. Create the Summary -- Read the `## Opinion` section from each review file from the last round. +- Read the `## Opinion` section from all `Review Board Files`. - Consolidate all options into a single review opinion. - Write the review opinion to `Copilot_Review.md` as a cohesive set of actionable feedback. - The only title in this file should be `# Review Target: {TargetDocumentName}`. @@ -162,7 +173,7 @@ Ignore this section if there is no `# Apply` in the LATEST chat message. - For `Copilot_Scrum.md`, follow `REPO-ROOT/.github/prompts/0-scrum.prompt.md`. - For `Copilot_Task.md`, follow `REPO-ROOT/.github/prompts/1-design.prompt.md`. - For `Copilot_Planning.md`, follow `REPO-ROOT/.github/prompts/2-planning.prompt.md`. - - For `Copilot_Execution.md`, follow `REPO-ROOT/.github/prompts/4-execution.prompt.md`. + - For `Copilot_Execution.md`, follow `REPO-ROOT/.github/prompts/3-summarizing.prompt.md`. ### Step A2. Apply the Review