fix: address review feedback from PR #176#178
Conversation
- Handle inline code (single backtick) in escapeHashReferences - Add comprehensive JSDoc documenting coverage scope - Add comment about global flag on HASH_NUM_RE - Export escapeHashReferences for direct testing - Add 14 TS unit tests (node:test) directly testing the function - Add cross-language consistency test (ZH/EN hash-avoidance strings must match between reviewers.ts and run-github-opencode.py) - Extract hash_avoid_zh/hash_avoid_en variables in Python to match TS structure and ensure one-to-one correspondence - Add npm test script and tsx devDependency for TS testing Addresses all confirmed suggestions from PR #176 multi-review.
|
无遗漏 PR 描述中列出的所有改动均已在代码中落实,未发现规格遗漏。 验证结果:
无 closingIssuesReferences,PR 自身描述即为 spec,所有具体可验证的代码变更项目均已实现,没有发现集成断点、未接线的配置或缺失分支。 |
|
可合并 四位 reviewer 均无阻塞项。 阻塞项:无 建议项(按已确认度排序): 已确认(≥ 2 位 reviewer 提及)
单一 reviewer 建议(领域特定)
📋 各 Reviewer 详细审查结果qualityI'll review this PR carefully. Let me first check the current state of the files to verify the claims. PR 干净且完整地解决了 PR #176 的 review 反馈,核心改动包括:把 hash-avoidance 提示词抽取为共享变量、给 我已在本地验证:14 个 TS 测试全部通过、17 个 Python 测试全部通过(含 2 个跨语言一致性用例)、 阻塞项:无 建议项:
security安全无虞 安全分析:
阻塞项:无 建议项:
performance性能良好 PR 主要是补全 阻塞项:无 建议项:
architecture架构有疑虑 整体变更遵循既有的"平台层为权威转义、prompt 层仅做提示"分层模式,并将该约定明确写入注释。 阻塞项:无 建议项:
|
- INLINE_CODE_RE: add newline boundary to prevent cross-line matching - escapeHashReferences: add @internal tag (exported for testing only) - package.json: add engines.node >= 20 (required by tsx/node --import) - Python TestEscapeHashReferences: slim down to 4 smoke tests; comprehensive coverage lives in platform.test.ts (14 tests) - Cross-language consistency tests: add CAVEAT comment warning that regex extraction is coupled to string literal form

Summary
Addresses all suggestions from PR #176 multi-review (quality, performance reviewers).
Changes
Inline code handling (
platform.ts)INLINE_CODE_REto skip`#1`inline code during escapingescapeSegment()helper to handle nested fenced + inline code exclusionJSDoc and documentation
escapeHashReferencesdocumenting coverage scopegflag behavior onHASH_NUM_RECODE_BLOCK_REtoFENCED_CODE_REfor clarityTS unit tests (eliminates dual-source-of-truth risk)
platform.test.tsusingnode:test— 14 tests directly testing the actual functionCross-language consistency enforcement
TestCrossLanguageHashInstructionConsistencyin Python test suitereviewers.tsandrun-github-opencode.pyhash_avoid_zh/hash_avoid_envariables in Python to mirror TS structureDev dependencies
tsxfor running TS testsnpm testscriptTesting
npm test)npx tsc --noEmit)