@ngockhoale/ukit 2.8.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/manifests/documentation.yaml +64 -64
  3. package/manifests/hostCapabilities.yaml +1 -1
  4. package/manifests/instructionRules.yaml +55 -55
  5. package/manifests/platform.full.yaml +4 -4
  6. package/manifests/platform.user.yaml +4 -4
  7. package/package.json +8 -7
  8. package/scripts/bench/v3-ceremony.mjs +214 -0
  9. package/scripts/install/sync-installed-mirror.mjs +3 -3
  10. package/scripts/perf/audit-perf.mjs +9 -9
  11. package/scripts/perf/perf-findings.json +4 -4
  12. package/scripts/perf/perf-measure.md +20 -20
  13. package/src/core/buildPlan.js +3 -3
  14. package/src/core/compact/contextBudget.js +2 -2
  15. package/src/core/compact/threshold.js +3 -3
  16. package/src/core/docContracts.js +17 -17
  17. package/src/core/ensureGitignore.js +1 -1
  18. package/src/core/executionContracts.js +2 -2
  19. package/src/core/fileOps.js +3 -3
  20. package/src/core/gatewayProbe.js +2 -2
  21. package/src/core/gatewayResilienceEnv.js +2 -2
  22. package/src/core/output/index.js +1 -1
  23. package/src/core/paths.js +2 -1
  24. package/src/core/runInstallPipeline.js +6 -4
  25. package/src/core/runtimeConfig.js +13 -6
  26. package/src/core/sensitiveValueScanner.js +1 -1
  27. package/src/core/taskBudgetValidator.js +1 -1
  28. package/src/core/unattendedDoctor.js +1 -1
  29. package/src/core/update.js +1 -1
  30. package/src/index/buildIndex.js +2 -2
  31. package/src/index/impactCatalog.js +12 -12
  32. package/src/index/taskRouting.js +213 -4
  33. package/src/render/instructionRenderer.js +7 -7
  34. package/src/skill/auditSkill.js +1 -1
  35. package/{templates → template_project}/.claude/agents/handoff-planner.md +2 -2
  36. package/{templates → template_project}/.claude/commands/ukit/handoff-create.md +1 -1
  37. package/{templates → template_project}/.claude/commands/ukit/handoff-fullstack.md +1 -1
  38. package/{templates → template_project}/.claude/hooks/handoff-model-guard.sh +1 -1
  39. package/{templates → template_project}/.claude/hooks/skill-router.sh +3 -3
  40. package/{templates → template_project}/.claude/skills/skill-quality/SKILL.md +1 -1
  41. package/{templates → template_project}/.claude/skills/skill-quality/pressure-scenario-template.md +1 -1
  42. package/{templates → template_project}/.claude/ukit/index/lib/index-core.mjs +12 -12
  43. package/{templates → template_project}/.claude/ukit/index/route-task.mjs +319 -11
  44. package/{templates → template_project}/.claude/ukit/index/unic-gateway.mjs +1 -1
  45. package/{templates → template_project}/.claude/ukit/runtime/execution-ledger.mjs +11 -5
  46. package/{templates → template_project}/.claude/ukit/runtime/safe-patch-core.mjs +3 -3
  47. package/{templates → template_project}/.claude/ukit/runtime/sensitive-value-scanner.mjs +1 -1
  48. package/{templates → template_project}/.claude/ukit/runtime/task-watchdog.mjs +1 -1
  49. package/{templates → template_project}/.gitignore +2 -2
  50. package/{templates → template_project}/.omp/RULES.md +1 -1
  51. package/{templates → template_project}/.omp/agents/handoff-planner.md +2 -2
  52. package/{templates → template_project}/.omp/config.yml +3 -3
  53. package/{templates → template_project}/AGENTS.md +2 -2
  54. package/{templates → template_project}/CLAUDE.md +2 -2
  55. package/{templates → template_project}/docs/AI_HANDOFF/RULES.md +1 -1
  56. package/{templates → template_project}/docs/UKIT_INTERNALS.md +3 -3
  57. package/{templates → template_project}/instructions/core.md +1 -1
  58. package/{templates → template_project}/instructions/layout.yaml +8 -8
  59. package/{templates → template_project}/instructions/overlays/claude.md +1 -1
  60. package/{templates → template_project}/instructions/overlays/repo.md +1 -1
  61. package/{templates → template_project}/ukit/storage/config.json +4 -1
  62. package/template_project/ukit/storage/memory/projects/.gitkeep +2 -0
  63. package/templates/ukit/storage/memory/projects/.gitkeep +0 -2
  64. /package/{templates → template_project}/.claude/agents/bug-debugger.md +0 -0
  65. /package/{templates → template_project}/.claude/agents/code-reviewer.md +0 -0
  66. /package/{templates → template_project}/.claude/agents/feature-implementer.md +0 -0
  67. /package/{templates → template_project}/.claude/agents/ukit-small-task-maintainer.md +0 -0
  68. /package/{templates → template_project}/.claude/agents/ukit-vision-analyst.md +0 -0
  69. /package/{templates → template_project}/.claude/commands/ukit/handoff-clear.md +0 -0
  70. /package/{templates → template_project}/.claude/commands/ukit/handoff-implement.md +0 -0
  71. /package/{templates → template_project}/.claude/commands/ukit/handoff-review.md +0 -0
  72. /package/{templates → template_project}/.claude/commands/ukit/handoff-status.md +0 -0
  73. /package/{templates → template_project}/.claude/config/providers.md +0 -0
  74. /package/{templates → template_project}/.claude/hooks/auto-allow-bash.sh +0 -0
  75. /package/{templates → template_project}/.claude/hooks/auto-prune-bash.sh +0 -0
  76. /package/{templates → template_project}/.claude/hooks/block-dangerous.mjs +0 -0
  77. /package/{templates → template_project}/.claude/hooks/block-dangerous.sh +0 -0
  78. /package/{templates → template_project}/.claude/hooks/completion-gate.sh +0 -0
  79. /package/{templates → template_project}/.claude/hooks/compress-output.sh +0 -0
  80. /package/{templates → template_project}/.claude/hooks/context-hardcap-gate.sh +0 -0
  81. /package/{templates → template_project}/.claude/hooks/context-window-guard.sh +0 -0
  82. /package/{templates → template_project}/.claude/hooks/handoff-resume.sh +0 -0
  83. /package/{templates → template_project}/.claude/hooks/post-edit-verify.sh +0 -0
  84. /package/{templates → template_project}/.claude/hooks/pre-edit-backup.sh +0 -0
  85. /package/{templates → template_project}/.claude/hooks/project-important.sh +0 -0
  86. /package/{templates → template_project}/.claude/hooks/protect-files.sh +0 -0
  87. /package/{templates → template_project}/.claude/hooks/record-execution.mjs +0 -0
  88. /package/{templates → template_project}/.claude/hooks/record-execution.sh +0 -0
  89. /package/{templates → template_project}/.claude/hooks/reinject-context.sh +0 -0
  90. /package/{templates → template_project}/.claude/hooks/reset-compact-pressure.sh +0 -0
  91. /package/{templates → template_project}/.claude/hooks/sensitive-data-guard.mjs +0 -0
  92. /package/{templates → template_project}/.claude/hooks/sensitive-data-guard.sh +0 -0
  93. /package/{templates → template_project}/.claude/hooks/session-episode.sh +0 -0
  94. /package/{templates → template_project}/.claude/hooks/session-start.md +0 -0
  95. /package/{templates → template_project}/.claude/hooks/stale-spec-guard.sh +0 -0
  96. /package/{templates → template_project}/.claude/hooks/task-watchdog.sh +0 -0
  97. /package/{templates → template_project}/.claude/hooks/verification-guard.sh +0 -0
  98. /package/{templates → template_project}/.claude/hooks/vision-router.sh +0 -0
  99. /package/{templates → template_project}/.claude/settings.json +0 -0
  100. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -0
  101. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -0
  102. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -0
  103. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -0
  104. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -0
  105. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -0
  106. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -0
  107. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -0
  108. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -0
  109. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -0
  110. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -0
  111. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -0
  112. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -0
  113. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -0
  114. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -0
  115. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -0
  116. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -0
  117. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -0
  118. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -0
  119. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -0
  120. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -0
  121. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -0
  122. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -0
  123. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -0
  124. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -0
  125. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -0
  126. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -0
  127. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -0
  128. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -0
  129. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -0
  130. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -0
  131. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/mce/mc.xsd +0 -0
  132. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2010.xsd +0 -0
  133. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2012.xsd +0 -0
  134. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2018.xsd +0 -0
  135. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -0
  136. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -0
  137. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -0
  138. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -0
  139. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/pack.py +0 -0
  140. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/unpack.py +0 -0
  141. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validate.py +0 -0
  142. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/__init__.py +0 -0
  143. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/base.py +0 -0
  144. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/docx.py +0 -0
  145. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/pptx.py +0 -0
  146. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/redlining.py +0 -0
  147. /package/{templates → template_project}/.claude/skills/backend-api/SKILL.md +0 -0
  148. /package/{templates → template_project}/.claude/skills/canvas-design/LICENSE.txt +0 -0
  149. /package/{templates → template_project}/.claude/skills/canvas-design/SKILL.md +0 -0
  150. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  151. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +0 -0
  152. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  153. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  154. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  155. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  156. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +0 -0
  157. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  158. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  159. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  160. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  161. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +0 -0
  162. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  163. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  164. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  165. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  166. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +0 -0
  167. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  168. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +0 -0
  169. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  170. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  171. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +0 -0
  172. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  173. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  174. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +0 -0
  175. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  176. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +0 -0
  177. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  178. /package/{templates → template_project}/.claude/skills/canvas-design/philosophy-examples.md +0 -0
  179. /package/{templates → template_project}/.claude/skills/code-review/SKILL.md +0 -0
  180. /package/{templates → template_project}/.claude/skills/debugging-toolkit/SKILL.md +0 -0
  181. /package/{templates → template_project}/.claude/skills/debugging-toolkit/reference-tables.md +0 -0
  182. /package/{templates → template_project}/.claude/skills/delivery/SKILL.md +0 -0
  183. /package/{templates → template_project}/.claude/skills/discover-security/SKILL.md +0 -0
  184. /package/{templates → template_project}/.claude/skills/docker-packaging/SKILL.md +0 -0
  185. /package/{templates → template_project}/.claude/skills/docs-manager/SKILL.md +0 -0
  186. /package/{templates → template_project}/.claude/skills/docs-manager/conventions-and-examples.md +0 -0
  187. /package/{templates → template_project}/.claude/skills/docs-manager/init-project-docs.sh +0 -0
  188. /package/{templates → template_project}/.claude/skills/docs-manager/templates/README.md.template +0 -0
  189. /package/{templates → template_project}/.claude/skills/docs-manager/templates/agent-roles.md.template +0 -0
  190. /package/{templates → template_project}/.claude/skills/docs-manager/templates/coding-conventions.md.template +0 -0
  191. /package/{templates → template_project}/.claude/skills/docs-manager/templates/memory.md.template +0 -0
  192. /package/{templates → template_project}/.claude/skills/docs-manager/templates/onboarding.md.template +0 -0
  193. /package/{templates → template_project}/.claude/skills/docs-manager/templates/project.md.template +0 -0
  194. /package/{templates → template_project}/.claude/skills/docs-quality/SKILL.md +0 -0
  195. /package/{templates → template_project}/.claude/skills/docx/LICENSE.txt +0 -0
  196. /package/{templates → template_project}/.claude/skills/docx/SKILL.md +0 -0
  197. /package/{templates → template_project}/.claude/skills/docx/docx-js.md +0 -0
  198. /package/{templates → template_project}/.claude/skills/docx/ooxml.md +0 -0
  199. /package/{templates → template_project}/.claude/skills/docx/redlining-reference.md +0 -0
  200. /package/{templates → template_project}/.claude/skills/docx/scripts/__init__.py +0 -0
  201. /package/{templates → template_project}/.claude/skills/docx/scripts/document.py +0 -0
  202. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/comments.xml +0 -0
  203. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsExtended.xml +0 -0
  204. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsExtensible.xml +0 -0
  205. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsIds.xml +0 -0
  206. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/people.xml +0 -0
  207. /package/{templates → template_project}/.claude/skills/docx/scripts/utilities.py +0 -0
  208. /package/{templates → template_project}/.claude/skills/duraone/SKILL.md +0 -0
  209. /package/{templates → template_project}/.claude/skills/duraone/references/backend.md +0 -0
  210. /package/{templates → template_project}/.claude/skills/duraone/references/frontend.md +0 -0
  211. /package/{templates → template_project}/.claude/skills/duraone/references/sql.md +0 -0
  212. /package/{templates → template_project}/.claude/skills/duraone/references/workflow.md +0 -0
  213. /package/{templates → template_project}/.claude/skills/executing-plans/SKILL.md +0 -0
  214. /package/{templates → template_project}/.claude/skills/file-organizer/SKILL.md +0 -0
  215. /package/{templates → template_project}/.claude/skills/file-organizer/examples-and-practices.md +0 -0
  216. /package/{templates → template_project}/.claude/skills/frontend/SKILL.md +0 -0
  217. /package/{templates → template_project}/.claude/skills/frontend-design/LICENSE.txt +0 -0
  218. /package/{templates → template_project}/.claude/skills/frontend-design/SKILL.md +0 -0
  219. /package/{templates → template_project}/.claude/skills/frontend-vue/SKILL.md +0 -0
  220. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Box.vue +0 -0
  221. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Button.vue +0 -0
  222. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/ButtonBar.vue +0 -0
  223. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/ButtonFloat.vue +0 -0
  224. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/CheckButton.vue +0 -0
  225. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Checkbox.vue +0 -0
  226. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Datetime.vue +0 -0
  227. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Dropdownlist.vue +0 -0
  228. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Input.vue +0 -0
  229. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Label.vue +0 -0
  230. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Master/BoxColumn.vue +0 -0
  231. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Confirm.vue +0 -0
  232. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Info.vue +0 -0
  233. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/ModalInfo.vue +0 -0
  234. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Reject.vue +0 -0
  235. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Tag.vue +0 -0
  236. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Upload.vue +0 -0
  237. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/Dropdownlist.vue +0 -0
  238. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/PagingBar.vue +0 -0
  239. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/UploadImage.vue +0 -0
  240. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/AG.vue +0 -0
  241. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/AntTable.vue +0 -0
  242. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditor.vue +0 -0
  243. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditorEnable.vue +0 -0
  244. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/HtmlTable.vue +0 -0
  245. /package/{templates → template_project}/.claude/skills/frontend-vue/components/PDFViewer.vue +0 -0
  246. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Panel/FormView.vue +0 -0
  247. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Footer.vue +0 -0
  248. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Header.vue +0 -0
  249. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Sidebar.vue +0 -0
  250. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Template.vue +0 -0
  251. /package/{templates → template_project}/.claude/skills/frontend-vue/components/View/Form.vue +0 -0
  252. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/indexDBStore.js +0 -0
  253. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/masterApi.js +0 -0
  254. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/state.js +0 -0
  255. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useRequest.js +0 -0
  256. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useSession.js +0 -0
  257. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useTranslation.js +0 -0
  258. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useWebSocket.js +0 -0
  259. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/userObj.js +0 -0
  260. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/utils.js +0 -0
  261. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/composables-example.vue +0 -0
  262. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/form-example.vue +0 -0
  263. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/grid-example.vue +0 -0
  264. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/masterdata-example/[id].vue +0 -0
  265. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/masterdata-example/index.vue +0 -0
  266. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/popup-example.vue +0 -0
  267. /package/{templates → template_project}/.claude/skills/next-step/SKILL.md +0 -0
  268. /package/{templates → template_project}/.claude/skills/pdf/LICENSE.txt +0 -0
  269. /package/{templates → template_project}/.claude/skills/pdf/SKILL.md +0 -0
  270. /package/{templates → template_project}/.claude/skills/pdf/forms.md +0 -0
  271. /package/{templates → template_project}/.claude/skills/pdf/reference.md +0 -0
  272. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_bounding_boxes.py +0 -0
  273. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_bounding_boxes_test.py +0 -0
  274. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_fillable_fields.py +0 -0
  275. /package/{templates → template_project}/.claude/skills/pdf/scripts/convert_pdf_to_images.py +0 -0
  276. /package/{templates → template_project}/.claude/skills/pdf/scripts/create_validation_image.py +0 -0
  277. /package/{templates → template_project}/.claude/skills/pdf/scripts/extract_form_field_info.py +0 -0
  278. /package/{templates → template_project}/.claude/skills/pdf/scripts/fill_fillable_fields.py +0 -0
  279. /package/{templates → template_project}/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -0
  280. /package/{templates → template_project}/.claude/skills/pdf-processing/SKILL.md +0 -0
  281. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/FORMS.md +0 -0
  282. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/OCR.md +0 -0
  283. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/SKILL.md +0 -0
  284. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/TABLES.md +0 -0
  285. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/scripts/analyze_form.py +0 -0
  286. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/workflows-and-troubleshooting.md +0 -0
  287. /package/{templates → template_project}/.claude/skills/postgres/SKILL.md +0 -0
  288. /package/{templates → template_project}/.claude/skills/postgres/reference/fn_get_examples.sql +0 -0
  289. /package/{templates → template_project}/.claude/skills/postgres/reference/fn_rpt_examples.sql +0 -0
  290. /package/{templates → template_project}/.claude/skills/postgres/reference/utility_functions.sql +0 -0
  291. /package/{templates → template_project}/.claude/skills/pptx/LICENSE.txt +0 -0
  292. /package/{templates → template_project}/.claude/skills/pptx/SKILL.md +0 -0
  293. /package/{templates → template_project}/.claude/skills/pptx/design-references.md +0 -0
  294. /package/{templates → template_project}/.claude/skills/pptx/html2pptx.md +0 -0
  295. /package/{templates → template_project}/.claude/skills/pptx/ooxml.md +0 -0
  296. /package/{templates → template_project}/.claude/skills/pptx/scripts/html2pptx.js +0 -0
  297. /package/{templates → template_project}/.claude/skills/pptx/scripts/inventory.py +0 -0
  298. /package/{templates → template_project}/.claude/skills/pptx/scripts/rearrange.py +0 -0
  299. /package/{templates → template_project}/.claude/skills/pptx/scripts/replace.py +0 -0
  300. /package/{templates → template_project}/.claude/skills/pptx/scripts/thumbnail.py +0 -0
  301. /package/{templates → template_project}/.claude/skills/pptx/template-replacement-reference.md +0 -0
  302. /package/{templates → template_project}/.claude/skills/pptx/utilities.md +0 -0
  303. /package/{templates → template_project}/.claude/skills/principle-attack-the-premise/SKILL.md +0 -0
  304. /package/{templates → template_project}/.claude/skills/principle-boundary-discipline/SKILL.md +0 -0
  305. /package/{templates → template_project}/.claude/skills/principle-encode-lessons-in-structure/SKILL.md +0 -0
  306. /package/{templates → template_project}/.claude/skills/principle-fix-root-causes/SKILL.md +0 -0
  307. /package/{templates → template_project}/.claude/skills/principle-foundational-thinking/SKILL.md +0 -0
  308. /package/{templates → template_project}/.claude/skills/principle-guard-the-context-window/SKILL.md +0 -0
  309. /package/{templates → template_project}/.claude/skills/principle-laziness-protocol/SKILL.md +0 -0
  310. /package/{templates → template_project}/.claude/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +0 -0
  311. /package/{templates → template_project}/.claude/skills/principle-minimize-reader-load/SKILL.md +0 -0
  312. /package/{templates → template_project}/.claude/skills/principle-model-the-domain/SKILL.md +0 -0
  313. /package/{templates → template_project}/.claude/skills/principle-never-block-on-the-human/SKILL.md +0 -0
  314. /package/{templates → template_project}/.claude/skills/principle-prove-it-works/SKILL.md +0 -0
  315. /package/{templates → template_project}/.claude/skills/principle-sequence-verifiable-units/SKILL.md +0 -0
  316. /package/{templates → template_project}/.claude/skills/principle-subtract-before-you-add/SKILL.md +0 -0
  317. /package/{templates → template_project}/.claude/skills/principle-test-behavior-not-implementation/SKILL.md +0 -0
  318. /package/{templates → template_project}/.claude/skills/project-learning/SKILL.md +0 -0
  319. /package/{templates → template_project}/.claude/skills/repo-maintenance/SKILL.md +0 -0
  320. /package/{templates → template_project}/.claude/skills/research/EXAMPLES.md +0 -0
  321. /package/{templates → template_project}/.claude/skills/research/REFERENCE.md +0 -0
  322. /package/{templates → template_project}/.claude/skills/research/SKILL.md +0 -0
  323. /package/{templates → template_project}/.claude/skills/root-cause-tracing/SKILL.md +0 -0
  324. /package/{templates → template_project}/.claude/skills/root-cause-tracing/diagrams.md +0 -0
  325. /package/{templates → template_project}/.claude/skills/root-cause-tracing/find-polluter.sh +0 -0
  326. /package/{templates → template_project}/.claude/skills/sharing-skills/SKILL.md +0 -0
  327. /package/{templates → template_project}/.claude/skills/sharing-skills/complete-example.md +0 -0
  328. /package/{templates → template_project}/.claude/skills/skill-quality/rationalization-table-template.md +0 -0
  329. /package/{templates → template_project}/.claude/skills/skill-quality/trigger-accuracy-template.md +0 -0
  330. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/SKILL.md +0 -0
  331. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/advanced-techniques.md +0 -0
  332. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/core-concepts.md +0 -0
  333. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/query-patterns.md +0 -0
  334. /package/{templates → template_project}/.claude/skills/subagent-driven-development/SKILL.md +0 -0
  335. /package/{templates → template_project}/.claude/skills/subagent-driven-development/example-workflow.md +0 -0
  336. /package/{templates → template_project}/.claude/skills/systematic-debugging/CREATION-LOG.md +0 -0
  337. /package/{templates → template_project}/.claude/skills/systematic-debugging/SKILL.md +0 -0
  338. /package/{templates → template_project}/.claude/skills/systematic-debugging/reference-tables.md +0 -0
  339. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-academic.md +0 -0
  340. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-1.md +0 -0
  341. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-2.md +0 -0
  342. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-3.md +0 -0
  343. /package/{templates → template_project}/.claude/skills/test-driven-development/SKILL.md +0 -0
  344. /package/{templates → template_project}/.claude/skills/test-driven-development/reference-tables.md +0 -0
  345. /package/{templates → template_project}/.claude/skills/testing-anti-patterns/SKILL.md +0 -0
  346. /package/{templates → template_project}/.claude/skills/testing-anti-patterns/reference-tables.md +0 -0
  347. /package/{templates → template_project}/.claude/skills/testing-quality/SKILL.md +0 -0
  348. /package/{templates → template_project}/.claude/skills/update-status/SKILL.md +0 -0
  349. /package/{templates → template_project}/.claude/skills/verification-before-completion/SKILL.md +0 -0
  350. /package/{templates → template_project}/.claude/skills/verification-before-completion/key-patterns.md +0 -0
  351. /package/{templates → template_project}/.claude/skills/webapp-testing/LICENSE.txt +0 -0
  352. /package/{templates → template_project}/.claude/skills/webapp-testing/SKILL.md +0 -0
  353. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/console_logging.py +0 -0
  354. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/element_discovery.py +0 -0
  355. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/static_html_automation.py +0 -0
  356. /package/{templates → template_project}/.claude/skills/webapp-testing/scripts/with_server.py +0 -0
  357. /package/{templates → template_project}/.claude/ukit/index/anchor-search.mjs +0 -0
  358. /package/{templates → template_project}/.claude/ukit/index/build-index.mjs +0 -0
  359. /package/{templates → template_project}/.claude/ukit/index/cache-utils.mjs +0 -0
  360. /package/{templates → template_project}/.claude/ukit/index/extract-image.mjs +0 -0
  361. /package/{templates → template_project}/.claude/ukit/index/impact-context.mjs +0 -0
  362. /package/{templates → template_project}/.claude/ukit/index/post-edit-verify.mjs +0 -0
  363. /package/{templates → template_project}/.claude/ukit/index/pre-edit-backup.mjs +0 -0
  364. /package/{templates → template_project}/.claude/ukit/index/provision-worktree.mjs +0 -0
  365. /package/{templates → template_project}/.claude/ukit/index/query-index.mjs +0 -0
  366. /package/{templates → template_project}/.claude/ukit/index/refresh-index.mjs +0 -0
  367. /package/{templates → template_project}/.claude/ukit/index/reset-auto-permissions.mjs +0 -0
  368. /package/{templates → template_project}/.claude/ukit/index/resolve-context.mjs +0 -0
  369. /package/{templates → template_project}/.claude/ukit/index/route-catalog.mjs +0 -0
  370. /package/{templates → template_project}/.claude/ukit/index/safe-patch.mjs +0 -0
  371. /package/{templates → template_project}/.claude/ukit/index/stale-spec-check.mjs +0 -0
  372. /package/{templates → template_project}/.claude/ukit/index/task-budget-validator.mjs +0 -0
  373. /package/{templates → template_project}/.claude/ukit/index/triage.mjs +0 -0
  374. /package/{templates → template_project}/.claude/ukit/index/verify-context.mjs +0 -0
  375. /package/{templates → template_project}/.claude/ukit/runtime/async-lock.mjs +0 -0
  376. /package/{templates → template_project}/.claude/ukit/runtime/compact-threshold.mjs +0 -0
  377. /package/{templates → template_project}/.claude/ukit/runtime/context-capacity.mjs +0 -0
  378. /package/{templates → template_project}/.claude/ukit/runtime/hook-chain-budget.mjs +0 -0
  379. /package/{templates → template_project}/.claude/ukit/runtime/hook-chain-runner.mjs +0 -0
  380. /package/{templates → template_project}/.claude/ukit/runtime/hook-field-salvage.mjs +0 -0
  381. /package/{templates → template_project}/.claude/ukit/runtime/hook-input.mjs +0 -0
  382. /package/{templates → template_project}/.claude/ukit/runtime/hook-input.sh +0 -0
  383. /package/{templates → template_project}/.claude/ukit/runtime/hook-payload-store.mjs +0 -0
  384. /package/{templates → template_project}/.claude/ukit/runtime/hook-process.mjs +0 -0
  385. /package/{templates → template_project}/.claude/ukit/runtime/hook-telemetry.mjs +0 -0
  386. /package/{templates → template_project}/.claude/ukit/runtime/hook-telemetry.sh +0 -0
  387. /package/{templates → template_project}/.claude/ukit/runtime/output-compression.mjs +0 -0
  388. /package/{templates → template_project}/.claude/ukit/runtime/project-important.mjs +0 -0
  389. /package/{templates → template_project}/.claude/ukit/runtime/reinject-context.mjs +0 -0
  390. /package/{templates → template_project}/.claude/ukit/runtime/stop-coordinator.mjs +0 -0
  391. /package/{templates → template_project}/.claude/ukit/runtime/text-profile.mjs +0 -0
  392. /package/{templates → template_project}/.claude/ukit/runtime/token-utils.mjs +0 -0
  393. /package/{templates → template_project}/.claude/ukit/runtime/transcript-tail.mjs +0 -0
  394. /package/{templates → template_project}/.claude/ukit/skill-router-state.json +0 -0
  395. /package/{templates → template_project}/.codex/README.md +0 -0
  396. /package/{templates → template_project}/.codex/settings.json +0 -0
  397. /package/{templates → template_project}/.omp/AGENTS.md +0 -0
  398. /package/{templates → template_project}/.omp/README.md +0 -0
  399. /package/{templates → template_project}/.omp/agents/bug-debugger.md +0 -0
  400. /package/{templates → template_project}/.omp/agents/code-reviewer.md +0 -0
  401. /package/{templates → template_project}/.omp/agents/feature-implementer.md +0 -0
  402. /package/{templates → template_project}/.omp/agents/ukit-small-task-maintainer.md +0 -0
  403. /package/{templates → template_project}/.omp/agents/ukit-vision-analyst.md +0 -0
  404. /package/{templates → template_project}/.omp/hooks/pre/ukit-bridge.js +0 -0
  405. /package/{templates → template_project}/.ukit/storage/cache/hook-latency/unknown.jsonl +0 -0
  406. /package/{templates → template_project}/PROJECT_IMPORTANT.md +0 -0
  407. /package/{templates → template_project}/adapter-presets/claude/settings.local.json +0 -0
  408. /package/{templates → template_project}/adapter-presets/codex/settings.local.json +0 -0
  409. /package/{templates → template_project}/docs/AI_HANDOFF/ACTIVE.md +0 -0
  410. /package/{templates → template_project}/docs/AI_HANDOFF/HISTORY.md +0 -0
  411. /package/{templates → template_project}/docs/AI_HANDOFF/INDEX.md +0 -0
  412. /package/{templates → template_project}/docs/AI_HANDOFF/PLAN.md +0 -0
  413. /package/{templates → template_project}/docs/AI_HANDOFF/SPEC.md +0 -0
  414. /package/{templates → template_project}/docs/AI_HANDOFF/archive/.gitkeep +0 -0
  415. /package/{templates → template_project}/docs/AI_HANDOFF/tasks/.gitkeep +0 -0
  416. /package/{templates → template_project}/docs/AI_HANDOFF/tasks/_TEMPLATE.md +0 -0
  417. /package/{templates → template_project}/docs/BUGFIX.md +0 -0
  418. /package/{templates → template_project}/docs/BUG_INDEX.md +0 -0
  419. /package/{templates → template_project}/docs/BUG_METRICS.md +0 -0
  420. /package/{templates → template_project}/docs/BUG_TEMPLATE.md +0 -0
  421. /package/{templates → template_project}/docs/CODE_MAP.md +0 -0
  422. /package/{templates → template_project}/docs/MEMORY.md +0 -0
  423. /package/{templates → template_project}/docs/PROJECT.md +0 -0
  424. /package/{templates → template_project}/docs/PROMPT_CACHING.md +0 -0
  425. /package/{templates → template_project}/docs/WORKLOG.md +0 -0
  426. /package/{templates → template_project}/instructions/overlays/agents.md +0 -0
  427. /package/{templates → template_project}/instructions/overlays/omp-rules.md +0 -0
  428. /package/{templates → template_project}/instructions/repo-vars.yaml +0 -0
  429. /package/{templates → template_project}/ukit/README.md +0 -0
  430. /package/{templates → template_project}/ukit/storage/cache/compact-history.json +0 -0
  431. /package/{templates → template_project}/ukit/storage/cache/compact-pressure.json +0 -0
  432. /package/{templates → template_project}/ukit/storage/cache/output-history.json +0 -0
  433. /package/{templates → template_project}/ukit/storage/cache/prompt-cache.json +0 -0
  434. /package/{templates → template_project}/ukit/storage/memory/sessions/.gitkeep +0 -0
  435. /package/{templates → template_project}/ukit/storage/memory/user.json +0 -0
  436. /package/{templates/user → template_user}/README.md +0 -0
  437. /package/{templates/user → template_user}/playbooks/bug-fix.md +0 -0
  438. /package/{templates/user → template_user}/playbooks/issue-implementation.md +0 -0
  439. /package/{templates/user → template_user}/storage/config.json +0 -0
