diff --git a/.github/Guidelines/Building.md b/.github/Guidelines/Building.md index 1a3a5fb9..9ec77807 100644 --- a/.github/Guidelines/Building.md +++ b/.github/Guidelines/Building.md @@ -19,10 +19,7 @@ cd SOLUTION-ROOT ``` It is possible that, before running `copilotBuild.ps1`, the binary to compile is still running or still being debugged. This could cause the linking to fail. You need to check the error message, and in case when it happens: -- Kill `cdb` process first, if any. - - The cdb path is stored in `$env:CDBPATH`. - - Avoid running `copilotDebug_Stop.ps1` directly. -- Kill the binary process that is blocked. +- Follow `### Stop a Debugger` in `REPO-ROOT/.github/Guidelines/Debugging.md` to stop debugging. - Rebuild, and this issue should be gone. ### Ensure Target Configuration diff --git a/.github/Guidelines/Debugging.md b/.github/Guidelines/Debugging.md index 16c89694..3f7282c1 100644 --- a/.github/Guidelines/Debugging.md +++ b/.github/Guidelines/Debugging.md @@ -29,15 +29,9 @@ After you are ready, send the `g` command to start running. ### Stop a Debugger -You must call this script to stop the debugger. -Do not stop the debugger using any command. -This script is also required to run before compiling only when Visual Studio Code tasks are not available to you. - -``` -& REPO-ROOT\.github\Scripts\copilotDebug_Stop.ps1 -``` - -If there is any error message, it means the debugger is not alive, which is fine. +- Kill `cdb` process first, if any. + - The cdb path is stored in `$env:CDBPATH`. +- Kill the binary process that is blocked. #### Warning diff --git a/.github/KnowledgeBase/Learning.md b/.github/KnowledgeBase/Learning.md index a8af7882..f7e8eb49 100644 --- a/.github/KnowledgeBase/Learning.md +++ b/.github/KnowledgeBase/Learning.md @@ -25,6 +25,7 @@ - Avoid references into containers when mutating them [1] - Prefer designated initializers for aggregate-like structs [1] - Construct `Nullable` explicitly in function calls [1] +- Sort serialization metadata by deterministic keys, not pointer addresses [1] - `collections::Dictionary` copy assignment is deleted (use move/swap) [1] - Dereference `Ptr` via `.Obj()` (not `*ptr`) [1] - `vl::regex` separator regex: `L"[\\/\\\\]+"` [1] @@ -129,6 +130,10 @@ For small structs used as value objects (especially those with default member in When passing string literals to a function parameter typed as `Nullable`, wrap them in `WString(...)` (or otherwise construct a `WString`) to make the conversion explicit. Direct assignment to a `Nullable` field may compile via an assignment operator, but function-call argument conversion can require explicit construction. +## Sort serialization metadata by deterministic keys, not pointer addresses + +When serializing metadata into stable binary output, do not let pointer-address ordering decide indices or item order. Collect items for membership checks if needed, then sort the serialized lists by deterministic keys such as type names or owner-qualified member signatures before assigning indices and writing the stream. This applies to type descriptors, methods, properties, events, and generated custom-type lists whose order would otherwise depend on allocation order or ASLR. + ## `collections::Dictionary` copy assignment is deleted (use move/swap) `collections::Dictionary` does not support copy assignment. When you need to replace one dictionary with another, use move semantics (when appropriate), or rebuild/swap explicitly instead of `a = b`. diff --git a/.github/Scripts/copilotDebug_Stop.ps1 b/.github/Scripts/copilotDebug_Stop.ps1 deleted file mode 100644 index 82cb7a9e..00000000 --- a/.github/Scripts/copilotDebug_Stop.ps1 +++ /dev/null @@ -1,6 +0,0 @@ -. $PSScriptRoot\copilotShared.ps1 -$cdbpath = GetCDBPath -$debuggerNamedPipe = GetDebuggerNamedPipe -$commandLine = "`"$($cdbpath)`" -remote npipe:server=.,pipe=$debuggerNamedPipe -clines 0 -c `"qq`"" -echo $commandLine -cmd.exe /S /C $commandLine diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 9f63ddc2..3e184c7e 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -78,7 +78,6 @@ If you need to find any script or support files, they are in the `REPO-ROOT/.git - `copilotBuild.ps1` - `copilotExecute.ps1` - `copilotDebug_Start.ps1` -- `copilotDebug_Stop.ps1` - `copilotDebug_RunCommand.ps1` - `copilotRemember.ps1` - `Build.log` diff --git a/.github/prompts/investigate.prompt.md b/.github/prompts/investigate.prompt.md index debc2c72..5b0eaf50 100644 --- a/.github/prompts/investigate.prompt.md +++ b/.github/prompts/investigate.prompt.md @@ -138,6 +138,12 @@ Propose any solution you can think of and write them down in the document, you m - If there is only one `[CONFIRMED]` proposal, you should keep the change in the source code, according to its `### CODE CHANGE` section. And then do `Step 6`. - If there is multiple `[CONFIRMED]` proposals, you are going to make your decision about which is the best one, and keep that change in the source code, according to its `### CODE CHANGE` section. And then do `Step 6`. You will also need to write in the selected proposal about why it is better than the others, and also tell me directly. - Understand and implement the proposal. + - **IMPORTANT** The order of confirming a proposal should be in this order: + - Write down the details of a proposal to the document and save the file. + - Summarize `### CODE CHANGE`. + - Execute it and see if it works. + - I would like you to make sure that, before the test cases are running, the proposal has already been documented in the file. + - Test failures not necessary mean the proposal is invalid, it might be because of the implementation. But if you need to change the implementation, you should update the proposal in the same order. Unless it is a fundementally different idea, then abandon the current proposal and propose more. - Run the test cases to confirm the proposal. - Ensure all test cases passed. - If related test cases failed, it means the proposal is denied.