Conversation
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/306825f4-9f4b-4b8b-b8e7-e36263f61982 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/306825f4-9f4b-4b8b-b8e7-e36263f61982 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new safe_string_codec package that provides reversible HEX-escape encoding/decoding for arbitrary Python str values (including surrogate edge-cases), along with unit tests and a design note.
Changes:
- Implemented
to_safe_string()/from_safe_string()using~HHbyte escapes over UTF-8 (surrogatepass). - Added
unittestcoverage for roundtrip and malformed-input handling. - Added package exports and a design/edge-case rationale document.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| safe_string_codec/safe_string_codec.py | Core encoding/decoding implementation and format documentation. |
| safe_string_codec/test_safe_string_codec.py | Unit tests for roundtrip behavior and error handling. |
| safe_string_codec/init.py | Exposes the codec functions at the package level. |
| safe_string_codec/design_and_prompt.md | Design notes and enumerated corner cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/4afc7254-40ea-41eb-83c1-910fcb1b3532 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/4afc7254-40ea-41eb-83c1-910fcb1b3532 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/4afc7254-40ea-41eb-83c1-910fcb1b3532 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
已按你给的 CSM 文档规则更新:改为基于关键字字符集合( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/5f12cd84-1c7e-4894-bd72-c4277124f43a Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/5f12cd84-1c7e-4894-bd72-c4277124f43a Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
已按你给的 CSM-Wiki 文档对齐名称、注释和参数语义:新增 |
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/fcdb246d-9d16-46e3-bd19-a1fae26de2d9 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
已按要求只保留文档中的函数:移除了 |
|
@copilot 文档中添加两个函数的流程图 |
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/eb40711f-b63f-4bf8-bb49-9426f2e18da7 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
Agent-Logs-Url: https://github.com/NEVSTOP-LAB/CSM-Prototype/sessions/eb40711f-b63f-4bf8-bb49-9426f2e18da7 Co-authored-by: nevstop <8196752+nevstop@users.noreply.github.com>
已在文档中补充两个函数的流程图(Mermaid): |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # 代码与测试文件 | ||
|
|
||
| - `safe_string_codec/safe_string_codec.py`:核心编码/解码实现 | ||
| - `safe_string_codec/test_safe_string_codec.py`:`unittest` 全面测试 | ||
| - `safe_string_codec/__init__.py`:对外导出接口 |
There was a problem hiding this comment.
PR description says the diff should be documentation-only/minimal doc update, but this change introduces new runtime code and a full unittest suite (codec implementation + exports). Please update the PR description/scope (or split into separate PRs) so reviewers and release notes match what’s actually being merged.
There was a problem hiding this comment.
已按该反馈调整 PR 描述范围,现已与实际合并内容一致(实现 + 测试 + 文档,而不仅是最小文档更新)。本次仅更新 PR 描述,无新增代码改动。当前分支提交:3907f2c。无 UI 变更,截图不适用。
This PR aligns the safe-string codec behavior with CSM keyword-based escaping and the CSM-Wiki Arguments VI documented APIs.
What changed
safe_string_codec/safe_string_codec.py:make_string_arguments_safe(argument_string: str, ignore_argument_type: bool = False) -> strrevert_arguments_safe_string(safe_argument_string: str, force_convert: bool = False) -> str%HHescaping (uppercase hex) for CSM keyword-related characters:-|@&<>\r\n/;,%is also escaped as%25to keep decoding unambiguous.%HHdecoding with malformed-sequence validation.safe_string_codec/__init__.py:make_string_arguments_saferevert_arguments_safe_stringTests
Updated
safe_string_codec/test_safe_string_codec.pyto cover:->,//,>>,>>>,;,,)%escaping behavior\r,\n, plus\t,\x00)<SAFESTR>prefix behavior withignore_argument_type/force_convertDocumentation
Updated
safe_string_codec/design_and_prompt.mdwith:make_string_arguments_saferevert_arguments_safe_string