@@ -10,7 +10,7 @@
10
10
 
11
11
  ## Worked example — don't copy it here, read the original
12
12
 
13
- Rather than duplicating a worked scenario in this file, reuse the one already written and already run in this repo: `templates/.claude/skills/systematic-debugging/test-pressure-1.md` (economic + authority + time + sunk-cost pressure, A/B/C choice, passed against `systematic-debugging`). Open it directly, swap the skill name and domain details for the skill you're testing. See its sibling `CREATION-LOG.md` → "Bulletproofing Elements" for the language choices (ALWAYS/NEVER, explicit "even if faster") that made the original pass.
13
+ Rather than duplicating a worked scenario in this file, reuse the one already written and already run in this repo: `template_project/.claude/skills/systematic-debugging/test-pressure-1.md` (economic + authority + time + sunk-cost pressure, A/B/C choice, passed against `systematic-debugging`). Open it directly, swap the skill name and domain details for the skill you're testing. See its sibling `CREATION-LOG.md` → "Bulletproofing Elements" for the language choices (ALWAYS/NEVER, explicit "even if faster") that made the original pass.
14
14
 
15
15
  ## Producing your own scenario (when the worked example doesn't fit the skill's domain)
16
16
 
@@ -4037,56 +4037,56 @@ const IMPACT_SHARED_PATTERNS = [
4037
4037
  label: 'shared-install-runtime',
4038
4038
  },
