mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-18 07:55:32 +08:00
...
This commit is contained in:
@@ -37,7 +37,7 @@ You are required to `cd` to such folder before running the compiled CLI binary,
|
||||
|
||||
After a successful build, `Bin/UnitTest` will be generated as the executable.
|
||||
If you can't find it, first check if the build succeeded, and then read `makefile` to find the correct binary file name.
|
||||
`Bin/UnitTest` is the default name in any `vmake` if it is not changed, so many CLI application still named `UnitTest`.
|
||||
`Bin/UnitTest` is the default name in any `vmake` if it is not changed, so many CLI applications are still named `UnitTest`.
|
||||
|
||||
**IMPORTANT**: Always run it asynchronously, read terminal output and its return code.
|
||||
Compiled binary might have a bug causing it to trap in a dead loop. DO NOT just wait for it to complete.
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# Remember Copilot investigation notes
|
||||
|
||||
param(
|
||||
[switch]$Earliest,
|
||||
[Parameter(Position=0)]
|
||||
[ValidateRange(1, [int]::MaxValue)]
|
||||
[int]$Count = 1
|
||||
)
|
||||
|
||||
if ($Earliest) {
|
||||
$learningRoot = Resolve-Path -LiteralPath "$PSScriptRoot\..\Learning"
|
||||
$earliestFolders = @(Get-ChildItem -LiteralPath $learningRoot -Directory |
|
||||
Sort-Object -Property Name |
|
||||
Select-Object -First $Count)
|
||||
|
||||
if ($earliestFolders.Count -lt $Count) {
|
||||
Write-Output "Requested $Count backups and $($earliestFolders.Count) found:"
|
||||
}
|
||||
|
||||
$earliestFolders | ForEach-Object {
|
||||
Write-Output $_.FullName
|
||||
}
|
||||
exit 0
|
||||
}
|
||||
|
||||
$filePath = "$PSScriptRoot\..\TaskLogs\Copilot_Investigate.md"
|
||||
|
||||
if (Test-Path $filePath) {
|
||||
$timestamp = Get-Date -Format "yyyy-MM-dd-HH-mm-ss"
|
||||
$backupFolder = "$PSScriptRoot\..\Learning\$timestamp"
|
||||
$fileName = Split-Path $filePath -Leaf
|
||||
$destinationPath = Join-Path $backupFolder $fileName
|
||||
|
||||
Write-Host "Creating backup folder: $backupFolder"
|
||||
New-Item -ItemType Directory -Path $backupFolder -Force | Out-Null
|
||||
|
||||
Write-Host "Backing up $fileName to Learning folder..."
|
||||
Copy-Item -Path $filePath -Destination $destinationPath -Force
|
||||
|
||||
Write-Host "Deleting $fileName..."
|
||||
Remove-Item -Path $filePath -Force
|
||||
}
|
||||
|
||||
Write-Host "Copilot remember completed."
|
||||
@@ -60,12 +60,8 @@ otherwise it won't work properly.
|
||||
## Accessing Task Documents
|
||||
|
||||
If you need to find any document for the current working task, they are in the `REPO-ROOT/.github/TaskLogs` folder:
|
||||
- `Copilot_Scrum.md`
|
||||
- `Copilot_Task.md`
|
||||
- `Copilot_Planning.md`
|
||||
- `Copilot_Execution.md`
|
||||
- `Copilot_KB.md`
|
||||
- `Copilot_Investigate.md`
|
||||
- `Copilot_KB.md`
|
||||
|
||||
### Important Rules for Writing Markdown Files
|
||||
|
||||
@@ -77,14 +73,13 @@ If you need to find any document for the current working task, they are in the `
|
||||
|
||||
## (Windows Specific) Accessing Script Files
|
||||
|
||||
If you need to find any script or log files, they are in the `REPO-ROOT/.github/Scripts` folder:
|
||||
- `copilotPrepare.ps1`
|
||||
- `copilotPrepareReview.ps1`
|
||||
If you need to find any script or support files, they are in the `REPO-ROOT/.github/Scripts` folder:
|
||||
- `copilotBuild.ps1`
|
||||
- `copilotExecute.ps1`
|
||||
- `copilotDebug_Start.ps1`
|
||||
- `copilotDebug_Stop.ps1`
|
||||
- `copilotDebug_RunCommand.ps1`
|
||||
- `copilotRemember.ps1`
|
||||
- `Build.log`
|
||||
- `Execute.log`
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
## Goal and Constraints
|
||||
|
||||
- Your goal is to finish an investigation document in `Copilot_Investigate.md` to address a problem.
|
||||
- You are recommended to modify unit test, build, run, debug to understand the problem, or verify your root cause analysis during tracing a bug.
|
||||
- You are recommended to modify unit tests, build, run, and debug to understand the problem, or verify your root cause analysis while tracing a bug.
|
||||
|
||||
## Copilot_Investigate.md Structure
|
||||
|
||||
- `# !!!INVESTIGATE!!!`: This file always begins with this title.
|
||||
- `# PROBLEM DESCRIPTION`: An exact copy of the problem description I gave you.
|
||||
- `# UPDATES`
|
||||
- `# (CONTINUE|REPORT)`: There could be multiple occurrences. Each one has an exact copy of the update description I gave you.
|
||||
- `## (UPDATE|REPORT)`: There could be multiple occurrences. Each one has an exact copy of the update description I gave you.
|
||||
- `# TEST`: Test cases to confirm or define the problem.
|
||||
- `# PROPOSALS`: A list of proposed solutions, followed by details about each proposal.
|
||||
- `- No.X TITLE OF PROPOSAL`, with `[CONFIRMED]` or `[DENIED]` after the proposal is tested and proven to be correct or incorrect. X is an increasing number starting from 1.
|
||||
@@ -38,6 +38,8 @@
|
||||
Ignore this section if there is no "# Repro" in the LATEST chat message
|
||||
I am starting a fresh new request.
|
||||
|
||||
- Before replacing `Copilot_Investigate.md`, read its current content.
|
||||
- If it contains anything beyond the `# !!!INVESTIGATE!!!` title, run `copilotRemember.ps1` without arguments to archive the old investigation first.
|
||||
- You should override `Copilot_Investigate.md` with only one title `# !!!INVESTIGATE!!!`.
|
||||
- At the moment, `Copilot_Investigate.md` may contain the last investigation. Even if it may look like the document is already finished for the current investigation, always clean it up.
|
||||
- After overriding, copy precisely my problem description in `# Repro` from the LATEST chat message under `# PROBLEM DESCRIPTION`.
|
||||
@@ -62,8 +64,8 @@ Ignore this section if there is no "# Report" in the LATEST chat message
|
||||
I am going to propose a change to `Copilot_Investigate.md`.
|
||||
|
||||
- When there is any content under `# Report` in the LATEST chat message:
|
||||
- Copy precisely my problem description in `# Report` from the LATEST chat message to the `# UPDATES` section, with a new sub-section `## UPDATE`.
|
||||
- The new `## UPDATE` should be appended to the end of the existing `# UPDATES` section (aka before `# TEST`).
|
||||
- Copy precisely my problem description in `# Report` from the LATEST chat message to the `# UPDATES` section, with a new sub-section `## REPORT`.
|
||||
- The new `## REPORT` should be appended to the end of the existing `# UPDATES` section (aka before `# TEST`).
|
||||
- If I do not agree with any proposal marked with `[CONFIRMED]`:
|
||||
- Mark these proposals with `[DENIED]`, change related `### CONFIRMED` in those proposals to `### DENIED BY USER`, and write a comprehensive explanation in each proposal about why.
|
||||
- Add a `# REPORT` at the end of the document:
|
||||
@@ -73,7 +75,7 @@ I am going to propose a change to `Copilot_Investigate.md`.
|
||||
|
||||
## Step 2. Construct Test Cases
|
||||
|
||||
Only when I suggest that the problem is impossible to repro with test cases, write `N/A` under `# TEST` and skip `Step 2.`.
|
||||
Only when I suggest that the problem is impossible to reproduce with test cases, write `N/A` under `# TEST` and skip `Step 2.`.
|
||||
|
||||
- You are going to construct proper test cases to address the problem.
|
||||
- If I suggest a way to confirm the issue:
|
||||
@@ -97,7 +99,7 @@ Only when I suggest that the problem is impossible to repro with test cases, wri
|
||||
|
||||
## Step 3. Confirm the Problem
|
||||
|
||||
If `N/A` is written under `# TEST`, it means the problem is not possible to repro with test cases, skip this step.
|
||||
If `N/A` is written under `# TEST`, it means the problem is not possible to reproduce with test cases, skip this step.
|
||||
If the title is `# TEST [CONFIRMED]`, it means the problem is already proven confirmable by the test cases, skip this step.
|
||||
|
||||
- Run the test cases and confirm that the problem is reproduced.
|
||||
|
||||
@@ -24,27 +24,31 @@
|
||||
|
||||
## Step 1. Find the Earliest Backup Folder
|
||||
|
||||
- Find and execute `copilotPrepare.ps1 -Earliest` to get the absolute path to the earliest backup folder in `Learning`.
|
||||
- If the script fails, it means there is no material to learn from, stop. Otherwise continue to process this folder.
|
||||
- Firstly you need to do a simple clean up:
|
||||
- Folder names are time stamps, you need to read a few of earilest documents.
|
||||
- Sometimes the same document will be backed up multiple times with new content increasing as instructed in the original request.
|
||||
- You should identify them, and leave the latest one while deleting earlier ones. The kept document should contain the most content.
|
||||
- Stop cleaning up at the first group of documents. Or when the second earilest document has a different task than the earliest one, you will have nothing to delete and just stops the cleaning up.
|
||||
- You can use `copilotRemember.ps1 -Earliest COUNT` to help you identify the earliest COUNT backup folders.
|
||||
- Secondly, pick the earliest backup folder after cleaning up and continue.
|
||||
|
||||
## Step 2. Read All Documents
|
||||
|
||||
- Read all files in the earliest backup folder. These may include:
|
||||
- `Copilot_Task.md`
|
||||
- `Copilot_Planning.md`
|
||||
- `Copilot_Execution.md`
|
||||
- `Copilot_Execution_Finding.md`
|
||||
- `Copilot_Investigate.md`
|
||||
|
||||
## Step 3. Extract Findings
|
||||
|
||||
- Focus on the following sections across all documents:
|
||||
- All `## UPDATE` sections in each document.
|
||||
- `# Comparing to User Edit` from `Copilot_Execution_Finding.md`.
|
||||
- From these sections, identify learnings about:
|
||||
- Best practices and coding preferences.
|
||||
- Mistakes made and corrections applied.
|
||||
- Patterns the user prefers or dislikes.
|
||||
- Any insight into the user's philosophy about code quality, style, or approach.
|
||||
- Extract useful information that reflect my preferences:
|
||||
- `# PROBLEM DESCRIPTION` section, you need to careful read the original request in this section and tell what it wanted to achieve:
|
||||
- If it is a feature request, ignore it.
|
||||
- If it is a refactoring request, pay attention to the reason for refactoring and the expected improvement. This usually reflect my preferences.
|
||||
- `## UPDATE` sections under `# UPDATES`, usually contains my corrections to previous proposals in the document.
|
||||
- Try to extract knowledges from the above content, focus on:
|
||||
- Coding guidelines, best practices and preferences for using any specific language or library.
|
||||
- Software design principles, best practices for engineering.
|
||||
- Knowledges that can be generalized across projects.
|
||||
- Knowledges that is useful for maintaining this project.
|
||||
|
||||
## Step 4. Write Learnings
|
||||
|
||||
|
||||
@@ -16,8 +16,13 @@ Read the first word of the request, and read an additional instruction file if i
|
||||
|
||||
### Exceptions
|
||||
|
||||
- If the latest chat message is simply "execute and verify", it means do `execute` followed by `verify`.
|
||||
- If the first word is not in the list, treat the request as if it begins with "investigate repro"
|
||||
- The following rules apply when the first word is not in the list:
|
||||
- If the request looks like a research or question, treat the request as if it begins with "ask".
|
||||
- If the request looks like a coding work, treat the request as if it begins with "investigate repro".
|
||||
- If the request looks like other non-coding work, just execute the request directly. Such works usually include but not limit to:
|
||||
- Planning.
|
||||
- Document refining.
|
||||
- Daily maintenance.
|
||||
|
||||
## Step 2
|
||||
|
||||
|
||||
@@ -16,8 +16,13 @@ Read the first word of the request, and read an additional instruction file if i
|
||||
|
||||
### Exceptions
|
||||
|
||||
- If the latest chat message is simply "execute and verify", it means do `execute` followed by `verify`.
|
||||
- If the first word is not in the list, treat the request as if it begins with "investigate repro"
|
||||
- The following rules apply when the first word is not in the list:
|
||||
- If the request looks like a research or question, treat the request as if it begins with "ask".
|
||||
- If the request looks like a coding work, treat the request as if it begins with "investigate repro".
|
||||
- If the request looks like other non-coding work, just execute the request directly. Such works usually include but not limit to:
|
||||
- Planning.
|
||||
- Document refining.
|
||||
- Daily maintenance.
|
||||
|
||||
## Step 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user