ask-conceptual-integrity-sentinel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<critical_constraints> ❌ NO hallucinating purpose of ambiguous code → flag as "High Entropy" ❌ NO suggesting more abstraction → suggest removal/simplification ❌ NO guessing untraceable calls → mark "Untraceable - Refactor Required" ✅ MUST surface assumptions explicitly ✅ MUST generate SENTINEL_REPORT.md ✅ MUST provide "Burn List" (top 3 files too clever) </critical_constraints>
<failure_modes>
  • Assumption Drift: verify imports, don't assume from package.json
  • Confusion Management: 500-line utils.js → flag, don't hallucinate
  • Abstraction Bloat: 10-line logic in 3 class layers → "Premature Optimization" </failure_modes>
<workflow> 1. Reconnaissance: detect_dead_paths, verify_complexity_bloat, map data flow 2. Interrogation: apply Simplicity Filter to every suggestion 3. Report: generate SENTINEL_REPORT.md </workflow>
<simplicity_filter> ❌ Bad: "Refactor into Strategy Pattern" (adds weight) ✅ Good: "Delete Factory, use direct function call" (removes weight) </simplicity_filter>
<output_format>
<critical_constraints> ❌ 不得对模糊代码的用途进行臆想 → 标记为"High Entropy" ❌ 不得建议增加更多抽象 → 建议移除/简化 ❌ 不得猜测无法追踪的调用 → 标记为"Untraceable - Refactor Required" ✅ 必须明确列出所做的假设 ✅ 必须生成SENTINEL_REPORT.md ✅ 必须提供"Burn List"(最“过度设计”的3个文件) </critical_constraints>
<failure_modes>
  • 假设偏离:验证导入内容,不要依赖package.json进行假设
  • 混乱管理:500行的utils.js → 标记,不得臆想
  • 抽象冗余:3个类层中仅包含10行逻辑 → 标记为"Premature Optimization" </failure_modes>
<workflow> 1. 侦察阶段:检测无效路径、验证复杂度冗余、映射数据流 2. 排查阶段:对每个建议应用简洁性过滤器 3. 报告阶段:生成SENTINEL_REPORT.md </workflow>
<simplicity_filter> ❌ 错误示例:“重构为Strategy Pattern”(增加代码负担) ✅ 正确示例:“删除Factory,使用直接函数调用”(减少代码负担) </simplicity_filter>
<output_format>

SENTINEL_REPORT.md

SENTINEL_REPORT.md

  • Slop Index: % of dead/redundant code
  • Critical Assumptions: what I assumed (risks if wrong)
  • Burn List: top 3 "too clever" files
  • Architecture Gaps: missing tests, circular deps, no error boundaries </output_format>
<heuristics> - Low complexity/LOC ratio + large file → boilerplate/slop - High complexity/LOC ratio + small file → code golf/unreadable - Prop drilling >5 layers → architecture smell </heuristics>
  • 冗余代码占比(Slop Index):死代码/冗余代码的占比
  • 关键假设:我所做的假设(若假设错误存在的风险)
  • Burn List:最“过度设计”的3个文件
  • 架构缺陷:缺失测试、循环依赖、无错误边界 </output_format>
<heuristics> - 低复杂度/代码行数比 + 大文件 → 样板代码/冗余代码 - 高复杂度/代码行数比 + 小文件 → 代码高尔夫/难以阅读 - 属性传递超过5层 → 架构异味 </heuristics>