4039
4039
  { regex: /^src\/core\/(output|token|compact)\//, label: 'shared-token-runtime' },
4040
- { regex: /^templates\/\.claude\/hooks\//, label: 'installed-hook-runtime' },
4041
- { regex: /^templates\/\.claude\/ukit\//, label: 'installed-helper-runtime' },
4040
+ { regex: /^template_project\/\.claude\/hooks\//, label: 'installed-hook-runtime' },
4041
+ { regex: /^template_project\/\.claude\/ukit\//, label: 'installed-helper-runtime' },
4042
4042
  { regex: /^manifests\/platform\.full\.yaml$/, label: 'install-manifest' },
4043
- { regex: /^templates\//, label: 'published-template-surface' },
4043
+ { regex: /^template_project\//, label: 'published-template-surface' },
4044
4044
  ];
4045
4045
 
4046
4046
  const IMPACT_MIRROR_PAIRS = [
4047
4047
  {
4048
4048
  source: 'src/index/buildIndex.js',
4049
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
4049
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
4050
4050
  reason: 'installed index-core mirror embeds source index behavior',
4051
4051
  },
4052
4052
  {
4053
4053
  source: 'src/index/queryIndex.js',
4054
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
4054
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
4055
4055
  reason: 'installed index-core mirror embeds source query behavior',
4056
4056
  },
4057
4057
  {
4058
4058
  source: 'src/index/resolveContext.js',
4059
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
4059
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
4060
4060
  reason: 'installed index-core mirror embeds context resolution behavior',
4061
4061
  },
4062
4062
  {
4063
4063
  source: 'src/index/verificationPlan.js',
4064
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
4064
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
4065
4065
  reason: 'installed index-core mirror embeds verification planning behavior',
4066
4066
  },
4067
4067
  {
4068
4068
  source: 'src/index/taskRouting.js',
4069
- mirror: 'templates/.claude/ukit/index/route-task.mjs',
4069
+ mirror: 'template_project/.claude/ukit/index/route-task.mjs',
4070
4070
  reason: 'installed route-task helper mirrors source task routing behavior',
4071
4071
  },
4072
4072
  {
4073
4073
  source: 'src/index/routeCatalog.js',
4074
- mirror: 'templates/.claude/ukit/index/route-catalog.mjs',
4074
+ mirror: 'template_project/.claude/ukit/index/route-catalog.mjs',
4075
4075
  reason: 'installed route catalog must match source route catalog',
4076
4076
  },
4077
4077
  {
4078
4078
  source: 'src/core/output/index.js',
4079
- mirror: 'templates/.claude/ukit/runtime/output-compression.mjs',
4079
+ mirror: 'template_project/.claude/ukit/runtime/output-compression.mjs',
4080
4080
  reason: 'source output compression runtime should stay aligned with installed hook runtime',
4081
4081
  },
4082
4082
  {
4083
4083
  source: 'src/core/token/index.js',
4084
- mirror: 'templates/.claude/ukit/runtime/token-utils.mjs',
4084
+ mirror: 'template_project/.claude/ukit/runtime/token-utils.mjs',
4085
4085
  reason: 'source token runtime should stay aligned with installed token utilities',
4086
4086
  },
4087
4087
  {
4088
4088
  source: 'src/core/compact/threshold.js',
4089
- mirror: 'templates/.claude/ukit/runtime/compact-threshold.mjs',
4089
+ mirror: 'template_project/.claude/ukit/runtime/compact-threshold.mjs',
4090
4090
  reason: 'source compact threshold runtime should stay aligned with installed compact threshold hook',
4091
4091
  },
4092
4092
  ];
@@ -69,6 +69,28 @@ export const ROUTE_INTENT_KINDS = new Set(['informational', 'delivery', 'mutatio
69
69
  export const ROUTE_MUTABILITIES = new Set(['read-only', 'mutating', 'mixed']);
70
70
  export const ROUTE_RIGOR_LEVELS = new Set(['R0', 'R1', 'R2', 'R3', 'R4']);
71
71
  export const ROUTE_MODEL_TIERS = new Set(['lite', 'code', 'smart']);
72
+ export const ROUTE_RISK_FLOORS = new Set(['none', 'high-risk']);
73
+ // SPEC §5 FR-003: fixed table order — codes are emitted and printed in this order.
74
+ // The first six raise the floor to 'high-risk'; the last two are informational only.
75
+ export const ROUTE_RISK_REASON_CODES = Object.freeze([
76
+ 'security-sensitive',
77
+ 'shared-impact',
78
+ 'public-contract',
79
+ 'schema-change',
80
+ 'destructive-action',
81
+ 'cross-engine',
82
+ 'established-precedent',
83
+ 'explicit-local-target',
84
+ ]);
85
+ const ROUTE_RISK_FLOOR_RAISING_CODES = new Set(ROUTE_RISK_REASON_CODES.slice(0, 6));
86
+ const ROUTE_RISK_ENGINES = ['claude code', 'codex', 'omp'];
87
+
88
+ // FR-004 (M01.3'): Fast Path eligibility vocabulary. The suppressed list is fixed
89
+ // text per SPEC — deliberately not configurable. Reasons are the informational
90
+ // risk codes (the last two ROUTE_RISK_REASON_CODES entries) present on the route.
91
+ const FAST_PATH_MODES = new Set(['tiny-fix', 'local-fix']);
92
+ const FAST_PATH_SUPPRESSED = Object.freeze(['design', 'smart', 'subagents', 'broad-verify']);
93
+ const FAST_PATH_REASON_CODES = new Set(ROUTE_RISK_REASON_CODES.slice(6));
72
94
  // 'informational' is a real router emission (no completion contract) even though it is
73
95
  // not part of the seven-lane execution-mode ladder.
74
96
  export const ROUTE_EXECUTION_MODES = [
@@ -249,6 +271,131 @@ export function resolveRouteSchemaStage(config = null) {
249
271
  return ROUTE_SCHEMA_STAGES.has(stage) ? stage : 'off';
250
272
  }
251
273
 
274
+ // FR-002: generic stage resolver — every routing.<key>.stage shares the same
275
+ // absent/malformed → 'off' contract. resolveRouteSchemaStage stays as the
276
+ // routeSchema-specific spelling of this helper.
277
+ export function resolveRouteStage(config = null, key) {
278
+ const stage = config?.routing?.[key]?.stage;
279
+ return ROUTE_SCHEMA_STAGES.has(stage) ? stage : 'off';
280
+ }
281
+
282
+ // FR-003 (M01.2'): derive the additive riskFloor from hard signals. Codes are
283
+ // collected in ROUTE_RISK_REASON_CODES table order; the floor is 'high-risk' iff
284
+ // any of the first six (floor-raising) codes fired — informational codes never
285
+ // raise it. Detectors read the normalized signal text (same source the mode
286
+ // ladder uses) plus the raw target path and context preview.
287
+ export function deriveRiskFloor({
288
+ promptText = '',
289
+ commandText = '',
290
+ targetFile = null,
291
+ executionMode = null,
292
+ activeSkillIds = [],
293
+ contextPreview = null,
294
+ } = {}) {
295
+ const signalText = buildNormalizedRouteSignalText(promptText, commandText);
296
+ const target = String(targetFile || '');
297
+ const skillIds = Array.isArray(activeSkillIds) ? activeSkillIds : [];
298
+ const codes = [];
299
+ if (
300
+ /\b(auth|security|token|permission|secret|credential|password|vulnerab|exploit|xss|injection)\b/i.test(signalText)
301
+ || skillIds.includes('discover-security')
302
+ ) {
303
+ codes.push('security-sensitive');
304
+ }
305
+ if (isSharedImpactFile(targetFile) || executionMode === 'shared-edit' || executionMode === 'map-impact') {
306
+ codes.push('shared-impact');
307
+ }
308
+ if (
309
+ /(^|\/)(package\.json|manifests\/|.*\.d\.ts$|(^|\/)api\/|openapi|swagger)/i.test(target)
310
+ || /\b(public api|breaking change|api contract|semver)\b/i.test(signalText)
311
+ ) {
312
+ codes.push('public-contract');
313
+ }
314
+ if (
315
+ /(^|\/)(migrations?|db|database|prisma|schema)/i.test(target)
316
+ || /\b(migration|migrate|schema|alter table|add column|drop column)\b/i.test(signalText)
317
+ ) {
318
+ codes.push('schema-change');
319
+ }
320
+ if (/\b(delete|drop|truncate|destroy|wipe|uninstall|rm -rf|purge)\b/i.test(signalText)) {
321
+ codes.push('destructive-action');
322
+ }
323
+ const engineHits = ROUTE_RISK_ENGINES.filter(
324
+ (name) => new RegExp(`\\b${name}\\b`, 'i').test(signalText),
325
+ ).length;
326
+ if (
327
+ /\bcross[- ]engine\b|\ball engines\b/i.test(signalText)
328
+ || engineHits >= 2
329
+ || /^template_project\/\.(claude|codex|omp)\//i.test(target)
330
+ ) {
331
+ codes.push('cross-engine');
332
+ }
333
+ if ((contextPreview?.analogFiles?.length ?? 0) > 0 || (contextPreview?.styleFiles?.length ?? 0) > 0) {
334
+ codes.push('established-precedent');
335
+ }
336
+ if (target && !isSharedImpactFile(targetFile)) {
337
+ codes.push('explicit-local-target');
338
+ }
339
+ return {
340
+ floor: codes.some((code) => ROUTE_RISK_FLOOR_RAISING_CODES.has(code)) ? 'high-risk' : 'none',
341
+ codes,
342
+ };
343
+ }
344
+
345
+ // Route-line segment (FR-003): on 'high-risk' only the floor-raising codes print;
346
+ // on 'none' the informational codes do. Empty list → no segment at all.
347
+ function formatRiskFloorSegment(riskFloor = null) {
348
+ if (!riskFloor) {
349
+ return null;
350
+ }
351
+ const printed = riskFloor.floor === 'high-risk'
352
+ ? riskFloor.codes.filter((code) => ROUTE_RISK_FLOOR_RAISING_CODES.has(code))
353
+ : riskFloor.codes;
354
+ return printed.length > 0 ? `risk=${riskFloor.floor}(${printed.join(',')})` : null;
355
+ }
356
+
357
+ // FR-004 (M01.3'): Fast Path eligibility predicate. Returns null when no riskFloor
358
+ // was supplied — eligibility must never be derived without the floor check, so a
359
+ // missing floor means "not computed", not "none". Eligible iff the lane is
360
+ // tiny-fix/local-fix, exactly one local target is known, the floor is 'none',
361
+ // a bounded verification path exists (targeted commands or the tiny-fix
362
+ // 'minimal-or-targeted' contract policy), and the target is not shared-impact.
363
+ export function deriveFastPath({
364
+ executionMode = null,
365
+ targetFile = null,
366
+ riskFloor = null,
367
+ verificationRecommendation = null,
368
+ contextPreview = null,
369
+ } = {}) {
370
+ if (!riskFloor) {
371
+ return null;
372
+ }
373
+ const reasons = (riskFloor.codes ?? []).filter((code) => FAST_PATH_REASON_CODES.has(code));
374
+ const hasLocalTarget = Boolean(targetFile) || contextPreview?.primaryTargets?.length === 1;
375
+ const hasBoundedVerification = (verificationRecommendation?.commands?.length ?? 0) > 0
376
+ || buildExecutionContract(executionMode)?.verificationPolicy === 'minimal-or-targeted';
377
+ const eligible = FAST_PATH_MODES.has(executionMode)
378
+ && hasLocalTarget
379
+ && riskFloor.floor === 'none'
380
+ && hasBoundedVerification
381
+ && !isSharedImpactFile(targetFile);
382
+ return {
383
+ eligible,
384
+ suppressed: eligible ? [...FAST_PATH_SUPPRESSED] : [],
385
+ reasons,
386
+ };
387
+ }
388
+
389
+ // Route-line segment (FR-004): emitted only for eligible routes — ineligible
390
+ // routes keep the routeSummary.fastPath field for telemetry but stay silent.
391
+ function formatFastPathSegment(fastPath = null) {
392
+ if (!fastPath?.eligible) {
393
+ return null;
394
+ }
395
+ const reasons = fastPath.reasons?.length ? ` (${fastPath.reasons.join(',')})` : '';
396
+ return `fastPath=on | suppress: ${FAST_PATH_SUPPRESSED.join(',')}${reasons}`;
397
+ }
398
+
252
399
  // A bare delivery command ("push this to git", "đẩy bộ này lên git") performs no
253
400
  // repository mutation the ledger could ever receipt. With no edit/review/debug/build
254
401
  // signal present, routing it to an investigation lane fabricates write debt and the
@@ -311,6 +458,7 @@ function buildResolvedRouteFields({
311
458
  executionMode = null,
312
459
  executionContract = null,
313
460
  completionState = null,
461
+ riskFloor = null,
314
462
  } = {}) {
315
463
  const signalText = buildNormalizedRouteSignalText(routingContext.promptText, routingContext.commandText);
316
464
  const deliveryOnly = isDeliveryOnlyRequest({
@@ -333,13 +481,14 @@ function buildResolvedRouteFields({
333
481
  execution: {
334
482
  mode: executionMode,
335
483
  rigor: null,
484
+ riskFloor: riskFloor?.floor ?? null,
336
485
  phase: null,
337
486
  contractVersion: ROUTE_CONTRACT_VERSION,
338
487
  modelTier: executionContract?.modelTier ?? null,
339
488
  },
340
489
  evidence: {
341
490
  observations: [],
342
- riskSignals: [],
491
+ riskSignals: riskFloor?.codes ?? [],
343
492
  activationReasons: [],
344
493
  suppressionReasons: [],
345
494
  completionRequirements: unique(completionState?.missingEvidence ?? []),
@@ -347,7 +496,13 @@ function buildResolvedRouteFields({
347
496
  ceremonyBudget: {
348
497
  policyVersion: ROUTE_CONTRACT_VERSION,
349
498
  rigor: null,
350
- limits: {},
499
+ limits: riskFloor
500
+ ? Object.fromEntries(
501
+ ['maxReadPasses', 'maxContextPulls', 'maxReadPassesBeforeReassess']
502
+ .filter((key) => typeof executionContract?.[key] === 'number')
503
+ .map((key) => [key, executionContract[key]]),
504
+ )
505
+ : {},
351
506
  consumed: {},
352
507
  exceptions: [],
353
508
  },
@@ -403,6 +558,9 @@ export function validateResolvedRoute(route = null) {
403
558
  if (route.execution.rigor !== null && !ROUTE_RIGOR_LEVELS.has(route.execution.rigor)) {
404
559
  errors.push(`execution.rigor must be null or one of: ${[...ROUTE_RIGOR_LEVELS].join(', ')}.`);
405
560
  }
561
+ if (route.execution.riskFloor !== null && !ROUTE_RISK_FLOORS.has(route.execution.riskFloor)) {
562
+ errors.push(`execution.riskFloor must be null or one of: ${[...ROUTE_RISK_FLOORS].join(', ')}.`);
563
+ }
406
564
  if (route.execution.contractVersion !== ROUTE_CONTRACT_VERSION) {
407
565
  errors.push(`execution.contractVersion must be ${ROUTE_CONTRACT_VERSION}.`);
408
566
  }
@@ -418,6 +576,12 @@ export function validateResolvedRoute(route = null) {
418
576
  errors.push(`evidence.${key} must be an array.`);
419
577
  }
420
578
  }
579
+ if (Array.isArray(route.evidence.riskSignals)
580
+ && route.evidence.riskSignals.some(
581
+ (code) => typeof code !== 'string' || !ROUTE_RISK_REASON_CODES.includes(code),
582
+ )) {
583
+ errors.push(`evidence.riskSignals entries must be one of: ${ROUTE_RISK_REASON_CODES.join(', ')}.`);
584
+ }
421
585
  }
422
586
  if (!isObject(route.ceremonyBudget)) {
423
587
  errors.push('ceremonyBudget must be an object.');
@@ -1379,11 +1543,24 @@ async function main() {
1379
1543
  }
1380
1544
  : null;
1381
1545
  if (rescuedRouteSummary) {
1546
+ // FR-005: the rescued summary IS the previous route state — merge its
1547
+ // persisted riskEscalation with current evidence (monotonic, idempotent).
1548
+ const riskEscalation = computeRiskEscalation({
1549
+ routeSummary: rescuedRouteSummary,
1550
+ previousRouteSummary: cachedRouteState.routeSummary,
1551
+ config: escalationConfig,
1552
+ });
1553
+ if (riskEscalation) {
1554
+ rescuedRouteSummary.riskEscalation = riskEscalation;
1555
+ } else {
1556
+ delete rescuedRouteSummary.riskEscalation;
1557
+ }
1382
1558
  applyRescueBiasToRouteSummary(rescuedRouteSummary);
1383
1559
  applyEscalationToRouteSummary(rescuedRouteSummary, {
1384
1560
  config: escalationConfig,
1385
1561
  targetFile: cachedRouteState.routingContext?.targetFile ?? null,
1386
1562
  });
1563
+ appendRiskEscalationSegment(rescuedRouteSummary);
1387
1564
  }
1388
1565
  const sharedState = {
1389
1566
  ...cachedRouteState,
@@ -1673,11 +1850,25 @@ async function finalizeTaskRoute({
1673
1850
  previousRouteSummary?.continuationState ?? null,
1674
1851
  resolveEscalationSettings(escalationConfig),
1675
1852
  );
1853
+ // FR-005: merge risk evidence with the persisted previous riskEscalation AFTER
1854
+ // advanceContinuationState (stuckRisk is already advanced). Stage 'off'
1855
+ // returns null → the field is dropped, not carried forward.
1856
+ const riskEscalation = computeRiskEscalation({
1857
+ routeSummary,
1858
+ previousRouteSummary,
1859
+ config: escalationConfig,
1860
+ });
1861
+ if (riskEscalation) {
1862
+ routeSummary.riskEscalation = riskEscalation;
1863
+ } else {
1864
+ delete routeSummary.riskEscalation;
1865
+ }
1676
1866
  applyRescueBiasToRouteSummary(routeSummary);
1677
1867
  applyEscalationToRouteSummary(routeSummary, {
1678
1868
  config: escalationConfig,
1679
1869
  targetFile: routingContext.targetFile ?? null,
1680
1870
  });
1871
+ appendRiskEscalationSegment(routeSummary);
1681
1872
  const approachSelector = routeSummary?.approachSelector ?? null;
1682
1873
 
1683
1874
  return {
@@ -2672,6 +2863,42 @@ function buildRouteSummary({
2672
2863
  nextActionType: nextAction?.type ?? null,
2673
2864
  completionState,
2674
2865
  });
2866
+ // FR-003 (M01.2'): riskFloor is a top-level additive field emitted whenever ANY
2867
+ // of rigor/fastPath/escalation stages is on — fastPath/escalation consumers read
2868
+ // it even when routeSchema is off. All three off → absent, byte-identical route.
2869
+ const riskStageOn = ['rigor', 'fastPath', 'escalation']
2870
+ .some((key) => resolveRouteStage(runtimeConfig, key) !== 'off');
2871
+ const riskFloor = riskStageOn
2872
+ ? deriveRiskFloor({
2873
+ promptText: routingContext.promptText,
2874
+ commandText: routingContext.commandText,
2875
+ targetFile: routingContext.targetFile ?? null,
2876
+ executionMode,
2877
+ activeSkillIds: activeSkills.map((entry) => entry.id),
2878
+ contextPreview: contextRecommendation?.preview ?? null,
2879
+ })
2880
+ : null;
2881
+ const riskSegment = formatRiskFloorSegment(riskFloor);
2882
+ // FR-004 (M01.3'): fastPath is emitted whenever its own stage is on — the field
2883
+ // is always set then (eligible or not) so telemetry/harness can read it; the
2884
+ // route-line segment prints only for eligible routes.
2885
+ const fastPathStage = resolveRouteStage(runtimeConfig, 'fastPath');
2886
+ const fastPath = fastPathStage !== 'off'
2887
+ ? {
2888
+ eligible: false,
2889
+ suppressed: [],
2890
+ reasons: [],
2891
+ ...deriveFastPath({
2892
+ executionMode,
2893
+ targetFile: routingContext.targetFile ?? null,
2894
+ riskFloor,
2895
+ verificationRecommendation,
2896
+ contextPreview: contextRecommendation?.preview ?? null,
2897
+ }),
2898
+ stage: fastPathStage,
2899
+ }
2900
+ : null;
2901
+ const fastPathSegment = formatFastPathSegment(fastPath);
2675
2902
  const resolvedRouteFields = routeSchemaStage !== 'off'
2676
2903
  ? buildResolvedRouteFields({
2677
2904
  routingContext,
@@ -2679,6 +2906,7 @@ function buildRouteSummary({
2679
2906
  executionMode,
2680
2907
  executionContract,
2681
2908
  completionState,
2909
+ riskFloor,
2682
2910
  })
2683
2911
  : null;
2684
2912
  const helperHint = compactHelperHint(
@@ -2722,6 +2950,8 @@ function buildRouteSummary({
2722
2950
  formatCompactSegment('tests', relatedTests),
2723
2951
  formatCompactSegment('styles', styleFiles),
2724
2952
  editGuardHint ? `editGuard=${editGuardHint}` : null,
2953
+ riskSegment,
2954
+ fastPathSegment,
2725
2955
  delegationRecommendation?.hint ? `delegate=${delegationRecommendation.hint}` : null,
2726
2956
  policyMode ? `policy=${policyMode}` : null,
2727
2957
  workflowPolicyName ? `workflow=${workflowPolicyName}` : null,
@@ -2742,6 +2972,10 @@ function buildRouteSummary({
2742
2972
  completionState,
2743
2973
  // M01.1 additive C01 groups — present only when routing.routeSchema.stage != "off".
2744
2974
  ...(resolvedRouteFields ?? {}),
2975
+ // FR-003 additive top-level field — present only when a risk stage is on.
2976
+ ...(riskFloor ? { riskFloor } : {}),
2977
+ // FR-004 additive top-level field — present only when fastPath stage is on.
2978
+ ...(fastPath ? { fastPath } : {}),
2745
2979
  continuationState,
2746
2980
  autonomyLevel,
2747
2981
  continuousExecution,
@@ -3403,18 +3637,24 @@ function resolveEscalationSettings(config = null) {
3403
3637
  * Escalates exactly one rung above `modelTier` on `tierOrder`, capped at `cap`. Returns null when
3404
3638
  * escalation is disabled, `repeatCount` hasn't reached `debugLoopThreshold`, or `modelTier` isn't
3405
3639
  * on the cost ladder (e.g. no contract selected). Never returns 'vision'.
3640
+ * FR-005: when `riskEscalation.level === 'high'` the repeat-count threshold is treated as
3641
+ * satisfied (immediate one-rung escalation) and the effective cap rises to 'smart', overriding
3642
+ * the configured cap; the reason is prefixed `risk-floor:` so consumers can tell risk-driven
3643
+ * escalation from repeat-count escalation.
3406
3644
  */
3407
3645
  function computeEscalation({
3408
3646
  modelTier = null,
3409
3647
  repeatCount = null,
3410
3648
  config = null,
3411
3649
  targetFile = null,
3650
+ riskEscalation = null,
3412
3651
  } = {}) {
3413
- if (!modelTier || !Number.isFinite(repeatCount)) {
3652
+ if (!modelTier) {
3414
3653
  return null;
3415
3654
  }
3416
3655
  const settings = resolveEscalationSettings(config);
3417
- if (!settings.enabled || repeatCount < settings.debugLoopThreshold) {
3656
+ const riskDriven = riskEscalation?.level === 'high';
3657
+ if (!settings.enabled || (!riskDriven && (!Number.isFinite(repeatCount) || repeatCount < settings.debugLoopThreshold))) {
3418
3658
  return null;
3419
3659
  }
3420
3660
  const currentIndex = settings.tierOrder.indexOf(modelTier);
@@ -3422,18 +3662,23 @@ function computeEscalation({
3422
3662
  return null;
3423
3663
  }
3424
3664
  const capIndex = settings.tierOrder.indexOf(settings.cap);
3425
- const effectiveCapIndex = capIndex === -1 ? settings.tierOrder.length - 1 : capIndex;
3665
+ const smartIndex = settings.tierOrder.indexOf('smart');
3666
+ const effectiveCapIndex = riskDriven
3667
+ ? (smartIndex === -1 ? settings.tierOrder.length - 1 : smartIndex)
3668
+ : (capIndex === -1 ? settings.tierOrder.length - 1 : capIndex);
3426
3669
  const escalatedIndex = Math.min(currentIndex + 1, effectiveCapIndex);
3427
3670
  const escalatedTier = settings.tierOrder[escalatedIndex];
3428
3671
 
3429
3672
  return {
3430
3673
  escalatedTier,
3431
- escalationReason: `repeat-count=${repeatCount} threshold=${settings.debugLoopThreshold} file=${targetFile ?? 'null'}`,
3674
+ escalationReason: riskDriven
3675
+ ? `risk-floor: level=${riskEscalation.level} sources=${(riskEscalation.sources ?? []).join(',')} file=${targetFile ?? 'null'}`
3676
+ : `repeat-count=${repeatCount} threshold=${settings.debugLoopThreshold} file=${targetFile ?? 'null'}`,
3432
3677
  };
3433
3678
  }
3434
3679
 
3435
3680
  /** Attaches escalatedTier/escalationReason to routeSummary, additive alongside modelTier. */
3436
- function applyEscalationToRouteSummary(routeSummary = null, { config = null, targetFile = null } = {}) {
3681
+ export function applyEscalationToRouteSummary(routeSummary = null, { config = null, targetFile = null } = {}) {
3437
3682
  if (!routeSummary || typeof routeSummary !== 'object') {
3438
3683
  return routeSummary;
3439
3684
  }
@@ -3443,6 +3688,7 @@ function applyEscalationToRouteSummary(routeSummary = null, { config = null, tar
3443
3688
  repeatCount: routeSummary.continuationState?.repeatCount ?? null,
3444
3689
  config,
3445
3690
  targetFile,
3691
+ riskEscalation: routeSummary.riskEscalation ?? null,
3446
3692
  });
3447
3693
 
3448
3694
  if (escalation) {
@@ -3462,6 +3708,64 @@ function applyEscalationToRouteSummary(routeSummary = null, { config = null, tar
3462
3708
  return routeSummary;
3463
3709
  }
3464
3710
 
3711
+ // FR-005 (M01.4'): monotonic risk-evidence escalation. Sources are `risk-floor`
3712
+ // (routeSummary.riskFloor.floor === 'high-risk') and `stuck-risk`
3713
+ // (routeSummary.continuationState.stuckRisk === 'high' — read off the CURRENT
3714
+ // summary, which finalizeTaskRoute has already advanced). Sources merge as the
3715
+ // sorted union of current evidence and the persisted previous
3716
+ // riskEscalation.sources, so replaying the same evidence is a no-op and the
3717
+ // level can never decrease within a run (none < elevated < high). Stage 'off'
3718
+ // returns null unconditionally — a mid-run stage flip drops the field entirely
3719
+ // so the Stop gate sees nothing and the stage-off byte-identity contract holds.
3720
+ // Per-source flags: routing.escalation.sources.<source>: false disables that
3721
+ // source's current detection (absent = all sources on).
3722
+ const RISK_ESCALATION_LEVELS = { none: 0, elevated: 1, high: 2 };
3723
+
3724
+ export function computeRiskEscalation({
3725
+ routeSummary = null,
3726
+ previousRouteSummary = null,
3727
+ config = null,
3728
+ } = {}) {
3729
+ if (resolveRouteStage(config, 'escalation') === 'off') {
3730
+ return null;
3731
+ }
3732
+ const sourceFlags = config?.routing?.escalation?.sources ?? {};
3733
+ const isSourceEnabled = (source) => sourceFlags[source] !== false;
3734
+ const currentSources = [];
3735
+ if (isSourceEnabled('risk-floor') && routeSummary?.riskFloor?.floor === 'high-risk') {
3736
+ currentSources.push('risk-floor');
3737
+ }
3738
+ if (isSourceEnabled('stuck-risk') && routeSummary?.continuationState?.stuckRisk === 'high') {
3739
+ currentSources.push('stuck-risk');
3740
+ }
3741
+ const previous = previousRouteSummary?.riskEscalation ?? null;
3742
+ const sources = unique([...(previous?.sources ?? []), ...currentSources]).sort();
3743
+ const derivedLevel = sources.some((source) => source === 'risk-floor' || source === 'stuck-risk')
3744
+ ? 'high'
3745
+ : (sources.length > 0 ? 'elevated' : 'none');
3746
+ const previousLevel = RISK_ESCALATION_LEVELS[previous?.level] ?? 0;
3747
+ const level = RISK_ESCALATION_LEVELS[derivedLevel] >= previousLevel
3748
+ ? derivedLevel
3749
+ : previous.level;
3750
+ return { level, sources };
3751
+ }
3752
+
3753
+ // FR-005: buildRouteSummary runs before riskEscalation exists, so the
3754
+ // `escalate=<level>(<sources>)` segment is appended here, where the merge
3755
+ // happens. Any previously emitted segment is stripped first — replay on a
3756
+ // rescued compacted summary must not double-append (idempotent).
3757
+ function appendRiskEscalationSegment(routeSummary = null) {
3758
+ if (!routeSummary || typeof routeSummary.line !== 'string') {
3759
+ return routeSummary;
3760
+ }
3761
+ const baseLine = routeSummary.line.replace(/(?: \| )?escalate=\S+$/, '');
3762
+ const riskEscalation = routeSummary.riskEscalation;
3763
+ routeSummary.line = riskEscalation && riskEscalation.level !== 'none'
3764
+ ? `${baseLine} | escalate=${riskEscalation.level}(${(riskEscalation.sources ?? []).join(',')})`
3765
+ : baseLine;
3766
+ return routeSummary;
3767
+ }
3768
+
3465
3769
  // WS-E tier-role wiring: a contract tier only takes effect when the executing session hands
3466
3770
  // the work to an agent whose definition binds that tier — otherwise every session behaves as
3467
3771
  // if it only had one model. `code` is the DEFAULT implementation lane, so a code-tier contract
@@ -3690,10 +3994,10 @@ const SHARED_IMPACT_PATTERNS = [
3690
3994
  /^src\/index\//,
3691
3995
  /^src\/core\/(runInstallPipeline|applyPlan|buildPlan|diffPlan|metadata|migrateLegacy|uninstall|runtimeConfig|runtimePaths)\.js$/,
3692
3996
  /^src\/core\/(output|token|compact)\//,
3693
- /^templates\/\.claude\/hooks\//,
3694
- /^templates\/\.claude\/ukit\//,
3997
+ /^template_project\/\.claude\/hooks\//,
3998
+ /^template_project\/\.claude\/ukit\//,
3695
3999
  /^manifests\/platform\.full\.yaml$/,
3696
- /^templates\//,
4000
+ /^template_project\//,
3697
4001
  ];
3698
4002
 
3699
4003
  function isSharedImpactFile(filePath) {
@@ -4179,7 +4483,7 @@ function compactRecentOutput(recentOutput = null) {
4179
4483
  };
4180
4484
  }
4181
4485
 
4182
- function compactRouteSummary(routeSummary = null) {
4486
+ export function compactRouteSummary(routeSummary = null) {
4183
4487
  if (!routeSummary) {
4184
4488
  return null;
4185
4489
  }
@@ -4221,6 +4525,10 @@ function compactRouteSummary(routeSummary = null) {
4221
4525
  escalatedTier: routeSummary.escalatedTier,
4222
4526
  escalationReason: routeSummary.escalationReason ?? null,
4223
4527
  } : {}),
4528
+ // FR-005: riskEscalation is the Stop-gate carrier (FR-006) — it must survive
4529
+ // skill-router-state.json compaction. Conditional spread keeps stage-off
4530
+ // output byte-identical (no key emitted when the field is absent).
4531
+ ...(routeSummary.riskEscalation ? { riskEscalation: routeSummary.riskEscalation } : {}),
4224
4532
  // M01.1 compact whitelist (C01): grouped fields survive compaction minus verbose
4225
4533
  // evidence; absent entirely when the route schema stage is off.
4226
4534
  ...(compactResolvedRoute(routeSummary) ?? {}),
@@ -35,7 +35,7 @@
35
35
  * Fail-safe direction (do not re-flip this): `unicMode` keeps BINARY semantics on every runtime
36
36
  * — `unicMode = sources.length > 0`, default `false`. Inconclusive detection never resolves to
37
37
  * `true`. The "assume UNIC when ambiguous" fail-safe some tools want belongs ONLY to the static
38
- * `modelRoles` values TASK-003 writes unconditionally into `templates/.omp/config.yml`
38
+ * `modelRoles` values TASK-003 writes unconditionally into `template_project/.omp/config.yml`
39
39
  * (`@vision: unic-vision`, no probe involved) — never to this module's boolean, because this
40
40
  * module is shared by every runtime and flipping its default would make Codex/Kilo/OPENAI_BASE_URL
41
41
  * sessions with zero omp/Claude signal start false-positively reporting UNIC mode.
@@ -1588,7 +1588,7 @@ export async function recordExecutionReceipt({
1588
1588
  }
1589
1589
 
1590
1590
  // F-15: mirror of isExplicitBroadVerificationRequest in
1591
- // templates/.claude/hooks/verification-guard.sh — the guard uses this prompt signal to
1591
+ // template_project/.claude/hooks/verification-guard.sh — the guard uses this prompt signal to
1592
1592
  // let a broad suite run under a targeted policy, so the completion gate must honor the
1593
1593
  // same signal when it classifies the resulting broad receipt. Keep both lists in sync.
1594
1594
  function isExplicitBroadVerificationRequest(promptText) {
@@ -1628,10 +1628,16 @@ function explicitBroadVerificationRequested(state = {}) {
1628
1628
  function requiredEvidence(state = {}) {
1629
1629
  const routeSummary = state?.routeSummary || {};
1630
1630
  const contractEvidence = routeSummary.executionContract?.completionEvidence;
1631
- if (Array.isArray(contractEvidence) && contractEvidence.length > 0) {
1632
- return [...new Set(contractEvidence)];
1633
- }
1634
- return [...new Set(routeSummary.completionState?.missingEvidence || [])];
1631
+ const required = Array.isArray(contractEvidence) && contractEvidence.length > 0
1632
+ ? [...contractEvidence]
1633
+ : [...(routeSummary.completionState?.missingEvidence || [])];
1634
+ // FR-006 (M01.4' tail): a route persisted with a high riskEscalation must re-verify at
1635
+ // Stop even when its own contract only demands write evidence. The route state is the
1636
+ // carrier — no config read here; absent/malformed/non-high fields are a no-op.
1637
+ if (routeSummary.riskEscalation?.level === 'high') {
1638
+ required.push('verification-evidence');
1639
+ }
1640
+ return [...new Set(required)];
1635
1641
  }
1636
1642
 
1637
1643
  function evidenceSatisfied(evidence, ledger = {}, state = {}, { cwd } = {}) {
@@ -27,15 +27,15 @@ const SHARED_RISK_PATTERNS = [
27
27
  /^\.claude\/hooks\//,
28
28
  /^\.claude\/ukit\//,
29
29
  /^\.codex\//,
30
- /^templates\/\.claude\/hooks\//,
31
- /^templates\/\.claude\/ukit\//,
30
+ /^template_project\/\.claude\/hooks\//,
31
+ /^template_project\/\.claude\/ukit\//,
32
32
  /^src\/index\//,
33
33
  /^src\/core\/(runInstallPipeline|applyPlan|buildPlan|diffPlan|metadata|migrateLegacy|uninstall|runtimeConfig|runtimePaths)\.js$/,
34
34
  /^src\/core\/(output|token|compact)\//,
35
35
  /^manifests\/platform\.full\.yaml$/,
36
36
  // Intentional for UKit development: template edits become installed runtime behavior after `ukit install`,
37
37
  // so templates stay in the strict shared-risk lane rather than being treated as ordinary docs/assets.
38
- /^templates\//,
38
+ /^template_project\//,
39
39
  /^scripts\//,
40
40
  /(^|\/)(AGENTS|CLAUDE)\.md$/,
41
41
  ];
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Installed-runtime mirror of src/core/sensitiveValueScanner.js — the
5
5
  * high-confidence secret *value* scanner shared with
6
- * templates/.claude/hooks/sensitive-data-guard.sh. Deliberate mirror: the
6
+ * template_project/.claude/hooks/sensitive-data-guard.sh. Deliberate mirror: the
7
7
  * installed runtime cannot import package source, so this file is kept
8
8
  * byte-semantic with the source module and locked by
9
9
  * tests/consistency/projectImportantRuntimeParity.test.js.
@@ -14,7 +14,7 @@
14
14
  * Exports:
15
15
  * DEFAULT_CONFIG — fail-open defaults; identical to the
16
16
  * `handoff.taskBudgets` / `handoff.milestoneIntervalMin`
17
- * keys seeded into templates/ukit/storage/config.json.
17
+ * keys seeded into template_project/ukit/storage/config.json.
18
18
  * parseTaskFile(markdown) — minimal twin of src/core/taskProgressGuard's
19
19
  * parser; reads id, status, size, lastProgressIso.
20
20
  * evaluateBudgets(...) — per in_progress task returns