diff --git a/.github/KnowledgeBase/Learning.md b/.github/KnowledgeBase/Learning.md index 7aff79b2..949ef64b 100644 --- a/.github/KnowledgeBase/Learning.md +++ b/.github/KnowledgeBase/Learning.md @@ -9,6 +9,7 @@ - Make `Stop()` drain asynchronous work before returning [5] - Use `WString::IndexOf` with `wchar_t` (not `const wchar_t*`) [4] - Use `collections::BinarySearchLambda` on contiguous buffers (guard empty) [4] +- Proactively remove code made redundant by refactoring [3] - Capture dependent lambdas explicitly [2] - Don't assume observable changes are batched [2] - Do not assume async callback owners are heap allocated [2] @@ -18,7 +19,6 @@ - Validate expectations against implementation and existing tests [2] - Use `vl::Exception` for expected semantic failures and `CHECK_ERROR` for invariants [2] - Treat Debug memory leak dumps as required failures [2] -- Proactively remove code made redundant by refactoring [2] - Prefer well-defined tests over ambiguous edge cases [1] - Prefer `operator<=> = default` for lexicographic key structs [1] - Prefer two-pointer merge for sorted range maps [1] @@ -208,6 +208,8 @@ When an API needs to report syntax or validation errors synchronously but execut When a change makes a construction unnecessary or no longer meaningful, delete it as part of the same change instead of leaving it behind. This includes redirection/adapter layers that only forward, transport methods that exist solely for a now-collapsed path, specialized helpers superseded by a generic one, duplicated post-processing a callee already performs, and null checks the callee already handles (e.g. when `BoxValue`/`UnboxValue` already accept null, or when an `Invoke*` helper already reads/checks the result). Do not leave redirections that exist only because of history. It is acceptable to take the risk of breaking tests while removing redundant code, and then fix the tests afterward, rather than preserving dead structure to keep tests green. +Remove unused dependency parameters and fields as part of the refactor too. If every meaningful call path already receives a preconverted representation, do not keep serializer or adapter state only for a fallback that current callers neither need nor should use. + Preserve helper layers that still own observable behavior. For example, flat RPC dispatcher wrappers that only forward can be removed, but JSON wrappers that record generated TypeScript artifacts should stay until their recording responsibility is moved elsewhere. ## Keep design documentation aligned with code after refactoring diff --git a/.github/Scripts/copilotRemember.ps1 b/.github/Scripts/copilotRemember.ps1 index 9ec71135..6ba3d703 100644 --- a/.github/Scripts/copilotRemember.ps1 +++ b/.github/Scripts/copilotRemember.ps1 @@ -37,8 +37,8 @@ if (Test-Path $filePath) { 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 "Resetting $fileName..." + Set-Content -LiteralPath $filePath -Value "# !!!INVESTIGATE!!!" } Write-Host "Copilot remember completed." diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 08755d89..f6509ca5 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -37,7 +37,11 @@ The C++ project in this repo is built and tested using its own MSBuild wrappers. You must strictly follow the instructions in the following documents, otherwise it won't work properly. -- **SUPER IMPORTANT** Your should always follow the coding convention when coding: `REPO-ROOT/.github/Guidelines/Coding.md` +- **SUPER IMPORTANT** Your should always follow the coding convention when coding: + - `REPO-ROOT/.github/Guidelines/Coding.md` + - `REPO-ROOT/.github/KnowledgeBase/Learning.md` + - `REPO-ROOT/.github/Learning/Learning_Coding.md` + - `REPO-ROOT/.github/Learning/Learning_Testing.md` - Adding/Removing/Renaming Source Files: `REPO-ROOT/.github/Guidelines/SourceFileManagement.md` - Building a Solution: `REPO-ROOT/.github/Guidelines/Building.md` - Running a Project: diff --git a/.github/prompts/investigate.prompt.md b/.github/prompts/investigate.prompt.md index 4d4deb18..c408f53d 100644 --- a/.github/prompts/investigate.prompt.md +++ b/.github/prompts/investigate.prompt.md @@ -167,8 +167,12 @@ Propose any solution you can think of and write them down in the document, you m ## Step 6. Verify and Code Review - Unit test is always required to ensure the proposal actually works. -- Review all code you have changed, make sure they are clean and follow the coding convention in `REPO-ROOT/.github/Guidelines/Coding.md`. - - If code review changes the code, you need to run the test cases again to confirm the changes. +- Review all code you have changed, make sure they are clean and follow the coding convention in: + - `REPO-ROOT/.github/Guidelines/Coding.md`. + - `REPO-ROOT/.github/KnowledgeBase/Learning.md` + - `REPO-ROOT/.github/Learning/Learning_Coding.md` + - `REPO-ROOT/.github/Learning/Learning_Testing.md` +- If code review changes the code, you need to run the test cases again to confirm the changes. ## Git Commits and Multi-Task Request